CC26xx Driver Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
[auxtimer] 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_INLINE void AUXTimerTargetValSet (uint32_t ui32Timer, uint32_t ui32Target)
 Set AUX timer target value. More...
 
__STATIC_INLINE 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 adviced 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_INLINE uint32_t AUXTimerTargetValGet ( uint32_t  ui32Timer)

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 396 of file aux_timer.h.

__STATIC_INLINE void AUXTimerTargetValSet ( uint32_t  ui32Timer,
uint32_t  ui32Target 
)

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 360 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 177 of file aux_timer.h.

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

#define AUX_TIMER_CFG_FALLING_EDGE   0x00002000

Definition at line 108 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_ONE_SHOT   0x00000000

Definition at line 97 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_ONE_SHOT_EDGE_COUNT   0x00000002

Definition at line 101 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_PERIODIC   0x00000001

Definition at line 99 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_PERIODIC_EDGE_COUNT   0x00000003

Definition at line 103 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_RISING_EDGE   0x00000000

Definition at line 105 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_ACLK_REF   0x00001D00

Definition at line 162 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_ADC_DONE   0x00000700

Definition at line 127 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_ADC_DONE   0x00000700

Definition at line 127 of file aux_timer.h.

#define AUX_TIMER_CFG_TICK_SRC_ADC_IRQ   0x00001F00

Definition at line 166 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO0   0x00000d00

Definition at line 130 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO1   0x00000e00

Definition at line 132 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO10   0x00001700

Definition at line 150 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO11   0x00001800

Definition at line 152 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO12   0x00001900

Definition at line 154 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO13   0x00001A00

Definition at line 156 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO14   0x00001B00

Definition at line 158 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO15   0x00001C00

Definition at line 160 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO2   0x00000f00

Definition at line 134 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO3   0x00001000

Definition at line 136 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO4   0x00001100

Definition at line 138 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO5   0x00001200

Definition at line 140 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO6   0x00001300

Definition at line 142 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO7   0x00001400

Definition at line 144 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO8   0x00001500

Definition at line 146 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_AIO9   0x00001600

Definition at line 148 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_CMP_A   0x00000100

Definition at line 113 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_CMP_B   0x00000200

Definition at line 115 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_MCU_EVENT   0x00001E00

Definition at line 164 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_RTC_EVENT   0x00000000

Definition at line 111 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_SMPH_RELEASE   0x00000600

Definition at line 123 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_TDCDONE   0x00000300

Definition at line 117 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_TIMER0_EVENT   0x00000400

Definition at line 119 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_CFG_TICK_SRC_TIMER1_EVENT   0x00000500

Definition at line 121 of file aux_timer.h.

Referenced by AUXTimerConfigure().

#define AUX_TIMER_PRESCALE_DIV_1   0x00000000

Definition at line 185 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_1028   0x000000A0

Definition at line 205 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_128   0x00000070

Definition at line 199 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_16   0x00000040

Definition at line 193 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_16384   0x000000E0

Definition at line 213 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_2   0x00000010

Definition at line 187 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_2048   0x000000B0

Definition at line 207 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_256   0x00000080

Definition at line 201 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_32   0x00000050

Definition at line 195 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_32768   0x000000F0

Definition at line 215 of file aux_timer.h.

Referenced by AUXTimerPrescaleSet().

#define AUX_TIMER_PRESCALE_DIV_4   0x00000020

Definition at line 189 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_4096   0x000000C0

Definition at line 209 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_512   0x00000090

Definition at line 203 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_64   0x00000060

Definition at line 197 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_8   0x00000030

Definition at line 191 of file aux_timer.h.

#define AUX_TIMER_PRESCALE_DIV_8192   0x000000D0

Definition at line 211 of file aux_timer.h.