background image

DocID026248 Rev 1

11/21

UM1753

STLUX library

21

3.4 STLUX385A 

analog 

comparator unit (stlux_acu)

         

3.5 STLUX385A 

analog-to-digital converter (stlux_adc)

         

Table 4. STLUX385A analog comparator unit

Header

Input parameters

Output parameters

Functionality

ACU_Reset

Sets the ACU internal 

registers to their default 

initialization values.

ACU_Init

Enables the ACU unit and 

initializes the compare levels.

ACU_Read

ACUx specifies the comparator 

peripheral number.

The comparator output 

value is returned.

Reads the output of the 

comparator x.

ACU_Enable

ACUx specifies the comparator 

peripheral number.

CP3_SEL specifies whether 

the reference voltage for the 

CP3 is internal or external.

Enables the comparator 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 specified voltage 

level reference to the DACx.

Table 5. STLUX385A analog-to-digital converter

Header

Input parameters

Output parameters

Functionality

ADC_Reset

Sets the ADC internal 

registers to their default 

initialization values.

ADC_Init

ADC_ConvMode_Init is the conversion 

mode. It can be SEQUENCE or 

CIRCULAR.

ADC_DataFormat_Init determines 

whether the 10 bits data are left or right 

aligned.

This function initializes the 

ADC sequencer.

ADC_Interrupt

ADC_IntEndConvMode_Interrupt.

ADC_IntEndSeqMode_interrupt

ADC_IntSeqFull_Interrupt

ADC_Sequencer

ADC_Channel_Sequencer

ADC_Gain_Sequencer

ADC_Start

This function enables ADC 

functionality.

ADC_Stop

This function disables ADC 

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: