EFM32 Pearl Gecko Software Documentation
efm32pg1-doc-4.2.1
|
Ultra Low Energy Timer/Counter (CRYOTIMER) Peripheral API. More...
Data Structures | |
struct | CRYOTIMER_Init_TypeDef |
Macros | |
#define | CRYOTIMER_INIT_DEFAULT |
Functions | |
__STATIC_INLINE void | CRYOTIMER_IntClear (uint32_t flags) |
Clear the CRYOTIMER period interrupt. More... | |
__STATIC_INLINE uint32_t | CRYOTIMER_IntGet (void) |
Get the CRYOTIMER interrupt flag. More... | |
__STATIC_INLINE uint32_t | CRYOTIMER_IntGetEnabled (void) |
Get enabled and pending CRYOTIMER interrupt flags. Useful for handling more interrupt sources in the same interrupt handler. More... | |
__STATIC_INLINE void | CRYOTIMER_IntEnable (uint32_t flags) |
Enable one or more CRYOTIMER interrupts. More... | |
__STATIC_INLINE void | CRYOTIMER_IntDisable (uint32_t flags) |
Disable one or more CRYOTIMER interrupts. More... | |
__STATIC_INLINE void | CRYOTIMER_IntSet (uint32_t flags) |
Set the CRYOTIMER period interrupt flag. More... | |
__STATIC_INLINE void | CRYOTIMER_PeriodSet (uint32_t period) |
Set the CRYOTIMER period select. More... | |
__STATIC_INLINE uint32_t | CRYOTIMER_PeriodGet (void) |
Get the CRYOTIMER period select value. More... | |
__STATIC_INLINE uint32_t | CRYOTIMER_CounterGet (void) |
Get the CRYOTIMER counter value. More... | |
__STATIC_INLINE void | CRYOTIMER_EM4WakeupEnable (bool enable) |
Enable/disable EM4 wakeup capability. More... | |
__STATIC_INLINE void | CRYOTIMER_Enable (bool enable) |
Enable/disable the CRYOTIMER. More... | |
void | CRYOTIMER_Init (const CRYOTIMER_Init_TypeDef *init) |
Initialize the CRYOTIMER. More... | |
The user is responsible for choosing which oscillator to use for the CRYOTIMER. The oscillator that is choosen must be enabled and ready before calling this CRYOTIMER_Init function. See CMU_OscillatorEnable for details of how to enable and wait for an oscillator to become ready. Note that ULFRCO is always ready while LFRCO and LFXO must be enable by the user.
Note that the only oscillator which is running in EM3 is ULFRCO. Keep this in mind when choosing which oscillator to use for the CRYOTIMER.
Special care must be taken if the user wants the CRYOTIMER to run during EM4. All the low frequency oscillators can be used in EM4, however the oscillator that is used must be be configured to be retained when going into EM4. This can be configured by using functions in the EMU module. See EMU_EM4Init and EMU_EM4Init_TypeDef. If an oscillator is retained in EM4 the user is also responsible for unlatching the retained configuration on a wakeup from EM4.
#define CRYOTIMER_INIT_DEFAULT |
Default CRYOTIMER init structure.
Definition at line 173 of file em_cryotimer.h.
Prescaler selection.
Definition at line 84 of file em_cryotimer.h.
Low frequency oscillator selection.
Enumerator | |
---|---|
cryotimerOscLFRCO |
Select Low Frequency RC Oscillator. |
cryotimerOscLFXO |
Select Low Frequency Crystal Oscillator. |
cryotimerOscULFRCO |
Select Ultra Low Frequency RC Oscillator. |
Definition at line 97 of file em_cryotimer.h.
Period selection value
Definition at line 105 of file em_cryotimer.h.
__STATIC_INLINE void CRYOTIMER_IntClear | ( | uint32_t | flags | ) |
[in] | flags | CRYOTIMER interrupt sources to clear. Use CRYOTIMER_IFC_PERIOD |
Definition at line 194 of file em_cryotimer.h.
References _CRYOTIMER_IFC_MASK, and CRYOTIMER.
__STATIC_INLINE uint32_t CRYOTIMER_IntGet | ( | void | ) |
Definition at line 209 of file em_cryotimer.h.
References CRYOTIMER.
__STATIC_INLINE uint32_t CRYOTIMER_IntGetEnabled | ( | void | ) |
Definition at line 228 of file em_cryotimer.h.
References _CRYOTIMER_IEN_MASK, and CRYOTIMER.
__STATIC_INLINE void CRYOTIMER_IntEnable | ( | uint32_t | flags | ) |
[in] | flags | CRYOTIMER interrupt sources to enable. Use CRYOTIMER_IEN_PERIOD. |
Definition at line 243 of file em_cryotimer.h.
References _CRYOTIMER_IEN_MASK, and CRYOTIMER.
__STATIC_INLINE void CRYOTIMER_IntDisable | ( | uint32_t | flags | ) |
[in] | flags | CRYOTIMER interrupt sources to disable. Use CRYOTIMER_IEN_PERIOD. |
Definition at line 255 of file em_cryotimer.h.
References _CRYOTIMER_IEN_MASK, and CRYOTIMER.
__STATIC_INLINE void CRYOTIMER_IntSet | ( | uint32_t | flags | ) |
[in] | flags | CRYOTIMER interrupt sources to set to pending. Use CRYOTIMER_IFS_PERIOD. |
Definition at line 270 of file em_cryotimer.h.
References _CRYOTIMER_IFS_MASK, and CRYOTIMER.
__STATIC_INLINE void CRYOTIMER_PeriodSet | ( | uint32_t | period | ) |
[in] | period | 2^period is the number of clock cycles before a wakeup event or interrupt is triggered. The CRYOTIMER_Periodsel_TypeDef enum can be used a convenience type when calling this function. |
Definition at line 288 of file em_cryotimer.h.
References _CRYOTIMER_PERIODSEL_MASK, and CRYOTIMER.
__STATIC_INLINE uint32_t CRYOTIMER_PeriodGet | ( | void | ) |
Definition at line 306 of file em_cryotimer.h.
References CRYOTIMER.
__STATIC_INLINE uint32_t CRYOTIMER_CounterGet | ( | void | ) |
Definition at line 318 of file em_cryotimer.h.
References CRYOTIMER.
__STATIC_INLINE void CRYOTIMER_EM4WakeupEnable | ( | bool | enable | ) |
[in] | enable | True to enable EM4 wakeup, false to disable. |
Definition at line 330 of file em_cryotimer.h.
References _CRYOTIMER_EM4WUEN_EM4WU_SHIFT, BUS_RegBitWrite(), and CRYOTIMER.
Referenced by CRYOTIMER_Init().
__STATIC_INLINE void CRYOTIMER_Enable | ( | bool | enable | ) |
[in] | enable | True to enable the CRYOTIMER, false to disable. |
Definition at line 342 of file em_cryotimer.h.
References _CRYOTIMER_CTRL_EN_SHIFT, BUS_RegBitWrite(), and CRYOTIMER.
void CRYOTIMER_Init | ( | const CRYOTIMER_Init_TypeDef * | init | ) |
Use this function to initialize the CRYOTIMER. Select prescaler setting and select low frequency oscillator. Refer to the configuration structure CRYOTIMER_Init_TypeDef for more details.
[in] | init | Pointer to initialization structure. |
Definition at line 51 of file em_cryotimer.c.
References _CRYOTIMER_CTRL_DEBUGRUN_SHIFT, _CRYOTIMER_CTRL_EN_SHIFT, _CRYOTIMER_CTRL_OSCSEL_SHIFT, _CRYOTIMER_CTRL_PRESC_SHIFT, _CRYOTIMER_PERIODSEL_MASK, CRYOTIMER, CRYOTIMER_EM4WakeupEnable(), CRYOTIMER_Init_TypeDef::debugRun, CRYOTIMER_Init_TypeDef::em4Wakeup, CRYOTIMER_Init_TypeDef::enable, CRYOTIMER_Init_TypeDef::osc, CRYOTIMER_Init_TypeDef::period, and CRYOTIMER_Init_TypeDef::presc.