background image

DocID026248 Rev 1

13/21

UM1753

STLUX library

21

3.6 STLUX385A 

system 

timer (stlux_stmr)

         

Table 6. STLUX385A system timer

Header

Input parameters

Output 

parameters

Functionality

STMR_Reset

Sets the STMR internal 

registers to their default 

initialization values.

STMR_TimeBaseInit

STMR_Prescaler specifies the 

prescaler division factor for the 

STMR. It can be a power of two 

ranging from 1 to 128.

STMR_Period specifies the period to 

be set for the timer interrupt 

generation.

Initializes the STMR time 

base unit according to the 

specified parameters.

STMR_Cmd

NewState: it can be ENABLE or 

DISABLE.

This function enables or 

disables the STMR 

peripheral.

STMR_ITConfig

STMR_IT specifies whether the 

STMR interrupt must be enabled or 

disabled. 

NewState can be ENABLE or 

DISABLE.

Enables or disables the 

specified 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 

whether the interrupt is generated by 

counter overflow only or by registers 

update. Possible values are 

UPDATESOURCE_GLOBAL and 

UPDATESOURCE_REGULAR.

Selects the STMR Update 

Request Interrupt source.

STMR_SelectOnePulseMode

STMR_OPMode specifies if the one 

pulse mode must be activated.

Enables or disables the 

one pulse. This mode 

makes the counter stop 

when the next update 

event is triggered. 

STMR_PrescalerConfig

Prescaler specifies the prescaler 

division factor for the STMR. It can 

be a power of two ranging from 1 to 

128.

STMR_PSCReloadMode specifies 

whether the prescaler is loaded 

immediately or at the update event.

This function configures 

the STMR prescaler.

STMR_ARRPreloadConfig

Newstate can be ENABLE or 

DISABLE.

Enables or disables 

STMR peripheral on auto-

reload preload enable 

register.

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: