68 lines
2.3 KiB
C
68 lines
2.3 KiB
C
#ifndef _BOARD_CONFIG_H_
|
|
#define _BOARD_CONFIG_H_
|
|
|
|
// Borla S3 (esp-spot-s3) Board Configuration
|
|
// Source: xiaozhi-esp32/main/boards/esp-spot-s3/config.h
|
|
|
|
#include <driver/gpio.h>
|
|
|
|
// Audio sample rates
|
|
#define AUDIO_INPUT_SAMPLE_RATE 16000
|
|
#define AUDIO_OUTPUT_SAMPLE_RATE 16000
|
|
#define AUDIO_INPUT_REFERENCE false
|
|
|
|
// I2S GPIO — 注意: 不使用 MCLK
|
|
#define AUDIO_I2S_GPIO_MCLK GPIO_NUM_NC
|
|
#define AUDIO_I2S_GPIO_WS GPIO_NUM_17
|
|
#define AUDIO_I2S_GPIO_BCLK GPIO_NUM_16
|
|
#define AUDIO_I2S_GPIO_DIN GPIO_NUM_15
|
|
#define AUDIO_I2S_GPIO_DOUT GPIO_NUM_18
|
|
|
|
// ES8311 Codec I2C
|
|
#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
|
|
|
|
// NS4150B PA enable
|
|
#define AUDIO_CODEC_PA_PIN GPIO_NUM_40
|
|
// #define AUDIO_CODEC_PA_PIN GPIO_NUM_NC
|
|
|
|
// 4G ML307 UART
|
|
// Note: Despite the confusing naming in xiaozhi reference,
|
|
// ML307_TX_PIN = ESP32's TX pin (sends AT commands to ML307)
|
|
// ML307_RX_PIN = ESP32's RX pin (receives responses from ML307)
|
|
#define ML307_TX_PIN GPIO_NUM_43
|
|
#define ML307_RX_PIN GPIO_NUM_44
|
|
#define ML307_DTR_PIN GPIO_NUM_NC
|
|
|
|
// Buttons
|
|
#define BOOT_BUTTON_GPIO GPIO_NUM_0
|
|
#define KEY_BUTTON_GPIO GPIO_NUM_12
|
|
#define POWER_BUTTON_GPIO KEY_BUTTON_GPIO
|
|
|
|
// WS2812E RGB LED
|
|
#define LED_PIN GPIO_NUM_11
|
|
|
|
// Touch buttons — logical touch_1..touch_5 must match server semantics:
|
|
// touch_1=head, touch_2=back, touch_3=right hand, touch_4=left hand, touch_5=belly.
|
|
// GPIO order below follows the actual doll harness.
|
|
#define TOUCH_BUTTON_1 GPIO_NUM_3
|
|
#define TOUCH_BUTTON_2 GPIO_NUM_9
|
|
#define TOUCH_BUTTON_3 GPIO_NUM_13
|
|
#define TOUCH_BUTTON_4 GPIO_NUM_7
|
|
#define TOUCH_BUTTON_5 GPIO_NUM_8
|
|
|
|
// Battery ADC — 1S Li-ion cell, 3.7V nominal / 1000mAh / 3.7Wh
|
|
#define VBAT_ADC_CHANNEL ADC_CHANNEL_9 // GPIO10
|
|
#define FULL_BATTERY_VOLTAGE 4200 // CV cutoff (fully charged)
|
|
#define EMPTY_BATTERY_VOLTAGE 3000 // discharge cutoff (protect cell)
|
|
|
|
// Power control
|
|
#define MCU_VCC_CTL GPIO_NUM_4
|
|
#define PERP_VCC_CTL GPIO_NUM_6
|
|
|
|
// Board name
|
|
#define BOARD_NAME "borla-s3"
|
|
|
|
#endif // _BOARD_CONFIG_H_
|