diff --git a/src/esp32_smartdisplay.c b/src/esp32_smartdisplay.c index cdc3e59..506c3bd 100644 --- a/src/esp32_smartdisplay.c +++ b/src/esp32_smartdisplay.c @@ -112,7 +112,7 @@ void smartdisplay_lcd_set_backlight(float duty) if (duty < 0.0) duty = 0.0f; #if ESP_ARDUINO_VERSION_MAJOR >= 3 - ledcWrite(BCKL, duty * PWM_MAX_BCKL); + ledcWrite(GPIO_BCKL, duty * PWM_MAX_BCKL); #else ledcWrite(PWM_CHANNEL_BCKL, duty * PWM_MAX_BCKL); #endif @@ -235,14 +235,14 @@ void smartdisplay_init() lv_init(); // Setup backlight - pinMode(BCKL, OUTPUT); + pinMode(GPIO_BCKL, OUTPUT); + digitalWrite(GPIO_BCKL, LOW); #if ESP_ARDUINO_VERSION_MAJOR >= 3 - ledcAttach(BCKL, PWM_FREQ_BCKL, PWM_BITS_BCKL); + ledcAttach(GPIO_BCKL, PWM_FREQ_BCKL, PWM_BITS_BCKL); #else ledcSetup(PWM_CHANNEL_BCKL, PWM_FREQ_BCKL, PWM_BITS_BCKL); - ledcAttachPin(BCKL, PWM_CHANNEL_BCKL); + ledcAttachPin(GPIO_BCKL, PWM_CHANNEL_BCKL); #endif - digitalWrite(BCKL, LOW); // Setup TFT display lv_disp_drv_init(&disp_drv); disp_drv.hor_res = LCD_WIDTH; diff --git a/src/lvgl_gc9a01_spi.c b/src/lvgl_gc9a01_spi.c index 1dc7823..6fb21ea 100644 --- a/src/lvgl_gc9a01_spi.c +++ b/src/lvgl_gc9a01_spi.c @@ -38,7 +38,7 @@ void lvgl_lcd_init(lv_disp_drv_t *drv) // Create SPI bus const spi_bus_config_t spi_bus_config = { .mosi_io_num = GC9A01_SPI_BUS_MOSI_IO_NUM, - .mosi_io_num = GC9A01_SPI_BUS_MISO_IO_NUM, + .miso_io_num = GC9A01_SPI_BUS_MISO_IO_NUM, .sclk_io_num = GC9A01_SPI_BUS_SCLK_IO_NUM, .quadwp_io_num = GC9A01_SPI_BUS_QUADWP_IO_NUM, .quadhd_io_num = GC9A01_SPI_BUS_QUADHD_IO_NUM, diff --git a/src/lvgl_st7789_i80.c b/src/lvgl_st7789_i80.c index 77f50ea..b6b052c 100644 --- a/src/lvgl_st7789_i80.c +++ b/src/lvgl_st7789_i80.c @@ -1,7 +1,5 @@ #ifdef LCD_ST7789_I80 -#warning Still under development. Will most probably NOT function! - #include #include #include @@ -96,8 +94,12 @@ void lvgl_lcd_init(lv_disp_drv_t *drv) ESP_ERROR_CHECK(esp_lcd_panel_reset(panel_handle)); ESP_ERROR_CHECK(esp_lcd_panel_init(panel_handle)); - // IPS + +#ifdef LCD_IPS + // If LCD is IPS invert the colors ESP_ERROR_CHECK(esp_lcd_panel_invert_color(panel_handle, true)); +#endif + drv->user_data = panel_handle; drv->flush_cb = st7789_lv_flush; }