STM8L15x Standard Peripherals Drivers: Initialization and Configuration functions

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

Initialization and Configuration functions

Initialization and Configuration functions. More...

Functions

void LCD_BlinkConfig (LCD_BlinkMode_TypeDef LCD_BlinkMode, LCD_BlinkFrequency_TypeDef LCD_BlinkFrequency)
 Configures the LCD Blink mode and Blink frequency.
void LCD_Cmd (FunctionalState NewState)
 Enables or disables the LCD Controller.
void LCD_ContrastConfig (LCD_Contrast_TypeDef LCD_Contrast)
 Configures the LCD Contrast.
void LCD_DeadTimeConfig (LCD_DeadTime_TypeDef LCD_DeadTime)
 Configures the LCD dead time.
void LCD_DeInit (void)
 Deinitializes the LCD Controller registers to their default reset values.
void LCD_HighDriveCmd (FunctionalState NewState)
 Enables or disables the low resistance divider.
void LCD_Init (LCD_Prescaler_TypeDef LCD_Prescaler, LCD_Divider_TypeDef LCD_Divider, LCD_Duty_TypeDef LCD_Duty, LCD_Bias_TypeDef LCD_Bias, LCD_VoltageSource_TypeDef LCD_VoltageSource)
 Initializes the LCD according to the specified parameters.
void LCD_PortMaskConfig (LCD_PortMaskRegister_TypeDef LCD_PortMaskRegister, uint8_t LCD_Mask)
 Configures the LCD Port Mask.
void LCD_PulseOnDurationConfig (LCD_PulseOnDuration_TypeDef LCD_PulseOnDuration)
 Configures the LCD pulses on duration.

Detailed Description

Initialization and Configuration functions.

 ===============================================================================
                    Initialization and Configuration functions
 ===============================================================================  


Function Documentation

void LCD_BlinkConfig ( LCD_BlinkMode_TypeDef  LCD_BlinkMode,
LCD_BlinkFrequency_TypeDef  LCD_BlinkFrequency 
)

Configures the LCD Blink mode and Blink frequency.

Parameters:
LCD_BlinkMode,:specifies the LCD blink mode. This parameter can be one of the following values:
  • LCD_BlinkMode_Off: Blink disabled
  • LCD_BlinkMode_SEG0_COM0: Blink enabled on SEG[0], COM[0] (1 pixel)
  • LCD_BlinkMode_SEG0_AllCOM: Blink enabled on SEG[0], all COM (up to 8 pixels according to the programmed duty)
  • LCD_BlinkMode_AllSEG_AllCOM: Blink enabled on all SEG and all COM (all pixels)
LCD_BlinkFrequency,:specifies the LCD blink frequency. This parameter can be one of the following values:
  • LCD_BlinkFrequency_Div8: The Blink frequency = fLcd/8
  • LCD_BlinkFrequency_Div16: The Blink frequency = fLcd/16
  • LCD_BlinkFrequency_Div32: The Blink frequency = fLcd/32
  • LCD_BlinkFrequency_Div64: The Blink frequency = fLcd/64
  • LCD_BlinkFrequency_Div128: The Blink frequency = fLcd/128
  • LCD_BlinkFrequency_Div256: The Blink frequency = fLcd/256
  • LCD_BlinkFrequency_Div512: The Blink frequency = fLcd/512
  • LCD_BlinkFrequency_Div1024: The Blink frequency = fLcd/1024
Return values:
None

Definition at line 385 of file stm8l15x_lcd.c.

References IS_LCD_BLINK_FREQUENCY, IS_LCD_BLINK_MODE, LCD, LCD_CR1_BLINK, and LCD_CR1_BLINKF.

void LCD_Cmd ( FunctionalState  NewState)

Enables or disables the LCD Controller.

Parameters:
NewState,:new state of the LCD peripheral. This parameter can be: ENABLE or DISABLE.
Return values:
None
None

Definition at line 273 of file stm8l15x_lcd.c.

References DISABLE, IS_FUNCTIONAL_STATE, LCD, and LCD_CR3_LCDEN.

void LCD_ContrastConfig ( LCD_Contrast_TypeDef  LCD_Contrast)

Configures the LCD Contrast.

