From 7ed0b46275f5acdede66968a66779f9359b51344 Mon Sep 17 00:00:00 2001 From: Rene Zeldenthuis Date: Tue, 5 Mar 2024 00:05:28 +0100 Subject: [PATCH] Added logging --- src/esp_lcd_gc9a01.c | 20 ++++++++++---------- src/esp_lcd_touch_cst816s.c | 12 ++++++------ src/esp_lcd_touch_gt911.c | 23 ++++++++++++----------- src/esp_lcd_touch_xpt2046.c | 14 +++++++------- src/lvgl_cst816s_i2c.c | 3 +++ src/lvgl_gt911_i2c.c | 7 ++++--- src/lvgl_xpt2046_spi.c | 1 + 7 files changed, 43 insertions(+), 37 deletions(-) diff --git a/src/esp_lcd_gc9a01.c b/src/esp_lcd_gc9a01.c index 50be181..17af2ec 100644 --- a/src/esp_lcd_gc9a01.c +++ b/src/esp_lcd_gc9a01.c @@ -71,7 +71,7 @@ const lcd_init_cmd_t vendor_specific_init_default[] = { esp_err_t gc9a01_reset(esp_lcd_panel_t *panel) { gc9a01_panel_t *ph = (gc9a01_panel_t *)panel; - log_v("gc9a01_reset. ph:%08x", ph); + log_v("gc9a01_reset. ph:0x%08x", ph); assert(panel != NULL); @@ -101,7 +101,7 @@ esp_err_t gc9a01_reset(esp_lcd_panel_t *panel) esp_err_t gc9a01_init(esp_lcd_panel_t *panel) { gc9a01_panel_t *ph = (gc9a01_panel_t *)panel; - log_v("gc9a01_init. ph:%08x", ph); + log_v("gc9a01_init. ph:0x%08x", ph); assert(panel != NULL); @@ -161,7 +161,7 @@ esp_err_t gc9a01_init(esp_lcd_panel_t *panel) esp_err_t gc9a01_draw_bitmap(esp_lcd_panel_t *panel, int x_start, int y_start, int x_end, int y_end, const void *color_data) { gc9a01_panel_t *ph = (gc9a01_panel_t *)panel; - log_v("gc9a01_draw_bitmap. ph:%08x, x_start:%d, y_start:%d, x_end:%d, y_end:%d, color_data:%08x", ph, x_start, y_start, x_end, y_end, color_data); + log_v("gc9a01_draw_bitmap. ph:0x%08x, x_start:%d, y_start:%d, x_end:%d, y_end:%d, color_data:0x%08x", ph, x_start, y_start, x_end, y_end, color_data); assert(panel != NULL); assert(color_data != NULL); @@ -208,7 +208,7 @@ esp_err_t gc9a01_draw_bitmap(esp_lcd_panel_t *panel, int x_start, int y_start, i esp_err_t gc9a01_invert_color(esp_lcd_panel_t *panel, bool invert) { gc9a01_panel_t *ph = (gc9a01_panel_t *)panel; - log_v("gc9a01_invert_color. ph:%08x, invert:%d", ph, invert); + log_v("gc9a01_invert_color. ph:0x%08x, invert:%d", ph, invert); assert(panel != NULL); @@ -238,7 +238,7 @@ esp_err_t gc9a01_update_madctl(gc9a01_panel_t *ph) esp_err_t gc9a01_mirror(esp_lcd_panel_t *panel, bool mirror_x, bool mirror_y) { gc9a01_panel_t *ph = (gc9a01_panel_t *)panel; - log_v("gc9a01_mirror. ph:%08x, mirror_x:%d, mirror_y:%d", ph, mirror_x, mirror_y); + log_v("gc9a01_mirror. ph:0x%08x, mirror_x:%d, mirror_y:%d", ph, mirror_x, mirror_y); assert(panel != NULL); @@ -258,7 +258,7 @@ esp_err_t gc9a01_mirror(esp_lcd_panel_t *panel, bool mirror_x, bool mirror_y) esp_err_t gc9a01_swap_xy(esp_lcd_panel_t *panel, bool swap_xy) { gc9a01_panel_t *ph = (gc9a01_panel_t *)panel; - log_v("gc9a01_swap_xy. ph:%08x, swap_xy:%d", ph, swap_xy); + log_v("gc9a01_swap_xy. ph:0x%08x, swap_xy:%d", ph, swap_xy); assert(panel != NULL); @@ -273,7 +273,7 @@ esp_err_t gc9a01_swap_xy(esp_lcd_panel_t *panel, bool swap_xy) esp_err_t gc9a01_set_gap(esp_lcd_panel_t *panel, int x_gap, int y_gap) { gc9a01_panel_t *ph = (gc9a01_panel_t *)panel; - log_v("gc9a01_set_gap. ph:%08x, x_gap:%d, y_gap:%d", ph, x_gap, y_gap); + log_v("gc9a01_set_gap. ph:0x%08x, x_gap:%d, y_gap:%d", ph, x_gap, y_gap); assert(panel != NULL); @@ -286,7 +286,7 @@ esp_err_t gc9a01_set_gap(esp_lcd_panel_t *panel, int x_gap, int y_gap) esp_err_t gc9a01_disp_off(esp_lcd_panel_t *panel, bool off) { gc9a01_panel_t *ph = (gc9a01_panel_t *)panel; - log_v("gc9a01_disp_off. ph:%08x, off:%d", ph, off); + log_v("gc9a01_disp_off. ph:0x%08x, off:%d", ph, off); assert(panel != NULL); @@ -303,7 +303,7 @@ esp_err_t gc9a01_disp_off(esp_lcd_panel_t *panel, bool off) esp_err_t gc9a01_del(esp_lcd_panel_t *panel) { gc9a01_panel_t *ph = (gc9a01_panel_t *)panel; - log_v("gc9a01_del. ph:%08x", ph); + log_v("gc9a01_del. ph:0x%08x", ph); assert(panel != NULL); @@ -318,7 +318,7 @@ esp_err_t gc9a01_del(esp_lcd_panel_t *panel) esp_err_t esp_lcd_new_panel_gc9a01(const esp_lcd_panel_io_handle_t io, const esp_lcd_panel_dev_config_t *config, esp_lcd_panel_handle_t *handle) { - log_v("esp_lcd_new_panel_gc9a01. io:%08x, config:%08x, handle:%08x", io, config, handle); + log_v("esp_lcd_new_panel_gc9a01. io:0x%08x, config:0x%08x, handle:0x%08x", io, config, handle); assert(io != NULL); assert(config != NULL); diff --git a/src/esp_lcd_touch_cst816s.c b/src/esp_lcd_touch_cst816s.c index 77a014a..7c57bfb 100644 --- a/src/esp_lcd_touch_cst816s.c +++ b/src/esp_lcd_touch_cst816s.c @@ -74,7 +74,7 @@ extern "C" esp_err_t cst816s_reset(esp_lcd_touch_handle_t th) { - log_v("cst816s_reset. th:%08x", th); + log_v("cst816s_reset. th:0x%08x", th); esp_err_t res; @@ -103,7 +103,7 @@ extern "C" esp_err_t cst816s_read_info(esp_lcd_touch_handle_t th) { - log_v("cst816s_read_info. th:%08x", th); + log_v("cst816s_read_info. th:0x%08x", th); esp_err_t res; @@ -123,7 +123,7 @@ extern "C" esp_err_t cst816s_read_data(esp_lcd_touch_handle_t th) { - log_v("cst816s_read_data. th:%08x", th); + log_v("cst816s_read_data. th:0x%08x", th); esp_err_t res; cst816s_touch_event buffer; @@ -150,7 +150,7 @@ extern "C" bool cst816s_get_xy(esp_lcd_touch_handle_t th, uint16_t *x, uint16_t *y, uint16_t *strength, uint8_t *point_num, uint8_t max_point_num) { - log_v("cst816s_get_xy. th:%08x, x:0x%08x, y:0x%08x, strength:0x%08x, point_num:0x%08x, max_point_num:%d", th, x, y, strength, point_num, max_point_num); + log_v("cst816s_get_xy. th:0x%08x, x:0x%08x, y:0x%08x, strength:0x%08x, point_num:0x%08x, max_point_num:%d", th, x, y, strength, point_num, max_point_num); portENTER_CRITICAL(&th->data.lock); *point_num = th->data.points > max_point_num ? max_point_num : th->data.points; @@ -170,7 +170,7 @@ extern "C" esp_err_t cst816s_del(esp_lcd_touch_handle_t th) { - log_v("cst816s_del. th:%08x", th); + log_v("cst816s_del. th:0x%08x", th); portENTER_CRITICAL(&th->data.lock); @@ -194,7 +194,7 @@ extern "C" esp_err_t esp_lcd_touch_new_i2c_gt911(const esp_lcd_panel_io_handle_t io, const esp_lcd_touch_config_t *config, esp_lcd_touch_handle_t *handle) { - log_v("esp_lcd_touch_new_spi_gt911. io:%08x, config:%08x, handle:%08x", io, config, handle); + log_v("esp_lcd_touch_new_spi_gt911. io:0x%08x, config:0x%08x, handle:0x%08x", io, config, handle); assert(io != NULL); assert(config != NULL); diff --git a/src/esp_lcd_touch_gt911.c b/src/esp_lcd_touch_gt911.c index 95a8a15..f5bfbfa 100644 --- a/src/esp_lcd_touch_gt911.c +++ b/src/esp_lcd_touch_gt911.c @@ -69,7 +69,7 @@ extern "C" esp_err_t gt911_reset(esp_lcd_touch_handle_t th) { - log_v("gt911_reset. th:%08x", th); + log_v("gt911_reset. th:0x%08x", th); esp_err_t res; @@ -98,7 +98,7 @@ extern "C" esp_err_t gt911_read_info(esp_lcd_touch_handle_t th) { - log_v("gt911_read_info. th:%08x", th); + log_v("gt911_read_info. th:0x%08x", th); esp_err_t res; @@ -131,8 +131,9 @@ extern "C" if (info->xResolution == 0 || info->yResolution == 0) { - log_e("Invalid resolution in GT911"); - return ESP_FAIL; + log_w("Invalid resolution obtained from GT911. Using supplied resolution (%d,%d)", th->config.x_max, th->config.y_max); + info->xResolution = th->config.x_max; + info->yResolution = th->config.y_max; } log_d("GT911 productId: %s", info->productId); // 0x8140 - 0x8143 @@ -147,7 +148,7 @@ extern "C" esp_err_t gt911_enter_sleep(esp_lcd_touch_handle_t th) { - log_v("gt911_enter_sleep. th:%08x", th); + log_v("gt911_enter_sleep. th:0x%08x", th); esp_err_t res; const uint8_t data[] = {0x05}; // Sleep @@ -159,7 +160,7 @@ extern "C" esp_err_t gt911_exit_sleep(esp_lcd_touch_handle_t th) { - log_v("gt911_exit_sleep. th:%08x", th); + log_v("gt911_exit_sleep. th:0x%08x", th); esp_err_t res; if (th->config.int_gpio_num == GPIO_NUM_NC) @@ -191,7 +192,7 @@ extern "C" esp_err_t gt911_read_data(esp_lcd_touch_handle_t th) { - log_v("gt911_read_data. th:%08x", th); + log_v("gt911_read_data. th:0x%08x", th); esp_err_t res; gt911_touch_data buffer; @@ -273,7 +274,7 @@ extern "C" bool gt911_get_xy(esp_lcd_touch_handle_t th, uint16_t *x, uint16_t *y, uint16_t *strength, uint8_t *point_num, uint8_t max_point_num) { - log_v("gt911_get_xy. th:%08x, x:0x%08x, y:0x%08x, strength:0x%08x, point_num:0x%08x, max_point_num:%d", th, x, y, strength, point_num, max_point_num); + log_v("gt911_get_xy. th:0x%08x, x:0x%08x, y:0x%08x, strength:0x%08x, point_num:0x%08x, max_point_num:%d", th, x, y, strength, point_num, max_point_num); portENTER_CRITICAL(&th->data.lock); *point_num = th->data.points > max_point_num ? max_point_num : th->data.points; @@ -294,7 +295,7 @@ extern "C" #if (CONFIG_ESP_LCD_TOUCH_MAX_BUTTONS > 0) esp_err_t gt911_get_button_state(esp_lcd_touch_handle_t th, uint8_t n, uint8_t *state) { - log_v("gt911_get_xy. th:%08x, n:%d, state:0x%08x", th, n, state); + log_v("gt911_get_xy. th:0x%08x, n:%d, state:0x%08x", th, n, state); if (n > th->data.buttons) { @@ -312,7 +313,7 @@ extern "C" esp_err_t gt911_del(esp_lcd_touch_handle_t th) { - log_v("gt911_del. th:%08x", th); + log_v("gt911_del. th:0x%08x", th); portENTER_CRITICAL(&th->data.lock); // Remove gt911_info @@ -339,7 +340,7 @@ extern "C" esp_err_t esp_lcd_touch_new_i2c_gt911(const esp_lcd_panel_io_handle_t io, const esp_lcd_touch_config_t *config, esp_lcd_touch_handle_t *handle) { - log_v("esp_lcd_touch_new_spi_gt911. io:%08x, config:%08x, handle:%08x", io, config, handle); + log_v("esp_lcd_touch_new_spi_gt911. io:0x%08x, config:0x%08x, handle:0x%08x", io, config, handle); assert(io != NULL); assert(config != NULL); diff --git a/src/esp_lcd_touch_xpt2046.c b/src/esp_lcd_touch_xpt2046.c index cc4f767..919c502 100644 --- a/src/esp_lcd_touch_xpt2046.c +++ b/src/esp_lcd_touch_xpt2046.c @@ -34,7 +34,7 @@ extern "C" esp_err_t xpt2046_enter_sleep(esp_lcd_touch_handle_t th) { - log_v("xpt2046_enter_sleep. th:%08x", th); + log_v("xpt2046_enter_sleep. th:0x%08x", th); esp_err_t res; uint16_t discard; @@ -49,7 +49,7 @@ extern "C" esp_err_t xpt2046_exit_sleep(esp_lcd_touch_handle_t th) { - log_v("xpt2046_exit_sleep. th:%08x", th); + log_v("xpt2046_exit_sleep. th:0x%08x", th); esp_err_t res; uint16_t discard; @@ -64,7 +64,7 @@ extern "C" esp_err_t xpt2046_read_data(esp_lcd_touch_handle_t th) { - log_v("xpt2046_read_data. th:%08x", th); + log_v("xpt2046_read_data. th:0x%08x", th); esp_err_t res; uint32_t x = 0, y = 0; @@ -125,7 +125,7 @@ extern "C" bool xpt2046_get_xy(esp_lcd_touch_handle_t th, uint16_t *x, uint16_t *y, uint16_t *strength, uint8_t *point_num, uint8_t max_point_num) { - log_v("xpt2046_get_xy. th:%08x, x:0x%08x, y:0x%08x, strength:0x%08x, point_num:0x%08x, max_point_num:%d", th, x, y, strength, point_num, max_point_num); + log_v("xpt2046_get_xy. th:0x%08x, x:0x%08x, y:0x%08x, strength:0x%08x, point_num:0x%08x, max_point_num:%d", th, x, y, strength, point_num, max_point_num); portENTER_CRITICAL(&th->data.lock); *point_num = th->data.points > max_point_num ? max_point_num : th->data.points; @@ -154,7 +154,7 @@ extern "C" esp_err_t xpt2046_del(esp_lcd_touch_handle_t th) { - log_v("xpt2046_del. th:%08x", th); + log_v("xpt2046_del. th:0x%08x", th); portENTER_CRITICAL(&th->data.lock); // Remove interrupts and reset INT @@ -173,7 +173,7 @@ extern "C" esp_err_t esp_lcd_touch_new_spi_xpt2046(const esp_lcd_panel_io_handle_t io, const esp_lcd_touch_config_t *config, esp_lcd_touch_handle_t *handle) { - log_v("esp_lcd_touch_new_spi_xpt2046. io:%08x, config:%08x, handle:%08x", io, config, handle); + log_v("esp_lcd_touch_new_spi_xpt2046. io:0x%08x, config:0x%08x, handle:0x%08x", io, config, handle); assert(io != NULL); assert(config != NULL); @@ -239,7 +239,7 @@ extern "C" esp_err_t esp_lcd_touch_xpt2046_read_battery_level(const esp_lcd_touch_handle_t th, float *outhut) { - log_v("esp_lcd_touch_xpt2046_read_battery_level. th:%08x, outhut:0x%08x", th, outhut); + log_v("esp_lcd_touch_xpt2046_read_battery_level. th:0x%08x, outhut:0x%08x", th, outhut); assert(th != NULL); assert(outhut != NULL); diff --git a/src/lvgl_cst816s_i2c.c b/src/lvgl_cst816s_i2c.c index bb9e5e2..e63ffc5 100644 --- a/src/lvgl_cst816s_i2c.c +++ b/src/lvgl_cst816s_i2c.c @@ -42,6 +42,7 @@ void lvgl_touch_init(lv_indev_drv_t *drv) .master = { .clk_speed = CST816S_I2C_CONFIG_MASTER_CLK_SPEED}, .clk_flags = CST816S_I2C_CONFIG_CLK_FLAGS}; + log_v("i2c_config: mode:%d, sda_io_num:%d, scl_io_num:%d, sda_pullup_en:%d, scl_pullup_en:%d, master.clk_speed:%d, clk_flags:%d", i2c_config.mode, i2c_config.sda_io_num, i2c_config.scl_io_num, i2c_config.sda_pullup_en, i2c_config.scl_pullup_en, i2c_config.master.clk_speed, i2c_config.clk_flags); ESP_ERROR_CHECK(i2c_param_config(CST816S_I2C_HOST, &i2c_config)); ESP_ERROR_CHECK(i2c_driver_install(CST816S_I2C_HOST, i2c_config.mode, 0, 0, 0)); @@ -56,6 +57,7 @@ void lvgl_touch_init(lv_indev_drv_t *drv) .flags = { .dc_low_on_data = CST816S_IO_I2C_CONFIG_FLAGS_DC_LOW_ON_DATA, .disable_control_phase = CST816S_IO_I2C_CONFIG_FLAGS_DISABLE_CONTROL_PHASE}}; + log_v("io_i2c_config: dev_addr:0x%02x, control_phase_bytes:%d, user_ctx:0x%08x, dc_bit_offset:%d, lcd_cmd_bits:%d, lcd_param_bits:%d, flags.dc_low_on_data:%d, flags.disable_control_phase:%d", io_i2c_config.dev_addr, io_i2c_config.control_phase_bytes, io_i2c_config.user_ctx, io_i2c_config.dc_bit_offset, io_i2c_config.lcd_cmd_bits, io_i2c_config.lcd_param_bits, io_i2c_config.flags.dc_low_on_data, io_i2c_config.flags.disable_control_phase); esp_lcd_panel_io_handle_t io_handle; ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c((esp_lcd_i2c_bus_handle_t)CST816S_I2C_HOST, &io_i2c_config, &io_handle)); @@ -71,6 +73,7 @@ void lvgl_touch_init(lv_indev_drv_t *drv) // Unfortunately not supported //.flags = {.swap_xy = CST816S_TOUCH_CONFIG_FLAGS_SWAP_XY, .mirror_x = CST816S_TOUCH_CONFIG_FLAGS_MIRROR_X, .mirror_y = CST816S_TOUCH_CONFIG_FLAGS_MIRROR_Y}, .user_data = io_handle}; + log_v("touch_config: x_max:%d, y_max:%d, rst_gpio_num:%d, int_gpio_num:%d, levels.reset:%d, levels.interrupt:%d, flags.swap_xy:%d, flags.mirror_x:%d, flags.mirror_y:%d, user_data:0x%08x", touch_config.x_max, touch_config.y_max, touch_config.rst_gpio_num, touch_config.int_gpio_num, touch_config.levels.reset, touch_config.levels.interrupt, touch_config.flags.swap_xy, touch_config.flags.mirror_x, touch_config.flags.mirror_y, touch_config.user_data); esp_lcd_touch_handle_t touch_handle; ESP_ERROR_CHECK(esp_lcd_touch_new_i2c_cst816s(io_handle, &touch_config, &touch_handle)); diff --git a/src/lvgl_gt911_i2c.c b/src/lvgl_gt911_i2c.c index 81db795..60fbcbc 100644 --- a/src/lvgl_gt911_i2c.c +++ b/src/lvgl_gt911_i2c.c @@ -41,12 +41,13 @@ void lvgl_touch_init(lv_indev_drv_t *drv) .master = { .clk_speed = GT911_I2C_CONFIG_MASTER_CLK_SPEED}, .clk_flags = GT911_I2C_CONFIG_CLK_FLAGS}; + log_v("i2c_config: mode:%d, sda_io_num:%d, scl_io_num:%d, sda_pullup_en:%d, scl_pullup_en:%d, master.clk_speed:%d, clk_flags:%d", i2c_config.mode, i2c_config.sda_io_num, i2c_config.scl_io_num, i2c_config.sda_pullup_en, i2c_config.scl_pullup_en, i2c_config.master.clk_speed, i2c_config.clk_flags); ESP_ERROR_CHECK(i2c_param_config(GT911_I2C_HOST, &i2c_config)); ESP_ERROR_CHECK(i2c_driver_install(GT911_I2C_HOST, i2c_config.mode, 0, 0, 0)); // Create IO handle const esp_lcd_panel_io_i2c_config_t io_i2c_config = { - .dev_addr = GT911_IO_I2C_CONFIG_DEV_ADDRESS, + .dev_addr = GT911_IO_I2C_CONFIG_DEV_ADDR, .control_phase_bytes = GT911_IO_I2C_CONFIG_CONTROL_PHASE_BYTES, .user_ctx = drv, .dc_bit_offset = GT911_IO_I2C_CONFIG_DC_BIT_OFFSET, @@ -55,7 +56,7 @@ void lvgl_touch_init(lv_indev_drv_t *drv) .flags = { .dc_low_on_data = GT911_IO_I2C_CONFIG_FLAGS_DC_LOW_ON_DATA, .disable_control_phase = GT911_IO_I2C_CONFIG_FLAGS_DISABLE_CONTROL_PHASE}}; - + log_v("io_i2c_config: dev_addr:0x%02x, control_phase_bytes:%d, user_ctx:0x%08x, dc_bit_offset:%d, lcd_cmd_bits:%d, lcd_param_bits:%d, flags.dc_low_on_data:%d, flags.disable_control_phase:%d", io_i2c_config.dev_addr, io_i2c_config.control_phase_bytes, io_i2c_config.user_ctx, io_i2c_config.dc_bit_offset, io_i2c_config.lcd_cmd_bits, io_i2c_config.lcd_param_bits, io_i2c_config.flags.dc_low_on_data, io_i2c_config.flags.disable_control_phase); esp_lcd_panel_io_handle_t io_handle; ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c((esp_lcd_i2c_bus_handle_t)GT911_I2C_HOST, &io_i2c_config, &io_handle)); @@ -70,7 +71,7 @@ void lvgl_touch_init(lv_indev_drv_t *drv) .interrupt = GT911_TOUCH_CONFIG_LEVELS_INTERRUPT}, //.flags = {.swap_xy = LCD_SWAP_XY, .mirror_x = LCD_MIRROR_X, .mirror_y = LCD_MIRROR_Y}, .user_data = io_handle}; - + log_v("touch_config: x_max:%d, y_max:%d, rst_gpio_num:%d, int_gpio_num:%d, levels.reset:%d, levels.interrupt:%d, flags.swap_xy:%d, flags.mirror_x:%d, flags.mirror_y:%d, user_data:0x%08x", touch_config.x_max, touch_config.y_max, touch_config.rst_gpio_num, touch_config.int_gpio_num, touch_config.levels.reset, touch_config.levels.interrupt, touch_config.flags.swap_xy, touch_config.flags.mirror_x, touch_config.flags.mirror_y, touch_config.user_data); esp_lcd_touch_handle_t touch_handle; ESP_ERROR_CHECK(esp_lcd_touch_new_i2c_gt911(io_handle, &touch_config, &touch_handle)); diff --git a/src/lvgl_xpt2046_spi.c b/src/lvgl_xpt2046_spi.c index 03432d4..5774b49 100644 --- a/src/lvgl_xpt2046_spi.c +++ b/src/lvgl_xpt2046_spi.c @@ -69,6 +69,7 @@ void lvgl_touch_init(lv_indev_drv_t *drv) .interrupt = XPT2046_TOUCH_CONFIG_LEVELS_INTERRUPT}, //.flags = {.swap_xy = LCD_SWAP_XY, .mirror_x = LCD_MIRROR_X, .mirror_y = LCD_MIRROR_Y}, .user_data = io_handle}; + log_v("touch_config: x_max:%d, y_max:%d, rst_gpio_num:%d, int_gpio_num:%d, levels.reset:%d, levels.interrupt:%d, flags.swap_xy:%d, flags.mirror_x:%d, flags.mirror_y:%d, user_data:0x%08x", touch_config.x_max, touch_config.y_max, touch_config.rst_gpio_num, touch_config.int_gpio_num, touch_config.levels.reset, touch_config.levels.interrupt, touch_config.flags.swap_xy, touch_config.flags.mirror_x, touch_config.flags.mirror_y, touch_config.user_data); esp_lcd_touch_handle_t touch_handle; ESP_ERROR_CHECK(esp_lcd_touch_new_spi_xpt2046(io_handle, &touch_config, &touch_handle));