Functions | |
| cy_en_sysclk_status_t | Cy_SysClk_CalibStart (cy_en_meas_clks_t clock1, uint16_t count1, cy_en_meas_clks_t clock2) |
| Assigns clocks to the clock measurement counters, and starts counting. More... | |
| uint32_t | Cy_SysClk_CalibGetFreq (bool measuredClock, uint16_t count1) |
| Calculates the frequency of the indicated measured clock (clock1 or clock2). More... | |
| bool | Cy_SysClk_CalibDone (void) |
| Checks if clock measurement counting is done, that is, counter1 has counted down to zero. More... | |
| cy_en_sysclk_status_t Cy_SysClk_CalibStart | ( | cy_en_meas_clks_t | clock1, |
| uint16_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_CalibDone() to determine when counting is done; that is, counter1 has counted down to zero. Then call Cy_SysClk_CalibGetFreq() 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_CalibGetFreq | ( | bool | measuredClock, |
| uint16_t | count1 | ||
| ) |
Calculates the frequency of the indicated measured clock (clock1 or clock2).
Call this function only after counting is done; see Cy_SysClk_CalibDone().
| measuredClock | False (0) if the measured clock is clock1; true (1) if the measured clock is clock2. |
| count1 | The initial value for counter1, from which counter1 counts down to zero. See Cy_SysClk_CalibStart() |
| bool Cy_SysClk_CalibDone | ( | void | ) |
Checks if clock measurement counting is done, that is, counter1 has counted down to zero.
Call Cy_SysClk_CalibStart() before calling this function.