mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-28 21:33:32 +00:00
feat(st7789): add data endian config
Closes https://github.com/espressif/esp-idf/issues/11416
This commit is contained in:
@@ -211,7 +211,7 @@ void app_main(void)
|
||||
ESP_LOGI(TAG, "Install LCD driver of st7789");
|
||||
esp_lcd_panel_dev_config_t panel_config = {
|
||||
.reset_gpio_num = EXAMPLE_PIN_NUM_RST,
|
||||
.rgb_endian = LCD_RGB_ENDIAN_RGB,
|
||||
.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB,
|
||||
.bits_per_pixel = 16,
|
||||
};
|
||||
ESP_ERROR_CHECK(esp_lcd_new_panel_st7789(io_handle, &panel_config, &panel_handle));
|
||||
@@ -226,7 +226,7 @@ void app_main(void)
|
||||
ESP_LOGI(TAG, "Install LCD driver of nt35510");
|
||||
esp_lcd_panel_dev_config_t panel_config = {
|
||||
.reset_gpio_num = EXAMPLE_PIN_NUM_RST,
|
||||
.rgb_endian = LCD_RGB_ENDIAN_BGR,
|
||||
.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR,
|
||||
.bits_per_pixel = 16,
|
||||
};
|
||||
ESP_ERROR_CHECK(esp_lcd_new_panel_nt35510(io_handle, &panel_config, &panel_handle));
|
||||
@@ -244,7 +244,7 @@ void app_main(void)
|
||||
ESP_LOGI(TAG, "Install LCD driver of ili9341 (st7789 compatible)");
|
||||
esp_lcd_panel_dev_config_t panel_config = {
|
||||
.reset_gpio_num = EXAMPLE_PIN_NUM_RST,
|
||||
.rgb_endian = LCD_RGB_ENDIAN_BGR,
|
||||
.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR,
|
||||
.bits_per_pixel = 16,
|
||||
};
|
||||
ESP_ERROR_CHECK(esp_lcd_new_panel_st7789(io_handle, &panel_config, &panel_handle));
|
||||
|
@@ -206,7 +206,7 @@ void app_main(void)
|
||||
esp_lcd_panel_handle_t panel_handle = NULL;
|
||||
esp_lcd_panel_dev_config_t panel_config = {
|
||||
.reset_gpio_num = EXAMPLE_PIN_NUM_LCD_RST,
|
||||
.rgb_endian = LCD_RGB_ENDIAN_BGR,
|
||||
.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR,
|
||||
.bits_per_pixel = 16,
|
||||
};
|
||||
#if CONFIG_EXAMPLE_LCD_CONTROLLER_ILI9341
|
||||
|
@@ -130,7 +130,7 @@ void app_main(void)
|
||||
esp_lcd_panel_handle_t panel_handle = NULL;
|
||||
esp_lcd_panel_dev_config_t panel_config = {
|
||||
.reset_gpio_num = EXAMPLE_PIN_NUM_RST,
|
||||
.rgb_endian = LCD_RGB_ENDIAN_BGR,
|
||||
.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB,
|
||||
.bits_per_pixel = 16,
|
||||
};
|
||||
// Initialize the LCD configuration
|
||||
@@ -148,6 +148,7 @@ void app_main(void)
|
||||
|
||||
// Turn on the screen
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_handle, true));
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_invert_color(panel_handle, true));
|
||||
|
||||
// Swap x and y axis (Different LCD screens may need different options)
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, true));
|
||||
|
Reference in New Issue
Block a user