Functions | |
__STATIC_INLINE void | Cy_SysClk_IloEnable (void) |
Enables the ILO. More... | |
__STATIC_INLINE bool | Cy_SysClk_IloIsEnabled (void) |
Returns the ILO enable/disable state. More... | |
__STATIC_INLINE cy_en_sysclk_status_t | Cy_SysClk_IloDisable (void) |
Disables the ILO. More... | |
void | Cy_SysClk_IloStartMeasurement (void) |
Prepares the DFT hardware to perform the ILO accuracy measurement. More... | |
void | Cy_SysClk_IloStopMeasurement (void) |
Cleans the DFT hardware registers, returning it to the default state. More... | |
cy_en_sysclk_status_t | Cy_SysClk_IloCompensate (uint32_t desiredDelay, uint32_t *compensatedCycles) |
Measures the current ILO accuracy. More... | |
__STATIC_INLINE void Cy_SysClk_IloEnable | ( | void | ) |
Enables the ILO.
__STATIC_INLINE bool Cy_SysClk_IloIsEnabled | ( | void | ) |
Returns the ILO enable/disable state.
__STATIC_INLINE cy_en_sysclk_status_t Cy_SysClk_IloDisable | ( | void | ) |
Disables the ILO.
ILO can't be disabled if WDT is enabled or the ILO is selected as a LFCLK source.
void Cy_SysClk_IloStartMeasurement | ( | void | ) |
Prepares the DFT hardware to perform the ILO accuracy measurement.
This function is non-blocking and needs to be called before using the Cy_SysClk_IloCompensate() function.
This function configures measurement counters to be sourced:
and ILO (Counter 2).
void Cy_SysClk_IloStopMeasurement | ( | void | ) |
Cleans the DFT hardware registers, returning it to the default state.
Calling this function immediately stops the the ILO frequency measurement. Call this function before placing the device to deepsleep, if Cy_SysClk_IloStartMeasurement() API was called before.
cy_en_sysclk_status_t Cy_SysClk_IloCompensate | ( | uint32_t | desiredDelay, |
uint32_t * | compensatedCycles | ||
) |
Measures the current ILO accuracy.
Basing on the measured frequency the required number of ILO cycles for a given delay (in microseconds) is obtained. The desired delay that needs to be compensated is passed through the desiredDelay parameter. The compensated cycle count is returned through the compesatedCycles pointer. The compensated ILO cycles can then be used to define the WDT period value, effectively compensating for the ILO inaccuracy and allowing a more accurate WDT interrupt generation. This function starts timers, and if they are already running, their status is checked. If the timer has reached 0, then it is considered that it has already measured and calculated, how many cycles are needed for DesiredDelay and returns "success". The Cy_SysClk_IloCompensate function execution time is always ~ 1ms.
Cy_SysClk_IloStartMeasurement() function should be called prior to calling this function.
desiredDelay | Required delay in microseconds. Valid range is 100 ... 2 000 000 us. |
*compensatedCycles | The pointer to the variable in which the required number of ILO cycles for the given delay will be returned. |
The value returned in *compensatedCycles pointer is not valid until the function returns CY_SYSCLK_SUCCESS.