Skip to content

Commit e6ed926

Browse files
committed
Add support for Waveshare ESP32-S3-ePaper-1.54 board
1 parent 43ef2f4 commit e6ed926

File tree

10 files changed

+818
-0
lines changed

10 files changed

+818
-0
lines changed

main/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ elseif(CONFIG_BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_3_5B)
264264
set(BUILTIN_TEXT_FONT font_puhui_basic_16_4)
265265
set(BUILTIN_ICON_FONT font_awesome_16_4)
266266
set(DEFAULT_EMOJI_COLLECTION twemoji_32)
267+
elseif(CONFIG_BOARD_TYPE_WAVESHARE_S3_ePaper_1_54)
268+
set(BOARD_TYPE "waveshare-s3-epaper-1.54")
269+
set(BUILTIN_TEXT_FONT font_puhui_basic_20_4)
270+
set(BUILTIN_ICON_FONT font_awesome_20_4)
267271
elseif(CONFIG_BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_3_49)
268272
set(BOARD_TYPE "waveshare-s3-touch-lcd-3.49")
269273
set(LVGL_TEXT_FONT font_puhui_basic_30_4)

main/Kconfig.projbuild

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ choice BOARD_TYPE
279279
config BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_3_5B
280280
bool "Waveshare ESP32-S3-Touch-LCD-3.5B"
281281
depends on IDF_TARGET_ESP32S3
282+
config BOARD_TYPE_WAVESHARE_S3_ePaper_1_54
283+
bool "Waveshare ESP32-S3-ePaper-1.54"
284+
depends on IDF_TARGET_ESP32S3
282285
config BOARD_TYPE_WAVESHARE_P4_NANO
283286
bool "Waveshare ESP32-P4-NANO"
284287
depends on IDF_TARGET_ESP32P4
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# 产品链接
2+
3+
[微雪电子 ESP32-S3-ePaper-1.54](https://www.waveshare.net/shop/ESP32-S3-ePaper-1.54.htm)
4+
5+
# 编译配置命令
6+
7+
**克隆工程**
8+
9+
```bash
10+
git clone https://github.com/78/xiaozhi-esp32.git
11+
```
12+
13+
**进入工程**
14+
15+
```bash
16+
cd xiaozhi-esp32
17+
```
18+
19+
**配置编译目标为 ESP32S3**
20+
21+
```bash
22+
idf.py set-target esp32s3
23+
```
24+
25+
**打开 menuconfig**
26+
27+
```bash
28+
idf.py menuconfig
29+
```
30+
31+
**选择板子**
32+
33+
```bash
34+
Xiaozhi Assistant -> Board Type -> Waveshare ESP32-S3-ePaper-1.54
35+
```
36+
37+
**编译**
38+
39+
```ba
40+
idf.py build
41+
```
42+
43+
**下载并打开串口终端**
44+
45+
```bash
46+
idf.py build flash monitor
47+
```
48+
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#include <stdio.h>
2+
#include "freertos/FreeRTOS.h"
3+
#include "board_power_bsp.h"
4+
#include "driver/gpio.h"
5+
6+
void board_power_bsp::Pwoer_led_Task(void *arg) {
7+
gpio_config_t gpio_conf = {};
8+
gpio_conf.intr_type = GPIO_INTR_DISABLE;
9+
gpio_conf.mode = GPIO_MODE_OUTPUT;
10+
gpio_conf.pin_bit_mask = (0x1ULL << GPIO_NUM_3);
11+
gpio_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
12+
gpio_conf.pull_up_en = GPIO_PULLUP_ENABLE;
13+
ESP_ERROR_CHECK_WITHOUT_ABORT(gpio_config(&gpio_conf));
14+
for(;;) {
15+
gpio_set_level(GPIO_NUM_3,0);
16+
vTaskDelay(pdMS_TO_TICKS(200));
17+
gpio_set_level(GPIO_NUM_3,1);
18+
vTaskDelay(pdMS_TO_TICKS(200));
19+
}
20+
}
21+
22+
board_power_bsp::board_power_bsp(uint8_t _epd_power_pin,uint8_t _audio_power_pin,uint8_t _vbat_power_pin) :
23+
epd_power_pin(_epd_power_pin),
24+
audio_power_pin(_audio_power_pin),
25+
vbat_power_pin(_vbat_power_pin) {
26+
gpio_config_t gpio_conf = {};
27+
gpio_conf.intr_type = GPIO_INTR_DISABLE;
28+
gpio_conf.mode = GPIO_MODE_OUTPUT;
29+
gpio_conf.pin_bit_mask = (0x1ULL << epd_power_pin) | (0x1ULL << audio_power_pin) | (0x1ULL << vbat_power_pin);
30+
gpio_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
31+
gpio_conf.pull_up_en = GPIO_PULLUP_ENABLE;
32+
ESP_ERROR_CHECK_WITHOUT_ABORT(gpio_config(&gpio_conf));
33+
xTaskCreatePinnedToCore(Pwoer_led_Task, "Pwoer_led_Task", 3 * 1024, NULL , 2, NULL,0);
34+
}
35+
36+
board_power_bsp::~board_power_bsp() {
37+
38+
}
39+
40+
void board_power_bsp::POWEER_EPD_ON() {
41+
gpio_set_level((gpio_num_t)epd_power_pin,0);
42+
}
43+
44+
void board_power_bsp::POWEER_EPD_OFF() {
45+
gpio_set_level((gpio_num_t)epd_power_pin,1);
46+
}
47+
48+
void board_power_bsp::POWEER_Audio_ON() {
49+
gpio_set_level((gpio_num_t)audio_power_pin,0);
50+
}
51+
52+
void board_power_bsp::POWEER_Audio_OFF() {
53+
gpio_set_level((gpio_num_t)audio_power_pin,1);
54+
}
55+
56+
void board_power_bsp::VBAT_POWER_ON() {
57+
gpio_set_level((gpio_num_t)vbat_power_pin,1);
58+
}
59+
60+
void board_power_bsp::VBAT_POWER_OFF() {
61+
gpio_set_level((gpio_num_t)vbat_power_pin,0);
62+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#ifndef __BOARD_POWER_BSP_H__
2+
#define __BOARD_POWER_BSP_H__
3+
4+
5+
class board_power_bsp
6+
{
7+
private:
8+
const uint8_t epd_power_pin;
9+
const uint8_t audio_power_pin;
10+
const uint8_t vbat_power_pin;
11+
12+
static void Pwoer_led_Task(void *arg);
13+
14+
public:
15+
board_power_bsp(uint8_t _epd_power_pin,uint8_t _audio_power_pin,uint8_t _vbat_power_pin);
16+
~board_power_bsp();
17+
18+
void POWEER_EPD_ON();
19+
void POWEER_EPD_OFF();
20+
void POWEER_Audio_ON();
21+
void POWEER_Audio_OFF();
22+
void VBAT_POWER_ON();
23+
void VBAT_POWER_OFF();
24+
};
25+
26+
#endif
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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_14
10+
#define AUDIO_I2S_GPIO_WS GPIO_NUM_38
11+
#define AUDIO_I2S_GPIO_BCLK GPIO_NUM_15
12+
#define AUDIO_I2S_GPIO_DIN GPIO_NUM_16
13+
#define AUDIO_I2S_GPIO_DOUT GPIO_NUM_45
14+
15+
#define AUDIO_CODEC_PA_PIN GPIO_NUM_46
16+
#define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_47
17+
#define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_48
18+
#define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR
19+
20+
#define BOOT_BUTTON_GPIO GPIO_NUM_0
21+
#define VBAT_PWR_GPIO GPIO_NUM_18
22+
23+
/*EPD port Init*/
24+
#define EPD_SPI_NUM SPI3_HOST
25+
26+
#define EPD_DC_PIN GPIO_NUM_10
27+
#define EPD_CS_PIN GPIO_NUM_11
28+
#define EPD_SCK_PIN GPIO_NUM_12
29+
#define EPD_MOSI_PIN GPIO_NUM_13
30+
#define EPD_RST_PIN GPIO_NUM_9
31+
#define EPD_BUSY_PIN GPIO_NUM_8
32+
33+
#define EXAMPLE_LCD_WIDTH 200
34+
#define EXAMPLE_LCD_HEIGHT 200
35+
36+
/*DEV POWER init*/
37+
#define EPD_PWR_PIN GPIO_NUM_6
38+
#define Audio_PWR_PIN GPIO_NUM_42
39+
#define VBAT_PWR_PIN GPIO_NUM_17
40+
41+
#define DISPLAY_MIRROR_X false
42+
#define DISPLAY_MIRROR_Y false
43+
#define DISPLAY_SWAP_XY false
44+
45+
#define DISPLAY_OFFSET_X 0
46+
#define DISPLAY_OFFSET_Y 0
47+
48+
49+
50+
#endif // _BOARD_CONFIG_H_
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"target": "esp32s3",
3+
"builds": [
4+
{
5+
"name": "waveshare-s3-epaper-1.54",
6+
"sdkconfig_append": [
7+
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=partitions/v2/8m.csv",
8+
"CONFIG_ESPTOOLPY_FLASHSIZE=8MB"
9+
]
10+
}
11+
]
12+
}

0 commit comments

Comments
 (0)