Skip to content

Commit 1c63934

Browse files
Adjust ESP32-P4 chip compatibility Add Waveshare ESP32-P4-NANO board support (#589)
* Added ESP32-P4 chip support * Add Waveshare ESP32-P4-NANO board support * Add Waveshare ESP32-P4-NANO board support * Add prefix "Waveshare" to waveshare products * Adjust the ESP32-P4-NANO README and fix the index link. * Update code style * Optimize code styles * Adjust to naming requirements * Adjust to naming requirements
1 parent 45c62f5 commit 1c63934

File tree

10 files changed

+426
-8
lines changed

10 files changed

+426
-8
lines changed

main/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ elseif(CONFIG_BOARD_TYPE_ESP32S3_Touch_LCD_1_46)
103103
set(BOARD_TYPE "esp32-s3-touch-lcd-1.46")
104104
elseif(CONFIG_BOARD_TYPE_ESP32S3_Touch_LCD_3_5)
105105
set(BOARD_TYPE "esp32-s3-touch-lcd-3.5")
106+
elseif(CONFIG_BOARD_TYPE_ESP32P4_NANO)
107+
set(BOARD_TYPE "waveshare-p4-nano")
106108
elseif(CONFIG_BOARD_TYPE_BREAD_COMPACT_WIFI_LCD)
107109
set(BOARD_TYPE "bread-compact-wifi-lcd")
108110
elseif(CONFIG_BOARD_TYPE_TUDOUZI)

main/Kconfig.projbuild

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ choice BOARD_TYPE
100100
bool "Waveshare ESP32-S3-Touch-LCD-1.46"
101101
config BOARD_TYPE_ESP32S3_Touch_LCD_3_5
102102
bool "Waveshare ESP32-S3-Touch-LCD-3.5"
103+
config BOARD_TYPE_ESP32P4_NANO
104+
bool "Waveshare ESP32-P4-NANO"
103105
config BOARD_TYPE_TUDOUZI
104106
bool "土豆子"
105107
config BOARD_TYPE_LILYGO_T_CIRCLE_S3
@@ -177,7 +179,7 @@ choice DISPLAY_OLED_TYPE
177179
endchoice
178180

179181
choice DISPLAY_LCD_TYPE
180-
depends on BOARD_TYPE_BREAD_COMPACT_WIFI_LCD || BOARD_TYPE_BREAD_COMPACT_ESP32_LCD || BOARD_TYPE_ESP32_CGC
182+
depends on BOARD_TYPE_BREAD_COMPACT_WIFI_LCD || BOARD_TYPE_BREAD_COMPACT_ESP32_LCD || BOARD_TYPE_ESP32_CGC || BOARD_TYPE_ESP32P4_NANO
181183
prompt "LCD Type"
182184
default LCD_ST7789_240X320
183185
help
@@ -212,6 +214,10 @@ choice DISPLAY_LCD_TYPE
212214
bool "ILI9341, 分辨率240*320, 非IPS"
213215
config LCD_GC9A01_240X240
214216
bool "GC9A01, 分辨率240*240, 圆屏"
217+
config LCD_TYPE_800_1280_10_1_INCH
218+
bool "Waveshare 101M-8001280-IPS-CT-K Display"
219+
config LCD_TYPE_800_1280_10_1_INCH_A
220+
bool "Waveshare 10.1-DSI-TOUCH-A Display"
215221
config LCD_CUSTOM
216222
bool "自定义屏幕参数"
217223
endchoice
@@ -237,14 +243,14 @@ config USE_WECHAT_MESSAGE_STYLE
237243
config USE_WAKE_WORD_DETECT
238244
bool "启用唤醒词检测"
239245
default y
240-
depends on IDF_TARGET_ESP32S3 && SPIRAM
246+
depends on IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4 && SPIRAM
241247
help
242248
需要 ESP32 S3 与 AFE 支持
243249

244250
config USE_AUDIO_PROCESSOR
245251
bool "启用音频降噪、增益处理"
246252
default y
247-
depends on IDF_TARGET_ESP32S3 && SPIRAM
253+
depends on IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4 && SPIRAM
248254
help
249255
需要 ESP32 S3 与 AFE 支持
250256

main/boards/esp32-s3-touch-amoled-1.8/esp32-s3-touch-amoled-1.8.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <esp_lvgl_port.h>
2626
#include <lvgl.h>
2727

28-
#define TAG "waveshare_amoled_1_8"
28+
#define TAG "WaveshareEsp32s3TouchAMOLED1inch8"
2929

3030
LV_FONT_DECLARE(font_puhui_30_4);
3131
LV_FONT_DECLARE(font_awesome_30_4);
@@ -122,7 +122,7 @@ class CustomBacklight : public Backlight {
122122
}
123123
};
124124

