Initial commit
This commit is contained in:
82
main/boards/esp-vocat/README.md
Normal file
82
main/boards/esp-vocat/README.md
Normal file
@@ -0,0 +1,82 @@
|
||||
# ESP-VoCat 喵伴
|
||||
|
||||
## 简介
|
||||
|
||||
<div align="center">
|
||||
<a href="https://oshwhub.com/esp-college/echoear"><b> 立创开源平台 </b></a>
|
||||
</div>
|
||||
|
||||
ESP-VoCat 喵伴是一款智能 AI 开发套件,搭载 ESP32-S3-WROOM-1 模组,1.85 寸 QSPI 圆形触摸屏,双麦阵列,支持离线语音唤醒与声源定位算法。硬件详情等可查看[立创开源项目](https://oshwhub.com/esp-college/echoear)。
|
||||
|
||||
## 配置、编译命令
|
||||
|
||||
**配置编译目标为 ESP32S3**
|
||||
|
||||
```bash
|
||||
idf.py set-target esp32s3
|
||||
```
|
||||
|
||||
**打开 menuconfig 并配置**
|
||||
|
||||
```bash
|
||||
idf.py menuconfig
|
||||
```
|
||||
|
||||
分别配置如下选项:
|
||||
|
||||
### 基本配置
|
||||
- `Xiaozhi Assistant` → `Board Type` → 选择 `Espressif ESP-VoCat`
|
||||
|
||||
### UI风格选择
|
||||
|
||||
ESP-VoCat 支持多种不同的 UI 显示风格,通过 menuconfig 配置选择:
|
||||
|
||||
- `Xiaozhi Assistant` → `Select display style` → 选择显示风格
|
||||
|
||||
#### 可选风格
|
||||
|
||||
##### 表情动画风格 (Emote animation style) - 推荐
|
||||
- **配置选项**: `USE_EMOTE_MESSAGE_STYLE`
|
||||
- **特点**: 使用自定义的 `EmoteDisplay` 表情显示系统
|
||||
- **功能**: 支持丰富的表情动画、眼睛动画、状态图标显示
|
||||
- **适用**: 智能助手场景,提供更生动的人机交互体验
|
||||
- **类**: `emote::EmoteDisplay`
|
||||
|
||||
**⚠️ 重要**: 选择此风格需要额外配置自定义资源文件:
|
||||
1. `Xiaozhi Assistant` → `Flash Assets` → 选择 `Flash Custom Assets`
|
||||
2. `Xiaozhi Assistant` → `Custom Assets File` → 填入资源文件地址:
|
||||
```
|
||||
https://dl.espressif.com/AE/wn9_nihaoxiaozhi_tts-font_puhui_common_20_4-echoear.bin
|
||||
```
|
||||
|
||||
##### 默认消息风格 (Enable default message style)
|
||||
- **配置选项**: `USE_DEFAULT_MESSAGE_STYLE` (默认)
|
||||
- **特点**: 使用标准的消息显示界面
|
||||
- **功能**: 传统的文本和图标显示界面
|
||||
- **适用**: 标准的对话场景
|
||||
- **类**: `SpiLcdDisplay`
|
||||
|
||||
##### 微信消息风格 (Enable WeChat Message Style)
|
||||
- **配置选项**: `USE_WECHAT_MESSAGE_STYLE`
|
||||
- **特点**: 仿微信聊天界面风格
|
||||
- **功能**: 类似微信的消息气泡显示
|
||||
- **适用**: 喜欢微信风格的用户
|
||||
- **类**: `SpiLcdDisplay`
|
||||
|
||||
> **说明**: ESP-VoCat 喵伴使用16MB Flash,需要使用专门的分区表配置来合理分配存储空间给应用程序、OTA更新、资源文件等。
|
||||
|
||||
按 `S` 保存,按 `Q` 退出。
|
||||
|
||||
**编译**
|
||||
|
||||
```bash
|
||||
idf.py build
|
||||
```
|
||||
|
||||
**烧录**
|
||||
|
||||
将 ESP-VoCat 喵伴连接至电脑,**注意打开电源**,并运行:
|
||||
|
||||
```bash
|
||||
idf.py flash
|
||||
```
|
||||
88
main/boards/esp-vocat/config.h
Normal file
88
main/boards/esp-vocat/config.h
Normal file
@@ -0,0 +1,88 @@
|
||||
#ifndef _BOARD_CONFIG_H_
|
||||
#define _BOARD_CONFIG_H_
|
||||
|
||||
#include <driver/gpio.h>
|
||||
#include <driver/uart.h>
|
||||
#include <driver/spi_master.h>
|
||||
|
||||
#define AUDIO_INPUT_SAMPLE_RATE 24000
|
||||
#define AUDIO_OUTPUT_SAMPLE_RATE 24000
|
||||
#define AUDIO_INPUT_REFERENCE true
|
||||
|
||||
#define CORDEC_POWER_CTRL GPIO_NUM_48
|
||||
|
||||
#define POWER_CTRL GPIO_NUM_9
|
||||
#define LED_G GPIO_NUM_43
|
||||
#define SD_MISO GPIO_NUM_17
|
||||
#define SD_SCK GPIO_NUM_16
|
||||
#define SD_MOSI GPIO_NUM_38
|
||||
|
||||
#define AUDIO_I2S_GPIO_MCLK GPIO_NUM_42
|
||||
#define AUDIO_I2S_GPIO_WS GPIO_NUM_39
|
||||
#define AUDIO_I2S_GPIO_BCLK GPIO_NUM_40
|
||||
#define AUDIO_I2S_GPIO_DIN_1 GPIO_NUM_15
|
||||
#define AUDIO_I2S_GPIO_DIN_2 GPIO_NUM_3
|
||||
#define AUDIO_I2S_GPIO_DOUT GPIO_NUM_41
|
||||
|
||||
#define AUDIO_CODEC_PA_PIN_1 GPIO_NUM_4
|
||||
#define AUDIO_CODEC_PA_PIN_2 GPIO_NUM_15
|
||||
#define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_2
|
||||
#define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_1
|
||||
#define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR
|
||||
#define AUDIO_CODEC_ES7210_ADDR ES7210_CODEC_DEFAULT_ADDR
|
||||
|
||||
#define BUILTIN_LED_GPIO GPIO_NUM_NC
|
||||
#define BOOT_BUTTON_GPIO GPIO_NUM_0
|
||||
#define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC
|
||||
#define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC
|
||||
|
||||
#define DISPLAY_WIDTH 360
|
||||
#define DISPLAY_HEIGHT 360
|
||||
#define DISPLAY_MIRROR_X false
|
||||
#define DISPLAY_MIRROR_Y false
|
||||
#define DISPLAY_SWAP_XY false
|
||||
|
||||
#define QSPI_LCD_H_RES (360)
|
||||
#define QSPI_LCD_V_RES (360)
|
||||
#define QSPI_LCD_BIT_PER_PIXEL (16)
|
||||
|
||||
#define QSPI_LCD_HOST SPI2_HOST
|
||||
#define QSPI_PIN_NUM_LCD_PCLK GPIO_NUM_18
|
||||
#define QSPI_PIN_NUM_LCD_CS GPIO_NUM_14
|
||||
#define QSPI_PIN_NUM_LCD_DATA0 GPIO_NUM_46
|
||||
#define QSPI_PIN_NUM_LCD_DATA1 GPIO_NUM_13
|
||||
#define QSPI_PIN_NUM_LCD_DATA2 GPIO_NUM_11
|
||||
#define QSPI_PIN_NUM_LCD_DATA3 GPIO_NUM_12
|
||||
#define QSPI_PIN_NUM_LCD_RST_1 GPIO_NUM_3
|
||||
#define QSPI_PIN_NUM_LCD_RST_2 GPIO_NUM_47
|
||||
#define QSPI_PIN_NUM_LCD_BL GPIO_NUM_44
|
||||
|
||||
#define UART1_TX_1 GPIO_NUM_6
|
||||
#define UART1_TX_2 GPIO_NUM_5
|
||||
#define UART1_RX_1 GPIO_NUM_5
|
||||
#define UART1_RX_2 GPIO_NUM_4
|
||||
#define TOUCH_PAD2_1 GPIO_NUM_NC
|
||||
#define TOUCH_PAD2_2 GPIO_NUM_6
|
||||
#define TOUCH_PAD1 GPIO_NUM_7
|
||||
|
||||
#define DISPLAY_OFFSET_X 0
|
||||
#define DISPLAY_OFFSET_Y 0
|
||||
|
||||
#define TP_PORT (I2C_NUM_1)
|
||||
#define TP_PIN_NUM_RST (GPIO_NUM_NC)
|
||||
#define TP_PIN_NUM_INT (GPIO_NUM_10)
|
||||
|
||||
#define DISPLAY_BACKLIGHT_PIN QSPI_PIN_NUM_LCD_BL
|
||||
#define DISPLAY_BACKLIGHT_OUTPUT_INVERT false
|
||||
|
||||
#define TAIJIPI_ST77916_PANEL_BUS_QSPI_CONFIG(sclk, d0, d1, d2, d3, max_trans_sz) \
|
||||
{ \
|
||||
.data0_io_num = d0, \
|
||||
.data1_io_num = d1, \
|
||||
.sclk_io_num = sclk, \
|
||||
.data2_io_num = d2, \
|
||||
.data3_io_num = d3, \
|
||||
.max_transfer_sz = max_trans_sz, \
|
||||
}
|
||||
|
||||
#endif // _BOARD_CONFIG_H_
|
||||
13
main/boards/esp-vocat/config.json
Normal file
13
main/boards/esp-vocat/config.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "esp-vocat",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_USE_EMOTE_MESSAGE_STYLE=y",
|
||||
"CONFIG_MMAP_FILE_NAME_LENGTH=32",
|
||||
"CONFIG_FLASH_EXPRESSION_ASSETS=y"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
1017
main/boards/esp-vocat/esp_vocat.cc
Normal file
1017
main/boards/esp-vocat/esp_vocat.cc
Normal file
File diff suppressed because it is too large
Load Diff
51
main/boards/esp-vocat/touch.h
Normal file
51
main/boards/esp-vocat/touch.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief BSP Touchscreen
|
||||
*
|
||||
* This file offers API for basic touchscreen initialization.
|
||||
* It is useful for users who want to use the touchscreen without the default Graphical Library LVGL.
|
||||
*
|
||||
* For standard LCD initialization with LVGL graphical library, you can call all-in-one function bsp_display_start().
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "esp_lcd_touch.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief BSP touch configuration structure
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
void *dummy; /*!< Prepared for future use. */
|
||||
} bsp_touch_config_t;
|
||||
|
||||
/**
|
||||
* @brief Create new touchscreen
|
||||
*
|
||||
* If you want to free resources allocated by this function, you can use esp_lcd_touch API, ie.:
|
||||
*
|
||||
* \code{.c}
|
||||
* esp_lcd_touch_del(tp);
|
||||
* \endcode
|
||||
*
|
||||
* @param[in] config touch configuration
|
||||
* @param[out] ret_touch esp_lcd_touch touchscreen handle
|
||||
* @return
|
||||
* - ESP_OK On success
|
||||
* - Else esp_lcd_touch failure
|
||||
*/
|
||||
esp_err_t bsp_touch_new(const bsp_touch_config_t *config, esp_lcd_touch_handle_t *ret_touch);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user