SDL3 Form SIM_Display

This commit is contained in:
JiXieShi
2024-09-21 20:43:31 +08:00
parent fbc054d999
commit 6c9a999c71
14 changed files with 448 additions and 62 deletions

View File

@@ -9,7 +9,7 @@
TFT_T demo_tft;
uint16_t xs = 0, ys = 0, xe = 0, ye = 0;
bool fill;
static SIM_Display_t tft_display;
//屏幕指令
#define WGRAM_CMD 0x5C
#define SETXCMD 0x2A
@@ -79,7 +79,7 @@ uint8_t tft_senddata(uint8_t *data, size_t len) {
if (len == 2) {
color_u.u8[1] = *data;
color_u.u8[0] = *data++;
SIM_Color_DrawPiexl(RGB565_to_RGB888(color_u.u16, true), xs, ys);
SIM_Color_DrawPiexl(&tft_display, (SIM_Color_t) RGB565_to_RGB888(color_u.u16, true), xs, ys);
// LOGT("Piexl","color:%x,x:%d,y:%d,len:%d",color_u.u16,xs,ys,len);
// SIM_Color_ImgFromBuffer(color,xs, ys, uint16_t width, 1)
} else {
@@ -88,10 +88,10 @@ uint8_t tft_senddata(uint8_t *data, size_t len) {
data++;
color_u.u8[0] = *data;
data++;
color[i] = RGB565_to_RGB888(color_u.u16, true);
color[i] = RGB565_to_RGB888(color_u.u16, true) | 0xFF000000;
}
// SIM_Color_ImgFromBuffer(color, xs, ys, len / 2 - 1, 1);
SIM_Color_DrawHLineBuffer(color, xs, ys, len / 2);
SIM_Color_ImgFromBuffer(&tft_display, color, xs, ys, len / 2 - 1, 1);
// SIM_Color_DrawHLineBuffer(color, xs, ys, len / 2);
// LOGT("Img","x:%d,y:%d,len:%d",xs,ys,len);
}
@@ -116,8 +116,8 @@ void Test_tft(void *) {
demo_tft.dir = HORIZONTAL;//必填
//模拟初始化
SIM_Display_INIT(demo_tft.width, demo_tft.height, 0xFFFF, 0x0000, 2, 0);
SIM_Display_START();
SIM_Display_Init("TFT", demo_tft.width, demo_tft.height, 0xFFFF, 0x0000, 2, &tft_display);
TFT_Init(&demo_tft);//初始化
TFT_Color_t t;