Skip to content

Commit 9cbc4c4

Browse files
Merge pull request #16 from Y1hsiaochunnn/master
Update ESP32-P4-NANO BSP to add screen adaptation
2 parents 84ab1ae + 3d23e05 commit 9cbc4c4

File tree

5 files changed

+36
-28
lines changed

5 files changed

+36
-28
lines changed

bsp/esp32_p4_nano/esp32_p4_nano.c

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ esp_err_t bsp_display_brightness_set(int brightness_percent)
337337
#if CONFIG_BSP_LCD_TYPE_800_1280_10_1_INCH
338338
uint8_t data_addr = 0x86;
339339
uint8_t data_to_send[2] = {data_addr, data};
340-
#elif CONFIG_BSP_LCD_TYPE_800_1280_10_1_INCH_A || CONFIG_BSP_LCD_TYPE_800_1280_8_INCH_A || CONFIG_BSP_LCD_TYPE_720_1280_7_INCH_A
340+
#elif CONFIG_BSP_LCD_TYPE_800_1280_10_1_INCH_A || CONFIG_BSP_LCD_TY9PE_800_1280_8_INCH_A || CONFIG_BSP_LCD_TYPE_720_1280_7_INCH_A
341341
uint8_t data_addr = 0x96;
342342
uint8_t data_to_send[2] = {data_addr, data};
343343
#else
@@ -506,9 +506,9 @@ esp_err_t bsp_display_new_with_handles(const bsp_display_config_t *config, bsp_l
506506
ESP_LOGI(TAG, "Install Waveshare 7-DSI-TOUCH-A LCD control panel");
507507

508508
#if CONFIG_BSP_LCD_COLOR_FORMAT_RGB888
509-
esp_lcd_dpi_panel_config_t dpi_config = ILI9881C_800_1280_PANEL_60HZ_DPI_CONFIG(LCD_COLOR_PIXEL_FORMAT_RGB888);
509+
esp_lcd_dpi_panel_config_t dpi_config = ILI9881C_720_1280_PANEL_60HZ_DPI_CONFIG(LCD_COLOR_PIXEL_FORMAT_RGB888);
510510
#else
511-
esp_lcd_dpi_panel_config_t dpi_config = ILI9881C_800_1280_PANEL_60HZ_DPI_CONFIG(LCD_COLOR_PIXEL_FORMAT_RGB565);
511+
esp_lcd_dpi_panel_config_t dpi_config = ILI9881C_720_1280_PANEL_60HZ_DPI_CONFIG(LCD_COLOR_PIXEL_FORMAT_RGB565);
512512
#endif
513513
dpi_config.num_fbs = CONFIG_BSP_LCD_DPI_BUFFER_NUMS;
514514

@@ -529,9 +529,10 @@ esp_err_t bsp_display_new_with_handles(const bsp_display_config_t *config, bsp_l
529529
.reset_gpio_num = BSP_LCD_RST,
530530
.vendor_config = &vendor_config,
531531
};
532-
ESP_GOTO_ON_ERROR(esp_lcd_new_panel_ili9881c(io, &lcd_dev_config, &disp_panel), err, TAG, "New LCD panel Waveshare failed");
532+
ESP_GOTO_ON_ERROR(esp_lcd_new_panel_ili9881c(io, &lcd_dev_config, &disp_panel), err, TAG, "New LCD panel ILI9881C failed");
533533
ESP_GOTO_ON_ERROR(esp_lcd_panel_reset(disp_panel), err, TAG, "LCD panel reset failed");
534534
ESP_GOTO_ON_ERROR(esp_lcd_panel_init(disp_panel), err, TAG, "LCD panel init failed");
535+
ESP_GOTO_ON_ERROR(esp_lcd_panel_disp_on_off(disp_panel, true), err, TAG, "LCD panel ON failed");
535536
#else
536537
ESP_LOGI(TAG, "Install Waveshare DSI LCD control panel");
537538
#if CONFIG_BSP_LCD_COLOR_FORMAT_RGB888
@@ -649,7 +650,7 @@ esp_err_t bsp_touch_new(const bsp_touch_config_t *config, esp_lcd_touch_handle_t
649650

650651
/* Initialize touch */
651652
const esp_lcd_touch_config_t tp_cfg = {
652-
#if CONFIG_BSP_LCD_TYPE_480_640_2_8_INCH || CONFIG_BSP_LCD_TYPE_480_800_4_INCH || CONFIG_BSP_LCD_TYPE_1024_600_5_INCH_C
653+
#if CONFIG_BSP_LCD_TYPE_480_640_2_8_INCH || CONFIG_BSP_LCD_TYPE_480_800_4_INCH
653654
.x_max = BSP_LCD_V_RES,
654655
.y_max = BSP_LCD_H_RES,
655656
#else
@@ -671,30 +672,14 @@ esp_err_t bsp_touch_new(const bsp_touch_config_t *config, esp_lcd_touch_handle_t
671672
.swap_xy = 0,
672673
.mirror_x = 0,
673674
.mirror_y = 0,
674-
#elif CONFIG_BSP_LCD_TYPE_720_1280_7_INCH_A
675-
.swap_xy = 0,
676-
.mirror_x = 0,
677-
.mirror_y = 0,
678675
#elif CONFIG_BSP_LCD_TYPE_480_640_2_8_INCH
679676
.swap_xy = 1,
680677
.mirror_x = 0,
681678
.mirror_y = 1,
682-
#elif CONFIG_BSP_LCD_TYPE_800_800_3_4_INCH_C
683-
.swap_xy = 0,
684-
.mirror_x = 0,
685-
.mirror_y = 0,
686-
#elif CONFIG_BSP_LCD_TYPE_720_720_4_INCH_C
687-
.swap_xy = 0,
688-
.mirror_x = 0,
689-
.mirror_y = 0,
690679
#elif CONFIG_BSP_LCD_TYPE_480_800_4_INCH
691680
.swap_xy = 1,
692681
.mirror_x = 1,
693682
.mirror_y = 0,
694-
#elif CONFIG_BSP_LCD_TYPE_1024_600_5_INCH_C
695-
.swap_xy = 1,
696-
.mirror_x = 1,
697-
.mirror_y = 1,
698683
#else
699684
.swap_xy = 0,
700685
.mirror_x = 0,

bsp/esp32_p4_nano/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ tags:
2323
targets:
2424
- esp32p4
2525
url: https://www.waveshare.com/esp32-p4-nano.htm
26-
version: 1.1.3
26+
version: 1.1.4

bsp/esp32_p4_nano/include/bsp/display.h

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,62 +23,78 @@
2323
#if CONFIG_BSP_LCD_TYPE_800_1280_10_1_INCH
2424
#define BSP_LCD_H_RES (800)
2525
#define BSP_LCD_V_RES (1280)
26+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500)
2627
#elif CONFIG_BSP_LCD_TYPE_800_1280_10_1_INCH_A
2728
#define BSP_LCD_H_RES (800)
2829
#define BSP_LCD_V_RES (1280)
30+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500)
2931
#elif CONFIG_BSP_LCD_TYPE_800_1280_8_INCH_A
3032
#define BSP_LCD_H_RES (800)
3133
#define BSP_LCD_V_RES (1280)
34+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500)
3235
#elif CONFIG_BSP_LCD_TYPE_720_1280_7_INCH_A
3336
#define BSP_LCD_H_RES (720)
3437
#define BSP_LCD_V_RES (1280)
38+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1000)
3539
#elif CONFIG_BSP_LCD_TYPE_480_640_2_8_INCH
3640
#define BSP_LCD_H_RES (480)
3741
#define BSP_LCD_V_RES (640)
42+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500)
3843
#elif CONFIG_BSP_LCD_TYPE_800_800_3_4_INCH_C
3944
#define BSP_LCD_H_RES (800)
4045
#define BSP_LCD_V_RES (800)
46+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500)
4147
#elif CONFIG_BSP_LCD_TYPE_720_720_4_INCH_C
4248
#define BSP_LCD_H_RES (720)
4349
#define BSP_LCD_V_RES (720)
50+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500)
4451
#elif CONFIG_BSP_LCD_TYPE_480_800_4_INCH
4552
#define BSP_LCD_H_RES (480)
4653
#define BSP_LCD_V_RES (800)
54+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500)
4755
#elif CONFIG_BSP_LCD_TYPE_720_1280_5_INCH_D
4856
#define BSP_LCD_H_RES (720)
4957
#define BSP_LCD_V_RES (1280)
58+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500)
5059
#elif CONFIG_BSP_LCD_TYPE_720_1560_6_25_INCH
5160
#define BSP_LCD_H_RES (720)
5261
#define BSP_LCD_V_RES (1560)
62+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500)
5363
#elif CONFIG_BSP_LCD_TYPE_1024_600_5_INCH_C
5464
#define BSP_LCD_H_RES (1024)
5565
#define BSP_LCD_V_RES (600)
66+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500)
5667
#elif CONFIG_BSP_LCD_TYPE_1024_600_7_INCH_C
5768
#define BSP_LCD_H_RES (1024)
5869
#define BSP_LCD_V_RES (600)
70+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500)
5971
#elif CONFIG_BSP_LCD_TYPE_400_1280_7_9_INCH
6072
#define BSP_LCD_H_RES (400)
6173
#define BSP_LCD_V_RES (1280)
74+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1200)
6275
#elif CONFIG_BSP_LCD_TYPE_1280_800_7_INCH_E
6376
#define BSP_LCD_H_RES (1280)
6477
#define BSP_LCD_V_RES (800)
78+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1250)
6579
#elif CONFIG_BSP_LCD_TYPE_1280_800_8_INCH_C
6680
#define BSP_LCD_H_RES (1280)
6781
#define BSP_LCD_V_RES (800)
82+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1250)
6883
#elif CONFIG_BSP_LCD_TYPE_1280_800_10_1_INCH_C
6984
#define BSP_LCD_H_RES (1280)
7085
#define BSP_LCD_V_RES (800)
86+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1250)
7187
#elif CONFIG_BSP_LCD_TYPE_480_1920_8_8_INCH
7288
#define BSP_LCD_H_RES (480)
7389
#define BSP_LCD_V_RES (1920)
90+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500)
7491
#elif CONFIG_BSP_LCD_TYPE_320_1480_11_9_INCH
7592
#define BSP_LCD_H_RES (320)
7693
#define BSP_LCD_V_RES (1480)
94+
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500)
7795
#endif
7896

