LL CRS Constants

Clear Flags Defines

group CRS_LL_EC_CLEAR_FLAG

Flags defines which can be used with LL_CRS_WRITE_REG function.

Defines

LL_CRS_ICR_SYNCOKC CRS_ICR_SYNCOKC
LL_CRS_ICR_SYNCWARNC CRS_ICR_SYNCWARNC
LL_CRS_ICR_ERRC CRS_ICR_ERRC
LL_CRS_ICR_ESYNCC CRS_ICR_ESYNCC

Get Flags Defines

group CRS_LL_EC_GET_FLAG

Flags defines which can be used with LL_CRS_READ_REG function.

Defines

LL_CRS_ISR_SYNCOKF CRS_ISR_SYNCOKF
LL_CRS_ISR_SYNCWARNF CRS_ISR_SYNCWARNF
LL_CRS_ISR_ERRF CRS_ISR_ERRF
LL_CRS_ISR_ESYNCF CRS_ISR_ESYNCF
LL_CRS_ISR_SYNCERR CRS_ISR_SYNCERR
LL_CRS_ISR_SYNCMISS CRS_ISR_SYNCMISS
LL_CRS_ISR_TRIMOVF CRS_ISR_TRIMOVF

IT Defines

group CRS_LL_EC_IT

IT defines which can be used with LL_CRS_READ_REG and LL_CRS_WRITE_REG functions.

Defines

LL_CRS_CR_SYNCOKIE CRS_CR_SYNCOKIE
LL_CRS_CR_SYNCWARNIE CRS_CR_SYNCWARNIE
LL_CRS_CR_ERRIE CRS_CR_ERRIE
LL_CRS_CR_ESYNCIE CRS_CR_ESYNCIE

Auto trimming

group CRS_LL_EC_AUTO_TRIMMING

Defines

LL_CRS_AUTO_TRIMMING_DISABLE 0U

Auto trimming disable (default)

LL_CRS_AUTO_TRIMMING_ENABLE CRS_CR_AUTOTRIMEN

Auto trimming enable

Synchronization Signal Divider

group CRS_LL_EC_SYNC_DIV

Defines

LL_CRS_SYNC_DIV_1 0U

Synchro Signal not divided (default)

LL_CRS_SYNC_DIV_2 CRS_CFGR_SYNCDIV_0

Synchro Signal divided by 2

LL_CRS_SYNC_DIV_4 CRS_CFGR_SYNCDIV_1

Synchro Signal divided by 4

LL_CRS_SYNC_DIV_8 (CRS_CFGR_SYNCDIV_1 | CRS_CFGR_SYNCDIV_0)

Synchro Signal divided by 8

LL_CRS_SYNC_DIV_16 CRS_CFGR_SYNCDIV_2

Synchro Signal divided by 16

LL_CRS_SYNC_DIV_32 (CRS_CFGR_SYNCDIV_2 | CRS_CFGR_SYNCDIV_0)

Synchro Signal divided by 32

LL_CRS_SYNC_DIV_64 (CRS_CFGR_SYNCDIV_2 | CRS_CFGR_SYNCDIV_1)

Synchro Signal divided by 64

LL_CRS_SYNC_DIV_128 CRS_CFGR_SYNCDIV

Synchro Signal divided by 128

Synchronization Signal Source

group CRS_LL_EC_SYNC_SOURCE

Defines

LL_CRS_SYNC_SOURCE_GPIO 0U

Synchro Signal source GPIO

LL_CRS_SYNC_SOURCE_LSE CRS_CFGR_SYNCSRC_0

Synchro Signal source LSE

Synchronization Signal Polarity

group CRS_LL_EC_SYNC_POLARITY

Defines

LL_CRS_SYNC_POLARITY_RISING 0U

Synchro Active on rising edge (default)

LL_CRS_SYNC_POLARITY_FALLING CRS_CFGR_SYNCPOL

Synchro Active on falling edge

Frequency Error Direction

group CRS_LL_EC_FREQERRORDIR

Defines

LL_CRS_FREQ_ERROR_DIR_UP 0U

Upcounting direction, the actual frequency is above the target

LL_CRS_FREQ_ERROR_DIR_DOWN CRS_ISR_FEDIR

Downcounting direction, the actual frequency is below the target

Default Values

group CRS_LL_EC_DEFAULTVALUES

Defines

LL_CRS_RELOADVALUE_DEFAULT 0x0000BB7FU

Reset value of the RELOAD field.

Note

The reset value of the RELOAD field corresponds to a target frequency of 48 MHz and a synchronization signal frequency of 1 kHz (SOF signal from USB).

LL_CRS_ERRORLIMIT_DEFAULT 0x00000022U

Reset value of frequency error limit.

LL_CRS_HSI48CALIBRATION_DEFAULT 0x40U

Reset value of the HSI48 Calibration field.

Note

The default value is 0x40U, which corresponds to the middle of the trimming interval. The trimming step is specified in the product datasheet. A higher TRIM value corresponds to a higher output frequency.