HFXO Manager
Description
HFXO Manager.
Overview
HFXO Manager is a platform service module intended to manage the High Frequency Crystal Oscillator (HFXO) module and offer related functionalities and services. For the moment, this module is only supported on Silicon Labs series 2 devices. Among others, it handles the HFXO startup failures. This is to support sleepy crystals (crystals where the ESR value could change unexpectedly up to 5 times its value during the startup). In case of a failure during the HFXO startup, the HFXO Manager will retry the startup process with more aggressive settings (sleepy crystal settings) to try waking up the crystal from its sleepy state so that the ESR value can fall back to normal values. Once the crystal is out of its sleepy state, the module will put back the normal settings ensuring the right oscillation frequency. This feature can be enabled/disabled via the configuration define SL_HFXO_MANAGER_SLEEPY_CRYSTAL_SUPPORT. The module catches startup failures through interrupts using the HFXO interrupt handler. If your application also needs the HFXO interrupt handler, the configuration define SL_HFXO_MANAGER_CUSTOM_HFXO_IRQ_HANDLER can be used to remove the HFXO interrupt handler definition from the HFXO Manager so that it can be defined in your application. In that case, your definition of the HFXO Interrupt Handler will need to call the sl_hfxo_manager_irq_handler() function so that HFXO Manager can continue to work properly. The HFXO Manager is also required by the Power Manager module for some internal features and therefore becomes mandatory every time the Power Manager is present.
Initialization
Two functions are required to initialize the module. sl_hfxo_manager_init_hardware() is to initialize the HFXO interrupts and must therefore be called before any other HFXO initialization functions like the emlib CMU_HFXOInit() or device_init function sl_device_init_hfxo() . The second initialization function sl_hfxo_manager_init() is required for internal use and needs to be called before going to sleep.
Data Structures |
|
struct | sl_hfxo_manager_sleepy_xtal_settings |
Sleepy Crystal settings.
|
|
Functions |
|
void | sl_hfxo_manager_init_hardware (void) |
HFXO Manager module hardware specific initialization.
|
|
sl_status_t | sl_hfxo_manager_init (void) |
Initialize HFXO Manager module.
|
|
sl_status_t | sl_hfxo_manager_update_sleepy_xtal_settings (sl_hfxo_manager_sleepy_xtal_settings_t *settings) |
Updates Sleepy Crystal settings.
|
|
void | sl_hfxo_manager_notify_consecutive_failed_startups (void) |
When this callback function is called, it means that HFXO failed twice in a row to start with normal configurations.
|
|
void | sl_hfxo_manager_irq_handler (void) |
HFXO Manager HFXO interrupt handler.
|
|
Function Documentation
◆ sl_hfxo_manager_init_hardware()
void sl_hfxo_manager_init_hardware | ( | void |
|
) |
HFXO Manager module hardware specific initialization.
◆ sl_hfxo_manager_init()
sl_status_t sl_hfxo_manager_init | ( | void |
|
) |
Initialize HFXO Manager module.
- Returns
- Status Code.
◆ sl_hfxo_manager_update_sleepy_xtal_settings()
sl_status_t sl_hfxo_manager_update_sleepy_xtal_settings | ( | sl_hfxo_manager_sleepy_xtal_settings_t * |
settings
|
) |
Updates Sleepy Crystal settings.
- Parameters
-
settings
Pointer to settings structure
- Returns
- Status Code.
- Note
- Those settings are temporarily used to force oscillation on sleepy crystal. Default values should be enough to wake-up sleepy crystals. Otherwise, this function can be used.
◆ sl_hfxo_manager_notify_consecutive_failed_startups()
void sl_hfxo_manager_notify_consecutive_failed_startups | ( | void |
|
) |
When this callback function is called, it means that HFXO failed twice in a row to start with normal configurations.
This may mean that there is a bad crystal. When getting this callback, HFXO is running but its properties (frequency, precision) are not guaranteed. This should be considered as an error situation.
◆ sl_hfxo_manager_irq_handler()
void sl_hfxo_manager_irq_handler | ( | void |
|
) |
HFXO Manager HFXO interrupt handler.
- Note
- This function must be called by the HFXO interrupt handler in order to support the HFXO Manager module. This function handles the HFXO_IF_RDY, HFXO_IF_DNSERR and HFXO_XTALCTRL_SKIPCOREBIASOPT interrupt flags.