20#ifndef STM32H7xx_LL_CRS_H
21#define STM32H7xx_LL_CRS_H
58#define LL_CRS_ISR_SYNCOKF CRS_ISR_SYNCOKF
59#define LL_CRS_ISR_SYNCWARNF CRS_ISR_SYNCWARNF
60#define LL_CRS_ISR_ERRF CRS_ISR_ERRF
61#define LL_CRS_ISR_ESYNCF CRS_ISR_ESYNCF
62#define LL_CRS_ISR_SYNCERR CRS_ISR_SYNCERR
63#define LL_CRS_ISR_SYNCMISS CRS_ISR_SYNCMISS
64#define LL_CRS_ISR_TRIMOVF CRS_ISR_TRIMOVF
74#define LL_CRS_CR_SYNCOKIE CRS_CR_SYNCOKIE
75#define LL_CRS_CR_SYNCWARNIE CRS_CR_SYNCWARNIE
76#define LL_CRS_CR_ERRIE CRS_CR_ERRIE
77#define LL_CRS_CR_ESYNCIE CRS_CR_ESYNCIE
86#define LL_CRS_SYNC_DIV_1 0x00000000U
87#define LL_CRS_SYNC_DIV_2 CRS_CFGR_SYNCDIV_0
88#define LL_CRS_SYNC_DIV_4 CRS_CFGR_SYNCDIV_1
89#define LL_CRS_SYNC_DIV_8 (CRS_CFGR_SYNCDIV_1 | CRS_CFGR_SYNCDIV_0)
90#define LL_CRS_SYNC_DIV_16 CRS_CFGR_SYNCDIV_2
91#define LL_CRS_SYNC_DIV_32 (CRS_CFGR_SYNCDIV_2 | CRS_CFGR_SYNCDIV_0)
92#define LL_CRS_SYNC_DIV_64 (CRS_CFGR_SYNCDIV_2 | CRS_CFGR_SYNCDIV_1)
93#define LL_CRS_SYNC_DIV_128 CRS_CFGR_SYNCDIV
102#define LL_CRS_SYNC_SOURCE_GPIO 0x00000000U
103#define LL_CRS_SYNC_SOURCE_LSE CRS_CFGR_SYNCSRC_0
104#define LL_CRS_SYNC_SOURCE_USB CRS_CFGR_SYNCSRC_1
113#define LL_CRS_SYNC_POLARITY_RISING 0x00000000U
114#define LL_CRS_SYNC_POLARITY_FALLING CRS_CFGR_SYNCPOL
123#define LL_CRS_FREQ_ERROR_DIR_UP 0x00000000U
124#define LL_CRS_FREQ_ERROR_DIR_DOWN CRS_ISR_FEDIR
138#define LL_CRS_RELOADVALUE_DEFAULT 0x0000BB7FU
143#define LL_CRS_ERRORLIMIT_DEFAULT 0x00000022U
151#define LL_CRS_HSI48CALIBRATION_DEFAULT 0x00000020U
178#define LL_CRS_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
186#define LL_CRS_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
207#define __LL_CRS_CALC_CALCULATE_RELOADVALUE(__FTARGET__, __FSYNC__) (((__FTARGET__) / (__FSYNC__)) - 1U)
234__STATIC_INLINE
void LL_CRS_EnableFreqErrorCounter(
void)
244__STATIC_INLINE
void LL_CRS_DisableFreqErrorCounter(
void)
254__STATIC_INLINE uint32_t LL_CRS_IsEnabledFreqErrorCounter(
void)
264__STATIC_INLINE
void LL_CRS_EnableAutoTrimming(
void)
274__STATIC_INLINE
void LL_CRS_DisableAutoTrimming(
void)
284__STATIC_INLINE uint32_t LL_CRS_IsEnabledAutoTrimming(
void)
297__STATIC_INLINE
void LL_CRS_SetHSI48SmoothTrimming(uint32_t Value)
299 MODIFY_REG(CRS->CR,
CRS_CR_TRIM, Value << CRS_CR_TRIM_Pos);
307__STATIC_INLINE uint32_t LL_CRS_GetHSI48SmoothTrimming(
void)
309 return (uint32_t)(READ_BIT(CRS->CR,
CRS_CR_TRIM) >> CRS_CR_TRIM_Pos);
320__STATIC_INLINE
void LL_CRS_SetReloadCounter(uint32_t Value)
330__STATIC_INLINE uint32_t LL_CRS_GetReloadCounter(
void)
342__STATIC_INLINE
void LL_CRS_SetFreqErrorLimit(uint32_t Value)
344 MODIFY_REG(CRS->CFGR,
CRS_CFGR_FELIM, Value << CRS_CFGR_FELIM_Pos);
352__STATIC_INLINE uint32_t LL_CRS_GetFreqErrorLimit(
void)
354 return (uint32_t)(READ_BIT(CRS->CFGR,
CRS_CFGR_FELIM) >> CRS_CFGR_FELIM_Pos);
371__STATIC_INLINE
void LL_CRS_SetSyncDivider(uint32_t Divider)
389__STATIC_INLINE uint32_t LL_CRS_GetSyncDivider(
void)
403__STATIC_INLINE
void LL_CRS_SetSyncSignalSource(uint32_t Source)
416__STATIC_INLINE uint32_t LL_CRS_GetSyncSignalSource(
void)
429__STATIC_INLINE
void LL_CRS_SetSyncPolarity(uint32_t Polarity)
441__STATIC_INLINE uint32_t LL_CRS_GetSyncPolarity(
void)
464__STATIC_INLINE
void LL_CRS_ConfigSynchronization(uint32_t HSI48CalibrationValue, uint32_t ErrorLimitValue, uint32_t ReloadValue, uint32_t Settings)
466 MODIFY_REG(CRS->CR,
CRS_CR_TRIM, HSI48CalibrationValue);
467 MODIFY_REG(CRS->CFGR,
469 ReloadValue | (ErrorLimitValue << CRS_CFGR_FELIM_Pos) | Settings);
486__STATIC_INLINE
void LL_CRS_GenerateEvent_SWSYNC(
void)
499__STATIC_INLINE uint32_t LL_CRS_GetFreqErrorDirection(
void)
509__STATIC_INLINE uint32_t LL_CRS_GetFreqErrorCapture(
void)
511 return (uint32_t)(READ_BIT(CRS->ISR,
CRS_ISR_FECAP) >> CRS_ISR_FECAP_Pos);
528__STATIC_INLINE uint32_t LL_CRS_IsActiveFlag_SYNCOK(
void)
538__STATIC_INLINE uint32_t LL_CRS_IsActiveFlag_SYNCWARN(
void)
548__STATIC_INLINE uint32_t LL_CRS_IsActiveFlag_ERR(
void)
558__STATIC_INLINE uint32_t LL_CRS_IsActiveFlag_ESYNC(
void)
568__STATIC_INLINE uint32_t LL_CRS_IsActiveFlag_SYNCERR(
void)
578__STATIC_INLINE uint32_t LL_CRS_IsActiveFlag_SYNCMISS(
void)
588__STATIC_INLINE uint32_t LL_CRS_IsActiveFlag_TRIMOVF(
void)
598__STATIC_INLINE
void LL_CRS_ClearFlag_SYNCOK(
void)
608__STATIC_INLINE
void LL_CRS_ClearFlag_SYNCWARN(
void)
619__STATIC_INLINE
void LL_CRS_ClearFlag_ERR(
void)
629__STATIC_INLINE
void LL_CRS_ClearFlag_ESYNC(
void)
648__STATIC_INLINE
void LL_CRS_EnableIT_SYNCOK(
void)
658__STATIC_INLINE
void LL_CRS_DisableIT_SYNCOK(
void)
668__STATIC_INLINE uint32_t LL_CRS_IsEnabledIT_SYNCOK(
void)
678__STATIC_INLINE
void LL_CRS_EnableIT_SYNCWARN(
void)
688__STATIC_INLINE
void LL_CRS_DisableIT_SYNCWARN(
void)
698__STATIC_INLINE uint32_t LL_CRS_IsEnabledIT_SYNCWARN(
void)
708__STATIC_INLINE
void LL_CRS_EnableIT_ERR(
void)
718__STATIC_INLINE
void LL_CRS_DisableIT_ERR(
void)
728__STATIC_INLINE uint32_t LL_CRS_IsEnabledIT_ERR(
void)
738__STATIC_INLINE
void LL_CRS_EnableIT_ESYNC(
void)
748__STATIC_INLINE
void LL_CRS_DisableIT_ESYNC(
void)
758__STATIC_INLINE uint32_t LL_CRS_IsEnabledIT_ESYNC(
void)
767#if defined(USE_FULL_LL_DRIVER) || defined(__rtems__)
773ErrorStatus LL_CRS_DeInit(
void);
#define CRS_ISR_SYNCWARNF
Definition: stm32h723xx.h:5865
#define CRS_CR_SYNCOKIE
Definition: stm32h723xx.h:5811
#define CRS_CR_ESYNCIE
Definition: stm32h723xx.h:5820
#define CRS_CFGR_SYNCSRC
Definition: stm32h723xx.h:5851
#define CRS_CFGR_FELIM
Definition: stm32h723xx.h:5840
#define CRS_CR_SWSYNC
Definition: stm32h723xx.h:5829
#define CRS_CR_TRIM
Definition: stm32h723xx.h:5832
#define CRS_CFGR_RELOAD
Definition: stm32h723xx.h:5837
#define CRS_ISR_SYNCERR
Definition: stm32h723xx.h:5874
#define CRS_ISR_ESYNCF
Definition: stm32h723xx.h:5871
#define CRS_ISR_FEDIR
Definition: stm32h723xx.h:5883
#define CRS_ISR_ERRF
Definition: stm32h723xx.h:5868
#define CRS_ISR_SYNCMISS
Definition: stm32h723xx.h:5877
#define CRS_ICR_SYNCOKC
Definition: stm32h723xx.h:5891
#define CRS_CFGR_SYNCPOL
Definition: stm32h723xx.h:5857
#define CRS_ICR_SYNCWARNC
Definition: stm32h723xx.h:5894
#define CRS_CR_SYNCWARNIE
Definition: stm32h723xx.h:5814
#define CRS_CR_ERRIE
Definition: stm32h723xx.h:5817
#define CRS_CR_CEN
Definition: stm32h723xx.h:5823
#define CRS_ICR_ESYNCC
Definition: stm32h723xx.h:5900
#define CRS_CFGR_SYNCDIV
Definition: stm32h723xx.h:5844
#define CRS_ISR_SYNCOKF
Definition: stm32h723xx.h:5862
#define CRS_ICR_ERRC
Definition: stm32h723xx.h:5897
#define CRS_ISR_FECAP
Definition: stm32h723xx.h:5886
#define CRS_ISR_TRIMOVF
Definition: stm32h723xx.h:5880
#define CRS_CR_AUTOTRIMEN
Definition: stm32h723xx.h:5826
CMSIS STM32H7xx Device Peripheral Access Layer Header File.