Greenhouse Climate Observation Module
Dependencies: BSP_DISCO_F746NG DHT
bootup.cpp@0:a5831f680465, 2020-01-21 (annotated)
- Committer:
- chri721u
- Date:
- Tue Jan 21 12:28:42 2020 +0000
- Revision:
- 0:a5831f680465
- Child:
- 2:739ba85b7a90
Current version;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chri721u | 0:a5831f680465 | 1 | #include "mbed.h" // Mbed header from mbed-os version 5 |
chri721u | 0:a5831f680465 | 2 | #include "stm32746g_discovery_lcd.h" // Last updated 27/11/2019 |
chri721u | 0:a5831f680465 | 3 | #include "bootup.h" |
chri721u | 0:a5831f680465 | 4 | |
chri721u | 0:a5831f680465 | 5 | void bootup::LCD_Bootup() |
chri721u | 0:a5831f680465 | 6 | { |
chri721u | 0:a5831f680465 | 7 | // Boot up LCD screen |
chri721u | 0:a5831f680465 | 8 | BSP_LCD_Init(); // Starts up the LCD |
chri721u | 0:a5831f680465 | 9 | BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER, LCD_FB_START_ADDRESS); |
chri721u | 0:a5831f680465 | 10 | BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER); |
chri721u | 0:a5831f680465 | 11 | |
chri721u | 0:a5831f680465 | 12 | // Clear the screen, add black background and red text |
chri721u | 0:a5831f680465 | 13 | BSP_LCD_Clear(LCD_COLOR_BLACK); |
chri721u | 0:a5831f680465 | 14 | BSP_LCD_SetBackColor(LCD_COLOR_BLACK); |
chri721u | 0:a5831f680465 | 15 | BSP_LCD_SetTextColor(LCD_COLOR_RED); |
chri721u | 0:a5831f680465 | 16 | |
chri721u | 0:a5831f680465 | 17 | // Bootup Message |
chri721u | 0:a5831f680465 | 18 | printf("Device is booting up \r\n"); // Debug statement that lets you know that the device is booting. |
chri721u | 0:a5831f680465 | 19 | BSP_LCD_DisplayStringAt(0, 100, (uint8_t *) "HELLDROP GREENHOUSES", CENTER_MODE); // Company |
chri721u | 0:a5831f680465 | 20 | BSP_LCD_DisplayStringAt(0, 150, (uint8_t *) "BIG HARD PLANTS", CENTER_MODE); // Tagline 1 |
chri721u | 0:a5831f680465 | 21 | BSP_LCD_DisplayStringAt(0, 175, (uint8_t *) "IN A BIG HARD GREENHOUSE", CENTER_MODE); // Tagline 2 |
chri721u | 0:a5831f680465 | 22 | HAL_Delay(5000); // Delay 10 seconds to simulate actual bootup |
chri721u | 0:a5831f680465 | 23 | // Prep for display |
chri721u | 0:a5831f680465 | 24 | BSP_LCD_Clear(LCD_COLOR_BLACK); |
chri721u | 0:a5831f680465 | 25 | BSP_LCD_SetBackColor(LCD_COLOR_BLACK); |
chri721u | 0:a5831f680465 | 26 | BSP_LCD_SetTextColor(LCD_COLOR_RED); |
chri721u | 0:a5831f680465 | 27 | } |