Add lcd_set_bg_color_layer0
This commit is contained in:
@@ -96,13 +96,16 @@ void lcd_task(void);
|
||||
* a text wrap will be performed. If the text wrap is between two letters in a word, the '-' character
|
||||
* will be injected.
|
||||
*
|
||||
* @note When bg_color 0 is passed as a parameter, the background for the text will be transparent
|
||||
*
|
||||
* @param[in] text C-style text string to display on the LCD screen
|
||||
* @param[in] x_pos X-position
|
||||
* @param[in] y_pos Y-position
|
||||
* @param[in] color Color in which the text will be displayed, see preset colors in defines above
|
||||
* @param[in] bg_color Text background color
|
||||
* @param[in] font Font size, see defines above in file
|
||||
*/
|
||||
void lcd_display_text(const char* text, uint16_t x_pos, uint16_t y_pos, uint32_t color, sFONT *font);
|
||||
void lcd_display_text(const char* text, uint16_t x_pos, uint16_t y_pos, uint32_t color, uint32_t bg_color, sFONT *font);
|
||||
|
||||
/**
|
||||
* @brief Draw BMP image on screen
|
||||
@@ -156,6 +159,14 @@ void lcd_clear_text(void);
|
||||
*/
|
||||
void lcd_clear_images(void);
|
||||
|
||||
/**
|
||||
* @brief Set background color of layer 0
|
||||
* Sets the layer 0 color
|
||||
*
|
||||
* @param[in] color Color of layer 0 (images layer)
|
||||
*/
|
||||
void lcd_set_bg_color_layer0(uint32_t color);
|
||||
|
||||
/**
|
||||
* @brief LCD stop all GIFs
|
||||
* Stops all playing GIFs on lcd screen
|
||||
|
||||
@@ -84,7 +84,7 @@ void lcd_task(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void lcd_display_text(const char* text, uint16_t x_pos, uint16_t y_pos, uint32_t color, sFONT* font) {
|
||||
void lcd_display_text(const char* text, uint16_t x_pos, uint16_t y_pos, uint32_t color, uint32_t bg_color, sFONT* font) {
|
||||
BSP_LCD_SelectLayer(1);
|
||||
LOG_INFO(TAG, "Display text: %s @x=%d,y=%d", text, x_pos, y_pos);
|
||||
|
||||
@@ -94,7 +94,7 @@ void lcd_display_text(const char* text, uint16_t x_pos, uint16_t y_pos, uint32_t
|
||||
}
|
||||
|
||||
BSP_LCD_SetTextColor(color);
|
||||
BSP_LCD_SetBackColor(0);
|
||||
BSP_LCD_SetBackColor(bg_color);
|
||||
BSP_LCD_SetFont(font);
|
||||
|
||||
if (tot_length > BSP_LCD_GetXSize()) {
|
||||
@@ -186,6 +186,11 @@ void lcd_clear_images(void) {
|
||||
BSP_LCD_Clear(0);
|
||||
}
|
||||
|
||||
void lcd_set_bg_color_layer0(uint32_t color){
|
||||
BSP_LCD_SelectLayer(0);
|
||||
BSP_LCD_Clear(color);
|
||||
}
|
||||
|
||||
void lcd_stop_all_gifs(void) {
|
||||
for (uint8_t i = 0; i < LCD_MAX_GIFS; i++) {
|
||||
if (gifs[i].src != NULL) {
|
||||
|
||||
@@ -167,7 +167,7 @@ void tftp_close(void* handle) {
|
||||
if (handle == &virt_file[VIRT_TEXT_TXT]) {
|
||||
lcd_clear_images();
|
||||
lcd_clear_text();
|
||||
lcd_display_text((uint8_t*)virt_file[VIRT_TEXT_TXT].data, 0, 0, LCD_COLOR_WHITE, LCD_FONT16);
|
||||
lcd_display_text((uint8_t*)virt_file[VIRT_TEXT_TXT].data, 0, 0, LCD_COLOR_WHITE, 0, LCD_FONT16);
|
||||
}
|
||||
|
||||
if (handle == &virt_file[VIRT_INDEX_TXT] || handle == &virt_file[VIRT_IMAGE_BMP]
|
||||
@@ -321,4 +321,4 @@ void tftp_server_deinit(void) {
|
||||
|
||||
virt_file[VIRT_TEXT_TXT].data = NULL;
|
||||
virt_file[VIRT_TEXT_TXT].len = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user