STM32H735xx HAL User Manual
|
Extended Clock Recovery System Control functions. More...
Functions | |
void | HAL_RCCEx_CRSConfig (RCC_CRSInitTypeDef *pInit) |
Start automatic synchronization for polling mode. | |
void | HAL_RCCEx_CRSSoftwareSynchronizationGenerate (void) |
Generate the software synchronization event. | |
void | HAL_RCCEx_CRSGetSynchronizationInfo (RCC_CRSSynchroInfoTypeDef *pSynchroInfo) |
Return synchronization info. | |
uint32_t | HAL_RCCEx_CRSWaitSynchronization (uint32_t Timeout) |
Wait for CRS Synchronization status. | |
void | HAL_RCCEx_CRS_IRQHandler (void) |
Handle the Clock Recovery System interrupt request. | |
__weak void | HAL_RCCEx_CRS_SyncOkCallback (void) |
RCCEx Clock Recovery System SYNCOK interrupt callback. | |
__weak void | HAL_RCCEx_CRS_SyncWarnCallback (void) |
RCCEx Clock Recovery System SYNCWARN interrupt callback. | |
__weak void | HAL_RCCEx_CRS_ExpectedSyncCallback (void) |
RCCEx Clock Recovery System Expected SYNC interrupt callback. | |
__weak void | HAL_RCCEx_CRS_ErrorCallback (uint32_t Error) |
RCCEx Clock Recovery System Error interrupt callback. |
Extended Clock Recovery System Control functions.
=============================================================================== ##### Extended Clock Recovery System Control functions ##### =============================================================================== [..] For devices with Clock Recovery System feature (CRS), RCC Extension HAL driver can be used as follows: (#) In System clock config, HSI48 needs to be enabled (#) Enable CRS clock in IP MSP init which will use CRS functions (#) Call CRS functions as follows: (##) Prepare synchronization configuration necessary for HSI48 calibration (+++) Default values can be set for frequency Error Measurement (reload and error limit) and also HSI48 oscillator smooth trimming. (+++) Macro __HAL_RCC_CRS_RELOADVALUE_CALCULATE can be also used to calculate directly reload value with target and synchronization frequencies values (##) Call function HAL_RCCEx_CRSConfig which (+++) Resets CRS registers to their default values. (+++) Configures CRS registers with synchronization configuration (+++) Enables automatic calibration and frequency error counter feature Note: When using USB LPM (Link Power Management) and the device is in Sleep mode, the periodic USB SOF will not be generated by the host. No SYNC signal will therefore be provided to the CRS to calibrate the HSI48 on the run. To guarantee the required clock precision after waking up from Sleep mode, the LSE or reference clock on the GPIOs should be used as SYNC signal. (##) A polling function is provided to wait for complete synchronization (+++) Call function HAL_RCCEx_CRSWaitSynchronization() (+++) According to CRS status, user can decide to adjust again the calibration or continue application if synchronization is OK (#) User can retrieve information related to synchronization in calling function HAL_RCCEx_CRSGetSynchronizationInfo() (#) Regarding synchronization status and synchronization information, user can try a new calibration in changing synchronization configuration and call again HAL_RCCEx_CRSConfig. Note: When the SYNC event is detected during the down-counting phase (before reaching the zero value), it means that the actual frequency is lower than the target (and so, that the TRIM value should be incremented), while when it is detected during the up-counting phase it means that the actual frequency is higher (and that the TRIM value should be decremented). (#) In interrupt mode, user can resort to the available macros (__HAL_RCC_CRS_XXX_IT). Interrupts will go through CRS Handler (CRS_IRQn/CRS_IRQHandler) (++) Call function HAL_RCCEx_CRSConfig() (++) Enable CRS_IRQn (thanks to NVIC functions) (++) Enable CRS interrupt (__HAL_RCC_CRS_ENABLE_IT) (++) Implement CRS status management in the following user callbacks called from HAL_RCCEx_CRS_IRQHandler(): (+++) HAL_RCCEx_CRS_SyncOkCallback() (+++) HAL_RCCEx_CRS_SyncWarnCallback() (+++) HAL_RCCEx_CRS_ExpectedSyncCallback() (+++) HAL_RCCEx_CRS_ErrorCallback() (#) To force a SYNC EVENT, user can use the function HAL_RCCEx_CRSSoftwareSynchronizationGenerate(). This function can be called before calling HAL_RCCEx_CRSConfig (for instance in Systick handler)
void HAL_RCCEx_CRS_ErrorCallback | ( | uint32_t | Error | ) |
RCCEx Clock Recovery System Error interrupt callback.
Error | Combination of Error status. This parameter can be a combination of the following values: |
none |
Definition at line 3484 of file stm32h7xx_hal_rcc_ex.c.
Referenced by HAL_RCCEx_CRS_IRQHandler().
void HAL_RCCEx_CRS_ExpectedSyncCallback | ( | void | ) |
RCCEx Clock Recovery System Expected SYNC interrupt callback.
none |
Definition at line 3468 of file stm32h7xx_hal_rcc_ex.c.
Referenced by HAL_RCCEx_CRS_IRQHandler().
void HAL_RCCEx_CRS_IRQHandler | ( | void | ) |
Handle the Clock Recovery System interrupt request.
None |
Definition at line 3381 of file stm32h7xx_hal_rcc_ex.c.
References HAL_RCCEx_CRS_ErrorCallback(), HAL_RCCEx_CRS_ExpectedSyncCallback(), HAL_RCCEx_CRS_SyncOkCallback(), HAL_RCCEx_CRS_SyncWarnCallback(), RCC_CRS_FLAG_ERR, RCC_CRS_FLAG_ESYNC, RCC_CRS_FLAG_SYNCERR, RCC_CRS_FLAG_SYNCMISS, RCC_CRS_FLAG_SYNCOK, RCC_CRS_FLAG_SYNCWARN, RCC_CRS_FLAG_TRIMOVF, RCC_CRS_IT_ERR, RCC_CRS_IT_ESYNC, RCC_CRS_IT_SYNCOK, RCC_CRS_IT_SYNCWARN, RCC_CRS_NONE, RCC_CRS_SYNCERR, RCC_CRS_SYNCMISS, and RCC_CRS_TRIMOVF.
void HAL_RCCEx_CRS_SyncOkCallback | ( | void | ) |
RCCEx Clock Recovery System SYNCOK interrupt callback.
none |
Definition at line 3446 of file stm32h7xx_hal_rcc_ex.c.
Referenced by HAL_RCCEx_CRS_IRQHandler().
void HAL_RCCEx_CRS_SyncWarnCallback | ( | void | ) |
RCCEx Clock Recovery System SYNCWARN interrupt callback.
none |
Definition at line 3457 of file stm32h7xx_hal_rcc_ex.c.
Referenced by HAL_RCCEx_CRS_IRQHandler().
void HAL_RCCEx_CRSConfig | ( | RCC_CRSInitTypeDef * | pInit | ) |
Start automatic synchronization for polling mode.
pInit | Pointer on RCC_CRSInitTypeDef structure |
None |
Definition at line 3205 of file stm32h7xx_hal_rcc_ex.c.
References __HAL_RCC_CRS_FORCE_RESET, __HAL_RCC_CRS_RELEASE_RESET, assert_param, RCC_CRSInitTypeDef::ErrorLimitValue, HAL_GetREVID(), RCC_CRSInitTypeDef::HSI48CalibrationValue, IS_RCC_CRS_ERRORLIMIT, IS_RCC_CRS_HSI48CALIBRATION, IS_RCC_CRS_RELOADVALUE, IS_RCC_CRS_SYNC_DIV, IS_RCC_CRS_SYNC_POLARITY, IS_RCC_CRS_SYNC_SOURCE, RCC_CRSInitTypeDef::Polarity, RCC_CRSInitTypeDef::Prescaler, RCC_CRS_SYNC_SOURCE_PIN, RCC_CRS_SYNC_SOURCE_USB2, RCC_CRSInitTypeDef::ReloadValue, REV_ID_Y, and RCC_CRSInitTypeDef::Source.
void HAL_RCCEx_CRSGetSynchronizationInfo | ( | RCC_CRSSynchroInfoTypeDef * | pSynchroInfo | ) |
Return synchronization info.
pSynchroInfo | Pointer on RCC_CRSSynchroInfoTypeDef structure |
None |
Definition at line 3265 of file stm32h7xx_hal_rcc_ex.c.
References assert_param, RCC_CRSSynchroInfoTypeDef::FreqErrorCapture, RCC_CRSSynchroInfoTypeDef::FreqErrorDirection, RCC_CRSSynchroInfoTypeDef::HSI48CalibrationValue, and RCC_CRSSynchroInfoTypeDef::ReloadValue.
void HAL_RCCEx_CRSSoftwareSynchronizationGenerate | ( | void | ) |
Generate the software synchronization event.
None |
Definition at line 3255 of file stm32h7xx_hal_rcc_ex.c.
uint32_t HAL_RCCEx_CRSWaitSynchronization | ( | uint32_t | Timeout | ) |
Wait for CRS Synchronization status.
Timeout | Duration of the time-out |
Combination | of Synchronization status This parameter can be a combination of the following values: |
Definition at line 3298 of file stm32h7xx_hal_rcc_ex.c.
References __HAL_RCC_CRS_CLEAR_FLAG, __HAL_RCC_CRS_GET_FLAG, HAL_GetTick(), RCC_CRS_FLAG_ESYNC, RCC_CRS_FLAG_SYNCERR, RCC_CRS_FLAG_SYNCMISS, RCC_CRS_FLAG_SYNCOK, RCC_CRS_FLAG_SYNCWARN, RCC_CRS_FLAG_TRIMOVF, RCC_CRS_NONE, RCC_CRS_SYNCERR, RCC_CRS_SYNCMISS, RCC_CRS_SYNCOK, RCC_CRS_SYNCWARN, RCC_CRS_TIMEOUT, and RCC_CRS_TRIMOVF.