Contains all macro definitions and function prototypes support for timer2n firmware library on A31G11x. More...
Go to the source code of this file.
Data Structures | |
struct | TIMER2n_PERIODICCFG_Type |
struct | TIMER2n_PWMCFG_Type |
struct | TIMER2n_CAPTURECFG_Type |
Typedefs | |
typedef struct TIMER2n_PWMCFG_Type | TIMER2n_ONESHOTCFG_Type |
Enumerations | |
enum | TIMER2n_MODE_OPT { TIMER2n_PERIODIC_MODE = 0, TIMER2n_CAPTURE_MODE, TIMER2n_ONESHOT_MODE, TIMER2n_PWM_MODE } |
enum | TIMER2n_CLR_MODE_OPT { TIMER2n_FALLING_EGDE = 0, TIMER2n_RISING_EGDE, TIMER2n_BOTH_EGDE, TIMER2n_NONE } |
enum | TIMER2n_MASTER_CKSEL_OPT { TIMER2n_XSOSC_CLK = 0, TIMER2n_PCLK_CLK } |
enum | TIMER2n_CKSEL_MODE_OPT { TIMER2n_INTERNAL_CLK = 0, TIMER2n_EXTERNAL_CLK } |
enum | TIMER2n_CAP_CKSEL_OPT { TIMER2n_CAP_EXTERNAL_CLK = 0, TIMER2n_CAP_XSOSC_CLK, TIMER2n_CAP_WDTRC_CLK } |
enum | TIMER2n_STARTLVL_OPT { TIMER2n_START_HIGH = 0, TIMER2n_START_LOW } |
enum | TIMER2n_INT_Type { TIMER2n_CR_MATCH_INTR = 0, TIMER2n_CR_CAPTURE_INTR } |
Functions | |
HAL_Status_Type | HAL_TIMER2n_Init (TIMER2n_Type *TIMER2x, TIMER2n_MODE_OPT TimerCounterMode, void *TIMER2n_Config) |
Initialize the TIMER2n peripheral with the specified parameters. More... | |
HAL_Status_Type | HAL_TIMER2n_DeInit (TIMER2n_Type *TIMER2x) |
Close Timer/Counter device. More... | |
HAL_Status_Type | HAL_TIMER2n_ConfigInterrupt (TIMER2n_Type *TIMER2x, TIMER2n_INT_Type TIMER2n_IntCfg, FunctionalState NewState) |
Configure the peripheral interrupt. More... | |
HAL_Status_Type | HAL_TIMER2n_Cmd (TIMER2n_Type *TIMER2x, FunctionalState NewState) |
Start/Stop Timer/Counter device. More... | |
HAL_Status_Type | HAL_TIMER2n_ClearCounter (TIMER2n_Type *TIMER2x) |
Clear Timer/Counter device,. More... | |
HAL_Status_Type | HAL_TIMER2n_UpdateCountValue (TIMER2n_Type *TIMER2x, uint8_t CountCh, uint16_t Value) |
Update value. More... | |
HAL_Status_Type | HAL_TIMER2n_ClearStatus (TIMER2n_Type *TIMER2x, uint8_t value) |
Clear Timer Status. More... | |
uint8_t | HAL_TIMER2n_GetStatus (TIMER2n_Type *TIMER2x) |
Get Timer Status. More... | |
uint32_t | HAL_TIMER2n_GetCaptureData (TIMER2n_Type *TIMER2x) |
Read value of capture register in timer/counter device. More... | |
Contains all macro definitions and function prototypes support for timer2n firmware library on A31G11x.
Copyright(C) 2019, ABOV Semiconductor All rights reserved.
ABOV Disclaimer
IMPORTANT NOTICE ? PLEASE READ CAREFULLY ABOV Semiconductor ("ABOV") reserves the right to make changes, corrections, enhancements, modifications, and improvements to ABOV products and/or to this document at any time without notice. ABOV does not give warranties as to the accuracy or completeness of the information included herein. Purchasers should obtain the latest relevant information of ABOV products before placing orders. Purchasers are entirely responsible for the choice, selection, and use of ABOV products and ABOV assumes no liability for application assistance or the design of purchasers' products. No license, express or implied, to any intellectual property rights is granted by ABOV herein. ABOV disclaims all express and implied warranties and shall not be responsible or liable for any injuries or damages related to use of ABOV products in such unauthorized applications. ABOV and the ABOV logo are trademarks of ABOV. All other product or service names are the property of their respective owners. Information in this document supersedes and replaces the information previously supplied in any former versions of this document. 2020 ABOV Semiconductor All rights reserved
Definition in file A31G11x_hal_timer2n.h.
typedef struct TIMER2n_PWMCFG_Type TIMER2n_ONESHOTCFG_Type |
capture clock source select
Enumerator | |
---|---|
TIMER2n_CAP_EXTERNAL_CLK | clock source from Externl |
TIMER2n_CAP_XSOSC_CLK | clock source from XSOSC |
TIMER2n_CAP_WDTRC_CLK | Clock Source from WDTRC |
Definition at line 146 of file A31G11x_hal_timer2n.h.
counter clock source select
Enumerator | |
---|---|
TIMER2n_INTERNAL_CLK | clock source from Internal |
TIMER2n_EXTERNAL_CLK | clock source from External |
Definition at line 139 of file A31G11x_hal_timer2n.h.
enum TIMER2n_CLR_MODE_OPT |
clear select when capture mode
Enumerator | |
---|---|
TIMER2n_FALLING_EGDE | rising edge clear mode |
TIMER2n_RISING_EGDE | falling edge clear mode |
TIMER2n_BOTH_EGDE | both edge clear mode |
TIMER2n_NONE | none clear mode |
Definition at line 123 of file A31G11x_hal_timer2n.h.
enum TIMER2n_INT_Type |
TIMER Interrupt Type definitions
Enumerator | |
---|---|
TIMER2n_CR_MATCH_INTR | OVIE Interrupt enable |
TIMER2n_CR_CAPTURE_INTR | MBIE Interrupt enable |
Definition at line 161 of file A31G11x_hal_timer2n.h.
Timer clock source select
Enumerator | |
---|---|
TIMER2n_XSOSC_CLK | clock source from Internal |
TIMER2n_PCLK_CLK | clock source from External |
Definition at line 132 of file A31G11x_hal_timer2n.h.
enum TIMER2n_MODE_OPT |
Timer operating mode
Enumerator | |
---|---|
TIMER2n_PERIODIC_MODE | PERIODIC mode |
TIMER2n_CAPTURE_MODE | PWM mode |
TIMER2n_ONESHOT_MODE | ONE SHOT mode |
TIMER2n_PWM_MODE | CAPTURE mode |
Definition at line 114 of file A31G11x_hal_timer2n.h.
enum TIMER2n_STARTLVL_OPT |
start default level select: initial output value.
Enumerator | |
---|---|
TIMER2n_START_HIGH | clock source from pclk div 2 |
TIMER2n_START_LOW | clock source from pclk div 4 |
Definition at line 154 of file A31G11x_hal_timer2n.h.
HAL_Status_Type HAL_TIMER2n_ClearCounter | ( | TIMER2n_Type * | TIMER2x | ) |
Clear Timer/Counter device,.
[in] | TIMER2x | Pointer to the target TIMER2
|
Definition at line 266 of file A31G11x_hal_timer2n.c.
HAL_Status_Type HAL_TIMER2n_ClearStatus | ( | TIMER2n_Type * | TIMER2x, |
uint8_t | value | ||
) |
Clear Timer Status.
[in] | TIMER2x | Pointer to the target TIMER2
|
[in] | value | clear value |
Definition at line 321 of file A31G11x_hal_timer2n.c.
HAL_Status_Type HAL_TIMER2n_Cmd | ( | TIMER2n_Type * | TIMER2x, |
FunctionalState | NewState | ||
) |
Start/Stop Timer/Counter device.
[in] | TIMER2x | Pointer to the target TIMER2
|
[in] | NewState | Next State of Functional Operation
|
Definition at line 239 of file A31G11x_hal_timer2n.c.
HAL_Status_Type HAL_TIMER2n_ConfigInterrupt | ( | TIMER2n_Type * | TIMER2x, |
TIMER2n_INT_Type | TIMER2n_IntCfg, | ||
FunctionalState | NewState | ||
) |
Configure the peripheral interrupt.
[in] | TIMER2x | Pointer to the target TIMER2
|
[in] | TIMER2n_IntCfg | Specifies the interrupt flag
|
[in] | NewState | Next State of Interrupt Operation
|
Definition at line 194 of file A31G11x_hal_timer2n.c.
References DISABLE, ENABLE, HAL_ERROR, HAL_OK, TIMER2n_CR_CAPTURE_INTR, and TIMER2n_CR_MATCH_INTR.
HAL_Status_Type HAL_TIMER2n_DeInit | ( | TIMER2n_Type * | TIMER2x | ) |
Close Timer/Counter device.
[in] | TIMER2x | Pointer to the target TIMER2
|
Definition at line 152 of file A31G11x_hal_timer2n.c.
uint32_t HAL_TIMER2n_GetCaptureData | ( | TIMER2n_Type * | TIMER2x | ) |
Read value of capture register in timer/counter device.
[in] | TIMER2x | Pointer to the target TIMER2
|
Definition at line 353 of file A31G11x_hal_timer2n.c.
uint8_t HAL_TIMER2n_GetStatus | ( | TIMER2n_Type * | TIMER2x | ) |
Get Timer Status.
[in] | TIMER2x | Pointer to the target TIMER2
|
Definition at line 341 of file A31G11x_hal_timer2n.c.
HAL_Status_Type HAL_TIMER2n_Init | ( | TIMER2n_Type * | TIMER2x, |
TIMER2n_MODE_OPT | TimerCounterMode, | ||
void * | TIMER2n_Config | ||
) |
Initialize the TIMER2n peripheral with the specified parameters.
[in] | TIMER2x | Pointer to the target TIMER2 |
[in] | TimerCounterMode | Timer Counter Mode |
[in] | TIMER2n_Config | Pointer to the configuration information for the specified peripheral. |
Definition at line 64 of file A31G11x_hal_timer2n.c.
References TIMER2n_PERIODICCFG_Type::ADR, TIMER2n_PWMCFG_Type::ADR, TIMER2n_PERIODICCFG_Type::BDR, TIMER2n_PWMCFG_Type::BDR, TIMER2n_CAPTURECFG_Type::CAPCkSel, TIMER2n_PERIODICCFG_Type::CapEdge, TIMER2n_PWMCFG_Type::CapEdge, TIMER2n_PERIODICCFG_Type::CkSel, TIMER2n_PWMCFG_Type::CkSel, TIMER2n_CAPTURECFG_Type::CkSel, TIMER2n_CAPTURECFG_Type::ClrMode, TIMER2n_PERIODICCFG_Type::ExtCkEdge, TIMER2n_PWMCFG_Type::ExtCkEdge, HAL_ERROR, HAL_OK, TIMER2n_PERIODICCFG_Type::Prescaler, TIMER2n_PWMCFG_Type::Prescaler, TIMER2n_CAPTURECFG_Type::Prescaler, TIMER2n_PERIODICCFG_Type::StartLevel, TIMER2n_PWMCFG_Type::StartLevel, TIMER2n_PERIODICCFG_Type::TCLK_SEL, TIMER2n_PWMCFG_Type::TCLK_SEL, TIMER2n_CAPTURECFG_Type::TCLK_SEL, TIMER2n_CAPTURE_MODE, TIMER2n_ONESHOT_MODE, TIMER2n_PERIODIC_MODE, and TIMER2n_PWM_MODE.
HAL_Status_Type HAL_TIMER2n_UpdateCountValue | ( | TIMER2n_Type * | TIMER2x, |
uint8_t | CountCh, | ||
uint16_t | Value | ||
) |
Update value.
[in] | TIMER2x | Pointer to the target TIMER2
|
[in] | CountCh |
|
[in] | Value | updated match value |
Definition at line 291 of file A31G11x_hal_timer2n.c.