EFM32 Leopard Gecko Software Documentation
efm32lg-doc-4.2.1
|
Low Energy Timer (LETIMER) Peripheral API
. More...
Data Structures | |
struct | LETIMER_Init_TypeDef |
Macros | |
#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. More... | |
void | LETIMER_CompareSet (LETIMER_TypeDef *letimer, unsigned int comp, uint32_t value) |
Set LETIMER compare register value. More... | |
__STATIC_INLINE uint32_t | LETIMER_CounterGet (LETIMER_TypeDef *letimer) |
Get LETIMER counter value. More... | |
void | LETIMER_Enable (LETIMER_TypeDef *letimer, bool enable) |
Start/stop LETIMER. More... | |
void | LETIMER_FreezeEnable (LETIMER_TypeDef *letimer, bool enable) |
LETIMER register synchronization freeze control. More... | |
void | LETIMER_Init (LETIMER_TypeDef *letimer, const LETIMER_Init_TypeDef *init) |
Initialize LETIMER. More... | |
__STATIC_INLINE void | LETIMER_IntClear (LETIMER_TypeDef *letimer, uint32_t flags) |
Clear one or more pending LETIMER interrupts. More... | |
__STATIC_INLINE void | LETIMER_IntDisable (LETIMER_TypeDef *letimer, uint32_t flags) |
Disable one or more LETIMER interrupts. More... | |
__STATIC_INLINE void | LETIMER_IntEnable (LETIMER_TypeDef *letimer, uint32_t flags) |
Enable one or more LETIMER interrupts. More... | |
__STATIC_INLINE uint32_t | LETIMER_IntGet (LETIMER_TypeDef *letimer) |
Get pending LETIMER interrupt flags. More... | |
__STATIC_INLINE uint32_t | LETIMER_IntGetEnabled (LETIMER_TypeDef *letimer) |
Get enabled and pending LETIMER interrupt flags. More... | |
__STATIC_INLINE void | LETIMER_IntSet (LETIMER_TypeDef *letimer, uint32_t flags) |
Set one or more pending LETIMER interrupts from SW. More... | |
uint32_t | LETIMER_RepeatGet (LETIMER_TypeDef *letimer, unsigned int rep) |
Get LETIMER repeat register value. More... | |
void | LETIMER_RepeatSet (LETIMER_TypeDef *letimer, unsigned int rep, uint32_t value) |
Set LETIMER repeat counter register value. More... | |
void | LETIMER_Reset (LETIMER_TypeDef *letimer) |
Reset LETIMER to same state as after a HW reset. More... | |
#define LETIMER_INIT_DEFAULT |
Default config for LETIMER init structure.
Definition at line 115 of file em_letimer.h.
Repeat mode.
Definition at line 59 of file em_letimer.h.
enum LETIMER_UFOA_TypeDef |
Underflow action on output.
Definition at line 79 of file em_letimer.h.
uint32_t LETIMER_CompareGet | ( | LETIMER_TypeDef * | letimer, |
unsigned int | comp | ||
) |
[in] | letimer | Pointer to LETIMER peripheral register block |
[in] | comp | Compare register to get, either 0 or 1 |
Definition at line 125 of file em_letimer.c.
References LETIMER_TypeDef::COMP0, and LETIMER_TypeDef::COMP1.
void LETIMER_CompareSet | ( | LETIMER_TypeDef * | letimer, |
unsigned int | comp, | ||
uint32_t | 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 172 of file em_letimer.c.
References _LETIMER_COMP0_COMP0_MASK, _LETIMER_COMP0_COMP0_SHIFT, LETIMER_TypeDef::COMP0, LETIMER_TypeDef::COMP1, LETIMER_SYNCBUSY_COMP0, and LETIMER_SYNCBUSY_COMP1.
__STATIC_INLINE uint32_t LETIMER_CounterGet | ( | LETIMER_TypeDef * | letimer | ) |
[in] | letimer | Pointer to LETIMER peripheral register block. |
Definition at line 164 of file em_letimer.h.
References LETIMER_TypeDef::CNT.
void LETIMER_Enable | ( | LETIMER_TypeDef * | letimer, |
bool | enable | ||
) |
[in] | letimer | Pointer to LETIMER peripheral register block. |
[in] | enable | true to enable counting, false to disable. |
Definition at line 227 of file em_letimer.c.
References LETIMER_TypeDef::CMD, LETIMER_CMD_START, LETIMER_CMD_STOP, and LETIMER_SYNCBUSY_CMD.
void LETIMER_FreezeEnable | ( | LETIMER_TypeDef * | letimer, |
bool | enable | ||
) |
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 274 of file em_letimer.c.
References LETIMER_TypeDef::FREEZE, LETIMER_FREEZE_REGFREEZE, and LETIMER_TypeDef::SYNCBUSY.
Referenced by LETIMER_Reset().
void LETIMER_Init | ( | LETIMER_TypeDef * | letimer, |
const LETIMER_Init_TypeDef * | init | ||
) |
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 323 of file em_letimer.c.
References _LETIMER_CTRL_REPMODE_SHIFT, _LETIMER_CTRL_UFOA0_SHIFT, _LETIMER_CTRL_UFOA1_SHIFT, LETIMER_Init_TypeDef::bufTop, LETIMER_TypeDef::CMD, LETIMER_Init_TypeDef::comp0Top, LETIMER_TypeDef::CTRL, LETIMER_Init_TypeDef::debugRun, LETIMER_Init_TypeDef::enable, LETIMER_CMD_START, LETIMER_CMD_STOP, LETIMER_CTRL_BUFTOP, LETIMER_CTRL_COMP0TOP, LETIMER_CTRL_DEBUGRUN, LETIMER_CTRL_OPOL0, LETIMER_CTRL_OPOL1, LETIMER_CTRL_RTCC0TEN, LETIMER_CTRL_RTCC1TEN, LETIMER_STATUS_RUNNING, LETIMER_SYNCBUSY_CMD, LETIMER_SYNCBUSY_CTRL, LETIMER_Init_TypeDef::out0Pol, LETIMER_Init_TypeDef::out1Pol, LETIMER_Init_TypeDef::repMode, LETIMER_Init_TypeDef::rtcComp0Enable, LETIMER_Init_TypeDef::rtcComp1Enable, LETIMER_TypeDef::STATUS, LETIMER_Init_TypeDef::ufoa0, and LETIMER_Init_TypeDef::ufoa1.
__STATIC_INLINE void LETIMER_IntClear | ( | LETIMER_TypeDef * | letimer, |
uint32_t | flags | ||
) |
[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 189 of file em_letimer.h.
References LETIMER_TypeDef::IFC.
__STATIC_INLINE void LETIMER_IntDisable | ( | LETIMER_TypeDef * | letimer, |
uint32_t | flags | ||
) |
[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 206 of file em_letimer.h.
References LETIMER_TypeDef::IEN.
__STATIC_INLINE void LETIMER_IntEnable | ( | LETIMER_TypeDef * | letimer, |
uint32_t | flags | ||
) |
[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 228 of file em_letimer.h.
References LETIMER_TypeDef::IEN.
__STATIC_INLINE uint32_t LETIMER_IntGet | ( | LETIMER_TypeDef * | letimer | ) |
[in] | letimer | Pointer to LETIMER peripheral register block. |
Definition at line 248 of file em_letimer.h.
References LETIMER_TypeDef::IF.
__STATIC_INLINE uint32_t LETIMER_IntGetEnabled | ( | LETIMER_TypeDef * | letimer | ) |
Useful for handling more interrupt sources in the same interrupt handler.
[in] | letimer | Pointer to LETIMER peripheral register block. |
Definition at line 275 of file em_letimer.h.
References LETIMER_TypeDef::IEN, and LETIMER_TypeDef::IF.
__STATIC_INLINE void LETIMER_IntSet | ( | LETIMER_TypeDef * | letimer, |
uint32_t | flags | ||
) |
[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 300 of file em_letimer.h.
References LETIMER_TypeDef::IFS.
uint32_t LETIMER_RepeatGet | ( | LETIMER_TypeDef * | letimer, |
unsigned int | rep | ||
) |
[in] | letimer | Pointer to LETIMER peripheral register block |
[in] | rep | Repeat register to get, either 0 or 1 |
Definition at line 413 of file em_letimer.c.
References LETIMER_TypeDef::REP0, and LETIMER_TypeDef::REP1.
void LETIMER_RepeatSet | ( | LETIMER_TypeDef * | letimer, |
unsigned int | rep, | ||
uint32_t | 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 460 of file em_letimer.c.
References _LETIMER_REP0_REP0_MASK, _LETIMER_REP0_REP0_SHIFT, LETIMER_SYNCBUSY_REP0, LETIMER_SYNCBUSY_REP1, LETIMER_TypeDef::REP0, and LETIMER_TypeDef::REP1.
void LETIMER_Reset | ( | LETIMER_TypeDef * | letimer | ) |
[in] | letimer | Pointer to LETIMER peripheral register block. |
Definition at line 516 of file em_letimer.c.
References _LETIMER_COMP0_RESETVALUE, _LETIMER_COMP1_RESETVALUE, _LETIMER_CTRL_RESETVALUE, _LETIMER_IEN_RESETVALUE, _LETIMER_IFC_MASK, _LETIMER_REP0_RESETVALUE, _LETIMER_REP1_RESETVALUE, LETIMER_TypeDef::CMD, LETIMER_TypeDef::COMP0, LETIMER_TypeDef::COMP1, LETIMER_TypeDef::CTRL, LETIMER_TypeDef::IEN, LETIMER_TypeDef::IFC, LETIMER_CMD_CLEAR, LETIMER_CMD_CTO0, LETIMER_CMD_CTO1, LETIMER_CMD_STOP, LETIMER_FreezeEnable(), LETIMER_TypeDef::REP0, and LETIMER_TypeDef::REP1.