CC13xx Driver Library
[aux_timer] AUX Timer

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...
 

Detailed Description

Function Documentation

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. I.e. (AUX_TIMER_CFG_ONE_SHOT_EDGE_COUNT | AUX_TIMER_CFG_RISING_EDGE | AUX_TIMER_CFG_TICK_SRC_RTC_EVENT).

Note
When used as an edge counter the prescaler should be set to AUX_TIMER_PRESCALE_DIV_1.
A timer can not trigger itself thus timer 0 can not use AUX_TIMER_CFG_TICK_SRC_TIMER0_EVENT and timer 1 can not use AUX_TIMER_CFG_TICK_SRC_TIMER1_EVENT.
Parameters
ui32Timeris the timer to configure.
ui32Configis the timer configuration.
Returns
None
See also
AUXTimerPrescaleSet()

Definition at line 66 of file aux_timer.c.

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.

Parameters
ui32Timeris the timer to get the prescale value from.
Returns
Returns the prescaler division ratio as one of the following values:
See also
AUXTimerPrescaleSet()

Definition at line 308 of file aux_timer.c.

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.

Note
Setting prescale value is not advised when the timer is running.
When timer is used as an edge counter the prescaler should be set to AUX_TIMER_PRESCALE_DIV_1.
Parameters
ui32Timeris the timer to set the prescale on.
ui32PrescaleDivis the prescaler division ratio.
Returns
None
See also
AUXTimerPrescaleGet()

Definition at line 269 of file aux_timer.c.

void AUXTimerStart ( uint32_t  ui32Timer)

Start AUX timer(s).

This call starts the selected AUX timer(s).

Note
The counter will start counting up from zero.
Parameters
ui32Timeris the timer to start.
Returns
None
See also
AUXTimerStop()

Start AUX timer(s).

Definition at line 207 of file aux_timer.c.

void AUXTimerStop ( uint32_t  ui32Timer)

Stop AUX timer(s).

This call stops the selected AUX timer(s).

Parameters
ui32Timeris the timer to stop.
Returns
None
See also
AUXTimerStart()

Stop AUX timer(s).

Definition at line 238 of file aux_timer.c.

static uint32_t AUXTimerTargetValGet ( uint32_t  ui32Timer)
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.

Parameters
ui32Timeris the timer to get the target value from.
Returns
Returns target value for the specified timer
See also
AUXTimerTargetValSet()

Definition at line 355 of file aux_timer.h.

static void AUXTimerTargetValSet ( uint32_t  ui32Timer,
uint32_t  ui32Target 
)
inlinestatic

Set AUX timer target value.

The timer counts from zero to the target value. When target value is reached an event is generated.

Parameters
ui32Timeris the timer to set the target value for.
ui32Targetis the timer target value.
  • For AUX_TIMER_0 the target value must be an integer in the range 0..65535 (16 bit).
  • For AUX_TIMER_1 the target value must be an integer in the range 0..255 (8 bit).
Returns
None
See also
AUXTimerTargetValGet()

Definition at line 319 of file aux_timer.h.

Macro Definition Documentation

#define AUX_TIMER_0   0x0000FFFF
#define AUX_TIMER_1   0x00FF0000
#define AUX_TIMER_BOTH   0x00FFFFFF

Definition at line 147 of file aux_timer.h.

Referenced by AUXTimerConfigure(), AUXTimerPrescaleSet(), AUXTimerStart(), and AUXTimerStop().

#define AUX_TIMER_CFG_FALLING_EDGE   (AUX_TIMER_T0CFG_TICK_SRC_POL_FALL)

Definition at line 104 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_ONE_SHOT   (AUX_TIMER_T0CFG_RELOAD_MAN)

Definition at line 99 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_ONE_SHOT_EDGE_COUNT   ((AUX_TIMER_T0CFG_RELOAD_MAN) | (AUX_TIMER_T0CFG_MODE_TICK))

Definition at line 101 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_PERIODIC   (AUX_TIMER_T0CFG_RELOAD_CONT)

Definition at line 100 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_PERIODIC_EDGE_COUNT   ((AUX_TIMER_T0CFG_RELOAD_CONT) | (AUX_TIMER_T0CFG_MODE_TICK))

Definition at line 102 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_RISING_EDGE   (AUX_TIMER_T0CFG_TICK_SRC_POL_RISE)

