STM32L486xx HAL User Manual
Defines | Functions
stm32l4xx_hal_lcd.c File Reference

LCD Controller HAL module driver. This file provides firmware functions to manage the following functionalities of the LCD Controller (LCD) peripheral: + Initialization/de-initialization methods + I/O operation methods + Peripheral State methods. More...

#include "stm32l4xx_hal.h"

Go to the source code of this file.

Defines

#define LCD_TIMEOUT_VALUE   1000

Functions

HAL_StatusTypeDef HAL_LCD_Init (LCD_HandleTypeDef *hlcd)
 Initialize the LCD peripheral according to the specified parameters in the LCD_InitStruct and initialize the associated handle.
HAL_StatusTypeDef HAL_LCD_DeInit (LCD_HandleTypeDef *hlcd)
 DeInitialize the LCD peripheral.
__weak void HAL_LCD_MspDeInit (LCD_HandleTypeDef *hlcd)
 DeInitialize the LCD MSP.
__weak void HAL_LCD_MspInit (LCD_HandleTypeDef *hlcd)
 Initialize the LCD MSP.
HAL_StatusTypeDef HAL_LCD_Write (LCD_HandleTypeDef *hlcd, uint32_t RAMRegisterIndex, uint32_t RAMRegisterMask, uint32_t Data)
 Write a word in the specific LCD RAM.
HAL_StatusTypeDef HAL_LCD_Clear (LCD_HandleTypeDef *hlcd)
 Clear the LCD RAM registers.
HAL_StatusTypeDef HAL_LCD_UpdateDisplayRequest (LCD_HandleTypeDef *hlcd)
 Enable the Update Display Request.
HAL_LCD_StateTypeDef HAL_LCD_GetState (LCD_HandleTypeDef *hlcd)
 Return the LCD handle state.
uint32_t HAL_LCD_GetError (LCD_HandleTypeDef *hlcd)
 Return the LCD error code.
HAL_StatusTypeDef LCD_WaitForSynchro (LCD_HandleTypeDef *hlcd)
 Wait until the LCD FCR register is synchronized in the LCDCLK domain.

Detailed Description

LCD Controller HAL module driver. This file provides firmware functions to manage the following functionalities of the LCD Controller (LCD) peripheral: + Initialization/de-initialization methods + I/O operation methods + Peripheral State methods.

Author:
MCD Application Team
  ==============================================================================
                        ##### How to use this driver #####
  ==============================================================================
      [..] The LCD HAL driver can be used as follows:

      (#) Declare a LCD_HandleTypeDef handle structure.
      
      -@- The frequency generator allows you to achieve various LCD frame rates
          starting from an LCD input clock frequency (LCDCLK) which can vary
          from 32 kHz up to 1 MHz.      
      
      (#) Initialize the LCD low level resources by implementing the HAL_LCD_MspInit() API:
                  
          (++) Enable the LCDCLK (same as RTCCLK): to configure the RTCCLK/LCDCLK, proceed as follows:
               (+++) Use RCC function HAL_RCCEx_PeriphCLKConfig in indicating RCC_PERIPHCLK_LCD and
                  selected clock source (HSE, LSI or LSE)

          (++) LCD pins configuration:
              (+++) Enable the clock for the LCD GPIOs.
              (+++) Configure these LCD pins as alternate function no-pull.
          (++) Enable the LCD interface clock.

      
      (#) Program the Prescaler, Divider, Blink mode, Blink Frequency Duty, Bias,
          Voltage Source, Dead Time, Pulse On Duration, Contrast, High drive and Multiplexer
          Segment in the Init structure of the LCD handle.

      (#) Initialize the LCD registers by calling the HAL_LCD_Init() API.

      -@- The HAL_LCD_Init() API configures also the low level Hardware GPIO, CLOCK, ...etc)
          by calling the customized HAL_LCD_MspInit() API.
      -@- After calling the HAL_LCD_Init() the LCD RAM memory is cleared

      (#) Optionally you can update the LCD configuration using these macros:
              (++) LCD High Drive using the __HAL_LCD_HIGHDRIVER_ENABLE() and __HAL_LCD_HIGHDRIVER_DISABLE() macros
              (++) Voltage output buffer using __HAL_LCD_VOLTAGE_BUFFER_ENABLE() and __HAL_LCD_VOLTAGE_BUFFER_DISABLE() macros
              (++) LCD Pulse ON Duration using the __HAL_LCD_PULSEONDURATION_CONFIG() macro
              (++) LCD Dead Time using the __HAL_LCD_DEADTIME_CONFIG() macro
              (++) The LCD Blink mode and frequency using the __HAL_LCD_BLINK_CONFIG() macro
              (++) The LCD Contrast using the __HAL_LCD_CONTRAST_CONFIG() macro

      (#) Write to the LCD RAM memory using the HAL_LCD_Write() API, this API can be called
          more time to update the different LCD RAM registers before calling
          HAL_LCD_UpdateDisplayRequest() API.

      (#) The HAL_LCD_Clear() API can be used to clear the LCD RAM memory.

      (#) When LCD RAM memory is updated enable the update display request using
          the HAL_LCD_UpdateDisplayRequest() API.

      [..] LCD and low power modes:
           (#) The LCD remain active during Sleep, Low Power run, Low Power Sleep and
               STOP modes.

  
Attention:

© COPYRIGHT(c) 2017 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32l4xx_hal_lcd.c.