Functions | |
| cy_en_sysclk_status_t | Cy_SysClk_EcoConfigure (uint32_t freq, uint32_t cLoad, uint32_t esr, uint32_t driveLevel) |
| Configures the external crystal oscillator (ECO) trim bits based on crystal characteristics. More... | |
| cy_en_sysclk_status_t | Cy_SysClk_EcoEnable (uint32_t timeoutus) |
| Enables the external crystal oscillator (ECO). More... | |
| __STATIC_INLINE void | Cy_SysClk_EcoDisable (void) |
| Disables the external crystal oscillator (ECO). More... | |
| __STATIC_INLINE uint32_t | Cy_SysClk_EcoGetStatus (void) |
| Reports the current status of the external crystal oscillator (ECO). More... | |
| cy_en_sysclk_status_t Cy_SysClk_EcoConfigure | ( | uint32_t | freq, |
| uint32_t | cLoad, | ||
| uint32_t | esr, | ||
| uint32_t | driveLevel | ||
| ) |
Configures the external crystal oscillator (ECO) trim bits based on crystal characteristics.
This function should be called only when the ECO is disabled.
| freq | Operating frequency of the crystal in Hz. |
| cLoad | Crystal load capacitance in pF. |
| esr | Effective series resistance of the crystal in ohms. |
| driveLevel | Crystal drive level in uW. |
* freqMHz = freq / 1000000 * max amplitude Vpp = 1000 * sqrt(drivelevel / 2 / esr) / 3.14 / freqMHz / cLoad * gm_min mA/V = 5 * 4 * 3.14 * 3.14 * freqMhz^2 * cLoad^2 * 4 * esr / 1000000000 * Number of amplifier sections = INT(gm_min / 4.5) * * As a result of the above calculations, max amplitude must be >= 0.5, and the * number of amplifier sections must be <= 3, otherwise this function returns with * a parameter error. * * atrim = if (max amplitude < 0.5) then error * else 2 * the following: * max amplitude < 0.6: 0 * max amplitude < 0.7: 1 * max amplitude < 0.8: 2 * max amplitude < 0.9: 3 * max amplitude < 1.15: 5 * max amplitude < 1.275: 6 * max amplitude >= 1.275: 7 * wdtrim = if (max amplitude < 0.5) then error * else 2 * the following: * max amplitude < 1.2: INT(5 * max amplitude) - 2 * max amplitude >= 1.2: 3 * gtrim = if (number of amplifier sections > 3) then error * else the following: * number of amplifier sections > 1: number of amplifier sections * number of amplifier sections = 1: 0 * number of amplifier sections < 1: 1 * rtrim = if (gtrim = error) then error * else the following: * freqMHz > 26.8: 0 * freqMHz > 23.33: 1 * freqMHz > 16.5: 2 * freqMHz <= 16.5: 3 * ftrim = if (atrim = error) then error * else INT(atrim / 2) *
| cy_en_sysclk_status_t Cy_SysClk_EcoEnable | ( | uint32_t | timeoutus | ) |
Enables the external crystal oscillator (ECO).
This function should be called after Cy_SysClk_EcoConfigure.
| timeoutus | Amount of time in microseconds to wait for the ECO to stabilize. To avoid waiting for stabilization, set this parameter to 0. |
| __STATIC_INLINE void Cy_SysClk_EcoDisable | ( | void | ) |
Disables the external crystal oscillator (ECO).
This function should not be called if the ECO is sourcing clkHf[0].
| __STATIC_INLINE uint32_t Cy_SysClk_EcoGetStatus | ( | void | ) |
Reports the current status of the external crystal oscillator (ECO).