From e56bd84cb89c86deab1c8a145eea8749a15c8fee Mon Sep 17 00:00:00 2001 From: xoreo Date: Mon, 13 Nov 2023 17:17:15 +0100 Subject: [PATCH] Add draw BMP function (lcd_draw_bmp_img) --- project/Core/Inc/lcd_api.h | 13 ++++++ project/Core/Src/lcd_api.c | 4 ++ project/project Debug.launch | 80 ------------------------------------ 3 files changed, 17 insertions(+), 80 deletions(-) delete mode 100644 project/project Debug.launch diff --git a/project/Core/Inc/lcd_api.h b/project/Core/Inc/lcd_api.h index 4f20d68..7fe30c0 100644 --- a/project/Core/Inc/lcd_api.h +++ b/project/Core/Inc/lcd_api.h @@ -13,6 +13,7 @@ #define LOGGER_LEVEL_ALL #include "log.h" #include "../../Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_lcd.h" +#include "llfs.h" #define LCD_BLUE LCD_COLOR_BLUE #define LCD_GREEN LCD_COLOR_GREEN @@ -95,6 +96,18 @@ void lcd_display_text(uint8_t* text, uint16_t x_pos, uint16_t y_pos, uint32_t co */ void lcd_draw_raw_img(const void* p_src, uint32_t x_pos, uint32_t y_pos, uint32_t x_size, uint32_t y_size, uint32_t color_mode); +/** + * @brief Draw BMP image on screen + * Draw BMP image from C array to the LCD screen at position X, Y. In color mode ARGB8888, RGB888, RGB565 or ARGB1555 + * Supports ARGB8888, RGB565, RGB888 + * + * @param[in] x_pos X-position + * @param[in] y_pos Y-position + * @param[in] BMP file data + */ +void lcd_draw_bmp_img(uint32_t x_pos, uint32_t y_pos, uint8_t* bmp_buff); + + /** * @brief Clear LCD screen * Clears the whole LCD screen to the desired color diff --git a/project/Core/Src/lcd_api.c b/project/Core/Src/lcd_api.c index 57b3e66..a632cc0 100644 --- a/project/Core/Src/lcd_api.c +++ b/project/Core/Src/lcd_api.c @@ -96,6 +96,10 @@ void lcd_draw_raw_img(const void* p_src, uint32_t x_pos, uint32_t y_pos, uint32_ HAL_DMA2D_PollForTransfer(&hDma2dHandler2, 10); } +void lcd_draw_bmp_img(uint32_t x_pos, uint32_t y_pos, uint8_t* bmp_buff){ + BSP_LCD_DrawBitmap(x_pos, y_pos, bmp_buff); +} + void lcd_clear(uint32_t color){ BSP_LCD_Clear(color); } diff --git a/project/project Debug.launch b/project/project Debug.launch deleted file mode 100644 index ccaf85d..0000000 --- a/project/project Debug.launch +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -