DocID026248 Rev 1
7/21
UM1753
STLUX library
21
3 STLUX
library
3.1 Introduction
The STLUX385A library is a collection of APIs aiming to simplify the usage of the STLUX
SMEDs and peripherals to application developers. Each collection of APIs is dedicated to
a specific device or functionality and named so “stlux_xxx” where “xxx” stands for the name
of the peripheral. The library is developed using the C language compatible with the IAR™
and Raisonance tools and is composed of the “stlux_xxx.c” and “stlux_xxx.h” relative files to
be included in your application.
3.2 STLUX385A
clock (stlux_clk)
Table 2. STLUX385A clock
Header
Input parameters
Output
parameters
Functionality
CLK_Reset
Sets the clock internal
registers to their default
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 ENABLE or
DISABLE.
Enables/disables LSI.
CLK_CCOCmd
NewState: it can be ENABLE or
DISABLE.
Enables/disables CCO.
CLK_ClockSwitchCmd
NewState: it can be ENABLE or
DISABLE.
Manually starts/stops the
clock switch execution.
CLK_FastHaltWakeUpCmd
NewState: it can be ENABLE or
DISABLE.
When enabled, the HSI
oscillator is automatically
switched-on and selected
as a next master clock
when resuming from
HALT/active-halt modes.
CLK_SlowActiveHaltWakeUpCmd
NewState can be ENABLE or
DISABLE.
Configures the slow active-
halt wakeup.
CLK_PeripheralClockConfig
CLK_Peripheral can be one of
the following peripherals: I
2
C,
GPIO0, UART, DALI, STMR,
GPIO1, AWU, ADC, SMEDx,
MSC.
NewState can be ENABLE or
DISABLE.
Enables/disables the
specified peripheral CLK.