background image

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

Summary of Contents for STLUX385A

Page 1: ...The heart of the STLUX is the SMED State Machine Event Driven technology which allows the device to operate several independently configurable PWM clocks with up to 1 3 ns resolution A SMED is a power...

Page 2: ...ed 10 3 4 STLUX385A analog comparator unit stlux_acu 11 3 5 STLUX385A analog to digital converter stlux_adc 11 3 6 STLUX385A system timer stlux_stmr 13 3 7 STLUX385A general purpose I O stlux_gpio 15...

Page 3: ...ble 4 STLUX385A analog comparator unit 11 Table 5 STLUX385A analog to digital converter 11 Table 6 STLUX385A system timer 13 Table 7 STLUX385A general purpose I O 15 Table 8 STLUX385A auxiliary timer...

Page 4: ...ion of the internal Flash memory please refer to the STM8 Flash programming manual PM0047 For information about the debug and SWIM single wire interface module refer to the STM8 SWIM communication pro...

Page 5: ...gital to analog converter DALI Digital addressable lighting interface ECC Error Correction Code FSM Finite state machine FW Firmware loaded and running on the CPU GPIO General purpose input output HSE...

Page 6: ...System timer SW Software is the firmware loaded and running on the CPU synonymous of FW SWI Clock switch interrupt SWIM Single wire interface module UART Universal asynchronous receiver transmitter W...

Page 7: ...fault initialization values CLK_HSECmd NewState it can be ENABLE or DISABLE Enables disables HSE CLK_HSICmd NewState it can be ENABLE or DISABLE Enables disables HSI CLK_LSICmd NewState it can be ENAB...

Page 8: ...ividers 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...

Page 9: ...d PLL CLK_CCODIVR is the division factor n for the CCO clock CLKCCO CLK n 1 This function sets the clock source for the CCO clock CLK_ADCConfig CLK_ADC_Source specifies the clock source for the ADC It...

Page 10: ...ns zero in case of unsuccessful operation due to pending time validation one otherwise Sets the time value to the status TimeRegister for the selected SMEDx SMED_ValidateTimeValues SMEDx is the SMED T...

Page 11: ...or CPx In case of CP3 also the internal external reference is specified ACU_SetCompareLevel ACUx specifies the comparator peripheral number DACIN specifies the input voltage level to be set Assigns a...

Page 12: ...he gain factor to be applied for the conversion This function returns the 16 bit value coming from the specified channel Given a channel number and a gain factor the function returns a 16 bit value ca...

Page 13: ...ed STMR interrupts STMR_UpdateDisableConfig Newstate can be ENABLE or DISABLE Enables or disables the update event for the auto reload preload mode STMR_UpdateRequestConfig STMR_UpdateSource specifies...

Page 14: ...escaler The returned value is the current STMR prescaler Gets the current STMR prescaler value STMR_GetFlagStatus STMR_FLAG specifies the STMR status register value The returned value is the current f...

Page 15: ...level to the specified GPIO pins GPIO_WriteLow GPIOx specifies the GPIO peripheral number PortPins specifies the pins to be turned low to the port output Sets low level to the specified GPIO pins GPI...

Page 16: ...figuration ATM_OutDigIn0 NewState can be ENABLE or DISABLE Enables or disables the ATM clock to be sent to DIGIN 0 ATM_ITConfig NewState can be ENABLE or DISABLE Enables or disables the ATM to generat...

Page 17: ...ables or disables the UART peripheral UART_ITConfig UART_IT specifies the interrupt source to be enabled NewState can be ENABLE or DISABLE Enables or disables the specific UART interrupts UART_IsITEna...

Page 18: ...e UART node Sets the address of the UART node UART_SetPrescaler Prescaler can be a value ranging from 0 to 128 Sets the system clock UART prescaler UART_GetFlagStatus UART_FLAG specifies the UART stat...

Page 19: ...Parity error interrupt LIN break detection interrupt Receive overrun interrupt Returns the current status for the specified interrupt Checks whether the specified UART interrupt has occurred or not UA...

Page 20: ...Revision history UM1753 20 21 DocID026248 Rev 1 4 Revision history Table 11 Document revision history Date Revision Changes 14 May 2014 1 Initial release...

Page 21: ...OPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT ST PRODUCTS ARE NOT DESIGNED OR AUTHORIZED FOR USE IN A SAFETY CRITICAL APPLICATIONS SUCH AS LIFE SUPPORTING ACTIVE IMPLANTED DEVICES OR SYSTEMS WITH PROD...

Reviews: