STM32L443xx HAL User Manual
Defines
LCD Exported Macros
LCD

Defines

#define __HAL_LCD_RESET_HANDLE_STATE(__HANDLE__)   ((__HANDLE__)->State = HAL_LCD_STATE_RESET)
 Reset LCD handle state.
#define __HAL_LCD_ENABLE(__HANDLE__)   SET_BIT((__HANDLE__)->Instance->CR, LCD_CR_LCDEN)
 Enable the LCD peripheral.
#define __HAL_LCD_DISABLE(__HANDLE__)   CLEAR_BIT((__HANDLE__)->Instance->CR, LCD_CR_LCDEN)
 Disable the LCD peripheral.
#define __HAL_LCD_HIGHDRIVER_ENABLE(__HANDLE__)
 Enable the low resistance divider.
#define __HAL_LCD_HIGHDRIVER_DISABLE(__HANDLE__)
 Disable the low resistance divider.
#define __HAL_LCD_VOLTAGE_BUFFER_ENABLE(__HANDLE__)   SET_BIT((__HANDLE__)->Instance->CR, LCD_CR_BUFEN)
 Enable the voltage output buffer for higher driving capability.
#define __HAL_LCD_VOLTAGE_BUFFER_DISABLE(__HANDLE__)   CLEAR_BIT((__HANDLE__)->Instance->CR, LCD_CR_BUFEN)
 Disable the voltage output buffer for higher driving capability.
#define __HAL_LCD_PULSEONDURATION_CONFIG(__HANDLE__, __DURATION__)
 Configure the LCD pulse on duration.
#define __HAL_LCD_DEADTIME_CONFIG(__HANDLE__, __DEADTIME__)
 Configure the LCD dead time.
#define __HAL_LCD_CONTRAST_CONFIG(__HANDLE__, __CONTRAST__)
 Configure the LCD contrast.
#define __HAL_LCD_BLINK_CONFIG(__HANDLE__, __BLINKMODE__, __BLINKFREQUENCY__)
 Configure the LCD Blink mode and Blink frequency.
#define __HAL_LCD_ENABLE_IT(__HANDLE__, __INTERRUPT__)
 Enable the specified LCD interrupt.
#define __HAL_LCD_DISABLE_IT(__HANDLE__, __INTERRUPT__)
 Disable the specified LCD interrupt.
#define __HAL_LCD_GET_IT_SOURCE(__HANDLE__, __IT__)   (((__HANDLE__)->Instance->FCR) & (__IT__))
 Check whether the specified LCD interrupt source is enabled or not.
#define __HAL_LCD_GET_FLAG(__HANDLE__, __FLAG__)   (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__))
 Check whether the specified LCD flag is set or not.
#define __HAL_LCD_CLEAR_FLAG(__HANDLE__, __FLAG__)   WRITE_REG((__HANDLE__)->Instance->CLR, (__FLAG__))
 Clear the specified LCD pending flag.

Define Documentation

#define __HAL_LCD_BLINK_CONFIG (   __HANDLE__,
  __BLINKMODE__,
  __BLINKFREQUENCY__ 
)
Value:
do {                                                                    \
                MODIFY_REG((__HANDLE__)->Instance->FCR, (LCD_FCR_BLINKF | LCD_FCR_BLINK), ((__BLINKMODE__) | (__BLINKFREQUENCY__))); \
                LCD_WaitForSynchro(__HANDLE__);                                       \
              } while(0)

Configure the LCD Blink mode and Blink frequency.

Parameters:
__HANDLE__specifies the LCD Handle.
__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)
__BLINKFREQUENCY__specifies the LCD blink frequency.
  • 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 493 of file stm32l4xx_hal_lcd.h.

#define __HAL_LCD_CLEAR_FLAG (   __HANDLE__,
  __FLAG__ 
)    WRITE_REG((__HANDLE__)->Instance->CLR, (__FLAG__))

Clear the specified LCD pending flag.

Parameters:
__HANDLE__specifies the LCD Handle.
__FLAG__specifies the flag to clear. This parameter can be any combination of the following values:
  • LCD_FLAG_SOF: Start of Frame Interrupt
  • LCD_FLAG_UDD: Update Display Done Interrupt
Return values:
None

Definition at line 570 of file stm32l4xx_hal_lcd.h.

Referenced by HAL_LCD_UpdateDisplayRequest().

#define __HAL_LCD_CONTRAST_CONFIG (   __HANDLE__,
  __CONTRAST__ 
)
Value:
do {                                                                    \
                MODIFY_REG((__HANDLE__)->Instance->FCR, LCD_FCR_CC, (__CONTRAST__));  \
                LCD_WaitForSynchro(__HANDLE__);                                       \
              } while(0)

Configure the LCD contrast.

