21.8.1.1.3 Workflow
- Create a EXTOSC32K module configuration struct, which can be filled out to adjust the configuration of the external 32KHz oscillator channel.
struct
system_clock_source_xosc32k_config config_ext32k;
- Initialize the oscillator configuration struct with the module's default values.
system_clock_source_xosc32k_get_config_defaults(&config_ext32k);
Note: This should always be performed before using the configuration struct to ensure that all values are initialized to known default settings. - Alter the EXTOSC32K module configuration struct to require a start-up time of 4096 clock cycles.
config_ext32k.startup_time = SYSTEM_XOSC32K_STARTUP_4096;
- Write the new configuration to the EXTOSC32K module.
system_clock_source_xosc32k_set_config(&config_ext32k);
- Create a DFLL module configuration struct, which can be filled out to adjust the configuration of the external 32KHz oscillator channel.
struct
system_clock_source_dfll_config config_dfll;
- Initialize the DFLL oscillator configuration struct with the module's default values.
system_clock_source_dfll_get_config_defaults(&config_dfll);
Note: This should always be performed before using the configuration struct to ensure that all values are initialized to known default settings. - Write the new configuration to the DFLL module.
system_clock_source_dfll_set_config(&config_dfll);