Skip to content

Commit 8373a26

Browse files
authored
Add LILYGO T-Display-P4 board adaptation (#1269)
* Adapt for LilyGO-T-Circle-S3 device * Adapt for LilyGO-T-Circle-S3 device * Remove comments and modify the size of the lilygo-t-circle-s3 image * Modify the code style and format to Google C++ * Modify the code style and format to Google C++ * Fixed bugs in the LILYGO T-Circle-S3 board and added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY. * Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY. * Merge branch 'main' of https://github.com/Llgok/xiaozhi-esp32 * Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY. * Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY. * Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY. * Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY. * Fix the color display issue for T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY. * Update T-CameraPlus-S3_V1.2 Version Xiaozhi Example * Resolve the issue where the camera on the T-CameraPlus-S3_V1.2 board cannot be used normally. * Enhance microphone reception volume * fix the issue where voice wake-up is not working * fix the issue where voice wake-up is not working * Add LILYGO T-Display-P4 board adaptation
1 parent 6a28a98 commit 8373a26

File tree

11 files changed

+1696
-0
lines changed

11 files changed

+1696
-0
lines changed

main/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ elseif(CONFIG_BOARD_TYPE_LILYGO_T_DISPLAY_S3_PRO_MVSRLORA)
323323
set(BUILTIN_TEXT_FONT font_puhui_basic_20_4)
324324
set(BUILTIN_ICON_FONT font_awesome_20_4)
325325
set(DEFAULT_EMOJI_COLLECTION twemoji_64)
326+
elseif(CONFIG_BOARD_TYPE_LILYGO_T_DISPLAY_P4)
327+
set(BOARD_TYPE "lilygo-t-display-p4")
328+
set(BUILTIN_TEXT_FONT font_puhui_basic_30_4)
329+
set(BUILTIN_ICON_FONT font_awesome_30_4)
330+
set(DEFAULT_EMOJI_COLLECTION twemoji_64)
326331
elseif(CONFIG_BOARD_TYPE_MOVECALL_MOJI_ESP32S3)
327332
set(BOARD_TYPE "movecall-moji-esp32s3")
328333
set(BUILTIN_TEXT_FONT font_puhui_basic_20_4)

main/Kconfig.projbuild

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,9 @@ choice BOARD_TYPE
273273
config BOARD_TYPE_LILYGO_T_DISPLAY_S3_PRO_MVSRLORA_NO_BATTERY
274274
bool "LILYGO T-Display-S3-Pro-MVSRLora_No_Battery"
275275
depends on IDF_TARGET_ESP32S3
276+
config BOARD_TYPE_LILYGO_T_DISPLAY_P4
277+
bool "LILYGO T-Display-P4"
278+
depends on IDF_TARGET_ESP32P4
276279
config BOARD_TYPE_MOVECALL_MOJI_ESP32S3
277280
bool "Movecall Moji 小智AI衍生版"
278281
depends on IDF_TARGET_ESP32S3
@@ -385,6 +388,26 @@ choice BOARD_TYPE
385388
depends on IDF_TARGET_ESP32S3
386389
endchoice
387390

391+
choice
392+
depends on BOARD_TYPE_LILYGO_T_DISPLAY_P4
393+
prompt "Select the screen type"
394+
default SCREEN_TYPE_HI8561
395+
config SCREEN_TYPE_HI8561
396+
bool "HI8561"
397+
config SCREEN_TYPE_RM69A10
398+
bool "RM69A10"
399+
endchoice
400+
401+
choice
402+
depends on BOARD_TYPE_LILYGO_T_DISPLAY_P4
403+
prompt "Select the color format of the screen"
404+
default SCREEN_PIXEL_FORMAT_RGB565
405+
config SCREEN_PIXEL_FORMAT_RGB565
406+
bool "RGB565"
407+
config SCREEN_PIXEL_FORMAT_RGB888
408+
bool "RGB888"
409+
endchoice
410+
388411
choice ESP_S3_LCD_EV_Board_Version_TYPE
389412
depends on BOARD_TYPE_ESP_S3_LCD_EV_Board
390413
prompt "EV_BOARD Type"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## LILYGO T-Display-P4
2+
3+
The T-Display-P4 is a versatile development board based on the ESP32-P4 core. Its features include:
4+
5+
1. **High Processing Power**: Equipped with the high-performance ESP32-P4 core processor, it can handle more complex graphics and video tasks, delivering smoother display performance.
6+
2. **Low Power Design**: Offers multiple selectable power modes to effectively reduce energy consumption and extend battery life.
7+
3. **High-Resolution Display**: Supports high resolution (default with a large MIPI interface screen at 540x1168px), providing sharp and clear visuals.
8+
4. **Rich Peripheral Support**: Onboard peripherals include an HD MIPI touchscreen, ESP32-C6 module, speaker, microphone, LoRa module, GPS module, Ethernet, a linear vibration motor, an independent battery gauge for monitoring battery health and percentage, and an MIPI camera. Multiple GPIOs of both the ESP32-P4 and ESP32-C6 are exposed, enhancing the device's expandability.
9+
10+
Official github: [T-Display-P4](https://github.com/Xinyuan-LilyGO/T-Display-P4)
11+
12+
## Configuration
13+
14+
### ESP32P4 Configuration
15+
16+
* Set the compilation target to ESP32P4
17+
18+
idf.py set-target esp32p4
19+
20+
* Open menuconfig
21+
22+
idf.py menuconfig
23+
24+
* Select the board
25+
26+
Xiaozhi Assistant -> Board Type -> LILYGO T-Display-P4
27+
28+
* Select the screen type
29+
30+
Xiaozhi Assistant -> Select the screen type -> (Select the screen type you need to configure)
31+
32+
* Screen the screen pixel format
33+
34+
Xiaozhi Assistant -> Select the color format of the screen -> (Select the screen pixel format you need to configure)
35+
36+
* Build
37+
38+
idf.py build
39+
40+
### ESP32C6 Configuration
41+
42+
* Flash the slave example from the esp-hosted-mcu library for the target chip ESP32C6. The esp-hosted-mcu version must match the one used in the xiaozhi-esp32 library.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#ifndef _BOARD_CONFIG_H_
2+
#define _BOARD_CONFIG_H_
3+
4+
#include <driver/gpio.h>
5+
6+
#include "t_display_p4_config.h"
7+
8+
#if defined CONFIG_SCREEN_PIXEL_FORMAT_RGB565
9+
#define SCREEN_BITS_PER_PIXEL 16
10+
#define SCREEN_COLOR_RGB_PIXEL_FORMAT LCD_COLOR_PIXEL_FORMAT_RGB565
11+
#define LVGL_COLOR_FORMAT LV_COLOR_FORMAT_RGB565
12+
#elif defined CONFIG_SCREEN_PIXEL_FORMAT_RGB888
13+
#define SCREEN_BITS_PER_PIXEL 24
14+
#define SCREEN_COLOR_RGB_PIXEL_FORMAT LCD_COLOR_PIXEL_FORMAT_RGB888
15+
#define LVGL_COLOR_FORMAT LV_COLOR_FORMAT_RGB888
16+
#else
17+
#error "unknown macro definition, please select the correct macro definition."
18+
#endif
19+
20+
// SCREEN
21+
#if defined CONFIG_SCREEN_TYPE_HI8561
22+
#define SCREEN_WIDTH HI8561_SCREEN_WIDTH
23+
#define SCREEN_HEIGHT HI8561_SCREEN_HEIGHT
24+
#define SCREEN_MIPI_DSI_DPI_CLK_MHZ HI8561_SCREEN_MIPI_DSI_DPI_CLK_MHZ
25+
#define SCREEN_MIPI_DSI_HSYNC HI8561_SCREEN_MIPI_DSI_HSYNC
26+
#define SCREEN_MIPI_DSI_HBP HI8561_SCREEN_MIPI_DSI_HBP
27+
#define SCREEN_MIPI_DSI_HFP HI8561_SCREEN_MIPI_DSI_HFP
28+
#define SCREEN_MIPI_DSI_VSYNC HI8561_SCREEN_MIPI_DSI_VSYNC
29+
#define SCREEN_MIPI_DSI_VBP HI8561_SCREEN_MIPI_DSI_VBP
30+
#define SCREEN_MIPI_DSI_VFP HI8561_SCREEN_MIPI_DSI_VFP
31+
#define SCREEN_DATA_LANE_NUM HI8561_SCREEN_DATA_LANE_NUM
32+
#define SCREEN_LANE_BIT_RATE_MBPS HI8561_SCREEN_LANE_BIT_RATE_MBPS
33+
34+
#elif defined CONFIG_SCREEN_TYPE_RM69A10
35+
#define SCREEN_WIDTH RM69A10_SCREEN_WIDTH
36+
#define SCREEN_HEIGHT RM69A10_SCREEN_HEIGHT
37+
#define SCREEN_MIPI_DSI_DPI_CLK_MHZ RM69A10_SCREEN_MIPI_DSI_DPI_CLK_MHZ
38+
#define SCREEN_MIPI_DSI_HSYNC RM69A10_SCREEN_MIPI_DSI_HSYNC
39+
#define SCREEN_MIPI_DSI_HBP RM69A10_SCREEN_MIPI_DSI_HBP
40+
#define SCREEN_MIPI_DSI_HFP RM69A10_SCREEN_MIPI_DSI_HFP
41+
#define SCREEN_MIPI_DSI_VSYNC RM69A10_SCREEN_MIPI_DSI_VSYNC
42+
#define SCREEN_MIPI_DSI_VBP RM69A10_SCREEN_MIPI_DSI_VBP
43+
#define SCREEN_MIPI_DSI_VFP RM69A10_SCREEN_MIPI_DSI_VFP
44+
#define SCREEN_DATA_LANE_NUM RM69A10_SCREEN_DATA_LANE_NUM
45+
#define SCREEN_LANE_BIT_RATE_MBPS RM69A10_SCREEN_LANE_BIT_RATE_MBPS
46+
47+
#else
48+
#error "unknown macro definition, please select the correct macro definition."
49+
#endif
50+
51+
#define AUDIO_INPUT_SAMPLE_RATE 24000
52+
#define AUDIO_OUTPUT_SAMPLE_RATE 24000
53+
54+
#define AUDIO_INPUT_REFERENCE true
55+
56+
#define AUDIO_I2S_GPIO_MCLK static_cast<gpio_num_t>(ES8311_MCLK)
57+
#define AUDIO_I2S_GPIO_WS static_cast<gpio_num_t>(ES8311_WS_LRCK)
58+
#define AUDIO_I2S_GPIO_BCLK static_cast<gpio_num_t>(ES8311_BCLK)
59+
#define AUDIO_I2S_GPIO_DIN static_cast<gpio_num_t>(ES8311_ADC_DATA)
60+
#define AUDIO_I2S_GPIO_DOUT static_cast<gpio_num_t>(ES8311_DAC_DATA)
61+
62+
#define AUDIO_CODEC_PA_PIN GPIO_NUM_NC
63+
#define AUDIO_CODEC_I2C_SDA_PIN static_cast<gpio_num_t>(ES8311_SDA)
64+
#define AUDIO_CODEC_I2C_SCL_PIN static_cast<gpio_num_t>(ES8311_SCL)
65+
#define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR
66+
67+
#define BOOT_BUTTON_GPIO GPIO_NUM_35
68+
69+
#define SCREEN_SWAP_XY false
70+
#define SCREEN_MIRROR_X false
71+
#define SCREEN_MIRROR_Y false
72+
73+
#define SCREEN_OFFSET_X 0
74+
#define SCREEN_OFFSET_Y 0
75+
76+
#endif // _BOARD_CONFIG_H_

0 commit comments

Comments
 (0)