Parameters:
LCD_Contrast,:specifies the LCD Contrast. This parameter can be one of the following values:
  • LCD_Contrast_Level_0: Medium Density / High Density Maximum Voltage = 2.60V / 2.60V
  • LCD_Contrast_Level_1: Medium Density / High Density Maximum Voltage = 2.70V / 2.73V
  • LCD_Contrast_Level_2: Medium Density / High Density Maximum Voltage = 2.80V / 2.86V
  • LCD_Contrast_Level_3: Medium Density / High Density Maximum Voltage = 2.90V / 2.99V
  • LCD_Contrast_Level_4: Medium Density / High Density Maximum Voltage = 3.00V / 3.12V
  • LCD_Contrast_Level_5: Medium Density / High Density Maximum Voltage = 3.10V / 3.25V
  • LCD_Contrast_Level_6: Medium Density / High Density Maximum Voltage = 3.20V / 3.38V
  • LCD_Contrast_Level_7: Medium Density / High Density Maximum Voltage = 3.30V / 3.51V
Return values:
None

Definition at line 413 of file stm8l15x_lcd.c.

References IS_LCD_CONTRAST, LCD, and LCD_CR2_CC.

void LCD_DeadTimeConfig ( LCD_DeadTime_TypeDef  LCD_DeadTime)

Configures the LCD dead time.

Parameters:
LCD_DeadTime,:specifies the LCD dead time. This parameter can be one of the following values:
  • LCD_DeadTime_0: No dead Time
  • LCD_DeadTime_1: One Phase between different couple of Frame
  • LCD_DeadTime_2: Two Phase between different couple of Frame
  • LCD_DeadTime_3: Three Phase between different couple of Frame
  • LCD_DeadTime_4: Four Phase between different couple of Frame
  • LCD_DeadTime_5: Five Phase between different couple of Frame
  • LCD_DeadTime_6: Six Phase between different couple of Frame
  • LCD_DeadTime_7: Seven Phase between different couple of Frame
Return values:
None

Definition at line 352 of file stm8l15x_lcd.c.

References IS_LCD_DEAD_TIME, LCD, and LCD_CR3_DEAD.

void LCD_DeInit ( void  )

Deinitializes the LCD Controller registers to their default reset values.

Parameters:
None
Return values:
None

Definition at line 115 of file stm8l15x_lcd.c.

References LCD, LCD_CR1_RESET_VALUE, LCD_CR2_RESET_VALUE, LCD_CR3_RESET_VALUE, LCD_CR4_RESET_VALUE, LCD_FRQ_RESET_VALUE, LCD_PM_RESET_VALUE, and LCD_RAM_RESET_VALUE.

void LCD_HighDriveCmd ( FunctionalState  NewState)

Enables or disables the low resistance divider.

Displays with high internal resistance may need a longer drive time to achieve satisfactory contrast. This function is useful in this case if some additional power consumption can be tolerated.

Note:
When this mode is enabled, the PulseOn Duration (PON) have to be programmed to 1/CK_PS (LCD_PulseOnDuration_1).
Parameters:
NewState,:new state of the low resistance divider. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 299 of file stm8l15x_lcd.c.

References DISABLE, IS_FUNCTIONAL_STATE, LCD, and LCD_CR2_HD.

void LCD_Init ( LCD_Prescaler_TypeDef  LCD_Prescaler,
LCD_Divider_TypeDef  LCD_Divider,
LCD_Duty_TypeDef  LCD_Duty,
LCD_Bias_TypeDef  LCD_Bias,
LCD_VoltageSource_TypeDef  LCD_VoltageSource 
)

Initializes the LCD according to the specified parameters.

Parameters:
LCD_CLKPrescalerDiv: LCD clock prescaler This parameter can be one of the following values:
  • LCD_Prescaler_1: CLKprescaler = ClKinput
  • LCD_Prescaler_2: CLKprescaler = ClKinput/2
  • LCD_Prescaler_4: CLKprescaler = ClKinput/4
  • LCD_Prescaler_8: CLKprescaler = ClKinput/8
  • LCD_Prescaler_16: CLKprescaler = ClKinput/16
  • LCD_Prescaler_32: CLKprescaler = ClKinput/32
  • LCD_Prescaler_64: CLKprescaler = ClKinput/64
  • LCD_Prescaler_128: CLKprescaler = ClKinput/128
  • LCD_Prescaler_256: CLKprescaler = ClKinput/256
  • LCD_Prescaler_512: CLKprescaler = ClKinput/512
  • LCD_Prescaler_1024: CLKprescaler = ClKinput/1024
  • LCD_Prescaler_2048: CLKprescaler = ClKinput/2048
  • LCD_Prescaler_4096: CLKprescaler = ClKinput/4096
  • LCD_Prescaler_8192: CLKprescaler = ClKinput/8192
  • LCD_Prescaler_16384: CLKprescaler = ClKinput/16384
  • LCD_Prescaler_32768: CLKprescaler = ClKinput/32768
