Functions | |
void | AUXTimerConfigure (uint32_t ui32Timer, uint32_t ui32Config) |
Configure AUX timer. More... | |
void | AUXTimerStart (uint32_t ui32Timer) |
Start AUX timer(s). More... | |
void | AUXTimerStop (uint32_t ui32Timer) |
Stop AUX timer(s). More... | |
static void | AUXTimerTargetValSet (uint32_t ui32Timer, uint32_t ui32Target) |
Set AUX timer target value. More... | |
static uint32_t | AUXTimerTargetValGet (uint32_t ui32Timer) |
Get AUX timer target value. More... | |
void | AUXTimerPrescaleSet (uint32_t ui32Timer, uint32_t ui32PrescaleDiv) |
Set AUX timer prescale value. More... | |
uint32_t | AUXTimerPrescaleGet (uint32_t ui32Timer) |
Get AUX timer prescale value. More... | |
void AUXTimerConfigure | ( | uint32_t | ui32Timer, |
uint32_t | ui32Config | ||
) |
Configure AUX timer.
This call configures the AUX timer selected by the ui32Timer
. The timer module is disabled before being configured and is left in the disabled state.
The configuration is specified in ui32Config
as one of the following values:
When configured as timer, the counter is incremented based on the AUX clock after the prescaler. The prescale division ratio is set using AUXTimerPrescaleSet().
When configured as an edge counter the counter is incremented only on edges of the selected event. The polarity of the event is selected by:
The event source is selected as one of the following defines:
The mode, event polarity and event source are configured by setting the ui32Config
parameter as the bitwise OR of the various settings. Example: (AUX_TIMER_CFG_ONE_SHOT_EDGE_COUNT | AUX_TIMER_CFG_RISING_EDGE | AUX_TIMER_CFG_TICK_SRC_RTC_EVENT).
ui32Timer | is the timer to configure. |
ui32Config | is the timer configuration. |
uint32_t AUXTimerPrescaleGet | ( | uint32_t | ui32Timer | ) |
Get AUX timer prescale value.
When configured as timer, the counter is incremented based on the AUX clock after the prescaler. This call returns the setting of the prescale divide ratio for the specified timer.
ui32Timer | is the timer to get the prescale value from. |
void AUXTimerPrescaleSet | ( | uint32_t | ui32Timer, |
uint32_t | ui32PrescaleDiv | ||
) |
Set AUX timer prescale value.
When configured as timer, the counter is incremented based on the AUX clock after the prescaler.
ui32Timer | is the timer to set the prescale on. |
ui32PrescaleDiv | is the prescaler division ratio.
|
void AUXTimerStart | ( | uint32_t | ui32Timer | ) |
Start AUX timer(s).
This call starts the selected AUX timer(s).
ui32Timer | is the timer to start. |
void AUXTimerStop | ( | uint32_t | ui32Timer | ) |
Stop AUX timer(s).
This call stops the selected AUX timer(s).
ui32Timer | is the timer to stop. |
|
inlinestatic |
Get AUX timer target value.
The timer counts from zero to the target value. When target value is reached an event is generated. This function returns the programmed target value for the specified timer.
ui32Timer | is the timer to get the target value from. |
|
inlinestatic |
Set AUX timer target value.
The timer counts from zero to the target value. When target value is reached an event is generated.
ui32Timer | is the timer to set the target value for. |
ui32Target | is the timer target value.
|
#define AUX_TIMER_0 0x0000FFFF |
#define AUX_TIMER_1 0x00FF0000 |
#define AUX_TIMER_BOTH 0x00FFFFFF |
Referenced by AUXTimerConfigure(), AUXTimerPrescaleSet(), AUXTimerStart(), and AUXTimerStop().
#define AUX_TIMER_CFG_FALLING_EDGE (AUX_TIMER_T0CFG_TICK_SRC_POL_FALL) |
Referenced by AUXTimerConfigure().
#define AUX_TIMER_CFG_ONE_SHOT (AUX_TIMER_T0CFG_RELOAD_MAN) |
#define AUX_TIMER_CFG_ONE_SHOT_EDGE_COUNT ((AUX_TIMER_T0CFG_RELOAD_MAN) | (AUX_TIMER_T0CFG_MODE_TICK)) |
#define AUX_TIMER_CFG_PERIODIC (AUX_TIMER_T0CFG_RELOAD_CONT) |
#define AUX_TIMER_CFG_PERIODIC_EDGE_COUNT ((AUX_TIMER_T0CFG_RELOAD_CONT) | (AUX_TIMER_T0CFG_MODE_TICK)) |
#define AUX_TIMER_CFG_RISING_EDGE (AUX_TIMER_T0CFG_TICK_SRC_POL_RISE) |
#define AUX_TIMER_CFG_TICK_SRC_ACLK_REF (AUX_TIMER_T0CFG_TICK_SRC_ACLK_REF) |
#define AUX_TIMER_CFG_TICK_SRC_ADC_DONE (AUX_TIMER_T0CFG_TICK_SRC_ADC_DONE) |
#define AUX_TIMER_CFG_TICK_SRC_ADC_IRQ (AUX_TIMER_T0CFG_TICK_SRC_ADC_IRQ) |
#define AUX_TIMER_CFG_TICK_SRC_AIO0 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO0) |
#define AUX_TIMER_CFG_TICK_SRC_AIO1 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO1) |
#define AUX_TIMER_CFG_TICK_SRC_AIO10 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO10) |
#define AUX_TIMER_CFG_TICK_SRC_AIO11 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO11) |
#define AUX_TIMER_CFG_TICK_SRC_AIO12 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO12) |
#define AUX_TIMER_CFG_TICK_SRC_AIO13 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO13) |
#define AUX_TIMER_CFG_TICK_SRC_AIO14 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO14) |
#define AUX_TIMER_CFG_TICK_SRC_AIO15 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO15) |
#define AUX_TIMER_CFG_TICK_SRC_AIO2 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO2) |
#define AUX_TIMER_CFG_TICK_SRC_AIO3 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO3) |
#define AUX_TIMER_CFG_TICK_SRC_AIO4 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO4) |
#define AUX_TIMER_CFG_TICK_SRC_AIO5 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO5) |
#define AUX_TIMER_CFG_TICK_SRC_AIO6 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO6) |
#define AUX_TIMER_CFG_TICK_SRC_AIO7 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO7) |
#define AUX_TIMER_CFG_TICK_SRC_AIO8 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO8) |
#define AUX_TIMER_CFG_TICK_SRC_AIO9 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO9) |
#define AUX_TIMER_CFG_TICK_SRC_AON_PROG_WU (AUX_TIMER_T0CFG_TICK_SRC_AON_PROG_WU) |
#define AUX_TIMER_CFG_TICK_SRC_AON_SW (AUX_TIMER_T0CFG_TICK_SRC_AON_SW) |
#define AUX_TIMER_CFG_TICK_SRC_CMP_A (AUX_TIMER_T0CFG_TICK_SRC_AUX_COMPA) |
#define AUX_TIMER_CFG_TICK_SRC_CMP_B (AUX_TIMER_T0CFG_TICK_SRC_AUX_COMPB) |
#define AUX_TIMER_CFG_TICK_SRC_MCU_EVENT (AUX_TIMER_T0CFG_TICK_SRC_MCU_EVENT) |
#define AUX_TIMER_CFG_TICK_SRC_OBSMUX0 (AUX_TIMER_T0CFG_TICK_SRC_OBSMUX0) |
#define AUX_TIMER_CFG_TICK_SRC_OBSMUX1 (AUX_TIMER_T0CFG_TICK_SRC_OBSMUX1) |
#define AUX_TIMER_CFG_TICK_SRC_RTC_4KHZ (AUX_TIMER_T0CFG_TICK_SRC_RTC_4KHZ) |
#define AUX_TIMER_CFG_TICK_SRC_RTC_EVENT (AUX_TIMER_T0CFG_TICK_SRC_RTC_CH2_EV) |
#define AUX_TIMER_CFG_TICK_SRC_SMPH_RELEASE (AUX_TIMER_T0CFG_TICK_SRC_SMPH_AUTOTAKE_DONE) |
#define AUX_TIMER_CFG_TICK_SRC_TDCDONE (AUX_TIMER_T0CFG_TICK_SRC_TDC_DONE) |
#define AUX_TIMER_CFG_TICK_SRC_TIMER0_EVENT (AUX_TIMER_T1CFG_TICK_SRC_TIMER0_EV) |
#define AUX_TIMER_CFG_TICK_SRC_TIMER1_EVENT (AUX_TIMER_T0CFG_TICK_SRC_TIMER1_EV) |
#define AUX_TIMER_PRESCALE_DIV_1 0x00000000 |
#define AUX_TIMER_PRESCALE_DIV_1028 0x0000000A |
#define AUX_TIMER_PRESCALE_DIV_128 0x00000007 |
#define AUX_TIMER_PRESCALE_DIV_16 0x00000004 |
#define AUX_TIMER_PRESCALE_DIV_16384 0x0000000E |
#define AUX_TIMER_PRESCALE_DIV_2 0x00000001 |
#define AUX_TIMER_PRESCALE_DIV_2048 0x0000000B |
#define AUX_TIMER_PRESCALE_DIV_256 0x00000008 |
#define AUX_TIMER_PRESCALE_DIV_32 0x00000005 |
#define AUX_TIMER_PRESCALE_DIV_32768 0x0000000F |
Referenced by AUXTimerPrescaleSet().
#define AUX_TIMER_PRESCALE_DIV_4 0x00000002 |
#define AUX_TIMER_PRESCALE_DIV_4096 0x0000000C |
#define AUX_TIMER_PRESCALE_DIV_512 0x00000009 |
#define AUX_TIMER_PRESCALE_DIV_64 0x00000006 |
#define AUX_TIMER_PRESCALE_DIV_8 0x00000003 |
#define AUX_TIMER_PRESCALE_DIV_8192 0x0000000D |