Functions | |
cy_en_sysclk_status_t | Cy_SysClk_EcoConfigure (uint32_t freq, uint32_t cSum, 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... | |
uint32_t | Cy_SysClk_EcoGetFrequency (void) |
Returns the frequency of 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 | cSum, | ||
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. Valid range: 16000000...35000000 (16..35 MHz). |
cSum | The summary capacitance of C0 (the crystal itself shunt capacitance) and Cload (the parallel load capacitance), in pF. So cSum = C0 + Cload. Valid range: 1...100. |
esr | Effective series resistance of the crystal in Ohms. Valid range: 1...1000. |
driveLevel | Crystal drive level in uW. Valid range: 1...2000. |
* freqKhz = freq / 1000 * maxAmpl = sqrt(drivelevel / 2 / esr) / 3.14 / freqKhz / cSum * ampSect = INT(5 * 4 * 3.14^2 * freqKhz^2 * cSum^2 * 4 * esr / 1000000000 / 1000000 / 9) * * As a result of the above calculations, max amplitude must be >= 0.65V, and the * number of amplifier sections must be <= 3, otherwise this function returns with * a parameter error. * * atrim = 15 * agc_en = 1 * wdtrim = 7 * gtrim = ampSect > 1 ? ampSect : ampSect == 1 ? 0 : 1 * rtrim = 0 * ftrim = 3 *
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. |
uint32_t Cy_SysClk_EcoGetFrequency | ( | void | ) |
Returns the frequency of the external crystal oscillator (ECO).
__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).