7997
#define BSP_LCD_MIPI_DSI_LANE_NUM (2) // 2 data lanes
80-
#define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (CONFIG_BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS) // 1Gbps
81-
8298
#define BSP_MIPI_DSI_PHY_PWR_LDO_CHAN (3) // LDO_VO3 is connected to VDD_MIPI_DPHY
8399
#define BSP_MIPI_DSI_PHY_PWR_LDO_VOLTAGE_MV (2500)
84100

display/lcd/esp_lcd_dsi/README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ You can add them to your project via `idf.py add-dependancy`, e.g.
2525
Alternatively, you can create `idf_component.yml`. More is
2626
in [Espressif's documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-component-manager.html).
2727

28-
* List of supported screens
28+
* List of supported screens (Recommendations)
2929

3030
| Product ID | Screen parameters | tested |
3131
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
@@ -38,8 +38,15 @@ in [Espressif's documentation](https://docs.espressif.com/projects/esp-idf/en/la
3838
| [5inch DSI LCD (C)](https://www.waveshare.com/5inch-dsi-lcd-c.htm) <br/><img style="width: 150px; height: auto; display: block; margin: 0 auto;" src="https://www.waveshare.com/media/catalog/product/cache/1/image/800x800/9df78eab33525d08d6e5fb8d27136e95/5/i/5inch-dsi-lcd-c-2.jpg"> | dpi_clock_freq_mhz=48<br/>h_size=1024<br/>v_size=600<br/>hsync_back_porch=100<br/>hsync_pulse_width=100<br/>hsync_front_porch=100<br/>vsync_back_porch=10<br/>vsync_pulse_width=10<br/>vsync_front_porch=10 | YES |
3939
| [7inch DSI LCD (C)](https://www.waveshare.com/7inch-dsi-lcd-c-with-case-a.htm) <br/><img style="width: 150px; height: auto; display: block; margin: 0 auto;" src="https://www.waveshare.com/media/catalog/product/cache/1/image/800x800/9df78eab33525d08d6e5fb8d27136e95/7/i/7inch-dsi-lcd-c-4.jpg"> | dpi_clock_freq_mhz=48<br/>h_size=1024<br/>v_size=600<br/>hsync_back_porch=100<br/>hsync_pulse_width=100<br/>hsync_front_porch=100<br/>vsync_back_porch=10<br/>vsync_pulse_width=10<br/>vsync_front_porch=10 | YES |
4040
| [7.9inch DSI LCD](https://www.waveshare.com/7.9inch-dsi-lcd.htm) <br/><img style="width: 150px; height: auto; display: block; margin: 0 auto;" src="https://www.waveshare.com/media/catalog/product/cache/1/image/800x800/9df78eab33525d08d6e5fb8d27136e95/7/_/7.9inch-dsi-lcd-2.jpg"> | dpi_clock_freq_mhz=48<br/>h_size=400<br/>v_size=1280<br/>hsync_back_porch=40<br/>hsync_pulse_width=30<br/>hsync_front_porch=40<br/>vsync_back_porch=20<br/>vsync_pulse_width=10<br/>vsync_front_porch=20 | YES |
41+
| [8.8inch DSI LCD](https://www.waveshare.com/8.8inch-dsi-lcd.htm) <br/><img style="width: 150px; height: auto; display: block; margin: 0 auto;" src="https://www.waveshare.com/media/catalog/product/cache/1/image/800x800/9df78eab33525d08d6e5fb8d27136e95/8/_/8.8inch-dsi-lcd-2.jpg"> | dpi_clock_freq_mhz=48<br/>h_size=480<br/>v_size=1920<br/>hsync_back_porch=50<br/>hsync_pulse_width=50<br/>hsync_front_porch=50<br/>vsync_back_porch=20<br/>vsync_pulse_width=20<br/>vsync_front_porch=20 | YES |
42+
| [11.9inch DSI LCD](https://www.waveshare.com/11.9inch-dsi-lcd.htm) <br/><img style="width: 150px; height: auto; display: block; margin: 0 auto;" src="https://www.waveshare.com/media/catalog/product/cache/1/image/800x800/9df78eab33525d08d6e5fb8d27136e95/1/1/11.9inch-dsi-lcd-3.jpg"> | dpi_clock_freq_mhz=48<br/>h_size=320<br/>v_size=1480<br/>hsync_back_porch=60<br/>hsync_pulse_width=60<br/>hsync_front_porch=60<br/>vsync_back_porch=60<br/>vsync_pulse_width=60<br/>vsync_front_porch=60 | YES |
43+
* List of supported screens (Not recommended)
44+
45+
| Product ID | Screen parameters | tested |
46+
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
4147
| [7inch DSI LCD (E)](https://www.waveshare.com/7inch-dsi-lcd-e.htm) <br/><img style="width: 150px; height: auto; display: block; margin: 0 auto;" src="https://www.waveshare.com/media/catalog/product/cache/1/image/800x800/9df78eab33525d08d6e5fb8d27136e95/7/i/7inch-dsi-lcd-e-2.jpg"> | dpi_clock_freq_mhz=80<br/>h_size=1280<br/>v_size=800<br/>hsync_back_porch=156<br/>hsync_pulse_width=40<br/>hsync_front_porch=20<br/>vsync_back_porch=48<br/>vsync_pulse_width=40<br/>vsync_front_porch=40 | YES |
4248
| [8inch DSI LCD (C)](https://www.waveshare.com/8inch-dsi-lcd-c.htm) <br/><img style="width: 150px; height: auto; display: block; margin: 0 auto;" src="https://www.waveshare.com/media/catalog/product/cache/1/image/800x800/9df78eab33525d08d6e5fb8d27136e95/8/i/8inch-dsi-lcd-c-2.jpg"> | dpi_clock_freq_mhz=80<br/>h_size=1280<br/>v_size=800<br/>hsync_back_porch=156<br/>hsync_pulse_width=40<br/>hsync_front_porch=20<br/>vsync_back_porch=48<br/>vsync_pulse_width=40<br/>vsync_front_porch=40 | YES |
4349
| [10.1inch DSI LCD (C)](https://www.waveshare.com/10.1inch-dsi-lcd-c.htm) <br/><img style="width: 150px; height: auto; display: block; margin: 0 auto;" src="https://www.waveshare.com/media/catalog/product/cache/1/image/800x800/9df78eab33525d08d6e5fb8d27136e95/1/0/10.1inch-dsi-lcd-c-2.jpg"> | dpi_clock_freq_mhz=80<br/>h_size=1280<br/>v_size=800<br/>hsync_back_porch=156<br/>hsync_pulse_width=40<br/>hsync_front_porch=20<br/>vsync_back_porch=48<br/>vsync_pulse_width=40<br/>vsync_front_porch=40 | YES |
44-
| [8.8inch DSI LCD](https://www.waveshare.com/8.8inch-dsi-lcd.htm) <br/><img style="width: 150px; height: auto; display: block; margin: 0 auto;" src="https://www.waveshare.com/media/catalog/product/cache/1/image/800x800/9df78eab33525d08d6e5fb8d27136e95/8/_/8.8inch-dsi-lcd-2.jpg"> | dpi_clock_freq_mhz=48<br/>h_size=480<br/>v_size=1920<br/>hsync_back_porch=50<br/>hsync_pulse_width=50<br/>hsync_front_porch=50<br/>vsync_back_porch=20<br/>vsync_pulse_width=20<br/>vsync_front_porch=20 | YES |
45-
| [11.9inch DSI LCD](https://www.waveshare.com/11.9inch-dsi-lcd.htm) <br/><img style="width: 150px; height: auto; display: block; margin: 0 auto;" src="https://www.waveshare.com/media/catalog/product/cache/1/image/800x800/9df78eab33525d08d6e5fb8d27136e95/1/1/11.9inch-dsi-lcd-3.jpg"> | dpi_clock_freq_mhz=48<br/>h_size=320<br/>v_size=1480<br/>hsync_back_porch=60<br/>hsync_pulse_width=60<br/>hsync_front_porch=60<br/>vsync_back_porch=60<br/>vsync_pulse_width=60<br/>vsync_front_porch=60 | YES |
50+
51+
## Touch resolution (to be added)
52+

display/lcd/esp_lcd_dsi/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.0.3"
1+
version: "1.0.4"
22
targets:
33
- esp32p4
44
description: "Waveshare DSI display driver, compatible with a variety of DSI displays"

0 commit comments

Comments
 (0)