CRYOTIMEREMLIB

Detailed Description

Ultra Low Energy Timer/Counter (CRYOTIMER) Peripheral API.

The CRYOTIMER is a 32 bit counter which operates on a low-frequency oscillator and is capable of running in all Energy Modes. It can provide periodic wakeup events and PRS signals which can be used to wake up peripherals from any energy mode. The CRYOTIMER provides a very wide range of periods for the interrupts facilitating flexible ultra-low energy operation. Because of its simplicity, the CRYOTIMER is a lower energy solution for periodically waking up the MCU compared to the RTCC.

To configure the CRYOTIMER, call the CRYOTIMER_Init function. This function will configure the CRYOTIMER peripheral according to the user configuration.

When using the CRYOTIMER, choose which oscillator to use as the CRYOTIMER clock. The CRYOTIMER supports 3 low-frequency clocks LFXO, LFRCO, and ULFRCO. The oscillator that is chosen 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 cmuOsc_LFRCO and LFXO cmuOsc_LFXO must be enabled 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.

This example shows how to use the CRYOTIMER to generate an interrupt at a configurable period.

Note that when using the CRYOTIMER to wake up from EM4, the application has the responsibility to clear the wakeup event. This is done by calling CRYOTIMER_IntClear. If the user does not clear the wakeup event, the wakeup event will stay pending and will cause an immediate wakeup the next time the application attempts to enter EM4.

This example shows how to use the CRYOTIMER to wake up from EM4 after a configurable amount of time.

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.