Electronic speed controller discovery kit for drones with stm32g431cb (29 pages)
Summary of Contents for STMicroelectronics STLUX385A
Page 1
Description of STLUX385A peripheral library Introduction This user manual provides complete information for SW developers on the STLUX385A library, a library of APIs useful to get familiar developing applications for the STLUX385A digital controller and its peripherals. ® The STLUX385A is an STMicroelectronics digital device tailored for lighting applications.
Reference documents UM1753 Reference documents For hardware information on the STLUX385A controller and product specific SMED configuration, please refer to the STLUX385A product datasheet. For information on programming, erasing and protection of the internal Flash memory please refer to the STM8 Flash programming manual (PM0047).
UM1753 Acronyms Acronyms A list of acronyms used in this document: Table 1. List of acronyms Acronym Description Analog comparator unit Analog-to-digital converter Auxiliary timer Auto wake-up unit Bootloader - used to load the user program without the emulator Configurable clock output Clock control unit Clock master Central processing unit...
Page 6
Acronyms UM1753 Table 1. List of acronyms (continued) Acronym Description SMED State machine event driven STMR System timer Software, is the firmware loaded and running on the CPU (synonymous of FW) Clock switch interrupt SWIM Single-wire interface module UART Universal asynchronous receiver/transmitter WWDG Window watchdog 6/21...
STLUX library 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.
Page 8
STLUX library UM1753 Table 2. STLUX385A clock (continued) Output Header Input parameters Functionality parameters CLK_SwitchMode: the clock switch mode can be MANUAL or AUTOMATIC. ErrorStatus CLK_NewClock: the new clock reports ERROR This function configures the source can be HSI/LSI/HSE. CLK_ClockSwitchConfig...
Page 9
UM1753 STLUX library Table 2. STLUX385A clock (continued) Output Header Input parameters Functionality parameters ITStatus is the Checks whether the CLK_IT specifies the CLK CLK_GetITStatus current status specified CLK interrupt has interrupt. for the interrupt. is enabled or not. CLK_IT specifies the CLK...
STLUX library UM1753 STLUX385A SMEDs (stlux_smed) Table 3. STLUX385A SMEDs Header Input parameters Output parameters Functionality This function makes the SMED_Start SMEDx is the SMED to be started. SMEDx start running. SMEDx is the SMED to be This function makes the SMED_Stop stopped.
UM1753 STLUX library STLUX385A analog comparator unit (stlux_acu) Table 4. STLUX385A analog comparator unit Header Input parameters Output parameters Functionality Sets the ACU internal ACU_Reset registers to their default initialization values. Enables the ACU unit and ACU_Init initializes the compare levels.
Page 12
STLUX library UM1753 Table 5. STLUX385A analog-to-digital converter (continued) Header Input parameters Output parameters Functionality This function performs the correct power-on sequence ADC_PowerUp for the ADC (after a power down to save power). This function performs the correct power-down ADC_PowerDown sequence for the ADC (to save power).
UM1753 STLUX library STLUX385A system timer (stlux_stmr) Table 6. STLUX385A system timer Output Header Input parameters Functionality parameters Sets the STMR internal STMR_Reset registers to their default initialization values. STMR_Prescaler specifies the prescaler division factor for the STMR. It can be a power of two Initializes the STMR time ranging from 1 to 128.
Page 14
STLUX library UM1753 Table 6. STLUX385A system timer (continued) Output Header Input parameters Functionality parameters This function configures the STMR event to be STMR_EventSource enables the STMR_GenerateEvent generated by SW. The event to be generated. register is automatically cleared by HW.
DIGIN(0). Enables or disables ATM_ITConfig NewState can be ENABLE or DISABLE. the ATM to generate interrupt. STLUX385A auto wake-up unit (stlux_awu) Table 9. STLUX385A auto wake-up unit Header Input parameters Output parameters Functionality Sets the AWU internal AWU_Reset registers to their default initialization values.
UM1753 STLUX library 3.10 STLUX385A universal asynchronous receiver/transmitter (stlux_uart) Table 10. STLUX385A universal asynchronous receiver/transmitter Output Header Input parameters Functionality parameters Sets the UART internal registers to their UART_Reset default initialization values. BaudRate specifies the baud rate. It can be up to f_clk/16.
Page 18
STLUX library UM1753 Table 10. STLUX385A universal asynchronous receiver/transmitter (continued) Output Header Input parameters Functionality parameters The returned Returns the most value is the recent received data UART_ReceiveData8 most recent by the UART 8-bit data. peripheral. The returned Returns the most...
Page 19
UM1753 STLUX library Table 10. STLUX385A universal asynchronous receiver/transmitter (continued) Output Header Input parameters Functionality parameters UART_IT specifies the UART interrupt pending bit to check. It can be: Transmit interrupt Returns the Transmission complete interrupt Checks whether the current status...
Revision history UM1753 Revision history Table 11. Document revision history Date Revision Changes 14-May-2014 Initial release. 20/21 DocID026248 Rev 1...
Page 21
Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice.
Need help?
Do you have a question about the STLUX385A and is the answer not in the manual?
Questions and answers