Added demo image.

This commit is contained in:
imi415 2022-07-23 23:22:43 +08:00
parent e680528d73
commit d0e41353b2
Signed by: imi415
GPG Key ID: 17F01E106F9F5E0A
3 changed files with 6084 additions and 1 deletions

View File

@ -2,6 +2,7 @@ idf_component_register(
SRCS
"app_main.c"
"app_lcd_impl.c"
"app_demo_image_1.c"
"lib/st7789_lcd.c"
INCLUDE_DIRS

6069
main/app_demo_image_1.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,8 @@ st7789_lcd_ret_t lcd_impl_delay(void *pdev, uint32_t msec);
st7789_lcd_ret_t lcd_impl_write_command(void *pdev, uint8_t *command, uint32_t len);
st7789_lcd_ret_t lcd_impl_write_data(void *pdev, uint8_t *data, uint32_t len);
extern const uint8_t app_demo_image_1_rgb565[115200];
void app_main(void) {
ESP_LOGI(APP_LOG_TAG, "MAIN");
@ -49,7 +51,7 @@ void app_main(void) {
{
.dir = ST7789_LCD_DIR_0,
.inverted = false,
.bgr_mode = false,
.bgr_mode = true,
.pix_fmt = ST7789_LCD_PIXFMT_RGB565,
},
.user_data = lcd_impl_init(),
@ -64,6 +66,17 @@ void app_main(void) {
ESP_LOGE(APP_LOG_TAG, "LCD init failed");
}
st7789_lcd_coord_t coord = {
.x_start = 0,
.x_end = 239,
.y_start = 0,
.y_end = 239,
};
if(st7789_lcd_upload(&lcd, &coord, (uint8_t *)app_demo_image_1_rgb565) != ST7789_SUCCESS) {
ESP_LOGE(APP_LOG_TAG, "LCD upload failed");
}
for (;;) {
vTaskSuspend(NULL);
}