-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Add support for Waveshare ESP32-S3-ePaper-1.54 board #1375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DrayxR3X
wants to merge
2
commits into
78:main
Choose a base branch
from
DrayxR3X:waveshare-s3-epaper-1.54
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # 产品链接 | ||
|
|
||
| [微雪电子 ESP32-S3-ePaper-1.54](https://www.waveshare.net/shop/ESP32-S3-ePaper-1.54.htm) | ||
|
|
||
| # 编译配置命令 | ||
|
|
||
| **克隆工程** | ||
|
|
||
| ```bash | ||
| git clone https://github.com/78/xiaozhi-esp32.git | ||
| ``` | ||
|
|
||
| **进入工程** | ||
|
|
||
| ```bash | ||
| cd xiaozhi-esp32 | ||
| ``` | ||
|
|
||
| **配置编译目标为 ESP32S3** | ||
|
|
||
| ```bash | ||
| idf.py set-target esp32s3 | ||
| ``` | ||
|
|
||
| **打开 menuconfig** | ||
|
|
||
| ```bash | ||
| idf.py menuconfig | ||
| ``` | ||
|
|
||
| **选择板子** | ||
|
|
||
| ```bash | ||
| Xiaozhi Assistant -> Board Type -> Waveshare ESP32-S3-ePaper-1.54 | ||
| ``` | ||
|
|
||
| **编译** | ||
|
|
||
| ```ba | ||
| idf.py build | ||
| ``` | ||
|
|
||
| **下载并打开串口终端** | ||
|
|
||
| ```bash | ||
| idf.py build flash monitor | ||
| ``` | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| #include <stdio.h> | ||
| #include "freertos/FreeRTOS.h" | ||
| #include "board_power_bsp.h" | ||
| #include "driver/gpio.h" | ||
|
|
||
| void board_power_bsp::Pwoer_led_Task(void *arg) { | ||
| gpio_config_t gpio_conf = {}; | ||
| gpio_conf.intr_type = GPIO_INTR_DISABLE; | ||
| gpio_conf.mode = GPIO_MODE_OUTPUT; | ||
| gpio_conf.pin_bit_mask = (0x1ULL << GPIO_NUM_3); | ||
| gpio_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; | ||
| gpio_conf.pull_up_en = GPIO_PULLUP_ENABLE; | ||
| ESP_ERROR_CHECK_WITHOUT_ABORT(gpio_config(&gpio_conf)); | ||
| for(;;) { | ||
| gpio_set_level(GPIO_NUM_3,0); | ||
| vTaskDelay(pdMS_TO_TICKS(200)); | ||
| gpio_set_level(GPIO_NUM_3,1); | ||
| vTaskDelay(pdMS_TO_TICKS(200)); | ||
| } | ||
| } | ||
|
|
||
| board_power_bsp::board_power_bsp(uint8_t _epd_power_pin,uint8_t _audio_power_pin,uint8_t _vbat_power_pin) : | ||
| epd_power_pin(_epd_power_pin), | ||
| audio_power_pin(_audio_power_pin), | ||
| vbat_power_pin(_vbat_power_pin) { | ||
| gpio_config_t gpio_conf = {}; | ||
| gpio_conf.intr_type = GPIO_INTR_DISABLE; | ||
| gpio_conf.mode = GPIO_MODE_OUTPUT; | ||
| gpio_conf.pin_bit_mask = (0x1ULL << epd_power_pin) | (0x1ULL << audio_power_pin) | (0x1ULL << vbat_power_pin); | ||
| gpio_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; | ||
| gpio_conf.pull_up_en = GPIO_PULLUP_ENABLE; | ||
| ESP_ERROR_CHECK_WITHOUT_ABORT(gpio_config(&gpio_conf)); | ||
| xTaskCreatePinnedToCore(Pwoer_led_Task, "Pwoer_led_Task", 3 * 1024, NULL , 2, NULL,0); | ||
| } | ||
|
|
||
| board_power_bsp::~board_power_bsp() { | ||
|
|
||
| } | ||
|
|
||
| void board_power_bsp::POWEER_EPD_ON() { | ||
| gpio_set_level((gpio_num_t)epd_power_pin,0); | ||
| } | ||
|
|
||
| void board_power_bsp::POWEER_EPD_OFF() { | ||
| gpio_set_level((gpio_num_t)epd_power_pin,1); | ||
| } | ||
|
|
||
| void board_power_bsp::POWEER_Audio_ON() { | ||
| gpio_set_level((gpio_num_t)audio_power_pin,0); | ||
| } | ||
|
|
||
| void board_power_bsp::POWEER_Audio_OFF() { | ||
| gpio_set_level((gpio_num_t)audio_power_pin,1); | ||
| } | ||
|
|
||
| void board_power_bsp::VBAT_POWER_ON() { | ||
| gpio_set_level((gpio_num_t)vbat_power_pin,1); | ||
| } | ||
|
|
||
| void board_power_bsp::VBAT_POWER_OFF() { | ||
| gpio_set_level((gpio_num_t)vbat_power_pin,0); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #ifndef __BOARD_POWER_BSP_H__ | ||
| #define __BOARD_POWER_BSP_H__ | ||
|
|
||
|
|
||
| class board_power_bsp | ||
| { | ||
| private: | ||
| const uint8_t epd_power_pin; | ||
| const uint8_t audio_power_pin; | ||
| const uint8_t vbat_power_pin; | ||
|
|
||
| static void Pwoer_led_Task(void *arg); | ||
|
|
||
| public: | ||
| board_power_bsp(uint8_t _epd_power_pin,uint8_t _audio_power_pin,uint8_t _vbat_power_pin); | ||
| ~board_power_bsp(); | ||
|
|
||
| void POWEER_EPD_ON(); | ||
| void POWEER_EPD_OFF(); | ||
| void POWEER_Audio_ON(); | ||
| void POWEER_Audio_OFF(); | ||
| void VBAT_POWER_ON(); | ||
| void VBAT_POWER_OFF(); | ||
| }; | ||
|
|
||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| #ifndef _BOARD_CONFIG_H_ | ||
| #define _BOARD_CONFIG_H_ | ||
|
|
||
| #include <driver/gpio.h> | ||
|
|
||
| #define AUDIO_INPUT_SAMPLE_RATE 24000 | ||
| #define AUDIO_OUTPUT_SAMPLE_RATE 24000 | ||
|
|
||
| #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_14 | ||
| #define AUDIO_I2S_GPIO_WS GPIO_NUM_38 | ||
| #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_15 | ||
| #define AUDIO_I2S_GPIO_DIN GPIO_NUM_16 | ||
| #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_45 | ||
|
|
||
| #define AUDIO_CODEC_PA_PIN GPIO_NUM_46 | ||
| #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_47 | ||
| #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_48 | ||
| #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR | ||
|
|
||
| #define BOOT_BUTTON_GPIO GPIO_NUM_0 | ||
| #define VBAT_PWR_GPIO GPIO_NUM_18 | ||
|
|
||
| /*EPD port Init*/ | ||
| #define EPD_SPI_NUM SPI3_HOST | ||
|
|
||
| #define EPD_DC_PIN GPIO_NUM_10 | ||
| #define EPD_CS_PIN GPIO_NUM_11 | ||
| #define EPD_SCK_PIN GPIO_NUM_12 | ||
| #define EPD_MOSI_PIN GPIO_NUM_13 | ||
| #define EPD_RST_PIN GPIO_NUM_9 | ||
| #define EPD_BUSY_PIN GPIO_NUM_8 | ||
|
|
||
| #define EXAMPLE_LCD_WIDTH 200 | ||
| #define EXAMPLE_LCD_HEIGHT 200 | ||
|
|
||
| /*DEV POWER init*/ | ||
| #define EPD_PWR_PIN GPIO_NUM_6 | ||
| #define Audio_PWR_PIN GPIO_NUM_42 | ||
| #define VBAT_PWR_PIN GPIO_NUM_17 | ||
|
|
||
| #define DISPLAY_MIRROR_X false | ||
| #define DISPLAY_MIRROR_Y false | ||
| #define DISPLAY_SWAP_XY false | ||
|
|
||
| #define DISPLAY_OFFSET_X 0 | ||
| #define DISPLAY_OFFSET_Y 0 | ||
|
|
||
|
|
||
|
|
||
| #endif // _BOARD_CONFIG_H_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "target": "esp32s3", | ||
| "builds": [ | ||
| { | ||
| "name": "waveshare-s3-epaper-1.54", | ||
| "sdkconfig_append": [ | ||
| "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=partitions/v2/8m.csv", | ||
| "CONFIG_ESPTOOLPY_FLASHSIZE=8MB" | ||
| ] | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个类的类名,构造函数的参数, 以及方法名,需要统一 Google C++ 代码风格。