Hello matthias:
The fsl_clock_manager component lets you add callbacks, but the callback's body itself needs to be implemented manually. Each callback will require different actions depending on the peripheral (uart, pit, i2c, etc) and also the callback code might be application dependent.
Attached is a simple example for FRDM-K64F with Processor Expert to show the use of the clock manager system. The example blinks the on-board blue LED using the PIT timer interrupt and each time you press SW2 the clock switches between configurations 0 and 5. In main.c there is a macro which works as next:
- CLOCK_CALLBACKS = 0: Clock configurations are changed using CLOCK_SYS_SetConfiguration(). PIT driver is not informed and the blink frequency changes.
- CLOCK_CALLBAKS = 1: Clock configurations are changed using CLOCK_SYS_UpdateConfiguration(). The PIT driver is notified of the clock change using the callback and the frequency is adjusted by De-initializing/Initializing the driver.
I hope this helps.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------