LCD demo using ST BSP driver

Dependencies:   BSP_DISCO_L496AG

Committer:
Jerome Coutant
Date:
Wed Nov 20 16:59:36 2019 +0100
Revision:
4:6831ef31324d
Parent:
3:ff6ab501ecb0
Update with CubeL4 V1.14.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:378633dfeb25 1 #include "mbed.h"
bcostm 0:378633dfeb25 2 #include "stm32l496g_discovery_lcd.h"
bcostm 0:378633dfeb25 3
bcostm 0:378633dfeb25 4 int main()
bcostm 0:378633dfeb25 5 {
Jerome Coutant 4:6831ef31324d 6 printf("\nSTART DISCO L496AG LCD EXAMPLE\n");
Jerome Coutant 4:6831ef31324d 7
bcostm 0:378633dfeb25 8 BSP_LCD_Init();
bcostm 0:378633dfeb25 9
bcostm 3:ff6ab501ecb0 10 while(1) {
bcostm 3:ff6ab501ecb0 11 BSP_LCD_SetFont(&Font12);
bcostm 3:ff6ab501ecb0 12 BSP_LCD_Clear(LCD_COLOR_MAGENTA);
bcostm 3:ff6ab501ecb0 13 BSP_LCD_SetBackColor(LCD_COLOR_MAGENTA);
bcostm 3:ff6ab501ecb0 14 BSP_LCD_SetTextColor(LCD_COLOR_ORANGE);
bcostm 3:ff6ab501ecb0 15 BSP_LCD_DisplayStringAt(0, LINE(4), (uint8_t *)"DISCO_L496AG", CENTER_MODE);
bcostm 3:ff6ab501ecb0 16 BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"LCD DEMO", CENTER_MODE);
bcostm 3:ff6ab501ecb0 17 BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"FONT12", CENTER_MODE);
Jerome Coutant 4:6831ef31324d 18 ThisThread::sleep_for(2000);
Jerome Coutant 4:6831ef31324d 19
bcostm 3:ff6ab501ecb0 20 BSP_LCD_SetFont(&Font16);
bcostm 3:ff6ab501ecb0 21 BSP_LCD_Clear(LCD_COLOR_RED);
bcostm 3:ff6ab501ecb0 22 BSP_LCD_SetBackColor(LCD_COLOR_RED);
bcostm 3:ff6ab501ecb0 23 BSP_LCD_SetTextColor(LCD_COLOR_YELLOW);
bcostm 3:ff6ab501ecb0 24 BSP_LCD_DisplayStringAt(0, LINE(4), (uint8_t *)"DISCO_L496AG", CENTER_MODE);
bcostm 3:ff6ab501ecb0 25 BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"LCD DEMO", CENTER_MODE);
bcostm 3:ff6ab501ecb0 26 BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"FONT16", CENTER_MODE);
Jerome Coutant 4:6831ef31324d 27 ThisThread::sleep_for(2000);
Jerome Coutant 4:6831ef31324d 28
bcostm 3:ff6ab501ecb0 29 BSP_LCD_SetFont(&Font20);
bcostm 3:ff6ab501ecb0 30 BSP_LCD_Clear(LCD_COLOR_GREEN);
bcostm 3:ff6ab501ecb0 31 BSP_LCD_SetBackColor(LCD_COLOR_GREEN);
bcostm 3:ff6ab501ecb0 32 BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
bcostm 3:ff6ab501ecb0 33 BSP_LCD_DisplayStringAt(0, LINE(4), (uint8_t *)"DISCO_L496AG", CENTER_MODE);
bcostm 3:ff6ab501ecb0 34 BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"LCD DEMO", CENTER_MODE);
bcostm 3:ff6ab501ecb0 35 BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"FONT20", CENTER_MODE);
Jerome Coutant 4:6831ef31324d 36 ThisThread::sleep_for(2000);
Jerome Coutant 4:6831ef31324d 37
bcostm 3:ff6ab501ecb0 38 BSP_LCD_Clear(LCD_COLOR_BLUE);
bcostm 3:ff6ab501ecb0 39 BSP_LCD_SetBackColor(LCD_COLOR_BLUE);
bcostm 3:ff6ab501ecb0 40 BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
bcostm 3:ff6ab501ecb0 41 BSP_LCD_SetFont(&Font24);
bcostm 3:ff6ab501ecb0 42 BSP_LCD_DisplayStringAt(0, LINE(4), (uint8_t *)"DISCO_L496AG", CENTER_MODE);
bcostm 3:ff6ab501ecb0 43 BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"LCD DEMO", CENTER_MODE);
bcostm 3:ff6ab501ecb0 44 BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"FONT24", CENTER_MODE);
Jerome Coutant 4:6831ef31324d 45 ThisThread::sleep_for(2000);
bcostm 3:ff6ab501ecb0 46 }
bcostm 0:378633dfeb25 47 }