125-
class waveshare_amoled_1_8 : public WifiBoard {
125+
class WaveshareEsp32s3TouchAMOLED1inch8 : public WifiBoard {
126126
private:
127127
i2c_master_bus_handle_t codec_i2c_bus_;
128128
Pmic* pmic_ = nullptr;
@@ -298,7 +298,7 @@ class waveshare_amoled_1_8 : public WifiBoard {
298298
}
299299

300300
public:
301-
waveshare_amoled_1_8() :
301+
WaveshareEsp32s3TouchAMOLED1inch8() :
302302
boot_button_(BOOT_BUTTON_GPIO) {
303303
InitializePowerSaveTimer();
304304
InitializeCodecI2c();
@@ -347,4 +347,4 @@ class waveshare_amoled_1_8 : public WifiBoard {
347347
}
348348
};
349349

350-
DECLARE_BOARD(waveshare_amoled_1_8);
350+
DECLARE_BOARD(WaveshareEsp32s3TouchAMOLED1inch8);
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Waveshare ESP32-P4-NANO
2+
3+
4+
[ESP32-P4-NANO](https://www.waveshare.com/esp32-p4-nano.htm) is a small size and highly integrated development board designed by waveshare electronics based on ESP32-P4 chip
5+
6+
7+
8+
## Display Page
9+
10+
11+
### Recommended display screen
12+
13+
| Product ID | Dependency | tested |
14+
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------|--------|
15+
| [10.1-DSI-TOUCH-A](https://www.waveshare.com/10.1-dsi-touch-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/1/0/10.1-dsi-touch-a-1.jpg"> | [waveshare/esp_lcd_jd9365_10_1](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_jd9365_10_1) ||
16+
| [101M-8001280-IPS-CT-K](https://www.waveshare.com/101m-8001280-ips-ct-k.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/101m-8001280-ips-ct-k-1.jpg"> | [waveshare/esp_lcd_jd9365_10_1](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_jd9365_10_1) ||
17+
18+
### Common Raspberry adapter screen
19+
20+
**These displays are supported on [ESP32-P4-NANO BSP](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/bsp/esp32_p4_nano), but not on xiaozhi-esp32**
21+
22+
<details open>
23+
<summary>View full display</summary>
24+
25+
| Product ID | Dependency | tested |
26+
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------|--------|
27+
| [2.8inch DSI LCD](https://www.waveshare.com/2.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/thumbnail/122x122/9df78eab33525d08d6e5fb8d27136e95/2/_/2.8inch-dsi-lcd-3.jpg"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
28+
| [3.4inch DSI LCD (C)](https://www.waveshare.com/3.4inch-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/3/_/3.4inch-dsi-lcd-c-1.jpg"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
29+
| [4inch DSI LCD (C)](https://www.waveshare.com/4inch-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/4/i/4inch-dsi-lcd-c-1.jpg"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
30+
| [4inch DSI LCD](https://www.waveshare.com/4inch-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/4/i/4inch-dsi-lcd-1.jpg"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
31+
| [5inch DSI LCD (D)](https://www.waveshare.com/5inch-dsi-lcd-d.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-d-2.jpg"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
32+
| [6.25inch DSI LCD](https://www.waveshare.com/6.25inch-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/6/_/6.25inch-dsi-lcd-2.jpg"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
33+
| [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"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
34+
| [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"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
35+
| [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"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
36+
| [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"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
37+
| [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"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
38+
| [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"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
39+
| [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"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
40+
| [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"> | [waveshare/esp_lcd_dsi](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_dsi) | 🕒 |
41+
| [7-DSI-TOUCH-A](https://www.waveshare.com/7-dsi-touch-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/-/7-dsi-touch-a-1.jpg"> | [waveshare/esp_lcd_ili9881c](https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/lcd/esp_lcd_ili9881c) | 🕒 |
42+
43+
</details>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#ifndef _BOARD_CONFIG_H_
2+
#define _BOARD_CONFIG_H_
3+
4+
#include <driver/gpio.h>
5+
6+
#define AUDIO_INPUT_SAMPLE_RATE 24000
7+
#define AUDIO_OUTPUT_SAMPLE_RATE 24000
8+
9+
#define AUDIO_I2S_GPIO_MCLK GPIO_NUM_13
10+
#define AUDIO_I2S_GPIO_WS GPIO_NUM_10
11+
#define AUDIO_I2S_GPIO_BCLK GPIO_NUM_12
12+
#define AUDIO_I2S_GPIO_DIN GPIO_NUM_11
13+
#define AUDIO_I2S_GPIO_DOUT GPIO_NUM_9
14+
15+
#define AUDIO_CODEC_PA_PIN GPIO_NUM_53
16+
#define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_7
17+
#define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_8
18+
#define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR
19+
20+
#define BOOT_BUTTON_GPIO GPIO_NUM_35
21+
22+
#define DISPLAY_WIDTH 800
23+
#define DISPLAY_HEIGHT 1280
24+
25+
#define LCD_BIT_PER_PIXEL (16)
26+
#define PIN_NUM_LCD_RST GPIO_NUM_NC
27+
28+
#define DELAY_TIME_MS (3000)
29+
#define LCD_MIPI_DSI_LANE_NUM (2) // 2 data lanes
30+
31+
#define MIPI_DSI_PHY_PWR_LDO_CHAN (3)
32+
#define MIPI_DSI_PHY_PWR_LDO_VOLTAGE_MV (2500)
33+
34+
#define DISPLAY_SWAP_XY false
35+
#define DISPLAY_MIRROR_X false
36+
#define DISPLAY_MIRROR_Y false
37+
38+
#define DISPLAY_OFFSET_X 0
39+
#define DISPLAY_OFFSET_Y 0
40+
41+
#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_NC
42+
#define DISPLAY_BACKLIGHT_OUTPUT_INVERT false
43+
44+
#endif // _BOARD_CONFIG_H_
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"target": "esp32p4",
3+
"builds": [
4+
{
5+
"name": "waveshare-p4-nano",
6+
"sdkconfig_append": [
7+
"CONFIG_USE_WECHAT_MESSAGE_STYLE=y"
8+
]
9+
}
10+
]
11+
}

0 commit comments

Comments
 (0)