To use the internal LCD driver of stm32l476; the best way is to use the LCD driver provided in the BSP. It is located inside the STM32Cube_FW_L4_V1.16.0 repository.
- Go to the
..\STM32Cube\Repository\STM32Cube_FW_L4_V1.16.0\Drivers\BSP\STM32L476G-Discovery
- Copy the stm32l476g_discovery.c, stm32l476g_discovery.h, stm32l476g_discovery_glass_lcd.c and stm32l476g_discovery_glass_lcd.h
- Paste the files in your project.
- Include the header file in your project.
#include “stm32l476g_discovery_glass_lcd.h”
After this you need to
- Initialize the LCD segment
BSP_LCD_GLASS_Init(); - Clear the LCD RAM
BSP_LCD_GLASS_Clear(); - Write Data in LCD RAM
BSP_LCD_GLASS_DisplayChar((uint8_t *)”A”, POINT_ON, DOUBLEPOINT_OFF, 1);
Leave a Reply