This API configures and enables the BLE ECO clock.
If Cy_BLE_Enable() API is called by the application, the stack enables the BLE ECO clock automatically with the following default parameters:
| Parameter | Value |
| ECO Frequency | CY_BLE_DEFAULT_ECO_FREQ |
| Divider | CY_BLE_DEFAULT_ECO_DIV |
| Startup time | CY_BLE_DEFAULT_OSC_STARTUP_DELAY_LF |
| Load cap | CY_BLE_DEFAULT_CAP_TRIM_VALUE |
If there is a need to start the BLE ECO with non-default parameters, call the Cy_BLE_EcoConfigure() function with the custom configuration each time before calling the Cy_BLE_Enable() function.
This clock is stopped in Deep Sleep and Hibernate power modes.
- Parameters
-
| freq | - Operating frequency of the crystal, type of cy_en_ble_eco_freq_t. |
| sysClkDiv | - System divider for ECO clock, type of cy_en_ble_eco_sys_clk_div_t. |
| cLoad | - ECO crystal load capacitance in multiple of 0.075pF (pF_from_user valid range: 7.5...26.625pF) cLoad = ((pF_from_user - 7.5)/0.075) |
| xtalStartUpTime | - ECO crystal startup time in multiple of 31.25us (startup_time_from_user valid range: 400...4593.75us) xtalStartUpTime = startup_time_from_user/31.25 |
| voltageReg | - BLE Voltage regulator, type of cy_en_ble_eco_voltage_reg_t. |
- Returns
- cy_en_ble_eco_status_t : The return value indicates if the function succeeded or failed. The possible error codes:
| Error Codes | Description |
| CY_BLE_ECO_SUCCESS | The function completed successfully. |
| CY_BLE_ECO_BAD_PARAM | The wrong input parameter. |
| CY_BLE_ECO_RCB_CONTROL_LL | The RCB Control is with BLE Link Layer. |
| CY_BLE_ECO_ALREADY_STARTED | The BLE ECO clock is already started. |
| CY_BLE_ECO_HARDWARE_ERROR | The RCB or BLE ECO operation failed. |
- Function Usage
uint32_t startTime = (uint32_t)(1500 / 31.25);
uint32_t loadCap = (uint32_t)((9.9 - 7.5) / 0.075);
- Side Effects
- The I/O pins will be automatically unfrozen coming out of Hibernate when the BLE ECO is in use.
- Note
- Limitation: Do not call this API if the BLE is executed with LPM. There is a risk that when the Cy_BLE_EcoConfigure() function is called on one core, the BLE is in Deep Sleep mode on the other core. It will cause a fault hard exception.