STLUX library
UM1753
8/21
DocID026248 Rev 1
CLK_ClockSwitchConfig
CLK_SwitchMode: the clock
switch mode can be MANUAL
or AUTOMATIC.
CLK_NewClock: the new clock
source can be HSI/LSI/HSE.
ITState can be ENABLE or
DISABLE.
CLK_CurrentClockState can be
ENABLE or DISABLE.
ErrorStatus
reports ERROR
or SUCCESS
according to the
operation result.
This function configures the
clock switch from a clock
source to another.
CLK_HSIPrescalerConfig
HSIPrescaler specifies the
HIS/CPU clock divider to apply.
This function configures the
HSI or CPU clock dividers.
CLK_ITConfig
CLK_IT specifies the interrupt
sources. They can be the CSS
or the SWI.
NewState can be ENABLE or
DISABLE.
This function
enables/disables the
specified CLK interrupts.
CLK_SYSCLKConfig
CLK_Prescaler specifies the
HIS/CPU clock divider to apply.
This function configures the
HSI or CPU clock dividers.
CLK_SWIMConfig
CLK_SWIMDivider specifies
the SWIM clock divider to apply.
It can be divided by 1 or 2.
This function configures the
SWIM clock frequency on
the fly.
CLK_ClockSecuritySystemEnable
This function enables the
CSS.
CLK_SYSCLKEmergencyClear
This function reset SWBSY
flag in order to reset clock
switch operations (target
oscillator is broken,
stabilization is longing too
much, etc.). If at the same
time software attempts to
set SWEN and clear
SWBSY, SWBSY action
takes precedence.
CLK_AdjustHSICalibrationValue
CLK_HSICalibrationValue is the
calibration trimming value.
This function adjusts the
HSI calibration value.
CLK_GetClockFreq
This function returns the
frequency of the currently
used on chip clock.
CLK_GetSYSCLKSource
Returns the clock source
currently used as system
clock.
CLK_GetFlagStatus
CLK_FLAG is the clock status
flag to be checked.
FlagStatus is the
current flag
status value.
Checks whether the
specified CLK flag is set or
not.
Table 2. STLUX385A clock (continued)
Header
Input parameters
Output
parameters
Functionality