Apply changes to doxygen
This commit is contained in:
@@ -47,11 +47,11 @@
|
|||||||
#define LCD_RGB565 0x00000002U
|
#define LCD_RGB565 0x00000002U
|
||||||
#define LCD_ARGB1555 0x00000003U
|
#define LCD_ARGB1555 0x00000003U
|
||||||
|
|
||||||
#define LCD_FONT8 &Font8
|
#define LCD_FONT8 (&Font8)
|
||||||
#define LCD_FONT12 &Font12
|
#define LCD_FONT12 (&Font12)
|
||||||
#define LCD_FONT16 &Font16
|
#define LCD_FONT16 (&Font16)
|
||||||
#define LCD_FONT20 &Font20
|
#define LCD_FONT20 (&Font20)
|
||||||
#define LCD_FONT24 &Font24
|
#define LCD_FONT24 (&Font24)
|
||||||
|
|
||||||
|
|
||||||
extern LTDC_HandleTypeDef hLtdcHandler;
|
extern LTDC_HandleTypeDef hLtdcHandler;
|
||||||
@@ -101,9 +101,9 @@ void lcd_draw_raw_img(const void* p_src, uint32_t x_pos, uint32_t y_pos, uint32_
|
|||||||
* Draw BMP image from C array to the LCD screen at position X, Y. In color mode ARGB8888, RGB888, RGB565 or ARGB1555
|
* 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
|
* Supports ARGB8888, RGB565, RGB888
|
||||||
*
|
*
|
||||||
|
* @param[in] bmp_buff BMP file data
|
||||||
* @param[in] x_pos X-position
|
* @param[in] x_pos X-position
|
||||||
* @param[in] y_pos Y-position
|
* @param[in] y_pos Y-position
|
||||||
* @param[in] BMP file data
|
|
||||||
*/
|
*/
|
||||||
void lcd_draw_bmp_img(uint8_t* bmp_buff, uint32_t x_pos, uint32_t y_pos);
|
void lcd_draw_bmp_img(uint8_t* bmp_buff, uint32_t x_pos, uint32_t y_pos);
|
||||||
|
|
||||||
@@ -112,9 +112,9 @@ void lcd_draw_bmp_img(uint8_t* bmp_buff, uint32_t x_pos, uint32_t y_pos);
|
|||||||
* Draw BMP image from C array to the LCD screen at position X, Y by specifying the BMP image name on the filesystem
|
* Draw BMP image from C array to the LCD screen at position X, Y by specifying the BMP image name on the filesystem
|
||||||
* Supports ARGB8888, RGB565, RGB888
|
* Supports ARGB8888, RGB565, RGB888
|
||||||
*
|
*
|
||||||
|
* @param[in] name Name of image on filesystem
|
||||||
* @param[in] x_pos X-position
|
* @param[in] x_pos X-position
|
||||||
* @param[in] y_pos Y-position
|
* @param[in] y_pos Y-position
|
||||||
* @param[in] BMP file data
|
|
||||||
*/
|
*/
|
||||||
void lcd_draw_img_from_fs_with_name(const char* name, uint32_t x_pos, uint32_t y_pos);
|
void lcd_draw_img_from_fs_with_name(const char* name, uint32_t x_pos, uint32_t y_pos);
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
* @file lcd_api.c
|
* @file lcd_api.c
|
||||||
* @brief LCD API implementation
|
* @brief LCD API implementation
|
||||||
* @author Tim S.
|
* @author Tim S.
|
||||||
* @todo Implement function to read images from fs
|
|
||||||
*/
|
*/
|
||||||
#include "lcd_api.h"
|
#include "lcd_api.h"
|
||||||
|
|
||||||
@@ -15,7 +14,7 @@ void lcd_init(bool bl_on) {
|
|||||||
|
|
||||||
BSP_LCD_Init();
|
BSP_LCD_Init();
|
||||||
BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS);
|
BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS);
|
||||||
BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS + (BSP_LCD_GetXSize() * BSP_LCD_GetYSize() * 4));
|
BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS + (BSP_LCD_GetXSize()*BSP_LCD_GetYSize()*4));
|
||||||
BSP_LCD_SelectLayer(0);
|
BSP_LCD_SelectLayer(0);
|
||||||
BSP_LCD_Clear(LCD_COLOR_BLACK);
|
BSP_LCD_Clear(LCD_COLOR_BLACK);
|
||||||
BSP_LCD_SelectLayer(1);
|
BSP_LCD_SelectLayer(1);
|
||||||
@@ -29,7 +28,7 @@ void lcd_init(bool bl_on) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_display_text(uint8_t* text, uint16_t x_pos, uint16_t y_pos, uint32_t color, uint32_t bg_color, sFONT* font) {
|
void lcd_display_text(uint8_t* text, uint16_t x_pos, uint16_t y_pos, uint32_t color, uint32_t bg_color, sFONT *font) {
|
||||||
LOG_INFO(TAG, "Display text: %s @x=%d,y=%d", text, x_pos, y_pos);
|
LOG_INFO(TAG, "Display text: %s @x=%d,y=%d", text, x_pos, y_pos);
|
||||||
|
|
||||||
uint16_t tot_length = x_pos + (strlen(text) * font->Width);
|
uint16_t tot_length = x_pos + (strlen(text) * font->Width);
|
||||||
@@ -43,8 +42,8 @@ void lcd_display_text(uint8_t* text, uint16_t x_pos, uint16_t y_pos, uint32_t co
|
|||||||
|
|
||||||
if (tot_length > BSP_LCD_GetXSize()) {
|
if (tot_length > BSP_LCD_GetXSize()) {
|
||||||
for (int i = 0; i < strlen(text); i++) {
|
for (int i = 0; i < strlen(text); i++) {
|
||||||
if ((x_pos) > BSP_LCD_GetXSize() - (font->Width) * 2) {
|
if ((x_pos) > BSP_LCD_GetXSize() - (font->Width)*2) {
|
||||||
if (isalpha(text[i - 1]) && isalpha(text[i])) {
|
if (isalpha(text[i-1]) && isalpha(text[i])) {
|
||||||
BSP_LCD_DisplayChar(x_pos, y_pos, '-');
|
BSP_LCD_DisplayChar(x_pos, y_pos, '-');
|
||||||
i -= 1;
|
i -= 1;
|
||||||
}
|
}
|
||||||
@@ -55,23 +54,21 @@ void lcd_display_text(uint8_t* text, uint16_t x_pos, uint16_t y_pos, uint32_t co
|
|||||||
x_pos += font->Width;
|
x_pos += font->Width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
} else {
|
||||||
}
|
|
||||||
BSP_LCD_DisplayStringAt(x_pos, y_pos, text, LEFT_MODE);
|
BSP_LCD_DisplayStringAt(x_pos, y_pos, text, LEFT_MODE);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_draw_raw_img(const void* p_src,
|
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) {
|
||||||
uint32_t x_pos,
|
|
||||||
uint32_t y_pos,
|
uint32_t address = hLtdcHandler.LayerCfg[1].FBStartAdress + (((BSP_LCD_GetXSize()*y_pos) + x_pos)*(4));
|
||||||
uint32_t x_size,
|
void *p_dst = (void *)address;
|
||||||
uint32_t y_size,
|
|
||||||
uint32_t color_mode) {
|
|
||||||
uint32_t address = hLtdcHandler.LayerCfg[1].FBStartAdress + (((BSP_LCD_GetXSize() * y_pos) + x_pos) * (4));
|
|
||||||
void* p_dst = (void*)address;
|
|
||||||
|
|
||||||
hDma2dHandler2.Init.Mode = DMA2D_M2M_PFC;
|
hDma2dHandler2.Init.Mode = DMA2D_M2M_PFC;
|
||||||
hDma2dHandler2.Init.ColorMode = DMA2D_ARGB8888;
|
hDma2dHandler2.Init.ColorMode = DMA2D_ARGB8888;
|
||||||
hDma2dHandler2.Init.OutputOffset = BSP_LCD_GetXSize() - x_size;
|
hDma2dHandler2.Init.OutputOffset = BSP_LCD_GetXSize()-x_size;
|
||||||
|
|
||||||
hDma2dHandler2.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
|
hDma2dHandler2.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
|
||||||
hDma2dHandler2.LayerCfg[1].InputAlpha = 0xFF;
|
hDma2dHandler2.LayerCfg[1].InputAlpha = 0xFF;
|
||||||
@@ -98,11 +95,11 @@ void lcd_draw_raw_img(const void* p_src,
|
|||||||
HAL_DMA2D_PollForTransfer(&hDma2dHandler2, 10);
|
HAL_DMA2D_PollForTransfer(&hDma2dHandler2, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_draw_bmp_img(uint8_t* bmp_buff, uint32_t x_pos, uint32_t y_pos) {
|
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);
|
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) {
|
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);
|
llfs_file_t* file = llfs_file_open(name);
|
||||||
if (file != NULL) {
|
if (file != NULL) {
|
||||||
BSP_LCD_DrawBitmap(x_pos, y_pos, file->data);
|
BSP_LCD_DrawBitmap(x_pos, y_pos, file->data);
|
||||||
@@ -111,6 +108,6 @@ void lcd_draw_img_from_fs_with_name(const char* name, uint32_t x_pos, uint32_t y
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_clear(uint32_t color) {
|
void lcd_clear(uint32_t color){
|
||||||
BSP_LCD_Clear(color);
|
BSP_LCD_Clear(color);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user