Definition at line 103 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_ACLK_REF   (AUX_TIMER_T0CFG_TICK_SRC_ACLK_REF)

Definition at line 135 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_ADC_DONE   (AUX_TIMER_T0CFG_TICK_SRC_ADC_DONE)

Definition at line 113 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_ADC_IRQ   (AUX_TIMER_T0CFG_TICK_SRC_ADC_IRQ)

Definition at line 137 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO0   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO0)

Definition at line 119 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO1   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO1)

Definition at line 120 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO10   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO10)

Definition at line 129 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO11   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO11)

Definition at line 130 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO12   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO12)

Definition at line 131 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO13   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO13)

Definition at line 132 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO14   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO14)

Definition at line 133 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO15   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO15)

Definition at line 134 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO2   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO2)

Definition at line 121 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO3   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO3)

Definition at line 122 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO4   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO4)

Definition at line 123 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO5   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO5)

Definition at line 124 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO6   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO6)

Definition at line 125 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO7   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO7)

Definition at line 126 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO8   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO8)

Definition at line 127 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO9   (AUX_TIMER_T0CFG_TICK_SRC_AUXIO9)

Definition at line 128 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AON_PROG_WU   (AUX_TIMER_T0CFG_TICK_SRC_AON_PROG_WU)

Definition at line 118 of file aux_timer.h.

#define AUX_TIMER_CFG_TICK_SRC_AON_SW   (AUX_TIMER_T0CFG_TICK_SRC_AON_SW)

Definition at line 117 of file aux_timer.h.

#define AUX_TIMER_CFG_TICK_SRC_CMP_A   (AUX_TIMER_T0CFG_TICK_SRC_AUX_COMPA)

Definition at line 107 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_CMP_B   (AUX_TIMER_T0CFG_TICK_SRC_AUX_COMPB)

Definition at line 108 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_MCU_EVENT   (AUX_TIMER_T0CFG_TICK_SRC_MCU_EVENT)

Definition at line 136 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_OBSMUX0   (AUX_TIMER_T0CFG_TICK_SRC_OBSMUX0)

Definition at line 115 of file aux_timer.h.

#define AUX_TIMER_CFG_TICK_SRC_OBSMUX1   (AUX_TIMER_T0CFG_TICK_SRC_OBSMUX1)

Definition at line 116 of file aux_timer.h.

#define AUX_TIMER_CFG_TICK_SRC_RTC_4KHZ   (AUX_TIMER_T0CFG_TICK_SRC_RTC_4KHZ)

Definition at line 114 of file aux_timer.h.

#define AUX_TIMER_CFG_TICK_SRC_RTC_EVENT   (AUX_TIMER_T0CFG_TICK_SRC_RTC_CH2_EV)

Definition at line 106 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_SMPH_RELEASE   (AUX_TIMER_T0CFG_TICK_SRC_SMPH_AUTOTAKE_DONE)

Definition at line 112 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_TDCDONE   (AUX_TIMER_T0CFG_TICK_SRC_TDC_DONE)

Definition at line 109 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_TIMER0_EVENT   (AUX_TIMER_T1CFG_TICK_SRC_TIMER0_EV)

Definition at line 110 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_TIMER1_EVENT   (AUX_TIMER_T0CFG_TICK_SRC_TIMER1_EV)

Definition at line 111 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_PRESCALE_DIV_1   0x00000000

Definition at line 155 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_1028   0x000000A0

Definition at line 165 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_128   0x00000070

Definition at line 162 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_16   0x00000040

Definition at line 159 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_16384   0x000000E0

Definition at line 169 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_2   0x00000010

Definition at line 156 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_2048   0x000000B0

Definition at line 166 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_256   0x00000080

Definition at line 163 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_32   0x00000050

Definition at line 160 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_32768   0x000000F0

Definition at line 170 of file aux_timer.h.

Referenced by AUXTimerPrescaleSet().

#define AUX_TIMER_PRESCALE_DIV_4   0x00000020

Definition at line 157 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_4096   0x000000C0

Definition at line 167 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_512   0x00000090

Definition at line 164 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_64   0x00000060

Definition at line 161 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_8   0x00000030

Definition at line 158 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_8192   0x000000D0

Definition at line 168 of file aux_timer.h.