Finish display impl, write UI widget, refactor

This commit is contained in:
maddiebaka
2025-12-31 11:56:54 -05:00
parent 7556496158
commit f02d138ffa
8 changed files with 368 additions and 199 deletions
+3 -7
View File
@@ -58,7 +58,6 @@ void touch_driver_read(lv_indev_t * indev, lv_indev_data_t * data) {
bool touchpad_pressed = esp_lcd_touch_get_coordinates(tp, x, y, strength, &count, 1);
if(touchpad_pressed == true) {
//ESP_LOGI(TAG, "Touchpad pressed from LVGL..\n");
data->point.x = x[0];
data->point.y = y[0];
data->state = LV_INDEV_STATE_PRESSED;
@@ -73,8 +72,6 @@ void touch_driver_read(lv_indev_t * indev, lv_indev_data_t * data) {
static void btn_event_cb(lv_event_t * e) {
lv_event_code_t code = lv_event_get_code(e);
//ESP_LOGI(TAG, "Button callback fired.");
if(code == LV_EVENT_CLICKED) {
ESP_LOGI(TAG, "LVGL button pressed.");
}
@@ -132,8 +129,8 @@ void init_touchscreen_xpt2046(void) {
ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(TOUCH_SPI_HOST, &tp_io_config, &tp_io_handle));
esp_lcd_touch_config_t tp_cfg = {
.x_max = TFT_HRES,
.y_max = TFT_VRES,
.x_max = TFT_VRES,
.y_max = TFT_HRES,
.rst_gpio_num = -1,
.int_gpio_num = -1,
.flags = {
@@ -227,7 +224,7 @@ void init_lvgl_display(void) {
},
.flags = {
.buff_dma = false,
.swap_bytes = false,
.swap_bytes = true,
}
};
disp_handle = lvgl_port_add_disp(&disp_cfg);
@@ -253,5 +250,4 @@ void init_display(void) {
init_touchscreen_xpt2046();
init_lvgl_display();
init_input();
lv_example_btn_1();
}