Parameters:
__HANDLE__specifies the LCD Handle.
__CONTRAST__specifies the LCD Contrast. This parameter can be one of the following values:
  • LCD_CONTRASTLEVEL_0: Maximum Voltage = 2.60V
  • LCD_CONTRASTLEVEL_1: Maximum Voltage = 2.73V
  • LCD_CONTRASTLEVEL_2: Maximum Voltage = 2.86V
  • LCD_CONTRASTLEVEL_3: Maximum Voltage = 2.99V
  • LCD_CONTRASTLEVEL_4: Maximum Voltage = 3.12V
  • LCD_CONTRASTLEVEL_5: Maximum Voltage = 3.25V
  • LCD_CONTRASTLEVEL_6: Maximum Voltage = 3.38V
  • LCD_CONTRASTLEVEL_7: Maximum Voltage = 3.51V
Return values:
None

Definition at line 465 of file stm32l4xx_hal_lcd.h.

#define __HAL_LCD_DEADTIME_CONFIG (   __HANDLE__,
  __DEADTIME__ 
)
Value:
do {                                                                     \
                    MODIFY_REG((__HANDLE__)->Instance->FCR, LCD_FCR_DEAD, (__DEADTIME__)); \
                    LCD_WaitForSynchro(__HANDLE__);                                        \
                  } while(0)

Configure the LCD dead time.

Parameters:
__HANDLE__specifies the LCD Handle.
__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 444 of file stm32l4xx_hal_lcd.h.

#define __HAL_LCD_DISABLE (   __HANDLE__)    CLEAR_BIT((__HANDLE__)->Instance->CR, LCD_CR_LCDEN)

Disable the LCD peripheral.

Parameters:
__HANDLE__specifies the LCD Handle.
Return values:
None

Definition at line 368 of file stm32l4xx_hal_lcd.h.

Referenced by HAL_LCD_Init().

#define __HAL_LCD_DISABLE_IT (   __HANDLE__,
  __INTERRUPT__ 
)
Value:
do {                                                       \
                    CLEAR_BIT((__HANDLE__)->Instance->FCR, (__INTERRUPT__)); \
                    LCD_WaitForSynchro(__HANDLE__);                          \
                  } while(0)

Disable the specified LCD interrupt.

Parameters:
__HANDLE__specifies the LCD Handle.
__INTERRUPT__specifies the LCD interrupt source to be disabled. This parameter can be one of the following values:
  • LCD_IT_SOF: Start of Frame Interrupt
  • LCD_IT_UDD: Update Display Done Interrupt
Return values:
None

Definition at line 521 of file stm32l4xx_hal_lcd.h.

#define __HAL_LCD_ENABLE (   __HANDLE__)    SET_BIT((__HANDLE__)->Instance->CR, LCD_CR_LCDEN)

Enable the LCD peripheral.

Parameters:
__HANDLE__specifies the LCD Handle.
Return values:
None

Definition at line 362 of file stm32l4xx_hal_lcd.h.

Referenced by HAL_LCD_Init().

#define __HAL_LCD_ENABLE_IT (   __HANDLE__,
  __INTERRUPT__ 
)
Value:
do {                                                      \
                    SET_BIT((__HANDLE__)->Instance->FCR, (__INTERRUPT__));  \
                    LCD_WaitForSynchro(__HANDLE__);                         \
                  } while(0)

Enable the specified LCD interrupt.

Parameters:
__HANDLE__specifies the LCD Handle.
__INTERRUPT__specifies the LCD interrupt source to be enabled. This parameter can be one of the following values:
  • LCD_IT_SOF: Start of Frame Interrupt
  • LCD_IT_UDD: Update Display Done Interrupt
Return values:
None

Definition at line 507 of file stm32l4xx_hal_lcd.h.

#define __HAL_LCD_GET_FLAG (   __HANDLE__,
  __FLAG__ 
)    (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__))

Check whether the specified LCD flag is set or not.

Parameters:
__HANDLE__specifies the LCD Handle.
__FLAG__specifies the flag to check. This parameter can be one of the following values:
  • LCD_FLAG_ENS: LCD Enabled flag. It indicates the LCD controller status.
Note:
The ENS bit is set immediately when the LCDEN bit in the LCD_CR goes from 0 to 1. On deactivation it reflects the real status of LCD so it becomes 0 at the end of the last displayed frame.
  • LCD_FLAG_SOF: Start of Frame flag. This flag is set by hardware at the beginning of a new frame, at the same time as the display data is updated.
  • LCD_FLAG_UDR: Update Display Request flag.
  • LCD_FLAG_UDD: Update Display Done flag.
  • LCD_FLAG_RDY: Step_up converter Ready flag. It indicates the status of the step-up converter.
  • LCD_FLAG_FCRSF: LCD Frame Control Register Synchronization Flag. This flag is set by hardware each time the LCD_FCR register is updated in the LCDCLK domain.
