Low Energy Timer (LETIMER) Peripheral API. More...
![]() |
Data Structures | |
struct | LETIMER_Init_TypeDef |
Defines | |
#define | LETIMER_INIT_DEFAULT |
Enumerations | |
enum | LETIMER_RepeatMode_TypeDef { letimerRepeatFree = _LETIMER_CTRL_REPMODE_FREE, letimerRepeatOneshot = _LETIMER_CTRL_REPMODE_ONESHOT, letimerRepeatBuffered = _LETIMER_CTRL_REPMODE_BUFFERED, letimerRepeatDouble = _LETIMER_CTRL_REPMODE_DOUBLE } |
enum | LETIMER_UFOA_TypeDef { letimerUFOANone = _LETIMER_CTRL_UFOA0_NONE, letimerUFOAToggle = _LETIMER_CTRL_UFOA0_TOGGLE, letimerUFOAPulse = _LETIMER_CTRL_UFOA0_PULSE, letimerUFOAPwm = _LETIMER_CTRL_UFOA0_PWM } |
Functions | |
uint32_t | LETIMER_CompareGet (LETIMER_TypeDef *letimer, unsigned int comp) |
Get LETIMER compare register value. | |
void | LETIMER_CompareSet (LETIMER_TypeDef *letimer, unsigned int comp, uint32_t value) |
Set LETIMER compare register value. | |
__STATIC_INLINE uint32_t | LETIMER_CounterGet (LETIMER_TypeDef *letimer) |
Get LETIMER counter value. | |
void | LETIMER_Enable (LETIMER_TypeDef *letimer, bool enable) |
Start/stop LETIMER. | |
void | LETIMER_FreezeEnable (LETIMER_TypeDef *letimer, bool enable) |
LETIMER register synchronization freeze control. | |
void | LETIMER_Init (LETIMER_TypeDef *letimer, const LETIMER_Init_TypeDef *init) |
Initialize LETIMER. | |
__STATIC_INLINE void | LETIMER_IntClear (LETIMER_TypeDef *letimer, uint32_t flags) |
Clear one or more pending LETIMER interrupts. | |
__STATIC_INLINE void | LETIMER_IntDisable (LETIMER_TypeDef *letimer, uint32_t flags) |
Disable one or more LETIMER interrupts. | |
__STATIC_INLINE void | LETIMER_IntEnable (LETIMER_TypeDef *letimer, uint32_t flags) |
Enable one or more LETIMER interrupts. | |
__STATIC_INLINE uint32_t | LETIMER_IntGet (LETIMER_TypeDef *letimer) |
Get pending LETIMER interrupt flags. | |
__STATIC_INLINE void | LETIMER_IntSet (LETIMER_TypeDef *letimer, uint32_t flags) |
Set one or more pending LETIMER interrupts from SW. | |
uint32_t | LETIMER_RepeatGet (LETIMER_TypeDef *letimer, unsigned int rep) |
Get LETIMER repeat register value. | |
void | LETIMER_RepeatSet (LETIMER_TypeDef *letimer, unsigned int rep, uint32_t value) |
Set LETIMER repeat counter register value. | |
void | LETIMER_Reset (LETIMER_TypeDef *letimer) |
Reset LETIMER to same state as after a HW reset. |
Low Energy Timer (LETIMER) Peripheral API.
#define LETIMER_INIT_DEFAULT |
{ true, /* Enable timer when init complete. */ \ false, /* Stop counter during debug halt. */ \ false, /* Do not start counting on RTC COMP0 match. */ \ false, /* Do not start counting on RTC COMP1 match. */ \ false, /* Do not load COMP0 into CNT on underflow. */ \ false, /* Do not load COMP1 into COMP0 when REP0 reaches 0. */ \ 0, /* Idle value 0 for output 0. */ \ 0, /* Idle value 0 for output 1. */ \ letimerUFOANone, /* No action on underflow on output 0. */ \ letimerUFOANone, /* No action on underflow on output 1. */ \ letimerRepeatFree /* Count until stopped by SW. */ \ }
Default config for LETIMER init structure.
Definition at line 113 of file em_letimer.h.
Repeat mode.
Definition at line 60 of file em_letimer.h.
enum LETIMER_UFOA_TypeDef |
Underflow action on output.
Definition at line 80 of file em_letimer.h.
uint32_t LETIMER_CompareGet | ( | LETIMER_TypeDef * | letimer, | |
unsigned int | comp | |||
) |
Get LETIMER compare register value.
[in] | letimer | Pointer to LETIMER peripheral register block |
[in] | comp | Compare register to get, either 0 or 1 |
Definition at line 124 of file em_letimer.c.
void LETIMER_CompareSet | ( | LETIMER_TypeDef * | letimer, | |
unsigned int | comp, | |||
uint32_t | value | |||
) |
Set LETIMER compare register value.
[in] | letimer | Pointer to LETIMER peripheral register block |
[in] | comp | Compare register to set, either 0 or 1 |
[in] | value | Initialization value (<= 0x0000ffff) |
Definition at line 171 of file em_letimer.c.
__STATIC_INLINE uint32_t LETIMER_CounterGet | ( | LETIMER_TypeDef * | letimer | ) |
Get LETIMER counter value.
[in] | letimer | Pointer to LETIMER peripheral register block. |
Definition at line 148 of file em_letimer.h.
void LETIMER_Enable | ( | LETIMER_TypeDef * | letimer, | |
bool | enable | |||
) |
Start/stop LETIMER.
[in] | letimer | Pointer to LETIMER peripheral register block. |
[in] | enable | true to enable counting, false to disable. |
Definition at line 224 of file em_letimer.c.
void LETIMER_FreezeEnable | ( | LETIMER_TypeDef * | letimer, | |
bool | enable | |||
) |
LETIMER register synchronization freeze control.
Some LETIMER registers require synchronization into the low frequency (LF) domain. The freeze feature allows for several such registers to be modified before passing them to the LF domain simultaneously (which takes place when the freeze mode is disabled).
[in] | letimer | Pointer to LETIMER peripheral register block. |
[in] | enable |
|
Definition at line 271 of file em_letimer.c.
Referenced by LETIMER_Reset().
void LETIMER_Init | ( | LETIMER_TypeDef * | letimer, | |
const LETIMER_Init_TypeDef * | init | |||
) |
Initialize LETIMER.
Note that the compare/repeat values must be set separately with LETIMER_CompareSet() and LETIMER_RepeatSet(). That should probably be done prior to the use of this function if configuring the LETIMER to start when initialization is completed.
[in] | letimer | Pointer to LETIMER peripheral register block. |
[in] | init | Pointer to LETIMER initialization structure. |
Definition at line 320 of file em_letimer.c.
References LETIMER_Init_TypeDef::bufTop, LETIMER_Init_TypeDef::comp0Top, LETIMER_Init_TypeDef::debugRun, LETIMER_Init_TypeDef::enable, LETIMER_Init_TypeDef::out0Pol, LETIMER_Init_TypeDef::out1Pol, LETIMER_Init_TypeDef::repMode, LETIMER_Init_TypeDef::rtcComp0Enable, LETIMER_Init_TypeDef::rtcComp1Enable, LETIMER_Init_TypeDef::ufoa0, and LETIMER_Init_TypeDef::ufoa1.
__STATIC_INLINE void LETIMER_IntClear | ( | LETIMER_TypeDef * | letimer, | |
uint32_t | flags | |||
) |
Clear one or more pending LETIMER interrupts.
[in] | letimer | Pointer to LETIMER peripheral register block. |
[in] | flags | Pending LETIMER interrupt source to clear. Use a bitwise logic OR combination of valid interrupt flags for the LETIMER module (LETIMER_IF_nnn). |
Definition at line 171 of file em_letimer.h.
__STATIC_INLINE void LETIMER_IntDisable | ( | LETIMER_TypeDef * | letimer, | |
uint32_t | flags | |||
) |
Disable one or more LETIMER interrupts.
[in] | letimer | Pointer to LETIMER peripheral register block. |
[in] | flags | LETIMER interrupt sources to disable. Use a bitwise logic OR combination of valid interrupt flags for the LETIMER module (LETIMER_IF_nnn). |
Definition at line 188 of file em_letimer.h.
__STATIC_INLINE void LETIMER_IntEnable | ( | LETIMER_TypeDef * | letimer, | |
uint32_t | flags | |||
) |
Enable one or more LETIMER interrupts.
[in] | letimer | Pointer to LETIMER peripheral register block. |
[in] | flags | LETIMER interrupt sources to enable. Use a bitwise logic OR combination of valid interrupt flags for the LETIMER module (LETIMER_IF_nnn). |
Definition at line 210 of file em_letimer.h.
__STATIC_INLINE uint32_t LETIMER_IntGet | ( | LETIMER_TypeDef * | letimer | ) |
Get pending LETIMER interrupt flags.
[in] | letimer | Pointer to LETIMER peripheral register block. |
Definition at line 230 of file em_letimer.h.
__STATIC_INLINE void LETIMER_IntSet | ( | LETIMER_TypeDef * | letimer, | |
uint32_t | flags | |||
) |
Set one or more pending LETIMER interrupts from SW.
[in] | letimer | Pointer to LETIMER peripheral register block. |
[in] | flags | LETIMER interrupt sources to set to pending. Use a bitwise logic OR combination of valid interrupt flags for the LETIMER module (LETIMER_IF_nnn). |
Definition at line 247 of file em_letimer.h.
uint32_t LETIMER_RepeatGet | ( | LETIMER_TypeDef * | letimer, | |
unsigned int | rep | |||
) |
Get LETIMER repeat register value.
[in] | letimer | Pointer to LETIMER peripheral register block |
[in] | rep | Repeat register to get, either 0 or 1 |
Definition at line 408 of file em_letimer.c.
void LETIMER_RepeatSet | ( | LETIMER_TypeDef * | letimer, | |
unsigned int | rep, | |||
uint32_t | value | |||
) |
Set LETIMER repeat counter register value.
[in] | letimer | Pointer to LETIMER peripheral register block |
[in] | rep | Repeat counter register to set, either 0 or 1 |
[in] | value | Initialization value (<= 0x0000ffff) |
Definition at line 455 of file em_letimer.c.
void LETIMER_Reset | ( | LETIMER_TypeDef * | letimer | ) |
Reset LETIMER to same state as after a HW reset.
[in] | letimer | Pointer to LETIMER peripheral register block. |
Definition at line 509 of file em_letimer.c.
References LETIMER_FreezeEnable().