Functions | |
cy_en_sysclk_status_t | Cy_SysClk_StartClkMeasurementCounters (cy_en_meas_clks_t clock1, uint32_t count1, cy_en_meas_clks_t clock2) |
Assigns clocks to the clock measurement counters, and starts counting. More... | |
uint32_t | Cy_SysClk_ClkMeasurementCountersGetFreq (bool measuredClock, uint32_t refClkFreq) |
Calculates the frequency of the indicated measured clock (clock1 or clock2). More... | |
bool | Cy_SysClk_ClkMeasurementCountersDone (void) |
Checks if clock measurement counting is done, that is, counter1 has counted down to zero. More... | |
cy_en_sysclk_status_t Cy_SysClk_StartClkMeasurementCounters | ( | cy_en_meas_clks_t | clock1, |
uint32_t | count1, | ||
cy_en_meas_clks_t | clock2 | ||
) |
Assigns clocks to the clock measurement counters, and starts counting.
The counters let you measure a clock frequency using another clock as a reference. There are two counters.
Either clock1 or clock2 can be a reference clock; the other clock becomes the measured clock. The reference clock frequency is always known.
After calling this function, call Cy_SysClk_ClkMeasurementCountersDone() to determine when counting is done; that is, counter1 has counted down to zero. Then call Cy_SysClk_ClkMeasurementCountersGetFreq() to calculate the frequency of the measured clock.
clock1 | The clock for counter1 |
count1 | The initial value for counter1, from which counter1 counts down to zero. |
clock2 | The clock for counter2 |
uint32_t Cy_SysClk_ClkMeasurementCountersGetFreq | ( | bool | measuredClock, |
uint32_t | refClkFreq | ||
) |
Calculates the frequency of the indicated measured clock (clock1 or clock2).
Call this function only after counting is done; see Cy_SysClk_ClkMeasurementCountersDone().
measuredClock | False (0) if the measured clock is clock1; true (1) if the measured clock is clock2. |
refClkFreq | The reference clock frequency (clock1 or clock2). |
bool Cy_SysClk_ClkMeasurementCountersDone | ( | void | ) |
Checks if clock measurement counting is done, that is, counter1 has counted down to zero.
Call Cy_SysClk_StartClkMeasurementCounters() before calling this function.