Return values:
Thenew state of __FLAG__ (TRUE or FALSE).

Definition at line 560 of file stm32l4xx_hal_lcd.h.

Referenced by HAL_LCD_Clear(), HAL_LCD_Init(), HAL_LCD_UpdateDisplayRequest(), HAL_LCD_Write(), and LCD_WaitForSynchro().

#define __HAL_LCD_GET_IT_SOURCE (   __HANDLE__,
  __IT__ 
)    (((__HANDLE__)->Instance->FCR) & (__IT__))

Check whether the specified LCD interrupt source is enabled or not.

Parameters:
__HANDLE__specifies the LCD Handle.
__IT__specifies the LCD interrupt source to check. This parameter can be one of the following values:
  • LCD_IT_SOF: Start of Frame Interrupt
  • LCD_IT_UDD: Update Display Done Interrupt.
Note:
If the device is in STOP mode (PCLK not provided) UDD will not generate an interrupt even if UDDIE = 1. If the display is not enabled the UDD interrupt will never occur.
Return values:
Thestate of __IT__ (TRUE or FALSE).

Definition at line 538 of file stm32l4xx_hal_lcd.h.

#define __HAL_LCD_HIGHDRIVER_DISABLE (   __HANDLE__)
Value:
do {                                                  \
                    CLEAR_BIT((__HANDLE__)->Instance->FCR, LCD_FCR_HD); \
                    LCD_WaitForSynchro(__HANDLE__);                     \
                  } while(0)

Disable the low resistance divider.

Parameters:
__HANDLE__specifies the LCD Handle.
Return values:
None

Definition at line 389 of file stm32l4xx_hal_lcd.h.

#define __HAL_LCD_HIGHDRIVER_ENABLE (   __HANDLE__)
Value:
do {                                                \
                    SET_BIT((__HANDLE__)->Instance->FCR, LCD_FCR_HD); \
                    LCD_WaitForSynchro(__HANDLE__);                   \
                  } while(0)

Enable the low resistance divider.

Parameters:
__HANDLE__specifies the LCD Handle.
Note:
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.
When this mode is enabled, the PulseOn Duration (PON) have to be programmed to 1/CK_PS (LCD_PULSEONDURATION_1).
Return values:
None

Definition at line 379 of file stm32l4xx_hal_lcd.h.

#define __HAL_LCD_PULSEONDURATION_CONFIG (   __HANDLE__,
  __DURATION__ 
)
Value:
do {                                                                    \
                    MODIFY_REG((__HANDLE__)->Instance->FCR, LCD_FCR_PON, (__DURATION__)); \
                    LCD_WaitForSynchro(__HANDLE__);                                       \
                  } while(0)

Configure the LCD pulse on duration.

Parameters:
__HANDLE__specifies the LCD Handle.
__DURATION__specifies the LCD pulse on duration in terms of CK_PS (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/CK_PS
  • LCD_PULSEONDURATION_2: Pulse ON duration = 2/CK_PS
  • LCD_PULSEONDURATION_3: Pulse ON duration = 3/CK_PS
  • LCD_PULSEONDURATION_4: Pulse ON duration = 4/CK_PS
  • LCD_PULSEONDURATION_5: Pulse ON duration = 5/CK_PS
  • LCD_PULSEONDURATION_6: Pulse ON duration = 6/CK_PS
  • LCD_PULSEONDURATION_7: Pulse ON duration = 7/CK_PS
Return values:
None

Definition at line 423 of file stm32l4xx_hal_lcd.h.

#define __HAL_LCD_RESET_HANDLE_STATE (   __HANDLE__)    ((__HANDLE__)->State = HAL_LCD_STATE_RESET)

Reset LCD handle state.

Parameters:
__HANDLE__specifies the LCD Handle.
Return values:
None

Definition at line 356 of file stm32l4xx_hal_lcd.h.

#define __HAL_LCD_VOLTAGE_BUFFER_DISABLE (   __HANDLE__)    CLEAR_BIT((__HANDLE__)->Instance->CR, LCD_CR_BUFEN)

Disable the voltage output buffer for higher driving capability.

Parameters:
__HANDLE__specifies the LCD Handle.
Return values:
None

Definition at line 405 of file stm32l4xx_hal_lcd.h.

#define __HAL_LCD_VOLTAGE_BUFFER_ENABLE (   __HANDLE__)    SET_BIT((__HANDLE__)->Instance->CR, LCD_CR_BUFEN)

Enable the voltage output buffer for higher driving capability.

Parameters:
__HANDLE__specifies the LCD Handle.
Return values:
None

Definition at line 399 of file stm32l4xx_hal_lcd.h.