LCD_Divider: LCD clock divider This parameter can be one of the following values:
  • LCD_Divider_16: LCD frequency = CLKprescaler/16
  • LCD_Divider_17: LCD frequency = CLKprescaler/17
  • LCD_Divider_18: LCD frequency = CLKprescaler/18
  • LCD_Divider_19: LCD frequency = CLKprescaler/19
  • LCD_Divider_20: LCD frequency = CLKprescaler/20
  • LCD_Divider_21: LCD frequency = CLKprescaler/21
  • LCD_Divider_22: LCD frequency = CLKprescaler/22
  • LCD_Divider_23: LCD frequency = CLKprescaler/23
  • LCD_Divider_24: LCD frequency = CLKprescaler/24
  • LCD_Divider_25: LCD frequency = CLKprescaler/25
  • LCD_Divider_26: LCD frequency = CLKprescaler/26
  • LCD_Divider_27: LCD frequency = CLKprescaler/27
  • LCD_Divider_28: LCD frequency = CLKprescaler/28
  • LCD_Divider_29: LCD frequency = CLKprescaler/29
  • LCD_Divider_30: LCD frequency = CLKprescaler/30
  • LCD_Divider_31: LCD frequency = CLKprescaler/31
LCD_Duty: LCD duty This parameter can be one of the following values:
  • LCD_Duty_Static: Static duty
  • LCD_Duty_1_2: 1/2 duty
  • LCD_Duty_1_3: 1/3 duty
  • LCD_Duty_1_4: 1/4 duty
  • LCD_Duty_1_8: 1/8 duty
LCD_Bias: LCD bias This parameter can be one of the following values:
  • LCD_Bias_1_4: 1/4 bias
  • LCD_Bias_1_3: 1/3 bias
  • LCD_Bias_1_2: 1/2 bias
LCD_VoltageSource: LCD voltage source This parameter can be one of the following values:
  • LCD_VoltageSource_Internal: Internal voltage source
  • LCD_VoltageSource_External: External voltage source
Return values:
None

Definition at line 194 of file stm8l15x_lcd.c.

References IS_LCD_BIAS, IS_LCD_CLOCK_DIVIDER, IS_LCD_CLOCK_PRESCALER, IS_LCD_DUTY, IS_LCD_VOLTAGE_SOURCE, LCD, LCD_Bias_1_4, LCD_CR1_B2, LCD_CR1_DUTY, LCD_CR2_VSEL, LCD_CR4_B4, LCD_CR4_DUTY8, LCD_Duty_1_8, LCD_FRQ_DIV, and LCD_FRQ_PS.

void LCD_PortMaskConfig ( LCD_PortMaskRegister_TypeDef  LCD_PortMaskRegister,
uint8_t  LCD_Mask 
)

Configures the LCD Port Mask.

Parameters:
LCD_PortMaskRegister,:The LCD register index in the port mask matrix. This parameter can be one of the following values:
  • LCD_PortMaskRegister_0: PortMask Register 0
  • LCD_PortMaskRegister_1: PortMask Register 1
  • LCD_PortMaskRegister_2: PortMask Register 2
  • LCD_PortMaskRegister_3: PortMask Register 3
  • LCD_PortMaskRegister_4: PortMask Register 4
  • LCD_PortMaskRegister_5: PortMask Register 5
LCD_Mask: Value to be written
Return values:
None

Definition at line 256 of file stm8l15x_lcd.c.

References IS_LCD_PORT_MASK, and LCD.

void LCD_PulseOnDurationConfig ( LCD_PulseOnDuration_TypeDef  LCD_PulseOnDuration)

Configures the LCD pulses on duration.

Parameters:
LCD_PulseOnDuration,:specifies the LCD pulse on duration in terms of CLKprescaler (prescaled LCD clock period) pulses. This parameter can be one of the following values:
  • LCD_PulseOnDuration_0: 0 pulse
  • LCD_PulseOnDuration_1: Pulse ON duration = 1/CLKprescaler
  • LCD_PulseOnDuration_2: Pulse ON duration = 2/CLKprescaler
  • LCD_PulseOnDuration_3: Pulse ON duration = 3/CLKprescaler
  • LCD_PulseOnDuration_4: Pulse ON duration = 4/CLKprescaler
  • LCD_PulseOnDuration_5: Pulse ON duration = 5/CLKprescaler
  • LCD_PulseOnDuration_6: Pulse ON duration = 6/CLKprescaler
  • LCD_PulseOnDuration_7: Pulse ON duration = 7/CLKprescaler
Return values:
None

Definition at line 329 of file stm8l15x_lcd.c.

References IS_LCD_PULSE_DURATION, LCD, and LCD_CR2_PON.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com