Implement lcd_draw_img_from_fs_with_name

This commit is contained in:
xoreo
2023-11-13 17:45:28 +01:00
parent e56bd84cb8
commit 35871d9eae
2 changed files with 21 additions and 2 deletions

View File

@@ -96,10 +96,19 @@ 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){
void lcd_draw_bmp_img(uint8_t* bmp_buff, uint32_t x_pos, uint32_t y_pos){
BSP_LCD_DrawBitmap(x_pos, y_pos, bmp_buff);
}
void lcd_draw_img_from_fs_with_name(const char* name, uint32_t x_pos, uint32_t y_pos){
llfs_file_t* file = llfs_file_open(name);
if (file != NULL) {
BSP_LCD_DrawBitmap(x_pos, y_pos, file->data);
} else {
LOG_WARN(TAG, "File \"%s\" not found", file->name);
}
}
void lcd_clear(uint32_t color){
BSP_LCD_Clear(color);
}