LCD demo using ST BSP driver
Dependencies: BSP_DISCO_L496AG
main.cpp@3:ff6ab501ecb0, 2018-03-26 (annotated)
- Committer:
- bcostm
- Date:
- Mon Mar 26 14:34:09 2018 +0200
- Revision:
- 3:ff6ab501ecb0
- Parent:
- 0:378633dfeb25
- Child:
- 4:6831ef31324d
Update main
Who changed what in which revision?
User | Revision | Line number | New 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 | { |
bcostm | 0:378633dfeb25 | 6 | BSP_LCD_Init(); |
bcostm | 0:378633dfeb25 | 7 | |
bcostm | 3:ff6ab501ecb0 | 8 | while(1) { |
bcostm | 3:ff6ab501ecb0 | 9 | BSP_LCD_SetFont(&Font12); |
bcostm | 3:ff6ab501ecb0 | 10 | BSP_LCD_Clear(LCD_COLOR_MAGENTA); |
bcostm | 3:ff6ab501ecb0 | 11 | BSP_LCD_SetBackColor(LCD_COLOR_MAGENTA); |
bcostm | 3:ff6ab501ecb0 | 12 | BSP_LCD_SetTextColor(LCD_COLOR_ORANGE); |
bcostm | 3:ff6ab501ecb0 | 13 | BSP_LCD_DisplayStringAt(0, LINE(4), (uint8_t *)"DISCO_L496AG", CENTER_MODE); |
bcostm | 3:ff6ab501ecb0 | 14 | BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"LCD DEMO", CENTER_MODE); |
bcostm | 3:ff6ab501ecb0 | 15 | BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"FONT12", CENTER_MODE); |
bcostm | 3:ff6ab501ecb0 | 16 | wait(2); |
bcostm | 3:ff6ab501ecb0 | 17 | BSP_LCD_SetFont(&Font16); |
bcostm | 3:ff6ab501ecb0 | 18 | BSP_LCD_Clear(LCD_COLOR_RED); |
bcostm | 3:ff6ab501ecb0 | 19 | BSP_LCD_SetBackColor(LCD_COLOR_RED); |
bcostm | 3:ff6ab501ecb0 | 20 | BSP_LCD_SetTextColor(LCD_COLOR_YELLOW); |
bcostm | 3:ff6ab501ecb0 | 21 | BSP_LCD_DisplayStringAt(0, LINE(4), (uint8_t *)"DISCO_L496AG", CENTER_MODE); |
bcostm | 3:ff6ab501ecb0 | 22 | BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"LCD DEMO", CENTER_MODE); |
bcostm | 3:ff6ab501ecb0 | 23 | BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"FONT16", CENTER_MODE); |
bcostm | 3:ff6ab501ecb0 | 24 | wait(2); |
bcostm | 3:ff6ab501ecb0 | 25 | BSP_LCD_SetFont(&Font20); |
bcostm | 3:ff6ab501ecb0 | 26 | BSP_LCD_Clear(LCD_COLOR_GREEN); |
bcostm | 3:ff6ab501ecb0 | 27 | BSP_LCD_SetBackColor(LCD_COLOR_GREEN); |
bcostm | 3:ff6ab501ecb0 | 28 | BSP_LCD_SetTextColor(LCD_COLOR_BLACK); |
bcostm | 3:ff6ab501ecb0 | 29 | BSP_LCD_DisplayStringAt(0, LINE(4), (uint8_t *)"DISCO_L496AG", CENTER_MODE); |
bcostm | 3:ff6ab501ecb0 | 30 | BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"LCD DEMO", CENTER_MODE); |
bcostm | 3:ff6ab501ecb0 | 31 | BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"FONT20", CENTER_MODE); |
bcostm | 3:ff6ab501ecb0 | 32 | wait(2); |
bcostm | 3:ff6ab501ecb0 | 33 | BSP_LCD_Clear(LCD_COLOR_BLUE); |
bcostm | 3:ff6ab501ecb0 | 34 | BSP_LCD_SetBackColor(LCD_COLOR_BLUE); |
bcostm | 3:ff6ab501ecb0 | 35 | BSP_LCD_SetTextColor(LCD_COLOR_WHITE); |
bcostm | 3:ff6ab501ecb0 | 36 | BSP_LCD_SetFont(&Font24); |
bcostm | 3:ff6ab501ecb0 | 37 | BSP_LCD_DisplayStringAt(0, LINE(4), (uint8_t *)"DISCO_L496AG", CENTER_MODE); |
bcostm | 3:ff6ab501ecb0 | 38 | BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"LCD DEMO", CENTER_MODE); |
bcostm | 3:ff6ab501ecb0 | 39 | BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"FONT24", CENTER_MODE); |
bcostm | 3:ff6ab501ecb0 | 40 | wait(2); |
bcostm | 3:ff6ab501ecb0 | 41 | } |
bcostm | 0:378633dfeb25 | 42 | |
bcostm | 0:378633dfeb25 | 43 | } |