├── .github ├── ISSUE_TEMPLATE │ ├── 01_build_install_bug.yml │ ├── 02_runtime_bug.yml │ ├── 03_feature_request.yml │ └── config.yml └── workflows │ └── build.yml ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── README_en.md ├── README_ja.md ├── docs ├── mcp-based-graph.jpg ├── mcp-protocol.md ├── mcp-usage.md ├── v0 │ ├── AtomMatrix-echo-base.jpg │ ├── ESP32-BreadBoard.jpg │ ├── atoms3r-echo-base.jpg │ ├── esp32s3-box3.jpg │ ├── lichuang-s3.jpg │ ├── m5stack-cores3.jpg │ ├── magiclick-2p4.jpg │ ├── waveshare-esp32-s3-touch-amoled-1.8.jpg │ └── wiring.jpg ├── v1 │ ├── atoms3r.jpg │ ├── esp-hi.jpg │ ├── esp-sparkbot.jpg │ ├── espbox3.jpg │ ├── lichuang-s3.jpg │ ├── lilygo-t-circle-s3.jpg │ ├── m5cores3.jpg │ ├── magiclick.jpg │ ├── movecall-cuican-esp32s3.jpg │ ├── movecall-moji-esp32s3.jpg │ ├── sensecap_watcher.jpg │ ├── waveshare.jpg │ ├── wiring2.jpg │ ├── wmnologo_xingzhi_0.96.jpg │ ├── wmnologo_xingzhi_1.54.jpg │ └── xmini-c3.jpg └── websocket.md ├── main ├── CMakeLists.txt ├── Kconfig.projbuild ├── application.cc ├── application.h ├── assets │ ├── common │ │ ├── exclamation.p3 │ │ ├── low_battery.p3 │ │ ├── popup.p3 │ │ ├── success.p3 │ │ └── vibration.p3 │ ├── en-US │ │ ├── 0.p3 │ │ ├── 1.p3 │ │ ├── 2.p3 │ │ ├── 3.p3 │ │ ├── 4.p3 │ │ ├── 5.p3 │ │ ├── 6.p3 │ │ ├── 7.p3 │ │ ├── 8.p3 │ │ ├── 9.p3 │ │ ├── activation.p3 │ │ ├── err_pin.p3 │ │ ├── err_reg.p3 │ │ ├── language.json │ │ ├── upgrade.p3 │ │ ├── welcome.p3 │ │ └── wificonfig.p3 │ ├── ja-JP │ │ ├── 0.p3 │ │ ├── 1.p3 │ │ ├── 2.p3 │ │ ├── 3.p3 │ │ ├── 4.p3 │ │ ├── 5.p3 │ │ ├── 6.p3 │ │ ├── 7.p3 │ │ ├── 8.p3 │ │ ├── 9.p3 │ │ ├── activation.p3 │ │ ├── err_pin.p3 │ │ ├── err_reg.p3 │ │ ├── language.json │ │ ├── upgrade.p3 │ │ ├── welcome.p3 │ │ └── wificonfig.p3 │ ├── zh-CN │ │ ├── 0.p3 │ │ ├── 1.p3 │ │ ├── 2.p3 │ │ ├── 3.p3 │ │ ├── 4.p3 │ │ ├── 5.p3 │ │ ├── 6.p3 │ │ ├── 7.p3 │ │ ├── 8.p3 │ │ ├── 9.p3 │ │ ├── activation.p3 │ │ ├── err_pin.p3 │ │ ├── err_reg.p3 │ │ ├── language.json │ │ ├── upgrade.p3 │ │ ├── welcome.p3 │ │ └── wificonfig.p3 │ └── zh-TW │ │ ├── 0.p3 │ │ ├── 1.p3 │ │ ├── 2.p3 │ │ ├── 3.p3 │ │ ├── 4.p3 │ │ ├── 5.p3 │ │ ├── 6.p3 │ │ ├── 7.p3 │ │ ├── 8.p3 │ │ ├── 9.p3 │ │ ├── activation.p3 │ │ ├── err_pin.p3 │ │ ├── err_reg.p3 │ │ ├── language.json │ │ ├── upgrade.p3 │ │ ├── welcome.p3 │ │ └── wificonfig.p3 ├── audio_codecs │ ├── audio_codec.cc │ ├── audio_codec.h │ ├── box_audio_codec.cc │ ├── box_audio_codec.h │ ├── es8311_audio_codec.cc │ ├── es8311_audio_codec.h │ ├── es8374_audio_codec.cc │ ├── es8374_audio_codec.h │ ├── es8388_audio_codec.cc │ ├── es8388_audio_codec.h │ ├── no_audio_codec.cc │ └── no_audio_codec.h ├── audio_processing │ ├── afe_audio_processor.cc │ ├── afe_audio_processor.h │ ├── afe_wake_word.cc │ ├── afe_wake_word.h │ ├── audio_processor.h │ ├── esp_wake_word.cc │ ├── esp_wake_word.h │ ├── no_audio_processor.cc │ ├── no_audio_processor.h │ ├── no_wake_word.cc │ ├── no_wake_word.h │ └── wake_word.h ├── background_task.cc ├── background_task.h ├── boards │ ├── README.md │ ├── atk-dnesp32s3-box │ │ ├── atk_dnesp32s3_box.cc │ │ ├── config.h │ │ └── config.json │ ├── atk-dnesp32s3-box0 │ │ ├── atk_dnesp32s3_box0.cc │ │ ├── config.h │ │ ├── config.json │ │ └── power_manager.h │ ├── atk-dnesp32s3 │ │ ├── atk_dnesp32s3.cc │ │ ├── config.h │ │ └── config.json │ ├── atk-dnesp32s3m-4g │ │ ├── atk_dnesp32s3m.cc │ │ └── config.h │ ├── atk-dnesp32s3m-wifi │ │ ├── atk_dnesp32s3m.cc │ │ └── config.h │ ├── atommatrix-echo-base │ │ ├── README.md │ │ ├── atommatrix_echo_base.cc │ │ ├── config.h │ │ └── config.json │ ├── atoms3-echo-base │ │ ├── README.md │ │ ├── atoms3_echo_base.cc │ │ ├── config.h │ │ └── config.json │ ├── atoms3r-cam-m12-echo-base │ │ ├── README.md │ │ ├── atoms3r_cam_m12_echo_base.cc │ │ ├── config.h │ │ └── config.json │ ├── atoms3r-echo-base │ │ ├── README.md │ │ ├── atoms3r_echo_base.cc │ │ ├── config.h │ │ └── config.json │ ├── bread-compact-esp32-lcd │ │ ├── config.h │ │ ├── config.json │ │ └── esp32_bread_board_lcd.cc │ ├── bread-compact-esp32 │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── esp32_bread_board.cc │ ├── bread-compact-ml307 │ │ ├── compact_ml307_board.cc │ │ ├── config.h │ │ └── config.json │ ├── bread-compact-wifi-lcd │ │ ├── compact_wifi_board_lcd.cc │ │ └── config.h │ ├── bread-compact-wifi │ │ ├── compact_wifi_board.cc │ │ ├── config.h │ │ └── config.json │ ├── common │ │ ├── axp2101.cc │ │ ├── axp2101.h │ │ ├── backlight.cc │ │ ├── backlight.h │ │ ├── board.cc │ │ ├── board.h │ │ ├── button.cc │ │ ├── button.h │ │ ├── camera.h │ │ ├── dual_network_board.cc │ │ ├── dual_network_board.h │ │ ├── esp32_camera.cc │ │ ├── esp32_camera.h │ │ ├── i2c_device.cc │ │ ├── i2c_device.h │ │ ├── knob.cc │ │ ├── knob.h │ │ ├── lamp_controller.h │ │ ├── ml307_board.cc │ │ ├── ml307_board.h │ │ ├── power_save_timer.cc │ │ ├── power_save_timer.h │ │ ├── sy6970.cc │ │ ├── sy6970.h │ │ ├── system_reset.cc │ │ ├── system_reset.h │ │ ├── wifi_board.cc │ │ └── wifi_board.h │ ├── df-k10 │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ ├── df_k10_board.cc │ │ ├── k10_audio_codec.cc │ │ └── k10_audio_codec.h │ ├── df-s3-ai-cam │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── df_s3_ai_cam.cc │ ├── doit-s3-aibox │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── doit_s3_aibox.cc │ ├── du-chatx │ │ ├── config.h │ │ ├── config.json │ │ ├── du-chatx-wifi.cc │ │ └── power_manager.h │ ├── esp-box-3 │ │ ├── config.h │ │ ├── config.json │ │ └── esp_box3_board.cc │ ├── esp-box-lite │ │ ├── box_audio_codec_lite.cc │ │ ├── box_audio_codec_lite.h │ │ ├── config.h │ │ ├── config.json │ │ └── esp_box_lite_board.cc │ ├── esp-box │ │ ├── config.h │ │ ├── config.json │ │ └── esp_box_board.cc │ ├── esp-hi │ │ ├── README.md │ │ ├── adc_pdm_audio_codec.cc │ │ ├── adc_pdm_audio_codec.h │ │ ├── config.h │ │ ├── config.json │ │ ├── emoji_display.cc │ │ ├── emoji_display.h │ │ └── esp_hi.cc │ ├── esp-s3-lcd-ev-board │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ ├── esp-s3-lcd-ev-board.cc │ │ ├── esp_io_expander_tca9554.c │ │ ├── esp_io_expander_tca9554.h │ │ ├── esp_lcd_gc9503.c │ │ ├── esp_lcd_gc9503.h │ │ └── pin_config.h │ ├── esp-sparkbot │ │ ├── config.h │ │ ├── config.json │ │ └── esp_sparkbot_board.cc │ ├── esp-spot-s3 │ │ ├── README.md │ │ ├── config.h │ │ └── esp_spot_s3_board.cc │ ├── esp32-cgc-144 │ │ ├── README.md │ │ ├── board_control.cc │ │ ├── config.h │ │ ├── config.json │ │ ├── esp32_cgc_144_board.cc │ │ ├── power_manager.h │ │ └── power_manager_lite.h │ ├── esp32-cgc │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── esp32_cgc_board.cc │ ├── esp32-s3-touch-amoled-1.8 │ │ ├── config.h │ │ ├── config.json │ │ └── esp32-s3-touch-amoled-1.8.cc │ ├── esp32-s3-touch-lcd-1.46 │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── esp32-s3-touch-lcd-1.46.cc │ ├── esp32-s3-touch-lcd-1.85 │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── esp32-s3-touch-lcd-1.85.cc │ ├── esp32-s3-touch-lcd-1.85c │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── esp32-s3-touch-lcd-1.85c.cc │ ├── esp32-s3-touch-lcd-3.5 │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── esp32-s3-touch-lcd-3.5.cc │ ├── esp32s3-korvo2-v3 │ │ ├── config.h │ │ ├── config.json │ │ └── esp32s3_korvo2_v3_board.cc │ ├── genjutech-s3-1.54tft │ │ ├── config.h │ │ ├── config.json │ │ ├── genjutech-s3-1.54tft.cc │ │ └── power_manager.h │ ├── kevin-box-1 │ │ ├── config.h │ │ ├── config.json │ │ └── kevin_box_board.cc │ ├── kevin-box-2 │ │ ├── config.h │ │ ├── config.json │ │ └── kevin_box_board.cc │ ├── kevin-c3 │ │ ├── config.h │ │ ├── config.json │ │ ├── kevin_c3_board.cc │ │ ├── led_strip_control.cc │ │ └── led_strip_control.h │ ├── kevin-sp-v3-dev │ │ ├── config.h │ │ └── kevin-sp-v3_board.cc │ ├── kevin-sp-v4-dev │ │ ├── config.h │ │ ├── config.json │ │ └── kevin-sp-v4_board.cc │ ├── kevin-yuying-313lcd │ │ ├── config.h │ │ ├── config.json │ │ ├── esp_lcd_gc9503.c │ │ ├── esp_lcd_gc9503.h │ │ ├── kevin_yuying_313lcd.cc │ │ └── pin_config.h │ ├── lichuang-c3-dev │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── lichuang_c3_dev_board.cc │ ├── lichuang-dev │ │ ├── config.h │ │ ├── config.json │ │ └── lichuang_dev_board.cc │ ├── lilygo-t-cameraplus-s3 │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ ├── lilygo-t-cameraplus-s3.cc │ │ ├── pin_config.h │ │ ├── tcamerapluss3_audio_codec.cc │ │ └── tcamerapluss3_audio_codec.h │ ├── lilygo-t-circle-s3 │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ ├── esp_lcd_gc9d01n.c │ │ ├── esp_lcd_gc9d01n.h │ │ ├── lilygo-t-circle-s3.cc │ │ ├── pin_config.h │ │ ├── tcircles3_audio_codec.cc │ │ └── tcircles3_audio_codec.h │ ├── lilygo-t-display-s3-pro-mvsrlora │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ ├── lilygo-t-display-s3-pro-mvsrlora.cc │ │ ├── pin_config.h │ │ ├── tdisplays3promvsrlora_audio_codec.cc │ │ └── tdisplays3promvsrlora_audio_codec.h │ ├── m5stack-core-s3 │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ ├── cores3_audio_codec.cc │ │ ├── cores3_audio_codec.h │ │ ├── m5stack_core_s3.cc │ │ └── sdkconfig.cores3 │ ├── m5stack-tab5 │ │ ├── README.md │ │ ├── config.h │ │ ├── m5stack_tab5.cc │ │ ├── sdkconfig.tab5 │ │ ├── tab5_audio_codec.cc │ │ └── tab5_audio_codec.h │ ├── magiclick-2p4 │ │ ├── config.h │ │ ├── config.json │ │ └── magiclick_2p4_board.cc │ ├── magiclick-2p5 │ │ ├── config.h │ │ ├── config.json │ │ ├── magiclick_2p5_board.cc │ │ └── power_manager.h │ ├── magiclick-c3-v2 │ │ ├── config.h │ │ ├── config.json │ │ └── magiclick_c3_v2_board.cc │ ├── magiclick-c3 │ │ ├── config.h │ │ ├── config.json │ │ └── magiclick_c3_board.cc │ ├── minsi-k08-dual │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ ├── minsi_k08_dual.cc │ │ └── power_manager.h │ ├── mixgo-nova │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── mixgo-nova.cc │ ├── movecall-cuican-esp32s3 │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── movecall_cuican_esp32s3.cc │ ├── movecall-moji-esp32s3 │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── movecall_moji_esp32s3.cc │ ├── sensecap-watcher │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ ├── sensecap_audio_codec.cc │ │ ├── sensecap_audio_codec.h │ │ └── sensecap_watcher.cc │ ├── sp-esp32-s3-1.28-box │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── sp-esp32-s3-1.28-box.cc │ ├── sp-esp32-s3-1.54-muma │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ ├── power_manager.h │ │ └── sp-esp32-s3-1.54-muma.cc │ ├── taiji-pi-s3 │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── taiji_pi_s3.cc │ ├── tudouzi │ │ ├── config.h │ │ ├── config.json │ │ └── kevin_box_board.cc │ ├── waveshare-p4-nano │ │ ├── README.md │ │ ├── config.h │ │ └── esp32-p4-nano.cc │ ├── waveshare-p4-wifi6-touch-lcd-4b │ │ ├── README.md │ │ ├── config.h │ │ └── esp32-p4-wifi6-touch-lcd-4b.cc │ ├── waveshare-p4-wifi6-touch-lcd-xc │ │ ├── README.md │ │ ├── config.h │ │ └── esp32-p4-wifi6-touch-lcd-xc.cc │ ├── waveshare-s3-touch-amoled-1.75 │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── esp32-s3-touch-amoled-1.75.cc │ ├── xingzhi-cube-0.85tft-ml307 │ │ ├── config.h │ │ ├── config.json │ │ └── xingzhi-cube-0.85tft-ml307.cc │ ├── xingzhi-cube-0.85tft-wifi │ │ ├── config.h │ │ ├── config.json │ │ └── xingzhi-cube-0.85tft-wifi.cc │ ├── xingzhi-cube-0.96oled-ml307 │ │ ├── config.h │ │ ├── config.json │ │ └── xingzhi-cube-0.96oled-ml307.cc │ ├── xingzhi-cube-0.96oled-wifi │ │ ├── config.h │ │ ├── config.json │ │ └── xingzhi-cube-0.96oled-wifi.cc │ ├── xingzhi-cube-1.54tft-ml307 │ │ ├── config.h │ │ ├── config.json │ │ └── xingzhi-cube-1.54tft-ml307.cc │ ├── xingzhi-cube-1.54tft-wifi │ │ ├── config.h │ │ ├── config.json │ │ ├── power_manager.h │ │ └── xingzhi-cube-1.54tft-wifi.cc │ ├── xmini-c3 │ │ ├── config.h │ │ ├── config.json │ │ └── xmini_c3_board.cc │ ├── zhengchen-1.54tft-ml307 │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ └── zhengchen-1.54tft-ml307.cc │ └── zhengchen-1.54tft-wifi │ │ ├── README.md │ │ ├── config.h │ │ ├── config.json │ │ ├── power_manager.h │ │ ├── zhengchen-1.54tft-wifi.cc │ │ └── zhengchen_lcd_display.h ├── display │ ├── display.cc │ ├── display.h │ ├── lcd_display.cc │ ├── lcd_display.h │ ├── oled_display.cc │ └── oled_display.h ├── idf_component.yml ├── iot │ ├── README.md │ ├── thing.cc │ ├── thing.h │ ├── thing_manager.cc │ ├── thing_manager.h │ └── things │ │ ├── battery.cc │ │ ├── lamp.cc │ │ ├── screen.cc │ │ └── speaker.cc ├── led │ ├── circular_strip.cc │ ├── circular_strip.h │ ├── gpio_led.cc │ ├── gpio_led.h │ ├── led.h │ ├── single_led.cc │ └── single_led.h ├── main.cc ├── mcp_server.cc ├── mcp_server.h ├── ota.cc ├── ota.h ├── protocols │ ├── mqtt_protocol.cc │ ├── mqtt_protocol.h │ ├── protocol.cc │ ├── protocol.h │ ├── websocket_protocol.cc │ └── websocket_protocol.h ├── settings.cc ├── settings.h ├── system_info.cc └── system_info.h ├── partitions └── v1 │ ├── 16m.csv │ ├── 32m.csv │ ├── 4m.csv │ ├── 4m_esp-hi.csv │ └── 8m.csv ├── scripts ├── Image_Converter │ ├── LVGLImage.py │ ├── README.md │ └── lvgl_tools_gui.py ├── flash.sh ├── gen_lang.py ├── p3_tools │ ├── README.md │ ├── batch_convert_gui.py │ ├── convert_audio_to_p3.py │ ├── convert_p3_to_audio.py │ ├── img │ │ └── img.png │ ├── p3_gui_player.py │ ├── play_p3.py │ └── requirements.txt ├── release.py └── versions.py ├── sdkconfig.defaults ├── sdkconfig.defaults.esp32c3 ├── sdkconfig.defaults.esp32p4 └── sdkconfig.defaults.esp32s3 /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: 小智 AI 官方网站 4 | url: https://xiaozhi.me/ 5 | about: 激活设备、配置 AI、声纹识别、声音克隆等应有尽有,DIY 属于你自己的小智 6 | - name: 小智 AI 聊天机器人百科全书 7 | url: https://ccnphfhqs21z.feishu.cn/wiki/F5krwD16viZoF0kKkvDcrZNYnhb 8 | about: 开发文档、硬件制作、烧录教程、FAQ尽在小智百科 -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build and Test 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Checkout code 17 | uses: actions/checkout@v2 18 | 19 | - name: Espressif IoT Development Framework (ESP-IDF) 20 | # You may pin to the exact commit or the version. 21 | # uses: espressif/esp-idf-ci-action@8cd22ae10042fadc37890e81e9988a9113e7b506 22 | uses: espressif/esp-idf-ci-action@v1.1.0 23 | with: 24 | # Relative path under $GITHUB_WORKSPACE to place the repository 25 | #path: # optional, default is 26 | # Version of ESP-IDF docker image to use 27 | esp_idf_version: release-v5.4 28 | # ESP32 variant to build for 29 | target: esp32s3 30 | # Command to run inside the docker container (default: builds the project) 31 | # command: # optional, default is idf.py build 32 | 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | tmp/ 2 | components/ 3 | managed_components/ 4 | build/ 5 | .vscode/ 6 | .devcontainer/ 7 | sdkconfig.old 8 | sdkconfig 9 | dependencies.lock 10 | .env 11 | releases/ 12 | main/assets/lang_config.h 13 | main/mmap_generate_emoji.h 14 | .DS_Store 15 | .cache 16 | main/mmap_generate_emoji.h -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # For more information about build system see 2 | # https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html 3 | # The following five lines of boilerplate have to be in your project's 4 | # CMakeLists in this exact order for cmake to work correctly 5 | cmake_minimum_required(VERSION 3.16) 6 | 7 | set(PROJECT_VER "1.6.8") 8 | 9 | # Add this line to disable the specific warning 10 | add_compile_options(-Wno-missing-field-initializers) 11 | 12 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 13 | project(xiaozhi) 14 | 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Xiaoxia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/mcp-based-graph.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/mcp-based-graph.jpg -------------------------------------------------------------------------------- /docs/v0/AtomMatrix-echo-base.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v0/AtomMatrix-echo-base.jpg -------------------------------------------------------------------------------- /docs/v0/ESP32-BreadBoard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v0/ESP32-BreadBoard.jpg -------------------------------------------------------------------------------- /docs/v0/atoms3r-echo-base.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v0/atoms3r-echo-base.jpg -------------------------------------------------------------------------------- /docs/v0/esp32s3-box3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v0/esp32s3-box3.jpg -------------------------------------------------------------------------------- /docs/v0/lichuang-s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v0/lichuang-s3.jpg -------------------------------------------------------------------------------- /docs/v0/m5stack-cores3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v0/m5stack-cores3.jpg -------------------------------------------------------------------------------- /docs/v0/magiclick-2p4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v0/magiclick-2p4.jpg -------------------------------------------------------------------------------- /docs/v0/waveshare-esp32-s3-touch-amoled-1.8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v0/waveshare-esp32-s3-touch-amoled-1.8.jpg -------------------------------------------------------------------------------- /docs/v0/wiring.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v0/wiring.jpg -------------------------------------------------------------------------------- /docs/v1/atoms3r.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/atoms3r.jpg -------------------------------------------------------------------------------- /docs/v1/esp-hi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/esp-hi.jpg -------------------------------------------------------------------------------- /docs/v1/esp-sparkbot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/esp-sparkbot.jpg -------------------------------------------------------------------------------- /docs/v1/espbox3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/espbox3.jpg -------------------------------------------------------------------------------- /docs/v1/lichuang-s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/lichuang-s3.jpg -------------------------------------------------------------------------------- /docs/v1/lilygo-t-circle-s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/lilygo-t-circle-s3.jpg -------------------------------------------------------------------------------- /docs/v1/m5cores3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/m5cores3.jpg -------------------------------------------------------------------------------- /docs/v1/magiclick.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/magiclick.jpg -------------------------------------------------------------------------------- /docs/v1/movecall-cuican-esp32s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/movecall-cuican-esp32s3.jpg -------------------------------------------------------------------------------- /docs/v1/movecall-moji-esp32s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/movecall-moji-esp32s3.jpg -------------------------------------------------------------------------------- /docs/v1/sensecap_watcher.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/sensecap_watcher.jpg -------------------------------------------------------------------------------- /docs/v1/waveshare.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/waveshare.jpg -------------------------------------------------------------------------------- /docs/v1/wiring2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/wiring2.jpg -------------------------------------------------------------------------------- /docs/v1/wmnologo_xingzhi_0.96.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/wmnologo_xingzhi_0.96.jpg -------------------------------------------------------------------------------- /docs/v1/wmnologo_xingzhi_1.54.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/wmnologo_xingzhi_1.54.jpg -------------------------------------------------------------------------------- /docs/v1/xmini-c3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/docs/v1/xmini-c3.jpg -------------------------------------------------------------------------------- /main/assets/common/exclamation.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/common/exclamation.p3 -------------------------------------------------------------------------------- /main/assets/common/low_battery.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/common/low_battery.p3 -------------------------------------------------------------------------------- /main/assets/common/popup.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/common/popup.p3 -------------------------------------------------------------------------------- /main/assets/common/success.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/common/success.p3 -------------------------------------------------------------------------------- /main/assets/common/vibration.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/common/vibration.p3 -------------------------------------------------------------------------------- /main/assets/en-US/0.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/0.p3 -------------------------------------------------------------------------------- /main/assets/en-US/1.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/1.p3 -------------------------------------------------------------------------------- /main/assets/en-US/2.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/2.p3 -------------------------------------------------------------------------------- /main/assets/en-US/3.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/3.p3 -------------------------------------------------------------------------------- /main/assets/en-US/4.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/4.p3 -------------------------------------------------------------------------------- /main/assets/en-US/5.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/5.p3 -------------------------------------------------------------------------------- /main/assets/en-US/6.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/6.p3 -------------------------------------------------------------------------------- /main/assets/en-US/7.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/7.p3 -------------------------------------------------------------------------------- /main/assets/en-US/8.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/8.p3 -------------------------------------------------------------------------------- /main/assets/en-US/9.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/9.p3 -------------------------------------------------------------------------------- /main/assets/en-US/activation.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/activation.p3 -------------------------------------------------------------------------------- /main/assets/en-US/err_pin.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/err_pin.p3 -------------------------------------------------------------------------------- /main/assets/en-US/err_reg.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/err_reg.p3 -------------------------------------------------------------------------------- /main/assets/en-US/upgrade.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/upgrade.p3 -------------------------------------------------------------------------------- /main/assets/en-US/welcome.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/welcome.p3 -------------------------------------------------------------------------------- /main/assets/en-US/wificonfig.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/en-US/wificonfig.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/0.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/0.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/1.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/1.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/2.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/2.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/3.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/3.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/4.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/4.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/5.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/5.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/6.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/6.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/7.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/7.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/8.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/8.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/9.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/9.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/activation.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/activation.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/err_pin.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/err_pin.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/err_reg.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/err_reg.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/upgrade.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/upgrade.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/welcome.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/welcome.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/wificonfig.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/ja-JP/wificonfig.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/0.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/0.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/1.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/1.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/2.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/2.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/3.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/3.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/4.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/4.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/5.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/5.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/6.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/6.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/7.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/7.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/8.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/8.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/9.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/9.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/activation.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/activation.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/err_pin.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/err_pin.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/err_reg.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/err_reg.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/upgrade.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/upgrade.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/welcome.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/welcome.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/wificonfig.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-CN/wificonfig.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/0.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/0.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/1.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/1.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/2.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/2.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/3.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/3.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/4.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/4.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/5.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/5.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/6.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/6.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/7.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/7.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/8.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/8.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/9.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/9.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/activation.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/activation.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/err_pin.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/err_pin.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/err_reg.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/err_reg.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/upgrade.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/upgrade.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/welcome.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/welcome.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/wificonfig.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/main/assets/zh-TW/wificonfig.p3 -------------------------------------------------------------------------------- /main/audio_codecs/box_audio_codec.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOX_AUDIO_CODEC_H 2 | #define _BOX_AUDIO_CODEC_H 3 | 4 | #include "audio_codec.h" 5 | 6 | #include 7 | #include 8 | 9 | class BoxAudioCodec : public AudioCodec { 10 | private: 11 | const audio_codec_data_if_t* data_if_ = nullptr; 12 | const audio_codec_ctrl_if_t* out_ctrl_if_ = nullptr; 13 | const audio_codec_if_t* out_codec_if_ = nullptr; 14 | const audio_codec_ctrl_if_t* in_ctrl_if_ = nullptr; 15 | const audio_codec_if_t* in_codec_if_ = nullptr; 16 | const audio_codec_gpio_if_t* gpio_if_ = nullptr; 17 | 18 | esp_codec_dev_handle_t output_dev_ = nullptr; 19 | esp_codec_dev_handle_t input_dev_ = nullptr; 20 | 21 | void CreateDuplexChannels(gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din); 22 | 23 | virtual int Read(int16_t* dest, int samples) override; 24 | virtual int Write(const int16_t* data, int samples) override; 25 | 26 | public: 27 | BoxAudioCodec(void* i2c_master_handle, int input_sample_rate, int output_sample_rate, 28 | gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din, 29 | gpio_num_t pa_pin, uint8_t es8311_addr, uint8_t es7210_addr, bool input_reference); 30 | virtual ~BoxAudioCodec(); 31 | 32 | virtual void SetOutputVolume(int volume) override; 33 | virtual void EnableInput(bool enable) override; 34 | virtual void EnableOutput(bool enable) override; 35 | }; 36 | 37 | #endif // _BOX_AUDIO_CODEC_H 38 | -------------------------------------------------------------------------------- /main/audio_codecs/es8311_audio_codec.h: -------------------------------------------------------------------------------- 1 | #ifndef _ES8311_AUDIO_CODEC_H 2 | #define _ES8311_AUDIO_CODEC_H 3 | 4 | #include "audio_codec.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class Es8311AudioCodec : public AudioCodec { 12 | private: 13 | const audio_codec_data_if_t* data_if_ = nullptr; 14 | const audio_codec_ctrl_if_t* ctrl_if_ = nullptr; 15 | const audio_codec_if_t* codec_if_ = nullptr; 16 | const audio_codec_gpio_if_t* gpio_if_ = nullptr; 17 | 18 | esp_codec_dev_handle_t output_dev_ = nullptr; 19 | esp_codec_dev_handle_t input_dev_ = nullptr; 20 | gpio_num_t pa_pin_ = GPIO_NUM_NC; 21 | 22 | void CreateDuplexChannels(gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din); 23 | 24 | virtual int Read(int16_t* dest, int samples) override; 25 | virtual int Write(const int16_t* data, int samples) override; 26 | 27 | public: 28 | Es8311AudioCodec(void* i2c_master_handle, i2c_port_t i2c_port, int input_sample_rate, int output_sample_rate, 29 | gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din, 30 | gpio_num_t pa_pin, uint8_t es8311_addr, bool use_mclk = true); 31 | virtual ~Es8311AudioCodec(); 32 | 33 | virtual void SetOutputVolume(int volume) override; 34 | virtual void EnableInput(bool enable) override; 35 | virtual void EnableOutput(bool enable) override; 36 | }; 37 | 38 | #endif // _ES8311_AUDIO_CODEC_H -------------------------------------------------------------------------------- /main/audio_codecs/es8374_audio_codec.h: -------------------------------------------------------------------------------- 1 | #ifndef _ES8374_AUDIO_CODEC_H 2 | #define _ES8374_AUDIO_CODEC_H 3 | 4 | #include "audio_codec.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class Es8374AudioCodec : public AudioCodec { 12 | private: 13 | const audio_codec_data_if_t* data_if_ = nullptr; 14 | const audio_codec_ctrl_if_t* ctrl_if_ = nullptr; 15 | const audio_codec_if_t* codec_if_ = nullptr; 16 | const audio_codec_gpio_if_t* gpio_if_ = nullptr; 17 | 18 | esp_codec_dev_handle_t output_dev_ = nullptr; 19 | esp_codec_dev_handle_t input_dev_ = nullptr; 20 | gpio_num_t pa_pin_ = GPIO_NUM_NC; 21 | 22 | void CreateDuplexChannels(gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din); 23 | 24 | virtual int Read(int16_t* dest, int samples) override; 25 | virtual int Write(const int16_t* data, int samples) override; 26 | 27 | public: 28 | Es8374AudioCodec(void* i2c_master_handle, i2c_port_t i2c_port, int input_sample_rate, int output_sample_rate, 29 | gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din, 30 | gpio_num_t pa_pin, uint8_t es8374_addr, bool use_mclk = true); 31 | virtual ~Es8374AudioCodec(); 32 | 33 | virtual void SetOutputVolume(int volume) override; 34 | virtual void EnableInput(bool enable) override; 35 | virtual void EnableOutput(bool enable) override; 36 | }; 37 | 38 | #endif // _ES8374_AUDIO_CODEC_H -------------------------------------------------------------------------------- /main/audio_codecs/es8388_audio_codec.h: -------------------------------------------------------------------------------- 1 | #ifndef _ES8388_AUDIO_CODEC_H 2 | #define _ES8388_AUDIO_CODEC_H 3 | 4 | #include "audio_codec.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | class Es8388AudioCodec : public AudioCodec { 11 | private: 12 | const audio_codec_data_if_t* data_if_ = nullptr; 13 | const audio_codec_ctrl_if_t* ctrl_if_ = nullptr; 14 | const audio_codec_if_t* codec_if_ = nullptr; 15 | const audio_codec_gpio_if_t* gpio_if_ = nullptr; 16 | 17 | esp_codec_dev_handle_t output_dev_ = nullptr; 18 | esp_codec_dev_handle_t input_dev_ = nullptr; 19 | gpio_num_t pa_pin_ = GPIO_NUM_NC; 20 | 21 | void CreateDuplexChannels(gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din); 22 | 23 | virtual int Read(int16_t* dest, int samples) override; 24 | virtual int Write(const int16_t* data, int samples) override; 25 | 26 | public: 27 | Es8388AudioCodec(void* i2c_master_handle, i2c_port_t i2c_port, int input_sample_rate, int output_sample_rate, 28 | gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din, 29 | gpio_num_t pa_pin, uint8_t es8388_addr); 30 | virtual ~Es8388AudioCodec(); 31 | 32 | virtual void SetOutputVolume(int volume) override; 33 | virtual void EnableInput(bool enable) override; 34 | virtual void EnableOutput(bool enable) override; 35 | }; 36 | 37 | #endif // _ES8388_AUDIO_CODEC_H 38 | -------------------------------------------------------------------------------- /main/audio_processing/afe_audio_processor.h: -------------------------------------------------------------------------------- 1 | #ifndef AFE_AUDIO_PROCESSOR_H 2 | #define AFE_AUDIO_PROCESSOR_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include "audio_processor.h" 14 | #include "audio_codec.h" 15 | 16 | class AfeAudioProcessor : public AudioProcessor { 17 | public: 18 | AfeAudioProcessor(); 19 | ~AfeAudioProcessor(); 20 | 21 | void Initialize(AudioCodec* codec) override; 22 | void Feed(const std::vector& data) override; 23 | void Start() override; 24 | void Stop() override; 25 | bool IsRunning() override; 26 | void OnOutput(std::function&& data)> callback) override; 27 | void OnVadStateChange(std::function callback) override; 28 | size_t GetFeedSize() override; 29 | void EnableDeviceAec(bool enable) override; 30 | 31 | private: 32 | EventGroupHandle_t event_group_ = nullptr; 33 | esp_afe_sr_iface_t* afe_iface_ = nullptr; 34 | esp_afe_sr_data_t* afe_data_ = nullptr; 35 | std::function&& data)> output_callback_; 36 | std::function vad_state_change_callback_; 37 | AudioCodec* codec_ = nullptr; 38 | bool is_speaking_ = false; 39 | 40 | void AudioProcessorTask(); 41 | }; 42 | 43 | #endif -------------------------------------------------------------------------------- /main/audio_processing/audio_processor.h: -------------------------------------------------------------------------------- 1 | #ifndef AUDIO_PROCESSOR_H 2 | #define AUDIO_PROCESSOR_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "audio_codec.h" 9 | 10 | class AudioProcessor { 11 | public: 12 | virtual ~AudioProcessor() = default; 13 | 14 | virtual void Initialize(AudioCodec* codec) = 0; 15 | virtual void Feed(const std::vector& data) = 0; 16 | virtual void Start() = 0; 17 | virtual void Stop() = 0; 18 | virtual bool IsRunning() = 0; 19 | virtual void OnOutput(std::function&& data)> callback) = 0; 20 | virtual void OnVadStateChange(std::function callback) = 0; 21 | virtual size_t GetFeedSize() = 0; 22 | virtual void EnableDeviceAec(bool enable) = 0; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /main/audio_processing/esp_wake_word.h: -------------------------------------------------------------------------------- 1 | #ifndef ESP_WAKE_WORD_H 2 | #define ESP_WAKE_WORD_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #include "audio_codec.h" 20 | #include "wake_word.h" 21 | 22 | class EspWakeWord : public WakeWord { 23 | public: 24 | EspWakeWord(); 25 | ~EspWakeWord(); 26 | 27 | void Initialize(AudioCodec* codec); 28 | void Feed(const std::vector& data); 29 | void OnWakeWordDetected(std::function callback); 30 | void StartDetection(); 31 | void StopDetection(); 32 | bool IsDetectionRunning(); 33 | size_t GetFeedSize(); 34 | void EncodeWakeWordData(); 35 | bool GetWakeWordOpus(std::vector& opus); 36 | const std::string& GetLastDetectedWakeWord() const { return last_detected_wake_word_; } 37 | 38 | private: 39 | esp_wn_iface_t *wakenet_iface_ = nullptr; 40 | model_iface_data_t *wakenet_data_ = nullptr; 41 | srmodel_list_t *wakenet_model_ = nullptr; 42 | EventGroupHandle_t event_group_; 43 | AudioCodec* codec_ = nullptr; 44 | 45 | std::function wake_word_detected_callback_; 46 | std::string last_detected_wake_word_; 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /main/audio_processing/no_audio_processor.cc: -------------------------------------------------------------------------------- 1 | #include "no_audio_processor.h" 2 | #include 3 | 4 | #define TAG "NoAudioProcessor" 5 | 6 | void NoAudioProcessor::Initialize(AudioCodec* codec) { 7 | codec_ = codec; 8 | } 9 | 10 | void NoAudioProcessor::Feed(const std::vector& data) { 11 | if (!is_running_ || !output_callback_) { 12 | return; 13 | } 14 | // 直接将输入数据传递给输出回调 15 | output_callback_(std::vector(data)); 16 | } 17 | 18 | void NoAudioProcessor::Start() { 19 | is_running_ = true; 20 | } 21 | 22 | void NoAudioProcessor::Stop() { 23 | is_running_ = false; 24 | } 25 | 26 | bool NoAudioProcessor::IsRunning() { 27 | return is_running_; 28 | } 29 | 30 | void NoAudioProcessor::OnOutput(std::function&& data)> callback) { 31 | output_callback_ = callback; 32 | } 33 | 34 | void NoAudioProcessor::OnVadStateChange(std::function callback) { 35 | vad_state_change_callback_ = callback; 36 | } 37 | 38 | size_t NoAudioProcessor::GetFeedSize() { 39 | if (!codec_) { 40 | return 0; 41 | } 42 | // 返回一个固定的帧大小,比如 30ms 的数据 43 | return 30 * codec_->input_sample_rate() / 1000; 44 | } 45 | 46 | void NoAudioProcessor::EnableDeviceAec(bool enable) { 47 | if (enable) { 48 | ESP_LOGE(TAG, "Device AEC is not supported"); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /main/audio_processing/no_audio_processor.h: -------------------------------------------------------------------------------- 1 | #ifndef DUMMY_AUDIO_PROCESSOR_H 2 | #define DUMMY_AUDIO_PROCESSOR_H 3 | 4 | #include 5 | #include 6 | 7 | #include "audio_processor.h" 8 | #include "audio_codec.h" 9 | 10 | class NoAudioProcessor : public AudioProcessor { 11 | public: 12 | NoAudioProcessor() = default; 13 | ~NoAudioProcessor() = default; 14 | 15 | void Initialize(AudioCodec* codec) override; 16 | void Feed(const std::vector& data) override; 17 | void Start() override; 18 | void Stop() override; 19 | bool IsRunning() override; 20 | void OnOutput(std::function&& data)> callback) override; 21 | void OnVadStateChange(std::function callback) override; 22 | size_t GetFeedSize() override; 23 | void EnableDeviceAec(bool enable) override; 24 | 25 | private: 26 | AudioCodec* codec_ = nullptr; 27 | std::function&& data)> output_callback_; 28 | std::function vad_state_change_callback_; 29 | bool is_running_ = false; 30 | }; 31 | 32 | #endif -------------------------------------------------------------------------------- /main/audio_processing/no_wake_word.cc: -------------------------------------------------------------------------------- 1 | #include "no_wake_word.h" 2 | #include 3 | 4 | #define TAG "NoWakeWord" 5 | 6 | void NoWakeWord::Initialize(AudioCodec* codec) { 7 | codec_ = codec; 8 | } 9 | 10 | void NoWakeWord::Feed(const std::vector& data) { 11 | // Do nothing - no wake word processing 12 | } 13 | 14 | void NoWakeWord::OnWakeWordDetected(std::function callback) { 15 | // Do nothing - no wake word processing 16 | } 17 | 18 | void NoWakeWord::StartDetection() { 19 | // Do nothing - no wake word processing 20 | } 21 | 22 | void NoWakeWord::StopDetection() { 23 | // Do nothing - no wake word processing 24 | } 25 | 26 | bool NoWakeWord::IsDetectionRunning() { 27 | return false; // No wake word processing 28 | } 29 | 30 | size_t NoWakeWord::GetFeedSize() { 31 | return 0; // No specific feed size requirement 32 | } 33 | 34 | void NoWakeWord::EncodeWakeWordData() { 35 | // Do nothing - no encoding needed 36 | } 37 | 38 | bool NoWakeWord::GetWakeWordOpus(std::vector& opus) { 39 | opus.clear(); 40 | return false; // No opus data available 41 | } 42 | 43 | const std::string& NoWakeWord::GetLastDetectedWakeWord() const { 44 | return last_detected_wake_word_; 45 | } -------------------------------------------------------------------------------- /main/audio_processing/no_wake_word.h: -------------------------------------------------------------------------------- 1 | #ifndef NO_WAKE_WORD_H 2 | #define NO_WAKE_WORD_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "wake_word.h" 9 | #include "audio_codec.h" 10 | 11 | class NoWakeWord : public WakeWord { 12 | public: 13 | NoWakeWord() = default; 14 | ~NoWakeWord() = default; 15 | 16 | void Initialize(AudioCodec* codec) override; 17 | void Feed(const std::vector& data) override; 18 | void OnWakeWordDetected(std::function callback) override; 19 | void StartDetection() override; 20 | void StopDetection() override; 21 | bool IsDetectionRunning() override; 22 | size_t GetFeedSize() override; 23 | void EncodeWakeWordData() override; 24 | bool GetWakeWordOpus(std::vector& opus) override; 25 | const std::string& GetLastDetectedWakeWord() const override; 26 | 27 | private: 28 | AudioCodec* codec_ = nullptr; 29 | std::string last_detected_wake_word_; 30 | }; 31 | 32 | #endif -------------------------------------------------------------------------------- /main/audio_processing/wake_word.h: -------------------------------------------------------------------------------- 1 | #ifndef WAKE_WORD_H 2 | #define WAKE_WORD_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "audio_codec.h" 9 | 10 | class WakeWord { 11 | public: 12 | virtual ~WakeWord() = default; 13 | 14 | virtual void Initialize(AudioCodec* codec) = 0; 15 | virtual void Feed(const std::vector& data) = 0; 16 | virtual void OnWakeWordDetected(std::function callback) = 0; 17 | virtual void StartDetection() = 0; 18 | virtual void StopDetection() = 0; 19 | virtual bool IsDetectionRunning() = 0; 20 | virtual size_t GetFeedSize() = 0; 21 | virtual void EncodeWakeWordData() = 0; 22 | virtual bool GetWakeWordOpus(std::vector& opus) = 0; 23 | virtual const std::string& GetLastDetectedWakeWord() const = 0; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /main/background_task.h: -------------------------------------------------------------------------------- 1 | #ifndef BACKGROUND_TASK_H 2 | #define BACKGROUND_TASK_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class BackgroundTask { 12 | public: 13 | BackgroundTask(uint32_t stack_size = 4096 * 2); 14 | ~BackgroundTask(); 15 | 16 | void Schedule(std::function callback); 17 | void WaitForCompletion(); 18 | 19 | private: 20 | std::mutex mutex_; 21 | std::list> main_tasks_; 22 | std::condition_variable condition_variable_; 23 | TaskHandle_t background_task_handle_ = nullptr; 24 | std::atomic active_tasks_{0}; 25 | 26 | void BackgroundTaskLoop(); 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /main/boards/atk-dnesp32s3-box/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_13 10 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_21 11 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_47 12 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_14 13 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 14 | 15 | #define BUILTIN_LED_GPIO GPIO_NUM_4 16 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 17 | 18 | #define DISPLAY_OFFSET_X 0 19 | #define DISPLAY_OFFSET_Y 0 20 | #define DISPLAY_WIDTH 320 21 | #define DISPLAY_HEIGHT 240 22 | #define DISPLAY_SWAP_XY true 23 | #define DISPLAY_MIRROR_X true 24 | #define DISPLAY_MIRROR_Y false 25 | 26 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_NC 27 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT true 28 | 29 | 30 | // Pin Definitions 31 | #define LCD_NUM_CS GPIO_NUM_1 32 | #define LCD_NUM_DC GPIO_NUM_2 33 | #define LCD_NUM_RD GPIO_NUM_41 34 | #define LCD_NUM_WR GPIO_NUM_42 35 | #define LCD_NUM_RST GPIO_NUM_NC 36 | 37 | #define GPIO_LCD_D0 GPIO_NUM_40 38 | #define GPIO_LCD_D1 GPIO_NUM_39 39 | #define GPIO_LCD_D2 GPIO_NUM_38 40 | #define GPIO_LCD_D3 GPIO_NUM_12 41 | #define GPIO_LCD_D4 GPIO_NUM_11 42 | #define GPIO_LCD_D5 GPIO_NUM_10 43 | #define GPIO_LCD_D6 GPIO_NUM_9 44 | #define GPIO_LCD_D7 GPIO_NUM_46 45 | 46 | #endif // _BOARD_CONFIG_H_ 47 | -------------------------------------------------------------------------------- /main/boards/atk-dnesp32s3-box/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "atk-dnesp32s3-box", 6 | "sdkconfig_append": [ 7 | "CONFIG_USE_WECHAT_MESSAGE_STYLE=y" 8 | ] 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /main/boards/atk-dnesp32s3-box0/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "atk-dnesp32s3-box0", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/atk-dnesp32s3/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "atk-dnesp32s3", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/atk-dnesp32s3m-4g/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | 5 | #include 6 | 7 | #define AUDIO_INPUT_SAMPLE_RATE 24000 8 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 9 | 10 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_48 11 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_47 12 | 13 | #define Module_4G_RX_PIN GPIO_NUM_21 14 | #define Module_4G_TX_PIN GPIO_NUM_45 15 | 16 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_6 17 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_16 18 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_7 19 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_17 20 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_15 21 | 22 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_4 23 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_5 24 | #define AUDIO_CODEC_ES8388_ADDR ES8388_CODEC_DEFAULT_ADDR 25 | 26 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 27 | 28 | #define BUILTIN_LED_GPIO GPIO_NUM_1 29 | 30 | #define LCD_SCLK_PIN GPIO_NUM_12 31 | #define LCD_MOSI_PIN GPIO_NUM_11 32 | #define LCD_MISO_PIN GPIO_NUM_13 33 | #define LCD_DC_PIN GPIO_NUM_40 34 | #define LCD_CS_PIN GPIO_NUM_39 35 | #define LCD_RST_PIN GPIO_NUM_38 36 | 37 | #define SPK_EN_PIN GPIO_NUM_42 38 | #define PHONE_CK_PIN GPIO_NUM_3 39 | 40 | #define DISPLAY_WIDTH 160 41 | #define DISPLAY_HEIGHT 80 42 | #define DISPLAY_MIRROR_X false 43 | #define DISPLAY_MIRROR_Y true 44 | #define DISPLAY_SWAP_XY true 45 | 46 | #define DISPLAY_OFFSET_X 1 47 | #define DISPLAY_OFFSET_Y 26 48 | 49 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_41 50 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 51 | 52 | #endif // _BOARD_CONFIG_H_ 53 | 54 | -------------------------------------------------------------------------------- /main/boards/atk-dnesp32s3m-wifi/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | 5 | #include 6 | 7 | #define AUDIO_INPUT_SAMPLE_RATE 24000 8 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 9 | 10 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_48 11 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_47 12 | 13 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_6 14 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_16 15 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_7 16 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_17 17 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_15 18 | 19 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_4 20 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_5 21 | #define AUDIO_CODEC_ES8388_ADDR ES8388_CODEC_DEFAULT_ADDR 22 | 23 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 24 | 25 | #define BUILTIN_LED_GPIO GPIO_NUM_1 26 | 27 | #define LCD_SCLK_PIN GPIO_NUM_12 28 | #define LCD_MOSI_PIN GPIO_NUM_11 29 | #define LCD_MISO_PIN GPIO_NUM_13 30 | #define LCD_DC_PIN GPIO_NUM_40 31 | #define LCD_CS_PIN GPIO_NUM_39 32 | #define LCD_RST_PIN GPIO_NUM_38 33 | 34 | #define SPK_EN_PIN GPIO_NUM_42 35 | #define PHONE_CK_PIN GPIO_NUM_3 36 | 37 | #define DISPLAY_WIDTH 160 38 | #define DISPLAY_HEIGHT 80 39 | #define DISPLAY_MIRROR_X false 40 | #define DISPLAY_MIRROR_Y true 41 | #define DISPLAY_SWAP_XY true 42 | 43 | #define DISPLAY_OFFSET_X 1 44 | #define DISPLAY_OFFSET_Y 26 45 | // #define DISPLAY_OFFSET_X 0 46 | // #define DISPLAY_OFFSET_Y 0 47 | 48 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_41 49 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 50 | 51 | #endif // _BOARD_CONFIG_H_ 52 | 53 | -------------------------------------------------------------------------------- /main/boards/atommatrix-echo-base/README.md: -------------------------------------------------------------------------------- 1 | # 编译配置命令 2 | 3 | **配置编译目标为 ESP32:** 4 | 5 | ```bash 6 | idf.py set-target esp32 7 | ``` 8 | 9 | **打开 menuconfig:** 10 | 11 | ```bash 12 | idf.py menuconfig 13 | ``` 14 | 15 | **选择板子:** 16 | 17 | ``` 18 | Xiaozhi Assistant -> Board Type -> AtomMatrix + Echo Base 19 | ``` 20 | 21 | **修改 flash 大小:** 22 | 23 | ``` 24 | Serial flasher config -> Flash size -> 4 MB 25 | ``` 26 | 27 | **修改分区表:** 28 | 29 | ``` 30 | Partition Table -> Custom partition CSV file -> partitions/v1/4m.csv 31 | ``` 32 | 33 | **编译:** 34 | 35 | ```bash 36 | idf.py build 37 | ``` -------------------------------------------------------------------------------- /main/boards/atommatrix-echo-base/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | // AtomMatrix+EchoBase Board configuration 5 | 6 | #include 7 | 8 | #define AUDIO_INPUT_SAMPLE_RATE 24000 9 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 10 | 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_NC 12 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_19 13 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_33 14 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_23 15 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_22 16 | 17 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_25 18 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_21 19 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 20 | #define AUDIO_CODEC_GPIO_PA GPIO_NUM_NC 21 | 22 | #define BUILTIN_LED_GPIO GPIO_NUM_27 23 | #define BOOT_BUTTON_GPIO GPIO_NUM_39 24 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC 25 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC 26 | 27 | 28 | 29 | #endif // _BOARD_CONFIG_H_ 30 | -------------------------------------------------------------------------------- /main/boards/atommatrix-echo-base/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32", 3 | "builds": [ 4 | { 5 | "name": "atommatrix-echo-base", 6 | "sdkconfig_append": [ 7 | "CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y", 8 | "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/4m.csv\"" 9 | ] 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /main/boards/atoms3-echo-base/README.md: -------------------------------------------------------------------------------- 1 | # 编译配置命令 2 | 3 | **配置编译目标为 ESP32S3:** 4 | 5 | ```bash 6 | idf.py set-target esp32s3 7 | ``` 8 | 9 | **打开 menuconfig:** 10 | 11 | ```bash 12 | idf.py menuconfig 13 | ``` 14 | 15 | **选择板子:** 16 | 17 | ``` 18 | Xiaozhi Assistant -> Board Type -> AtomS3 + Echo Base 19 | ``` 20 | 21 | **关闭语音唤醒:** 22 | 23 | ``` 24 | Xiaozhi Assistant -> [ ] 启用语音唤醒与音频处理 -> Unselect 25 | ``` 26 | 27 | **修改 flash 大小:** 28 | 29 | ``` 30 | Serial flasher config -> Flash size -> 8 MB 31 | ``` 32 | 33 | **修改分区表:** 34 | 35 | ``` 36 | Partition Table -> Custom partition CSV file -> partitions/v1/8m.csv 37 | ``` 38 | 39 | **关闭片外 PSRAM:** 40 | 41 | ``` 42 | Component config -> ESP PSRAM -> [ ] Support for external, SPI-connected RAM -> Unselect 43 | ``` 44 | 45 | **编译:** 46 | 47 | ```bash 48 | idf.py build 49 | ``` -------------------------------------------------------------------------------- /main/boards/atoms3-echo-base/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | // AtomS3+EchoBase Board configuration 5 | 6 | #include 7 | 8 | #define AUDIO_INPUT_REFERENCE true 9 | #define AUDIO_INPUT_SAMPLE_RATE 24000 10 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 11 | 12 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_NC 13 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_6 14 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_8 15 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_7 16 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_5 17 | 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_38 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_39 20 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 21 | #define AUDIO_CODEC_GPIO_PA GPIO_NUM_NC 22 | 23 | #define BUILTIN_LED_GPIO GPIO_NUM_NC 24 | #define BOOT_BUTTON_GPIO GPIO_NUM_41 25 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC 26 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC 27 | 28 | #define DISPLAY_SDA_PIN GPIO_NUM_NC 29 | #define DISPLAY_SCL_PIN GPIO_NUM_NC 30 | #define DISPLAY_WIDTH 128 31 | #define DISPLAY_HEIGHT 128 32 | #define DISPLAY_MIRROR_X false 33 | #define DISPLAY_MIRROR_Y false 34 | #define DISPLAY_SWAP_XY false 35 | 36 | #define DISPLAY_OFFSET_X 0 37 | #define DISPLAY_OFFSET_Y 32 38 | 39 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_16 40 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 41 | 42 | 43 | #endif // _BOARD_CONFIG_H_ -------------------------------------------------------------------------------- /main/boards/atoms3-echo-base/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "atoms3-echo-base", 6 | "sdkconfig_append": [ 7 | "CONFIG_SPIRAM=n", 8 | "CONFIG_USE_AFE=n", 9 | "CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y", 10 | "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\"" 11 | ] 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /main/boards/atoms3r-cam-m12-echo-base/README.md: -------------------------------------------------------------------------------- 1 | # AtomS3R CAM/M12 + Echo Base 2 | 3 | ## 简介 4 | 5 | 12 | 13 | AtomS3R CAM、AtomS3R M12 是 M5Stack 推出的基于 ESP32-S3-PICO-1-N8R8 的物联网可编程控制器,搭载了摄像头。Atomic Echo Base 是一款专为 M5 Atom 系列主机设计的语音识别底座,采用了 ES8311 单声道音频解码器、MEMS 麦克风和 NS4150B 功率放大器的集成方案。 14 | 15 | 两款开发版均**不带屏幕、不带额外按键**,需要使用语音唤醒。必要时,需要使用 `idf.py monitor` 查看 log 以确定运行状态。 16 | 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 | - `Xiaozhi Assistant` → `Board Type` → 选择 `AtomS3R CAM/M12 + Echo Base` 34 | - `Xiaozhi Assistant` → `IoT Protocol` → 选择 `MCP协议` 可开启摄像头识别功能 35 | - `Partition Table` → `Custom partition CSV file` → 删除原有内容,输入 `partitions/v1/8m.csv` 36 | - `Serial flasher config` → `Flash size` → 选择 `8 MB` 37 | 38 | 按 `S` 保存,按 `Q` 退出。 39 | 40 | **编译** 41 | 42 | ```bash 43 | idf.py build 44 | ``` 45 | 46 | **烧录** 47 | 48 | 将 AtomS3R CAM/M12 连接到电脑,按住侧面 RESET 按键,直到 RESET 按键下方绿灯闪烁。 49 | 50 | ```bash 51 | idf.py flash 52 | ``` 53 | 54 | 烧录完毕后,按一下 RESET 按钮重启。 55 | -------------------------------------------------------------------------------- /main/boards/atoms3r-cam-m12-echo-base/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "atoms3r-cam-m12-echo-base", 6 | "sdkconfig_append": [ 7 | "CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y", 8 | "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\"" 9 | ] 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /main/boards/atoms3r-echo-base/README.md: -------------------------------------------------------------------------------- 1 | # 编译配置命令 2 | 3 | **配置编译目标为 ESP32S3:** 4 | 5 | ```bash 6 | idf.py set-target esp32s3 7 | ``` 8 | 9 | **打开 menuconfig:** 10 | 11 | ```bash 12 | idf.py menuconfig 13 | ``` 14 | 15 | **选择板子:** 16 | 17 | ``` 18 | Xiaozhi Assistant -> Board Type -> AtomS3R + Echo Base 19 | ``` 20 | 21 | **修改 flash 大小:** 22 | 23 | ``` 24 | Serial flasher config -> Flash size -> 8 MB 25 | ``` 26 | 27 | **修改分区表:** 28 | 29 | ``` 30 | Partition Table -> Custom partition CSV file -> partitions/v1/8m.csv 31 | ``` 32 | 33 | **修改 psram 配置:** 34 | 35 | ``` 36 | Component config -> ESP PSRAM -> SPI RAM config -> Mode (QUAD/OCT) -> Octal Mode PSRAM 37 | ``` 38 | 39 | **编译:** 40 | 41 | ```bash 42 | idf.py build 43 | ``` -------------------------------------------------------------------------------- /main/boards/atoms3r-echo-base/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | // AtomS3R+EchoBase Board configuration 5 | 6 | #include 7 | 8 | #define AUDIO_INPUT_REFERENCE true 9 | #define AUDIO_INPUT_SAMPLE_RATE 24000 10 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 11 | 12 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_NC 13 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_6 14 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_8 15 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_7 16 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_5 17 | 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_38 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_39 20 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 21 | #define AUDIO_CODEC_GPIO_PA GPIO_NUM_NC 22 | 23 | #define BUILTIN_LED_GPIO GPIO_NUM_NC 24 | #define BOOT_BUTTON_GPIO GPIO_NUM_41 25 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC 26 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC 27 | 28 | #define DISPLAY_SDA_PIN GPIO_NUM_NC 29 | #define DISPLAY_SCL_PIN GPIO_NUM_NC 30 | #define DISPLAY_WIDTH 128 31 | #define DISPLAY_HEIGHT 128 32 | #define DISPLAY_MIRROR_X false 33 | #define DISPLAY_MIRROR_Y false 34 | #define DISPLAY_SWAP_XY false 35 | 36 | #define DISPLAY_OFFSET_X 0 37 | #define DISPLAY_OFFSET_Y 32 38 | 39 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_NC 40 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT true 41 | 42 | 43 | #endif // _BOARD_CONFIG_H_ 44 | -------------------------------------------------------------------------------- /main/boards/atoms3r-echo-base/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "atoms3r-echo-base", 6 | "sdkconfig_append": [ 7 | "CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y", 8 | "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\"" 9 | ] 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /main/boards/bread-compact-esp32-lcd/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32", 3 | "builds": [ 4 | { 5 | "name": "bread-compact-esp32-lcd", 6 | "sdkconfig_append": [ 7 | "CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y", 8 | "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/4m.csv\"", 9 | "LCD_ST7789_240X240_7PIN=y" 10 | ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /main/boards/bread-compact-esp32/README.md: -------------------------------------------------------------------------------- 1 | # 编译配置命令 2 | 3 | **配置编译目标为 ESP32:** 4 | 5 | ```bash 6 | idf.py set-target esp32 7 | ``` 8 | 9 | **打开 menuconfig:** 10 | 11 | ```bash 12 | idf.py menuconfig 13 | ``` 14 | 15 | **选择板子:** 16 | 17 | ``` 18 | Xiaozhi Assistant -> Board Type -> 面包板 ESP32 DevKit 19 | ``` 20 | 21 | **修改 flash 大小:** 22 | 23 | ``` 24 | Serial flasher config -> Flash size -> 4 MB 25 | ``` 26 | 27 | **修改分区表:** 28 | 29 | ``` 30 | Partition Table -> Custom partition CSV file -> partitions/v1/4m.csv 31 | ``` 32 | 33 | **编译:** 34 | 35 | ```bash 36 | idf.py build 37 | ``` -------------------------------------------------------------------------------- /main/boards/bread-compact-esp32/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 16000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | // 如果使用 Duplex I2S 模式,请注释下面一行 10 | #define AUDIO_I2S_METHOD_SIMPLEX 11 | 12 | #ifdef AUDIO_I2S_METHOD_SIMPLEX 13 | 14 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_25 15 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_26 16 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_32 17 | 18 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_33 19 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_14 20 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_27 21 | 22 | #else 23 | 24 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_4 25 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_5 26 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_6 27 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_7 28 | 29 | #endif 30 | 31 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 32 | #define TOUCH_BUTTON_GPIO GPIO_NUM_5 33 | #define ASR_BUTTON_GPIO GPIO_NUM_19 34 | #define BUILTIN_LED_GPIO GPIO_NUM_2 35 | 36 | #define DISPLAY_SDA_PIN GPIO_NUM_4 37 | #define DISPLAY_SCL_PIN GPIO_NUM_15 38 | #define DISPLAY_WIDTH 128 39 | 40 | #if CONFIG_OLED_SSD1306_128X32 41 | #define DISPLAY_HEIGHT 32 42 | #elif CONFIG_OLED_SSD1306_128X64 43 | #define DISPLAY_HEIGHT 64 44 | #else 45 | #error "未选择 OLED 屏幕类型" 46 | #endif 47 | 48 | #define DISPLAY_MIRROR_X true 49 | #define DISPLAY_MIRROR_Y true 50 | 51 | 52 | // A MCP Test: Control a lamp 53 | #define LAMP_GPIO GPIO_NUM_18 54 | 55 | #endif // _BOARD_CONFIG_H_ 56 | -------------------------------------------------------------------------------- /main/boards/bread-compact-esp32/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32", 3 | "builds": [ 4 | { 5 | "name": "bread-compact-esp32", 6 | "sdkconfig_append": [ 7 | "CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y", 8 | "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/4m.csv\"", 9 | "CONFIG_OLED_SSD1306_128X64=y" 10 | ] 11 | }, 12 | { 13 | "name": "bread-compact-esp32-128x32", 14 | "sdkconfig_append": [ 15 | "CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y", 16 | "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/4m.csv\"", 17 | "CONFIG_OLED_SSD1306_128X32=y" 18 | ] 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /main/boards/bread-compact-ml307/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 16000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | // 如果使用 Duplex I2S 模式,请注释下面一行 10 | #define AUDIO_I2S_METHOD_SIMPLEX 11 | 12 | #ifdef AUDIO_I2S_METHOD_SIMPLEX 13 | 14 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_4 15 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_5 16 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_6 17 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_7 18 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_15 19 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_16 20 | 21 | #else 22 | 23 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_4 24 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_5 25 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_6 26 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_7 27 | 28 | #endif 29 | 30 | #define BUILTIN_LED_GPIO GPIO_NUM_48 31 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 32 | #define TOUCH_BUTTON_GPIO GPIO_NUM_47 33 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_40 34 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_39 35 | 36 | #define DISPLAY_SDA_PIN GPIO_NUM_41 37 | #define DISPLAY_SCL_PIN GPIO_NUM_42 38 | #define DISPLAY_WIDTH 128 39 | 40 | #if CONFIG_OLED_SSD1306_128X32 41 | #define DISPLAY_HEIGHT 32 42 | #elif CONFIG_OLED_SSD1306_128X64 43 | #define DISPLAY_HEIGHT 64 44 | #else 45 | #error "未选择 OLED 屏幕类型" 46 | #endif 47 | 48 | #define DISPLAY_MIRROR_X true 49 | #define DISPLAY_MIRROR_Y true 50 | 51 | 52 | #define ML307_RX_PIN GPIO_NUM_11 53 | #define ML307_TX_PIN GPIO_NUM_12 54 | 55 | 56 | // A MCP Test: Control a lamp 57 | #define LAMP_GPIO GPIO_NUM_18 58 | 59 | #endif // _BOARD_CONFIG_H_ 60 | -------------------------------------------------------------------------------- /main/boards/bread-compact-ml307/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "bread-compact-ml307", 6 | "sdkconfig_append": [ 7 | "CONFIG_OLED_SSD1306_128X32=y" 8 | ] 9 | }, 10 | { 11 | "name": "bread-compact-ml307-128x64", 12 | "sdkconfig_append": [ 13 | "CONFIG_OLED_SSD1306_128X64=y" 14 | ] 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /main/boards/bread-compact-wifi/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 16000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | // 如果使用 Duplex I2S 模式,请注释下面一行 10 | #define AUDIO_I2S_METHOD_SIMPLEX 11 | 12 | #ifdef AUDIO_I2S_METHOD_SIMPLEX 13 | 14 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_4 15 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_5 16 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_6 17 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_7 18 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_15 19 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_16 20 | 21 | #else 22 | 23 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_4 24 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_5 25 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_6 26 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_7 27 | 28 | #endif 29 | 30 | 31 | #define BUILTIN_LED_GPIO GPIO_NUM_48 32 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 33 | #define TOUCH_BUTTON_GPIO GPIO_NUM_47 34 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_40 35 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_39 36 | 37 | #define DISPLAY_SDA_PIN GPIO_NUM_41 38 | #define DISPLAY_SCL_PIN GPIO_NUM_42 39 | #define DISPLAY_WIDTH 128 40 | 41 | #if CONFIG_OLED_SSD1306_128X32 42 | #define DISPLAY_HEIGHT 32 43 | #elif CONFIG_OLED_SSD1306_128X64 44 | #define DISPLAY_HEIGHT 64 45 | #elif CONFIG_OLED_SH1106_128X64 46 | #define DISPLAY_HEIGHT 64 47 | #define SH1106 48 | #else 49 | #error "未选择 OLED 屏幕类型" 50 | #endif 51 | 52 | #define DISPLAY_MIRROR_X true 53 | #define DISPLAY_MIRROR_Y true 54 | 55 | 56 | // A MCP Test: Control a lamp 57 | #define LAMP_GPIO GPIO_NUM_18 58 | 59 | #endif // _BOARD_CONFIG_H_ 60 | -------------------------------------------------------------------------------- /main/boards/bread-compact-wifi/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "bread-compact-wifi", 6 | "sdkconfig_append": [ 7 | "CONFIG_OLED_SSD1306_128X32=y" 8 | ] 9 | }, 10 | { 11 | "name": "bread-compact-wifi-128x64", 12 | "sdkconfig_append": [ 13 | "CONFIG_OLED_SSD1306_128X64=y" 14 | ] 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /main/boards/common/axp2101.cc: -------------------------------------------------------------------------------- 1 | #include "axp2101.h" 2 | #include "board.h" 3 | #include "display.h" 4 | 5 | #include 6 | 7 | #define TAG "Axp2101" 8 | 9 | Axp2101::Axp2101(i2c_master_bus_handle_t i2c_bus, uint8_t addr) : I2cDevice(i2c_bus, addr) { 10 | } 11 | 12 | int Axp2101::GetBatteryCurrentDirection() { 13 | return (ReadReg(0x01) & 0b01100000) >> 5; 14 | } 15 | 16 | bool Axp2101::IsCharging() { 17 | return GetBatteryCurrentDirection() == 1; 18 | } 19 | 20 | bool Axp2101::IsDischarging() { 21 | return GetBatteryCurrentDirection() == 2; 22 | } 23 | 24 | bool Axp2101::IsChargingDone() { 25 | uint8_t value = ReadReg(0x01); 26 | return (value & 0b00000111) == 0b00000100; 27 | } 28 | 29 | int Axp2101::GetBatteryLevel() { 30 | return ReadReg(0xA4); 31 | } 32 | 33 | float Axp2101::GetTemperature() { 34 | return ReadReg(0xA5); 35 | } 36 | 37 | void Axp2101::PowerOff() { 38 | uint8_t value = ReadReg(0x10); 39 | value = value | 0x01; 40 | WriteReg(0x10, value); 41 | } 42 | -------------------------------------------------------------------------------- /main/boards/common/axp2101.h: -------------------------------------------------------------------------------- 1 | #ifndef __AXP2101_H__ 2 | #define __AXP2101_H__ 3 | 4 | #include "i2c_device.h" 5 | 6 | class Axp2101 : public I2cDevice { 7 | public: 8 | Axp2101(i2c_master_bus_handle_t i2c_bus, uint8_t addr); 9 | bool IsCharging(); 10 | bool IsDischarging(); 11 | bool IsChargingDone(); 12 | int GetBatteryLevel(); 13 | float GetTemperature(); 14 | void PowerOff(); 15 | 16 | private: 17 | int GetBatteryCurrentDirection(); 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /main/boards/common/backlight.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | 10 | class Backlight { 11 | public: 12 | Backlight(); 13 | ~Backlight(); 14 | 15 | void RestoreBrightness(); 16 | void SetBrightness(uint8_t brightness, bool permanent = false); 17 | inline uint8_t brightness() const { return brightness_; } 18 | 19 | protected: 20 | void OnTransitionTimer(); 21 | virtual void SetBrightnessImpl(uint8_t brightness) = 0; 22 | 23 | esp_timer_handle_t transition_timer_ = nullptr; 24 | uint8_t brightness_ = 0; 25 | uint8_t target_brightness_ = 0; 26 | uint8_t step_ = 1; 27 | }; 28 | 29 | 30 | class PwmBacklight : public Backlight { 31 | public: 32 | PwmBacklight(gpio_num_t pin, bool output_invert = false); 33 | ~PwmBacklight(); 34 | 35 | void SetBrightnessImpl(uint8_t brightness) override; 36 | }; 37 | -------------------------------------------------------------------------------- /main/boards/common/button.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTON_H_ 2 | #define BUTTON_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class Button { 12 | public: 13 | Button(button_handle_t button_handle); 14 | Button(gpio_num_t gpio_num, bool active_high = false, uint16_t long_press_time = 0, uint16_t short_press_time = 0); 15 | ~Button(); 16 | 17 | void OnPressDown(std::function callback); 18 | void OnPressUp(std::function callback); 19 | void OnLongPress(std::function callback); 20 | void OnClick(std::function callback); 21 | void OnDoubleClick(std::function callback); 22 | void OnMultipleClick(std::function callback, uint8_t click_count = 3); 23 | 24 | protected: 25 | gpio_num_t gpio_num_; 26 | button_handle_t button_handle_ = nullptr; 27 | 28 | std::function on_press_down_; 29 | std::function on_press_up_; 30 | std::function on_long_press_; 31 | std::function on_click_; 32 | std::function on_double_click_; 33 | std::function on_multiple_click_; 34 | }; 35 | 36 | #if CONFIG_SOC_ADC_SUPPORTED 37 | class AdcButton : public Button { 38 | public: 39 | AdcButton(const button_adc_config_t& adc_config); 40 | }; 41 | #endif 42 | 43 | #endif // BUTTON_H_ 44 | -------------------------------------------------------------------------------- /main/boards/common/camera.h: -------------------------------------------------------------------------------- 1 | #ifndef CAMERA_H 2 | #define CAMERA_H 3 | 4 | #include 5 | 6 | class Camera { 7 | public: 8 | virtual void SetExplainUrl(const std::string& url, const std::string& token) = 0; 9 | virtual bool Capture() = 0; 10 | virtual bool SetHMirror(bool enabled) = 0; 11 | virtual bool SetVFlip(bool enabled) = 0; 12 | virtual std::string Explain(const std::string& question) = 0; 13 | }; 14 | 15 | #endif // CAMERA_H 16 | -------------------------------------------------------------------------------- /main/boards/common/esp32_camera.h: -------------------------------------------------------------------------------- 1 | #ifndef ESP32_CAMERA_H 2 | #define ESP32_CAMERA_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include "camera.h" 13 | 14 | struct JpegChunk { 15 | uint8_t* data; 16 | size_t len; 17 | }; 18 | 19 | class Esp32Camera : public Camera { 20 | private: 21 | camera_fb_t* fb_ = nullptr; 22 | lv_img_dsc_t preview_image_; 23 | std::string explain_url_; 24 | std::string explain_token_; 25 | std::thread encoder_thread_; 26 | 27 | public: 28 | Esp32Camera(const camera_config_t& config); 29 | ~Esp32Camera(); 30 | 31 | virtual void SetExplainUrl(const std::string& url, const std::string& token); 32 | virtual bool Capture(); 33 | // 翻转控制函数 34 | virtual bool SetHMirror(bool enabled) override; 35 | virtual bool SetVFlip(bool enabled) override; 36 | virtual std::string Explain(const std::string& question); 37 | }; 38 | 39 | #endif // ESP32_CAMERA_H -------------------------------------------------------------------------------- /main/boards/common/i2c_device.cc: -------------------------------------------------------------------------------- 1 | #include "i2c_device.h" 2 | 3 | #include 4 | 5 | #define TAG "I2cDevice" 6 | 7 | 8 | I2cDevice::I2cDevice(i2c_master_bus_handle_t i2c_bus, uint8_t addr) { 9 | i2c_device_config_t i2c_device_cfg = { 10 | .dev_addr_length = I2C_ADDR_BIT_LEN_7, 11 | .device_address = addr, 12 | .scl_speed_hz = 400 * 1000, 13 | .scl_wait_us = 0, 14 | .flags = { 15 | .disable_ack_check = 0, 16 | }, 17 | }; 18 | ESP_ERROR_CHECK(i2c_master_bus_add_device(i2c_bus, &i2c_device_cfg, &i2c_device_)); 19 | assert(i2c_device_ != NULL); 20 | } 21 | 22 | void I2cDevice::WriteReg(uint8_t reg, uint8_t value) { 23 | uint8_t buffer[2] = {reg, value}; 24 | ESP_ERROR_CHECK(i2c_master_transmit(i2c_device_, buffer, 2, 100)); 25 | } 26 | 27 | uint8_t I2cDevice::ReadReg(uint8_t reg) { 28 | uint8_t buffer[1]; 29 | ESP_ERROR_CHECK(i2c_master_transmit_receive(i2c_device_, ®, 1, buffer, 1, 100)); 30 | return buffer[0]; 31 | } 32 | 33 | void I2cDevice::ReadRegs(uint8_t reg, uint8_t* buffer, size_t length) { 34 | ESP_ERROR_CHECK(i2c_master_transmit_receive(i2c_device_, ®, 1, buffer, length, 100)); 35 | } -------------------------------------------------------------------------------- /main/boards/common/i2c_device.h: -------------------------------------------------------------------------------- 1 | #ifndef I2C_DEVICE_H 2 | #define I2C_DEVICE_H 3 | 4 | #include 5 | 6 | class I2cDevice { 7 | public: 8 | I2cDevice(i2c_master_bus_handle_t i2c_bus, uint8_t addr); 9 | 10 | protected: 11 | i2c_master_dev_handle_t i2c_device_; 12 | 13 | void WriteReg(uint8_t reg, uint8_t value); 14 | uint8_t ReadReg(uint8_t reg); 15 | void ReadRegs(uint8_t reg, uint8_t* buffer, size_t length); 16 | }; 17 | 18 | #endif // I2C_DEVICE_H 19 | -------------------------------------------------------------------------------- /main/boards/common/knob.cc: -------------------------------------------------------------------------------- 1 | #include "knob.h" 2 | 3 | static const char* TAG = "Knob"; 4 | 5 | Knob::Knob(gpio_num_t pin_a, gpio_num_t pin_b) { 6 | knob_config_t config = { 7 | .default_direction = 0, 8 | .gpio_encoder_a = static_cast(pin_a), 9 | .gpio_encoder_b = static_cast(pin_b), 10 | }; 11 | 12 | esp_err_t err = ESP_OK; 13 | knob_handle_ = iot_knob_create(&config); 14 | if (knob_handle_ == NULL) { 15 | ESP_LOGE(TAG, "Failed to create knob instance"); 16 | return; 17 | } 18 | 19 | err = iot_knob_register_cb(knob_handle_, KNOB_LEFT, knob_callback, this); 20 | if (err != ESP_OK) { 21 | ESP_LOGE(TAG, "Failed to register left callback: %s", esp_err_to_name(err)); 22 | return; 23 | } 24 | 25 | err = iot_knob_register_cb(knob_handle_, KNOB_RIGHT, knob_callback, this); 26 | if (err != ESP_OK) { 27 | ESP_LOGE(TAG, "Failed to register right callback: %s", esp_err_to_name(err)); 28 | return; 29 | } 30 | 31 | ESP_LOGI(TAG, "Knob initialized with pins A:%d B:%d", pin_a, pin_b); 32 | } 33 | 34 | Knob::~Knob() { 35 | if (knob_handle_ != NULL) { 36 | iot_knob_delete(knob_handle_); 37 | knob_handle_ = NULL; 38 | } 39 | } 40 | 41 | void Knob::OnRotate(std::function callback) { 42 | on_rotate_ = callback; 43 | } 44 | 45 | void Knob::knob_callback(void* arg, void* data) { 46 | Knob* knob = static_cast(data); 47 | knob_event_t event = iot_knob_get_event(arg); 48 | 49 | if (knob->on_rotate_) { 50 | knob->on_rotate_(event == KNOB_RIGHT); 51 | } 52 | } -------------------------------------------------------------------------------- /main/boards/common/knob.h: -------------------------------------------------------------------------------- 1 | #ifndef KNOB_H_ 2 | #define KNOB_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class Knob { 10 | public: 11 | Knob(gpio_num_t pin_a, gpio_num_t pin_b); 12 | ~Knob(); 13 | 14 | void OnRotate(std::function callback); 15 | 16 | private: 17 | static void knob_callback(void* arg, void* data); 18 | 19 | knob_handle_t knob_handle_; 20 | gpio_num_t pin_a_; 21 | gpio_num_t pin_b_; 22 | std::function on_rotate_; 23 | }; 24 | 25 | #endif // KNOB_H_ -------------------------------------------------------------------------------- /main/boards/common/lamp_controller.h: -------------------------------------------------------------------------------- 1 | #ifndef __LAMP_CONTROLLER_H__ 2 | #define __LAMP_CONTROLLER_H__ 3 | 4 | #include "mcp_server.h" 5 | 6 | 7 | class LampController { 8 | private: 9 | bool power_ = false; 10 | gpio_num_t gpio_num_; 11 | 12 | public: 13 | LampController(gpio_num_t gpio_num) : gpio_num_(gpio_num) { 14 | gpio_config_t config = { 15 | .pin_bit_mask = (1ULL << gpio_num_), 16 | .mode = GPIO_MODE_OUTPUT, 17 | .pull_up_en = GPIO_PULLUP_DISABLE, 18 | .pull_down_en = GPIO_PULLDOWN_DISABLE, 19 | .intr_type = GPIO_INTR_DISABLE, 20 | }; 21 | ESP_ERROR_CHECK(gpio_config(&config)); 22 | gpio_set_level(gpio_num_, 0); 23 | 24 | auto& mcp_server = McpServer::GetInstance(); 25 | mcp_server.AddTool("self.lamp.get_state", "Get the power state of the lamp", PropertyList(), [this](const PropertyList& properties) -> ReturnValue { 26 | return power_ ? "{\"power\": true}" : "{\"power\": false}"; 27 | }); 28 | 29 | mcp_server.AddTool("self.lamp.turn_on", "Turn on the lamp", PropertyList(), [this](const PropertyList& properties) -> ReturnValue { 30 | power_ = true; 31 | gpio_set_level(gpio_num_, 1); 32 | return true; 33 | }); 34 | 35 | mcp_server.AddTool("self.lamp.turn_off", "Turn off the lamp", PropertyList(), [this](const PropertyList& properties) -> ReturnValue { 36 | power_ = false; 37 | gpio_set_level(gpio_num_, 0); 38 | return true; 39 | }); 40 | } 41 | }; 42 | 43 | 44 | #endif // __LAMP_CONTROLLER_H__ 45 | -------------------------------------------------------------------------------- /main/boards/common/ml307_board.h: -------------------------------------------------------------------------------- 1 | #ifndef ML307_BOARD_H 2 | #define ML307_BOARD_H 3 | 4 | #include "board.h" 5 | #include 6 | 7 | class Ml307Board : public Board { 8 | protected: 9 | Ml307AtModem modem_; 10 | virtual std::string GetBoardJson() override; 11 | void WaitForNetworkReady(); 12 | 13 | public: 14 | Ml307Board(gpio_num_t tx_pin, gpio_num_t rx_pin, size_t rx_buffer_size = 4096); 15 | virtual std::string GetBoardType() override; 16 | virtual void StartNetwork() override; 17 | virtual Http* CreateHttp() override; 18 | virtual WebSocket* CreateWebSocket() override; 19 | virtual Mqtt* CreateMqtt() override; 20 | virtual Udp* CreateUdp() override; 21 | virtual const char* GetNetworkStateIcon() override; 22 | virtual void SetPowerSaveMode(bool enabled) override; 23 | virtual AudioCodec* GetAudioCodec() override { return nullptr; } 24 | virtual std::string GetDeviceStatusJson() override; 25 | }; 26 | 27 | #endif // ML307_BOARD_H 28 | -------------------------------------------------------------------------------- /main/boards/common/power_save_timer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | class PowerSaveTimer { 9 | public: 10 | PowerSaveTimer(int cpu_max_freq, int seconds_to_sleep = 20, int seconds_to_shutdown = -1); 11 | ~PowerSaveTimer(); 12 | 13 | void SetEnabled(bool enabled); 14 | void OnEnterSleepMode(std::function callback); 15 | void OnExitSleepMode(std::function callback); 16 | void OnShutdownRequest(std::function callback); 17 | void WakeUp(); 18 | 19 | private: 20 | void PowerSaveCheck(); 21 | 22 | esp_timer_handle_t power_save_timer_ = nullptr; 23 | bool enabled_ = false; 24 | bool in_sleep_mode_ = false; 25 | int ticks_ = 0; 26 | int cpu_max_freq_; 27 | int seconds_to_sleep_; 28 | int seconds_to_shutdown_; 29 | 30 | std::function on_enter_sleep_mode_; 31 | std::function on_exit_sleep_mode_; 32 | std::function on_shutdown_request_; 33 | }; 34 | -------------------------------------------------------------------------------- /main/boards/common/sy6970.h: -------------------------------------------------------------------------------- 1 | #ifndef __SY6970_H__ 2 | #define __SY6970_H__ 3 | 4 | #include "i2c_device.h" 5 | 6 | class Sy6970 : public I2cDevice { 7 | public: 8 | Sy6970(i2c_master_bus_handle_t i2c_bus, uint8_t addr); 9 | bool IsCharging(); 10 | bool IsPowerGood(); 11 | bool IsChargingDone(); 12 | int GetBatteryLevel(); 13 | void PowerOff(); 14 | 15 | private: 16 | int GetChangingStatus(); 17 | int GetBatteryVoltage(); 18 | int GetChargeTargetVoltage(); 19 | }; 20 | 21 | #endif -------------------------------------------------------------------------------- /main/boards/common/system_reset.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYSTEM_RESET_H 2 | #define _SYSTEM_RESET_H 3 | 4 | #include 5 | 6 | class SystemReset { 7 | public: 8 | SystemReset(gpio_num_t reset_nvs_pin, gpio_num_t reset_factory_pin); // 构造函数私有化 9 | void CheckButtons(); 10 | 11 | private: 12 | gpio_num_t reset_nvs_pin_; 13 | gpio_num_t reset_factory_pin_; 14 | 15 | void ResetNvsFlash(); 16 | void ResetToFactory(); 17 | void RestartInSeconds(int seconds); 18 | }; 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /main/boards/common/wifi_board.h: -------------------------------------------------------------------------------- 1 | #ifndef WIFI_BOARD_H 2 | #define WIFI_BOARD_H 3 | 4 | #include "board.h" 5 | 6 | class WifiBoard : public Board { 7 | protected: 8 | bool wifi_config_mode_ = false; 9 | void EnterWifiConfigMode(); 10 | virtual std::string GetBoardJson() override; 11 | 12 | public: 13 | WifiBoard(); 14 | virtual std::string GetBoardType() override; 15 | virtual void StartNetwork() override; 16 | virtual Http* CreateHttp() override; 17 | virtual WebSocket* CreateWebSocket() override; 18 | virtual Mqtt* CreateMqtt() override; 19 | virtual Udp* CreateUdp() override; 20 | virtual const char* GetNetworkStateIcon() override; 21 | virtual void SetPowerSaveMode(bool enabled) override; 22 | virtual void ResetWifiConfiguration(); 23 | virtual AudioCodec* GetAudioCodec() override { return nullptr; } 24 | virtual std::string GetDeviceStatusJson() override; 25 | }; 26 | 27 | #endif // WIFI_BOARD_H 28 | -------------------------------------------------------------------------------- /main/boards/df-k10/README.md: -------------------------------------------------------------------------------- 1 | # DFRobot 行空板 K10 2 | 3 | ## 按键配置 4 | * A:短按-打断/唤醒,长按1s-音量调大 5 | * B:短按-打断/唤醒,长按1s-音量调小 6 | 7 | ## 编译配置命令 8 | 9 | **配置编译目标为 ESP32S3:** 10 | 11 | ```bash 12 | idf.py set-target esp32s3 13 | ``` 14 | 15 | **打开 menuconfig:** 16 | 17 | ```bash 18 | idf.py menuconfig 19 | ``` 20 | 21 | **选择板子:** 22 | 23 | ``` 24 | Xiaozhi Assistant -> Board Type -> DFRobot 行空板 K10 25 | ``` 26 | 27 | **修改 psram 配置:** 28 | 29 | ``` 30 | Component config -> ESP PSRAM -> SPI RAM config -> Mode (QUAD/OCT) -> Octal Mode PSRAM 31 | ``` 32 | 33 | **编译:** 34 | 35 | ```bash 36 | idf.py build 37 | ``` -------------------------------------------------------------------------------- /main/boards/df-k10/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "df-k10", 6 | "sdkconfig_append": [ 7 | "CONFIG_SPIRAM_MODE_OCT=y", 8 | "CONFIG_IOT_PROTOCOL_MCP=y" 9 | ] 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /main/boards/df-k10/k10_audio_codec.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOX_AUDIO_CODEC_H 2 | #define _BOX_AUDIO_CODEC_H 3 | 4 | #include "audio_codec.h" 5 | 6 | #include 7 | #include 8 | 9 | class K10AudioCodec : public AudioCodec { 10 | private: 11 | const audio_codec_data_if_t* data_if_ = nullptr; 12 | const audio_codec_ctrl_if_t* out_ctrl_if_ = nullptr; 13 | const audio_codec_if_t* out_codec_if_ = nullptr; 14 | const audio_codec_ctrl_if_t* in_ctrl_if_ = nullptr; 15 | const audio_codec_if_t* in_codec_if_ = nullptr; 16 | const audio_codec_gpio_if_t* gpio_if_ = nullptr; 17 | 18 | esp_codec_dev_handle_t output_dev_ = nullptr; 19 | esp_codec_dev_handle_t input_dev_ = nullptr; 20 | 21 | void CreateDuplexChannels(gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din); 22 | 23 | virtual int Read(int16_t* dest, int samples) override; 24 | virtual int Write(const int16_t* data, int samples) override; 25 | 26 | public: 27 | K10AudioCodec(void* i2c_master_handle, int input_sample_rate, int output_sample_rate, 28 | gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din, 29 | gpio_num_t pa_pin, uint8_t es8311_addr, uint8_t es7210_addr, bool input_reference); 30 | virtual ~K10AudioCodec(); 31 | 32 | virtual void SetOutputVolume(int volume) override; 33 | virtual void EnableInput(bool enable) override; 34 | virtual void EnableOutput(bool enable) override; 35 | }; 36 | 37 | #endif // _BOX_AUDIO_CODEC_H 38 | -------------------------------------------------------------------------------- /main/boards/df-s3-ai-cam/README.md: -------------------------------------------------------------------------------- 1 | # DFRobot ESP32-S3 AI智能摄像头模块 2 | 3 | ## 介绍 4 | ESP32-S3 AI CAM是一款基于ESP32-S3芯片设计的智能摄像头模组,专为视频图像处理和语音交互打造,适用于视频监控、边缘图像识别、语音对话等AI项目。 5 | ![](https://ws.dfrobot.com.cn/FsTrGbrX2NZAwzWS8OSQGOGikuYA) 6 | 7 | [点击查看详细介绍](https://wiki.dfrobot.com.cn/SKU_DFR1154_ESP32_S3_AI_CAM) 8 | 9 | [点击查看视觉功能演示](https://www.bilibili.com/video/BV1ktjSzNEUU/) 10 | 11 | # 特性 12 | * 使用PDM麦克风 13 | * 板载 OV3660 摄像头 14 | 15 | ## 按键配置 16 | * BOOT:短按-打断/唤醒 17 | 18 | ## 编译配置命令 19 | 20 | **配置编译目标为 ESP32S3:** 21 | 22 | ```bash 23 | idf.py set-target esp32s3 24 | ``` 25 | 26 | **打开 menuconfig:** 27 | 28 | ```bash 29 | idf.py menuconfig 30 | ``` 31 | 32 | **选择板子:** 33 | 34 | ``` 35 | Xiaozhi Assistant -> Board Type -> DFRobot ESP32-S3 AI智能摄像头模块 36 | ``` 37 | 38 | **修改 psram 配置:** 39 | 40 | ``` 41 | Component config -> ESP PSRAM -> SPI RAM config -> Mode (QUAD/OCT) -> Octal Mode PSRAM 42 | ``` 43 | 44 | **修改 WiFi 发射功率 为 10:** 45 | 46 | ``` 47 | Component config -> PHY -> (10)Max WiFi TX power (dBm) 48 | ``` 49 | 50 | **编译:** 51 | 52 | ```bash 53 | idf.py build 54 | ``` -------------------------------------------------------------------------------- /main/boards/df-s3-ai-cam/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "df-s3-ai-cam", 6 | "sdkconfig_append": [ 7 | "CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=10", 8 | "CONFIG_ESP_PHY_MAX_TX_POWER=10", 9 | "CONFIG_SPIRAM_MODE_OCT=y", 10 | "CONFIG_IOT_PROTOCOL_MCP=y" 11 | ] 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /main/boards/doit-s3-aibox/README.md: -------------------------------------------------------------------------------- 1 | # 四博智联AI陪伴盒子 2 | 3 | # 特性 4 | * 使用PDM麦克风 5 | * 使用共阳极LED 6 | 7 | ## 按键配置 8 | * BUTTON3:短按-打断/唤醒 9 | * BUTTON1:音量+ 10 | * BUTTON2:音量- 11 | 12 | ## 编译配置命令 13 | 14 | **配置编译目标为 ESP32S3:** 15 | 16 | ```bash 17 | idf.py set-target esp32s3 18 | ``` 19 | 20 | **打开 menuconfig:** 21 | 22 | ```bash 23 | idf.py menuconfig 24 | ``` 25 | 26 | **选择板子:** 27 | 28 | ``` 29 | Xiaozhi Assistant -> Board Type -> 四博智联AI陪伴盒子 30 | ``` 31 | 32 | **修改 psram 配置:** 33 | 34 | ``` 35 | Component config -> ESP PSRAM -> SPI RAM config -> Mode (QUAD/OCT) -> Octal Mode PSRAM 36 | ``` 37 | 38 | **编译:** 39 | 40 | ```bash 41 | idf.py build 42 | ``` -------------------------------------------------------------------------------- /main/boards/doit-s3-aibox/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 16000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_41 10 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_40 11 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_42 12 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_18 13 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_17 14 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_16 15 | 16 | /* 17 | IO9: BUTTON2 18 | IO10: BUTTON3 引出:KEY3 19 | IO15: BUTTON1 20 | */ 21 | #define BUILTIN_LED_GPIO GPIO_NUM_45 22 | #define BOOT_BUTTON_GPIO GPIO_NUM_10 23 | #define TOUCH_BUTTON_GPIO GPIO_NUM_NC 24 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_15 25 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_9 26 | #define RESET_NVS_BUTTON_GPIO GPIO_NUM_10 27 | #define RESET_FACTORY_BUTTON_GPIO GPIO_NUM_NC 28 | 29 | #endif // _BOARD_CONFIG_H_ 30 | -------------------------------------------------------------------------------- /main/boards/doit-s3-aibox/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "doit-s3-aibox", 6 | "sdkconfig_append": [ 7 | ] 8 | } 9 | ] 10 | } -------------------------------------------------------------------------------- /main/boards/du-chatx/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 16000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_39 10 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_38 11 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_7 12 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_40 13 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_42 14 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_2 15 | 16 | #define BUILTIN_LED_GPIO GPIO_NUM_48 17 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 18 | #define TOUCH_BUTTON_GPIO GPIO_NUM_NC 19 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC 20 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC 21 | 22 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_9 23 | #define DISPLAY_MOSI_PIN GPIO_NUM_18 24 | #define DISPLAY_CLK_PIN GPIO_NUM_17 25 | #define DISPLAY_DC_PIN GPIO_NUM_8 26 | #define DISPLAY_RST_PIN GPIO_NUM_20 27 | #define DISPLAY_CS_PIN GPIO_NUM_16 28 | 29 | #define DISPLAY_WIDTH 128 30 | #define DISPLAY_HEIGHT 160 31 | #define DISPLAY_MIRROR_X true 32 | #define DISPLAY_MIRROR_Y true 33 | #define DISPLAY_SWAP_XY false 34 | #define DISPLAY_INVERT_COLOR false 35 | #define DISPLAY_RGB_ORDER LCD_RGB_ELEMENT_ORDER_RGB 36 | #define DISPLAY_OFFSET_X 2 37 | #define DISPLAY_OFFSET_Y 1 38 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 39 | 40 | #endif // _BOARD_CONFIG_H_ 41 | -------------------------------------------------------------------------------- /main/boards/du-chatx/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "du-chatx", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/esp-box-3/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_INPUT_REFERENCE true 10 | 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_2 12 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_45 13 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_17 14 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_16 15 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_15 16 | 17 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_46 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_8 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_18 20 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 21 | #define AUDIO_CODEC_ES7210_ADDR ES7210_CODEC_DEFAULT_ADDR 22 | 23 | #define BUILTIN_LED_GPIO GPIO_NUM_NC 24 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 25 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC 26 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC 27 | 28 | #define DISPLAY_WIDTH 320 29 | #define DISPLAY_HEIGHT 240 30 | #define DISPLAY_MIRROR_X true 31 | #define DISPLAY_MIRROR_Y true 32 | #define DISPLAY_SWAP_XY false 33 | 34 | #define DISPLAY_OFFSET_X 0 35 | #define DISPLAY_OFFSET_Y 0 36 | 37 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_47 38 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 39 | 40 | 41 | #endif // _BOARD_CONFIG_H_ 42 | -------------------------------------------------------------------------------- /main/boards/esp-box-3/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "esp-box-3", 6 | "sdkconfig_append": [ 7 | "CONFIG_USE_DEVICE_AEC=y" 8 | ] 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /main/boards/esp-box-lite/box_audio_codec_lite.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOX_AUDIO_CODEC_LITE_H 2 | #define _BOX_AUDIO_CODEC_LITE_H 3 | 4 | #include "audio_codec.h" 5 | 6 | #include 7 | #include 8 | 9 | class BoxAudioCodecLite : public AudioCodec { 10 | private: 11 | const audio_codec_data_if_t* data_if_ = nullptr; 12 | const audio_codec_ctrl_if_t* out_ctrl_if_ = nullptr; 13 | const audio_codec_if_t* out_codec_if_ = nullptr; 14 | const audio_codec_ctrl_if_t* in_ctrl_if_ = nullptr; 15 | const audio_codec_if_t* in_codec_if_ = nullptr; 16 | const audio_codec_gpio_if_t* gpio_if_ = nullptr; 17 | 18 | esp_codec_dev_handle_t output_dev_ = nullptr; 19 | esp_codec_dev_handle_t input_dev_ = nullptr; 20 | // ref buffer used for aec 21 | std::vector ref_buffer_; 22 | int read_pos_ = 0; 23 | int write_pos_ = 0; 24 | 25 | void CreateDuplexChannels(gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din); 26 | 27 | virtual int Read(int16_t* dest, int samples) override; 28 | virtual int Write(const int16_t* data, int samples) override; 29 | 30 | public: 31 | BoxAudioCodecLite(void* i2c_master_handle, int input_sample_rate, int output_sample_rate, 32 | gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din, 33 | gpio_num_t pa_pin, bool input_reference); 34 | virtual ~BoxAudioCodecLite(); 35 | 36 | virtual void SetOutputVolume(int volume) override; 37 | virtual void EnableInput(bool enable) override; 38 | virtual void EnableOutput(bool enable) override; 39 | }; 40 | 41 | #endif // _BOX_AUDIO_CODEC_LITE_H 42 | -------------------------------------------------------------------------------- /main/boards/esp-box-lite/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 16000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 16000 8 | 9 | #define AUDIO_INPUT_REFERENCE CONFIG_USE_AUDIO_PROCESSOR 10 | 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_2 12 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_47 13 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_17 14 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_16 15 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_15 16 | 17 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_46 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_8 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_18 20 | 21 | #define BUILTIN_LED_GPIO GPIO_NUM_NC 22 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 23 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC 24 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC 25 | 26 | #define DISPLAY_WIDTH 320 27 | #define DISPLAY_HEIGHT 240 28 | #define DISPLAY_MIRROR_X false 29 | #define DISPLAY_MIRROR_Y true 30 | #define DISPLAY_SWAP_XY false 31 | 32 | #define DISPLAY_OFFSET_X 0 33 | #define DISPLAY_OFFSET_Y 0 34 | 35 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_45 36 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT true 37 | 38 | 39 | #endif // _BOARD_CONFIG_H_ 40 | -------------------------------------------------------------------------------- /main/boards/esp-box-lite/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "esp-box-lite", 6 | "sdkconfig_append": ["CONFIG_SOC_ADC_SUPPORTED=y"] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/esp-box/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_INPUT_REFERENCE true 10 | 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_2 12 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_47 13 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_17 14 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_16 15 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_15 16 | 17 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_46 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_8 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_18 20 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 21 | #define AUDIO_CODEC_ES7210_ADDR ES7210_CODEC_DEFAULT_ADDR 22 | 23 | #define BUILTIN_LED_GPIO GPIO_NUM_NC 24 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 25 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC 26 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC 27 | 28 | #define DISPLAY_WIDTH 320 29 | #define DISPLAY_HEIGHT 240 30 | #define DISPLAY_MIRROR_X true 31 | #define DISPLAY_MIRROR_Y true 32 | #define DISPLAY_SWAP_XY false 33 | 34 | #define DISPLAY_OFFSET_X 0 35 | #define DISPLAY_OFFSET_Y 0 36 | 37 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_45 38 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 39 | 40 | 41 | #endif // _BOARD_CONFIG_H_ 42 | -------------------------------------------------------------------------------- /main/boards/esp-box/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "esp-box", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/esp-hi/README.md: -------------------------------------------------------------------------------- 1 | # ESP-Hi 2 | 3 | ## 简介 4 | 5 | 10 | 11 | ESP-Hi 是 ESP Friends 开源的一款基于 ESP32C3 的超**低成本** AI 对话机器人。ESP-Hi 集成了一个0.96寸的彩屏,用于显示表情,**机器狗已实现数十种动作**。通过对 ESP32-C3 外设的充分挖掘,仅需最少的板级硬件即可实现拾音和发声,同步优化了软件,降低内存与 Flash 占用,在资源受限的情况下同时实现了**唤醒词检测**与多种外设驱动。硬件详情等可查看[立创开源项目](https://oshwhub.com/esp-college/esp-hi)。 12 | 13 | ## WebUI 14 | 15 | ESP-Hi x 小智内置了一个控制身体运动的 WebUI,请将手机与 ESP-Hi 连接到同一个 Wi-Fi 下,手机访问 `http://esp-hi.local/` 以使用。 16 | 17 | 如需禁用,请取消 `ESP_HI_WEB_CONTROL_ENABLED`,即取消勾选 `Component config` → `Servo Dog Configuration` → `Web Control` → `Enable ESP-HI Web Control`。 18 | 19 | ## 配置、编译命令 20 | 21 | 由于 ESP-Hi 需要配置较多的 sdkconfig 选项,推荐使用编译脚本编译。 22 | 23 | **编译** 24 | 25 | ```bash 26 | python ./scripts/release.py esp-hi 27 | ``` 28 | 29 | 如需手动编译,请参考 `esp-hi/config.json` 修改 menuconfig 对应选项。 30 | 31 | **烧录** 32 | 33 | ```bash 34 | idf.py flash 35 | ``` 36 | 37 | 38 | > [!TIP] 39 | > 40 | > **舵机控制会占用 ESP-Hi 的 USB Type-C 接口**,导致无法连接电脑(无法烧录/查看运行日志)。如遇此情况,请按以下提示操作: 41 | > 42 | > **烧录** 43 | > 44 | > 1. 断开 ESP-Hi 的电源,只留头部,不要连接身体。 45 | > 2. 按住 ESP-Hi 的按钮并连接电脑。 46 | > 47 | > 此时,ESP-Hi (ESP32C3) 应当处于烧录模式,可以使用电脑烧录程序。烧录完成后,可能需要重新插拔电源。 48 | > 49 | > **查看 log** 50 | > 51 | > 请设置 `CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y`,即 `Component config` → `ESP System Settings` → `Channel for console output` 选择 `USB Serial/JTAG Controller`。这同时会禁用舵机控制功能。 52 | -------------------------------------------------------------------------------- /main/boards/esp-hi/adc_pdm_audio_codec.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOX_AUDIO_CODEC_H 2 | #define _BOX_AUDIO_CODEC_H 3 | 4 | #include "audio_codec.h" 5 | 6 | #include 7 | #include 8 | 9 | class AdcPdmAudioCodec : public AudioCodec { 10 | private: 11 | esp_codec_dev_handle_t output_dev_ = nullptr; 12 | esp_codec_dev_handle_t input_dev_ = nullptr; 13 | gpio_num_t pa_ctrl_pin_ = GPIO_NUM_NC; 14 | 15 | virtual int Read(int16_t* dest, int samples) override; 16 | virtual int Write(const int16_t* data, int samples) override; 17 | 18 | public: 19 | AdcPdmAudioCodec(int input_sample_rate, int output_sample_rate, 20 | uint32_t adc_mic_channel, gpio_num_t pdm_speak_p, gpio_num_t pdm_speak_n, gpio_num_t pa_ctl); 21 | virtual ~AdcPdmAudioCodec(); 22 | 23 | virtual void SetOutputVolume(int volume) override; 24 | virtual void EnableInput(bool enable) override; 25 | virtual void EnableOutput(bool enable) override; 26 | void Start(); 27 | }; 28 | 29 | #endif // _BOX_AUDIO_CODEC_H 30 | -------------------------------------------------------------------------------- /main/boards/esp-hi/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 16000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_ADC_MIC_CHANNEL 2 10 | #define AUDIO_PDM_SPEAK_P_GPIO GPIO_NUM_6 11 | #define AUDIO_PDM_SPEAK_N_GPIO GPIO_NUM_7 12 | #define AUDIO_PA_CTL_GPIO GPIO_NUM_3 13 | 14 | #define BUILTIN_LED_GPIO GPIO_NUM_NC 15 | #define BOOT_BUTTON_GPIO GPIO_NUM_9 16 | #define MOVE_WAKE_BUTTON_GPIO GPIO_NUM_0 17 | #define AUDIO_WAKE_BUTTON_GPIO GPIO_NUM_1 18 | 19 | #define DISPLAY_MOSI_PIN GPIO_NUM_4 20 | #define DISPLAY_CLK_PIN GPIO_NUM_5 21 | #define DISPLAY_DC_PIN GPIO_NUM_10 22 | #define DISPLAY_RST_PIN GPIO_NUM_NC 23 | #define DISPLAY_CS_PIN GPIO_NUM_NC 24 | 25 | #define FL_GPIO_NUM GPIO_NUM_21 26 | #define FR_GPIO_NUM GPIO_NUM_19 27 | #define BL_GPIO_NUM GPIO_NUM_20 28 | #define BR_GPIO_NUM GPIO_NUM_18 29 | 30 | #define LCD_TYPE_ST7789_SERIAL 31 | #define DISPLAY_WIDTH 160 32 | #define DISPLAY_HEIGHT 80 33 | #define DISPLAY_MIRROR_X false 34 | #define DISPLAY_MIRROR_Y true 35 | #define DISPLAY_SWAP_XY true 36 | 37 | #define DISPLAY_INVERT_COLOR true 38 | #define DISPLAY_RGB_ORDER LCD_RGB_ELEMENT_ORDER_RGB 39 | #define DISPLAY_OFFSET_X 0 40 | #define DISPLAY_OFFSET_Y 0 41 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 42 | #define DISPLAY_SPI_MODE 0 43 | 44 | #endif // _BOARD_CONFIG_H_ 45 | -------------------------------------------------------------------------------- /main/boards/esp-s3-lcd-ev-board/README.md: -------------------------------------------------------------------------------- 1 | 请确认自己的开发板硬件版本,如果硬件版本,在配置中进行ev_board type进行选择 2 | 1.4与1.5只有io进行变更 3 | 可以查看官方文档,确认具体细节https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-lcd-ev-board/user_guide.html 4 | 具体调整为: 5 | I2C_SCL IO18 -> IO48 6 | I2C_SDA IO8 -> IO47 7 | LCD_DATA6 IO47 -> IO8 8 | LCD_DATA7 IO48 -> IO18 9 | 10 | 11 | 本版本只支持了480x480的屏幕 -------------------------------------------------------------------------------- /main/boards/esp-s3-lcd-ev-board/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | 7 | #define AUDIO_INPUT_SAMPLE_RATE 16000 8 | #define AUDIO_OUTPUT_SAMPLE_RATE 16000 9 | 10 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_5 11 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_7 12 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_16 13 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_15 14 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_6 15 | 16 | #define BSP_POWER_AMP_IO (IO_EXPANDER_PIN_NUM_0) 17 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_NC 18 | 19 | //如果开发板是V1.4 IO 定义为 20 | #ifdef CONFIG_ESP_S3_LCD_EV_Board_1p4 21 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_8 22 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_18 23 | #endif 24 | //如果开发板是V1.5 IO 定义为 25 | #ifdef CONFIG_ESP_S3_LCD_EV_Board_1p5 26 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_47 27 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_48 28 | #endif 29 | 30 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 31 | #define AUDIO_CODEC_ES7210_ADDR 0x82 32 | 33 | 34 | #define BUILTIN_LED_GPIO GPIO_NUM_4 35 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 36 | 37 | #define DISPLAY_WIDTH 480 38 | #define DISPLAY_HEIGHT 480 39 | #define DISPLAY_MIRROR_X false 40 | #define DISPLAY_MIRROR_Y false 41 | #define DISPLAY_SWAP_XY false 42 | 43 | #define DISPLAY_OFFSET_X 0 44 | #define DISPLAY_OFFSET_Y 0 45 | 46 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_19 47 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 48 | 49 | 50 | 51 | 52 | 53 | #endif // _BOARD_CONFIG_H_ 54 | -------------------------------------------------------------------------------- /main/boards/esp-s3-lcd-ev-board/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "esp-s3-lcd-ev-board-1p4", 6 | "sdkconfig_append": [ 7 | "CONFIG_ESP_S3_LCD_EV_Board_1p4=y" 8 | ] 9 | }, 10 | { 11 | "name": "esp-s3-lcd-ev-board-1p5", 12 | "sdkconfig_append": [ 13 | "CONFIG_ESP_S3_LCD_EV_Board_1p5=y" 14 | ] 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /main/boards/esp-sparkbot/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "esp-sparkbot", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/esp-spot-s3/README.md: -------------------------------------------------------------------------------- 1 | # ESP-Spot S3 2 | 3 | ## 简介 4 | 5 | 10 | 11 | ESP-Spot 是 ESP Friends 开源的一款智能语音交互盒子,内置麦克风、扬声器、IMU 惯性传感器,可使用电池供电。ESP-Spot 不带屏幕,带有一个 RGB 指示灯和两个按钮。硬件详情可查看[立创开源项目](https://oshwhub.com/esp-college/esp-spot)。 12 | 13 | ESP-Spot 开源项目采用 ESP32-S3-WROOM-1-N16R8 模组。如在复刻时使用了其他大小的 Flash,需修改对应的参数。 14 | 15 | 16 | ## 配置、编译命令 17 | 18 | **配置编译目标为 ESP32S3** 19 | 20 | ```bash 21 | idf.py set-target esp32s3 22 | ``` 23 | 24 | **打开 menuconfig 并配置** 25 | 26 | ```bash 27 | idf.py menuconfig 28 | ``` 29 | 30 | 分别配置如下选项: 31 | 32 | - `Xiaozhi Assistant` → `Board Type` → 选择 `ESP-Spot-S3` 33 | 34 | 按 `S` 保存,按 `Q` 退出。 35 | 36 | **编译** 37 | 38 | ```bash 39 | idf.py build 40 | ``` 41 | 42 | **烧录** 43 | 44 | ```bash 45 | idf.py flash 46 | ``` 47 | 48 | > [!TIP] 49 | > 50 | > **若电脑始终无法找到 ESP-Spot 串口,可尝试如下步骤** 51 | > 1. 打开前盖; 52 | > 2. 拔出带有模组的 PCB 板; 53 | > 3. 按住 BOOT 同时插回 PCB 版,注意不要颠倒; 54 | > 55 | > 此时, ESP-Spot 应当已进入下载模式。在烧录完成后,可能需要重新插拔 PCB 板。 56 | -------------------------------------------------------------------------------- /main/boards/esp-spot-s3/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 16000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 16000 8 | 9 | #define AUDIO_INPUT_REFERENCE false 10 | 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_8 12 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_17 13 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_16 14 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_15 15 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_18 16 | 17 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_40 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_2 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_1 20 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 21 | 22 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 23 | #define KEY_BUTTON_GPIO GPIO_NUM_12 24 | #define LED_PIN GPIO_NUM_11 25 | 26 | #define VBAT_ADC_CHANNEL ADC_CHANNEL_9 // S3: IO10 27 | #define MCU_VCC_CTL GPIO_NUM_4 // set 1 to power on MCU 28 | #define PERP_VCC_CTL GPIO_NUM_6 // set 1 to power on peripherals 29 | 30 | #define ADC_ATTEN ADC_ATTEN_DB_12 31 | #define ADC_WIDTH ADC_BITWIDTH_DEFAULT 32 | #define FULL_BATTERY_VOLTAGE 4100 33 | #define EMPTY_BATTERY_VOLTAGE 3200 34 | 35 | #endif // _BOARD_CONFIG_H_ 36 | -------------------------------------------------------------------------------- /main/boards/esp32-cgc-144/README.md: -------------------------------------------------------------------------------- 1 | # 相关资料: 2 | - [插线款](https://www.wdmomo.fun:81/doc/index.html?file=001_%E8%AE%BE%E8%AE%A1%E9%A1%B9%E7%9B%AE/0001_%E5%B0%8F%E6%99%BAAI/003_ESP32-CGC-144%E6%8F%92%E7%BA%BF%E7%89%88%E5%B0%8F%E6%99%BAAI) 3 | 4 | - [电池款](https://www.wdmomo.fun:81/doc/index.html?file=001_%E8%AE%BE%E8%AE%A1%E9%A1%B9%E7%9B%AE/0001_%E5%B0%8F%E6%99%BAAI/004_ESP32-CGC-144%E7%94%B5%E6%B1%A0%E7%89%88%E5%B0%8F%E6%99%BAAI) 5 | 6 | # 编译配置命令 7 | 8 | **配置编译目标为 ESP32:** 9 | 10 | ```bash 11 | idf.py set-target esp32 12 | ``` 13 | 14 | **打开 menuconfig:** 15 | 16 | ```bash 17 | idf.py menuconfig 18 | ``` 19 | 20 | **选择板子:** 21 | 22 | ``` 23 | Xiaozhi Assistant -> Board Type -> ESP32 CGC 144 24 | ``` 25 | 26 | **修改 flash 大小:** 27 | 28 | ``` 29 | Serial flasher config -> Flash size -> 4 MB 30 | ``` 31 | 32 | **修改分区表:** 33 | 34 | ``` 35 | Partition Table -> Custom partition CSV file -> partitions/v1/4m.csv 36 | ``` 37 | 38 | **编译:** 39 | 40 | ```bash 41 | idf.py build 42 | ``` 43 | -------------------------------------------------------------------------------- /main/boards/esp32-cgc-144/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32", 3 | "builds": [ 4 | { 5 | "name": "esp32-cgc-144", 6 | "sdkconfig_append": [ 7 | "CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y", 8 | "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/4m.csv\"" 9 | ] 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /main/boards/esp32-cgc/README.md: -------------------------------------------------------------------------------- 1 | # 主板开源地址: 2 | - V1:[https://oshwhub.com/wdmomo/esp32-xiaozhi-kidpcb](https://oshwhub.com/wdmomo/esp32-xiaozhi-kidpcb) 3 | - V2:[https://oshwhub.com/wdmomo/esp32-xiaozhi-kidpcb_copy](https://oshwhub.com/wdmomo/esp32-xiaozhi-kidpcb_copy) 4 | - 更多介绍:[wdmomo.fun](https://www.wdmomo.fun:81/doc/index.html?file=001_%E8%AE%BE%E8%AE%A1%E9%A1%B9%E7%9B%AE/0001_%E5%B0%8F%E6%99%BAAI/002_ESP32-CGC%E5%BC%80%E5%8F%91%E6%9D%BF%E5%B0%8F%E6%99%BAAI) 5 | 6 | # 编译配置命令 7 | 8 | **配置编译目标为 ESP32:** 9 | 10 | ```bash 11 | idf.py set-target esp32 12 | ``` 13 | 14 | **打开 menuconfig:** 15 | 16 | ```bash 17 | idf.py menuconfig 18 | ``` 19 | 20 | **选择板子:** 21 | 22 | ``` 23 | Xiaozhi Assistant -> Board Type -> ESP32 CGC 24 | ``` 25 | 26 | **选择屏幕类型:** 27 | 28 | ``` 29 | Xiaozhi Assistant -> LCD Type -> "ST7735, 分辨率128*128" 30 | ``` 31 | 32 | **修改 flash 大小:** 33 | 34 | ``` 35 | Serial flasher config -> Flash size -> 4 MB 36 | ``` 37 | 38 | **修改分区表:** 39 | 40 | ``` 41 | Partition Table -> Custom partition CSV file -> partitions/v1/4m.csv 42 | ``` 43 | 44 | **编译:** 45 | 46 | ```bash 47 | idf.py build 48 | ``` 49 | -------------------------------------------------------------------------------- /main/boards/esp32-cgc/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32", 3 | "builds": [ 4 | { 5 | "name": "esp32-cgc", 6 | "sdkconfig_append": [ 7 | "CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y", 8 | "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/4m.csv\"", 9 | "CONFIG_LCD_ST7735_128X128=y" 10 | ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /main/boards/esp32-s3-touch-amoled-1.8/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_16 10 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_45 11 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_9 12 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_10 13 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_8 14 | 15 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_46 16 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_15 17 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_14 18 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 19 | 20 | #define I2C_ADDRESS ESP_IO_EXPANDER_I2C_TCA9554_ADDRESS_000 21 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 22 | 23 | #define EXAMPLE_PIN_NUM_LCD_CS GPIO_NUM_12 24 | #define EXAMPLE_PIN_NUM_LCD_PCLK GPIO_NUM_11 25 | #define EXAMPLE_PIN_NUM_LCD_DATA0 GPIO_NUM_4 26 | #define EXAMPLE_PIN_NUM_LCD_DATA1 GPIO_NUM_5 27 | #define EXAMPLE_PIN_NUM_LCD_DATA2 GPIO_NUM_6 28 | #define EXAMPLE_PIN_NUM_LCD_DATA3 GPIO_NUM_7 29 | #define EXAMPLE_PIN_NUM_LCD_RST GPIO_NUM_NC 30 | #define DISPLAY_WIDTH 368 31 | #define DISPLAY_HEIGHT 448 32 | #define DISPLAY_MIRROR_X false 33 | #define DISPLAY_MIRROR_Y false 34 | #define DISPLAY_SWAP_XY false 35 | 36 | #define DISPLAY_OFFSET_X 0 37 | #define DISPLAY_OFFSET_Y 0 38 | 39 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_NC 40 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 41 | #endif // _BOARD_CONFIG_H_ 42 | -------------------------------------------------------------------------------- /main/boards/esp32-s3-touch-amoled-1.8/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "esp32-s3-touch-amoled-1.8", 6 | "sdkconfig_append": [ 7 | "CONFIG_USE_WECHAT_MESSAGE_STYLE=y" 8 | ] 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /main/boards/esp32-s3-touch-lcd-1.46/README.md: -------------------------------------------------------------------------------- 1 | 新增 微雪 开发板: ESP32-S3-Touch-LCD-1.46、ESP32-S3-Touch-LCD-1.46B 2 | 产品链接: 3 | https://www.waveshare.net/shop/ESP32-S3-Touch-LCD-1.46.htm 4 | https://www.waveshare.net/shop/ESP32-S3-Touch-LCD-1.46B.htm -------------------------------------------------------------------------------- /main/boards/esp32-s3-touch-lcd-1.46/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "esp32-s3-touch-lcd-1.46", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/esp32-s3-touch-lcd-1.85/README.md: -------------------------------------------------------------------------------- 1 | 新增 微雪 开发板: ESP32-S3-Touch-LCD-1.85 2 | 产品链接: 3 | https://www.waveshare.net/shop/ESP32-S3-Touch-LCD-1.85.htm -------------------------------------------------------------------------------- /main/boards/esp32-s3-touch-lcd-1.85/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "esp32-s3-touch-lcd-1.85", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/esp32-s3-touch-lcd-1.85c/README.md: -------------------------------------------------------------------------------- 1 | 新增 微雪 开发板: ESP32-S3-Touch-LCD-1.85C 2 | 产品链接: 3 | https://www.waveshare.net/shop/ESP32-S3-Touch-LCD-1.85C.htm -------------------------------------------------------------------------------- /main/boards/esp32-s3-touch-lcd-1.85c/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "esp32-s3-touch-lcd-1.85c", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/esp32-s3-touch-lcd-3.5/README.md: -------------------------------------------------------------------------------- 1 | 新增 微雪 开发板: ESP32-S3-Touch-LCD-3.5 2 | 产品链接: 3 | https://www.waveshare.net/shop/ESP32-S3-Touch-LCD-3.5.htm -------------------------------------------------------------------------------- /main/boards/esp32-s3-touch-lcd-3.5/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "esp32-s3-touch-lcd-3.5", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/esp32s3-korvo2-v3/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "esp32s3-korvo2-v3", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/genjutech-s3-1.54tft/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 16000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 16000 8 | 9 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_14 10 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_11 11 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_13 12 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_12 13 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_10 14 | 15 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_21 16 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_9 17 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_8 18 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 19 | 20 | #define BUILTIN_LED_GPIO GPIO_NUM_1 21 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 22 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_42 23 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_41 24 | 25 | #define DISPLAY_SDA GPIO_NUM_3 26 | #define DISPLAY_SCL GPIO_NUM_4 27 | #define DISPLAY_DC GPIO_NUM_5 28 | #define DISPLAY_CS GPIO_NUM_6 29 | #define DISPLAY_RES GPIO_NUM_7 30 | 31 | #define DISPLAY_WIDTH 240 32 | #define DISPLAY_HEIGHT 240 33 | #define DISPLAY_SWAP_XY false 34 | #define DISPLAY_MIRROR_X false 35 | #define DISPLAY_MIRROR_Y false 36 | #define BACKLIGHT_INVERT false 37 | 38 | #define DISPLAY_OFFSET_X 0 39 | #define DISPLAY_OFFSET_Y 0 40 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_2 41 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 42 | 43 | #endif // _BOARD_CONFIG_H_ -------------------------------------------------------------------------------- /main/boards/genjutech-s3-1.54tft/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "genjutech-s3-1.54tft", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/kevin-box-1/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_INPUT_REFERENCE true 10 | 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_42 12 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_47 13 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_48 14 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_45 15 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_21 16 | 17 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_17 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_39 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_38 20 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 21 | #define AUDIO_CODEC_ES7210_ADDR ES7210_CODEC_DEFAULT_ADDR 22 | 23 | #define BUILTIN_LED_GPIO GPIO_NUM_8 24 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 25 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_6 26 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_7 27 | 28 | #define DISPLAY_SDA_PIN GPIO_NUM_4 29 | #define DISPLAY_SCL_PIN GPIO_NUM_5 30 | #define DISPLAY_WIDTH 128 31 | #define DISPLAY_HEIGHT 64 32 | #define DISPLAY_MIRROR_X false 33 | #define DISPLAY_MIRROR_Y false 34 | 35 | #define ML307_RX_PIN GPIO_NUM_20 36 | #define ML307_TX_PIN GPIO_NUM_19 37 | 38 | 39 | #endif // _BOARD_CONFIG_H_ 40 | -------------------------------------------------------------------------------- /main/boards/kevin-box-1/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "kevin-box-1", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/kevin-box-2/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_INPUT_REFERENCE true 10 | 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_40 12 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_47 13 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_38 14 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_39 15 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_48 16 | 17 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_9 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_42 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_41 20 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 21 | #define AUDIO_CODEC_ES7210_ADDR ES7210_CODEC_DEFAULT_ADDR 22 | 23 | #define BUILTIN_LED_GPIO GPIO_NUM_3 24 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 25 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_1 26 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_2 27 | 28 | #define DISPLAY_SDA_PIN GPIO_NUM_7 29 | #define DISPLAY_SCL_PIN GPIO_NUM_8 30 | #define DISPLAY_WIDTH 128 31 | #define DISPLAY_HEIGHT 64 32 | #define DISPLAY_MIRROR_X false 33 | #define DISPLAY_MIRROR_Y false 34 | 35 | #define ML307_RX_PIN GPIO_NUM_5 36 | #define ML307_TX_PIN GPIO_NUM_6 37 | 38 | #define AXP2101_I2C_ADDR 0x34 39 | 40 | 41 | #endif // _BOARD_CONFIG_H_ 42 | -------------------------------------------------------------------------------- /main/boards/kevin-box-2/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "kevin-box-2", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/kevin-c3/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_10 10 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_12 11 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_8 12 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_7 13 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_11 14 | 15 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_13 16 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_0 17 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_1 18 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 19 | 20 | #define BUILTIN_LED_GPIO GPIO_NUM_5 21 | #define BOOT_BUTTON_GPIO GPIO_NUM_6 22 | 23 | 24 | #endif // _BOARD_CONFIG_H_ 25 | -------------------------------------------------------------------------------- /main/boards/kevin-c3/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32c3", 3 | "builds": [ 4 | { 5 | "name": "kevin-c3", 6 | "sdkconfig_append": [ 7 | "CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=n", 8 | "CONFIG_LWIP_IPV6=n", 9 | "CONFIG_USE_ESP_WAKE_WORD=y" 10 | ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /main/boards/kevin-c3/led_strip_control.h: -------------------------------------------------------------------------------- 1 | #ifndef LED_STRIP_CONTROL_H 2 | #define LED_STRIP_CONTROL_H 3 | 4 | #include "led/circular_strip.h" 5 | 6 | class LedStripControl { 7 | private: 8 | CircularStrip* led_strip_; 9 | int brightness_level_; // 亮度等级 (0-8) 10 | 11 | int LevelToBrightness(int level) const; // 将等级转换为实际亮度值 12 | StripColor RGBToColor(int red, int green, int blue); 13 | 14 | public: 15 | explicit LedStripControl(CircularStrip* led_strip); 16 | }; 17 | 18 | #endif // LED_STRIP_CONTROL_H 19 | -------------------------------------------------------------------------------- /main/boards/kevin-sp-v4-dev/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "kevin-sp-v4-dev", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/kevin-yuying-313lcd/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 16000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 16000 8 | 9 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_42 10 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_39 11 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_41 12 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_40 13 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_38 14 | 15 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_45 16 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_1 17 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_2 18 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 19 | 20 | #define BUILTIN_LED_GPIO GPIO_NUM_NC 21 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 22 | 23 | #define DISPLAY_WIDTH 376 24 | #define DISPLAY_HEIGHT 960 25 | #define DISPLAY_MIRROR_X true 26 | #define DISPLAY_MIRROR_Y false 27 | #define DISPLAY_SWAP_XY true 28 | 29 | #define DISPLAY_OFFSET_X 0 30 | #define DISPLAY_OFFSET_Y 0 31 | 32 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_4 33 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 34 | 35 | #endif // _BOARD_CONFIG_H_ 36 | -------------------------------------------------------------------------------- /main/boards/kevin-yuying-313lcd/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "kevin-yuying-313lcd", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/lichuang-c3-dev/README.md: -------------------------------------------------------------------------------- 1 | ## 立创·实战派ESP32-C3开发板 2 | 3 | 1、开发板资料:https://wiki.lckfb.com/zh-hans/szpi-esp32c3 4 | 5 | 2、该开发板 flash 大小为 8MB,编译时注意选择合适的分区表: 6 | 7 | ``` 8 | Partition Table ---> 9 | Partition Table (Custom partition table CSV) ---> 10 | (partitions/v1/8m.csv) Custom partition CSV file 11 | ``` 12 | -------------------------------------------------------------------------------- /main/boards/lichuang-c3-dev/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_10 10 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_12 11 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_8 12 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_7 13 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_11 14 | 15 | #define AUDIO_CODEC_USE_PCA9557 16 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_13 17 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_0 18 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_1 19 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 20 | #define AUDIO_CODEC_ES7210_ADDR 0x82 21 | 22 | #define BUILTIN_LED_GPIO GPIO_NUM_NC 23 | #define BOOT_BUTTON_GPIO GPIO_NUM_9 24 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC 25 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC 26 | 27 | #define DISPLAY_SPI_SCK_PIN GPIO_NUM_3 28 | #define DISPLAY_SPI_MOSI_PIN GPIO_NUM_5 29 | #define DISPLAY_DC_PIN GPIO_NUM_6 30 | #define DISPLAY_SPI_CS_PIN GPIO_NUM_4 31 | 32 | #define DISPLAY_WIDTH 320 33 | #define DISPLAY_HEIGHT 240 34 | #define DISPLAY_MIRROR_X true 35 | #define DISPLAY_MIRROR_Y false 36 | #define DISPLAY_SWAP_XY true 37 | 38 | #define DISPLAY_OFFSET_X 0 39 | #define DISPLAY_OFFSET_Y 0 40 | 41 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_2 42 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT true 43 | 44 | 45 | #endif // _BOARD_CONFIG_H_ 46 | -------------------------------------------------------------------------------- /main/boards/lichuang-c3-dev/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32c3", 3 | "builds": [ 4 | { 5 | "name": "lichuang-c3-dev", 6 | "sdkconfig_append": [ 7 | "CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y", 8 | "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\"", 9 | "CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=n", 10 | "CONFIG_LWIP_IPV6=n", 11 | "CONFIG_USE_ESP_WAKE_WORD=y" 12 | ] 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /main/boards/lichuang-dev/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "lichuang-dev", 6 | "sdkconfig_append": [ 7 | "CONFIG_USE_DEVICE_AEC=y", 8 | "CONFIG_IOT_PROTOCOL_MCP=y" 9 | ] 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /main/boards/lilygo-t-cameraplus-s3/README.md: -------------------------------------------------------------------------------- 1 | # 编译配置命令 2 | 3 | **配置编译目标为 ESP32S3:** 4 | 5 | ```bash 6 | idf.py set-target esp32s3 7 | ``` 8 | 9 | **打开 menuconfig:** 10 | 11 | ```bash 12 | idf.py menuconfig 13 | ``` 14 | 15 | **选择板子:** 16 | 17 | ``` 18 | Xiaozhi Assistant -> Board Type -> LILYGO T-CameraPlus-S3_V1_0_V1_1或LILYGO T-CameraPlus-S3_V1_2 19 | ``` 20 | 21 | **修改 psram 配置:** 22 | 23 | ``` 24 | Component config -> ESP PSRAM -> SPI RAM config -> Mode (QUAD/OCT) -> Quad Mode PSRAM 25 | ``` 26 | 27 | **编译:** 28 | 29 | ```bash 30 | idf.py build 31 | ``` 32 | 33 | LILYGO T-CameraPlus-S3 -------------------------------------------------------------------------------- /main/boards/lilygo-t-cameraplus-s3/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "lilygo-t-cameraplus-s3", 6 | "sdkconfig_append": [ 7 | "CONFIG_SPIRAM_MODE_QUAD=y", 8 | "CONFIG_BOARD_TYPE_LILYGO_T_CAMERAPLUS_S3_V1_0_V1_1=y" 9 | ] 10 | }, 11 | { 12 | "name": "lilygo-t-cameraplus-s3_v1_2", 13 | "sdkconfig_append": [ 14 | "CONFIG_SPIRAM_MODE_QUAD=y", 15 | "CONFIG_BOARD_TYPE_LILYGO_T_CAMERAPLUS_S3_V1_2=y" 16 | ] 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /main/boards/lilygo-t-cameraplus-s3/tcamerapluss3_audio_codec.h: -------------------------------------------------------------------------------- 1 | #ifndef _TCIRCLES3_AUDIO_CODEC_H 2 | #define _TCIRCLES3_AUDIO_CODEC_H 3 | 4 | #include "audio_codecs/audio_codec.h" 5 | 6 | #include 7 | #include 8 | 9 | class Tcamerapluss3AudioCodec : public AudioCodec { 10 | private: 11 | const audio_codec_data_if_t *data_if_ = nullptr; 12 | const audio_codec_ctrl_if_t *out_ctrl_if_ = nullptr; 13 | const audio_codec_if_t *out_codec_if_ = nullptr; 14 | const audio_codec_ctrl_if_t *in_ctrl_if_ = nullptr; 15 | const audio_codec_if_t *in_codec_if_ = nullptr; 16 | const audio_codec_gpio_if_t *gpio_if_ = nullptr; 17 | 18 | uint32_t volume_ = 70; 19 | 20 | void CreateVoiceHardware(gpio_num_t mic_bclk, gpio_num_t mic_ws, gpio_num_t mic_data,gpio_num_t spkr_bclk, gpio_num_t spkr_lrclk, gpio_num_t spkr_data); 21 | 22 | virtual int Read(int16_t *dest, int samples) override; 23 | virtual int Write(const int16_t *data, int samples) override; 24 | 25 | public: 26 | Tcamerapluss3AudioCodec(int input_sample_rate, int output_sample_rate, 27 | gpio_num_t mic_bclk, gpio_num_t mic_ws, gpio_num_t mic_data, 28 | gpio_num_t spkr_bclk, gpio_num_t spkr_lrclk, gpio_num_t spkr_data, 29 | bool input_reference); 30 | virtual ~Tcamerapluss3AudioCodec(); 31 | 32 | virtual void SetOutputVolume(int volume) override; 33 | virtual void EnableInput(bool enable) override; 34 | virtual void EnableOutput(bool enable) override; 35 | }; 36 | 37 | #endif // _BOX_AUDIO_CODEC_H 38 | -------------------------------------------------------------------------------- /main/boards/lilygo-t-circle-s3/README.md: -------------------------------------------------------------------------------- 1 | # 编译配置命令 2 | 3 | **配置编译目标为 ESP32S3:** 4 | 5 | ```bash 6 | idf.py set-target esp32s3 7 | ``` 8 | 9 | **打开 menuconfig:** 10 | 11 | ```bash 12 | idf.py menuconfig 13 | ``` 14 | 15 | **选择板子:** 16 | 17 | ``` 18 | Xiaozhi Assistant -> Board Type -> LILYGO T-Circle-S3 19 | ``` 20 | 21 | 22 | **编译:** 23 | 24 | ```bash 25 | idf.py build 26 | ``` 27 | 28 | LILYGO T-Circle-S3 -------------------------------------------------------------------------------- /main/boards/lilygo-t-circle-s3/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | #include "pin_config.h" 6 | 7 | #define AUDIO_INPUT_REFERENCE true 8 | #define AUDIO_INPUT_SAMPLE_RATE 24000 9 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 10 | 11 | #define AUDIO_MIC_I2S_GPIO_BCLK static_cast(MSM261_BCLK) 12 | #define AUDIO_MIC_I2S_GPIO_WS static_cast(MSM261_WS) 13 | #define AUDIO_MIC_I2S_GPIO_DATA static_cast(MSM261_DATA) 14 | 15 | #define AUDIO_SPKR_I2S_GPIO_BCLK static_cast(MAX98357A_BCLK) 16 | #define AUDIO_SPKR_I2S_GPIO_LRCLK static_cast(MAX98357A_LRCLK) 17 | #define AUDIO_SPKR_I2S_GPIO_DATA static_cast(MAX98357A_DATA) 18 | #define AUDIO_SPKR_ENABLE static_cast(MAX98357A_SD_MODE) 19 | 20 | #define TOUCH_I2C_SDA_PIN static_cast(TP_SDA) 21 | #define TOUCH_I2C_SCL_PIN static_cast(TP_SCL) 22 | 23 | #define BUILTIN_LED_GPIO GPIO_NUM_NC 24 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 25 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC 26 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC 27 | 28 | #define DISPLAY_WIDTH LCD_WIDTH 29 | #define DISPLAY_HEIGHT LCD_HEIGHT 30 | #define DISPLAY_MOSI LCD_MOSI 31 | #define DISPLAY_SCLK LCD_SCLK 32 | #define DISPLAY_DC LCD_DC 33 | #define DISPLAY_RST LCD_RST 34 | #define DISPLAY_CS LCD_CS 35 | #define DISPLAY_BL static_cast(LCD_BL) 36 | #define DISPLAY_MIRROR_X false 37 | #define DISPLAY_MIRROR_Y false 38 | #define DISPLAY_SWAP_XY false 39 | 40 | #define DISPLAY_OFFSET_X 0 41 | #define DISPLAY_OFFSET_Y 0 42 | 43 | #define DISPLAY_BACKLIGHT_PIN DISPLAY_BL 44 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 45 | 46 | #endif // _BOARD_CONFIG_H_ 47 | -------------------------------------------------------------------------------- /main/boards/lilygo-t-circle-s3/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "lilygo-t-circle-s3", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/lilygo-t-circle-s3/pin_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: None 3 | * @Author: LILYGO_L 4 | * @Date: 2023-08-16 14:24:03 5 | * @LastEditTime: 2025-01-20 10:11:16 6 | * @License: GPL 3.0 7 | */ 8 | #pragma once 9 | 10 | // MAX98357A 11 | #define MAX98357A_BCLK 5 12 | #define MAX98357A_LRCLK 4 13 | #define MAX98357A_DATA 6 14 | #define MAX98357A_SD_MODE 45 15 | 16 | // MSM261 17 | #define MSM261_BCLK 7 18 | #define MSM261_WS 9 19 | #define MSM261_DATA 8 20 | 21 | // APA102 22 | #define APA102_DATA 38 23 | #define APA102_CLOCK 39 24 | 25 | // H0075Y002-V0 26 | #define LCD_WIDTH 160 27 | #define LCD_HEIGHT 160 28 | #define LCD_MOSI 17 29 | #define LCD_SCLK 15 30 | #define LCD_DC 16 31 | #define LCD_RST -1 32 | #define LCD_CS 13 33 | #define LCD_BL 18 34 | 35 | // IIC 36 | #define IIC_SDA 11 37 | #define IIC_SCL 14 38 | 39 | // CST816D 40 | #define TP_SDA 11 41 | #define TP_SCL 14 42 | #define TP_RST -1 43 | #define TP_INT 12 44 | 45 | //Rotary Encoder 46 | #define KNOB_DATA_A 47 47 | #define KNOB_DATA_B 48 48 | -------------------------------------------------------------------------------- /main/boards/lilygo-t-circle-s3/tcircles3_audio_codec.h: -------------------------------------------------------------------------------- 1 | #ifndef _TCIRCLES3_AUDIO_CODEC_H 2 | #define _TCIRCLES3_AUDIO_CODEC_H 3 | 4 | #include "audio_codecs/audio_codec.h" 5 | 6 | #include 7 | #include 8 | 9 | class Tcircles3AudioCodec : public AudioCodec { 10 | private: 11 | const audio_codec_data_if_t *data_if_ = nullptr; 12 | const audio_codec_ctrl_if_t *out_ctrl_if_ = nullptr; 13 | const audio_codec_if_t *out_codec_if_ = nullptr; 14 | const audio_codec_ctrl_if_t *in_ctrl_if_ = nullptr; 15 | const audio_codec_if_t *in_codec_if_ = nullptr; 16 | const audio_codec_gpio_if_t *gpio_if_ = nullptr; 17 | 18 | uint32_t volume_ = 70; 19 | 20 | void CreateVoiceHardware(gpio_num_t mic_bclk, gpio_num_t mic_ws, gpio_num_t mic_data,gpio_num_t spkr_bclk, gpio_num_t spkr_lrclk, gpio_num_t spkr_data); 21 | 22 | virtual int Read(int16_t *dest, int samples) override; 23 | virtual int Write(const int16_t *data, int samples) override; 24 | 25 | public: 26 | Tcircles3AudioCodec(int input_sample_rate, int output_sample_rate, 27 | gpio_num_t mic_bclk, gpio_num_t mic_ws, gpio_num_t mic_data, 28 | gpio_num_t spkr_bclk, gpio_num_t spkr_lrclk, gpio_num_t spkr_data, 29 | bool input_reference); 30 | virtual ~Tcircles3AudioCodec(); 31 | 32 | virtual void SetOutputVolume(int volume) override; 33 | virtual void EnableInput(bool enable) override; 34 | virtual void EnableOutput(bool enable) override; 35 | }; 36 | 37 | #endif // _BOX_AUDIO_CODEC_H 38 | -------------------------------------------------------------------------------- /main/boards/lilygo-t-display-s3-pro-mvsrlora/README.md: -------------------------------------------------------------------------------- 1 | # 编译配置命令 2 | 3 | **配置编译目标为 ESP32S3:** 4 | 5 | ```bash 6 | idf.py set-target esp32s3 7 | ``` 8 | 9 | **打开 menuconfig:** 10 | 11 | ```bash 12 | idf.py menuconfig 13 | ``` 14 | 15 | **选择板子:** 16 | 17 | ``` 18 | Xiaozhi Assistant -> Board Type -> LILYGO T-Display-S3-Pro-MVSRLora 19 | Or 20 | Xiaozhi Assistant -> Board Type -> LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY 21 | ``` 22 | 23 | 24 | **编译:** 25 | 26 | ```bash 27 | idf.py build 28 | ``` 29 | 30 | LILYGO T-Display-S3-Pro 31 |
32 | LILYGO T-Display-S3-Pro-MVSRLora -------------------------------------------------------------------------------- /main/boards/lilygo-t-display-s3-pro-mvsrlora/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "lilygo-t-display-s3-pro-mvsrlora", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/lilygo-t-display-s3-pro-mvsrlora/tdisplays3promvsrlora_audio_codec.h: -------------------------------------------------------------------------------- 1 | #ifndef _TDISPLAYS3PROMVSRLORA_AUDIO_CODEC_H 2 | #define _TDISPLAYS3PROMVSRLORA_AUDIO_CODEC_H 3 | 4 | #include "audio_codecs/audio_codec.h" 5 | 6 | #include 7 | #include 8 | 9 | class Tdisplays3promvsrloraAudioCodec : public AudioCodec { 10 | private: 11 | const audio_codec_data_if_t *data_if_ = nullptr; 12 | const audio_codec_ctrl_if_t *out_ctrl_if_ = nullptr; 13 | const audio_codec_if_t *out_codec_if_ = nullptr; 14 | const audio_codec_ctrl_if_t *in_ctrl_if_ = nullptr; 15 | const audio_codec_if_t *in_codec_if_ = nullptr; 16 | const audio_codec_gpio_if_t *gpio_if_ = nullptr; 17 | 18 | uint32_t volume_ = 70; 19 | 20 | void CreateVoiceHardware(gpio_num_t mic_bclk, gpio_num_t mic_ws, gpio_num_t mic_data,gpio_num_t spkr_bclk, gpio_num_t spkr_lrclk, gpio_num_t spkr_data); 21 | 22 | virtual int Read(int16_t *dest, int samples) override; 23 | virtual int Write(const int16_t *data, int samples) override; 24 | 25 | public: 26 | Tdisplays3promvsrloraAudioCodec(int input_sample_rate, int output_sample_rate, 27 | gpio_num_t mic_bclk, gpio_num_t mic_ws, gpio_num_t mic_data, 28 | gpio_num_t spkr_bclk, gpio_num_t spkr_lrclk, gpio_num_t spkr_data, 29 | bool input_reference); 30 | virtual ~Tdisplays3promvsrloraAudioCodec(); 31 | 32 | virtual void SetOutputVolume(int volume) override; 33 | virtual void EnableInput(bool enable) override; 34 | virtual void EnableOutput(bool enable) override; 35 | }; 36 | 37 | #endif // _BOX_AUDIO_CODEC_H 38 | -------------------------------------------------------------------------------- /main/boards/m5stack-core-s3/README.md: -------------------------------------------------------------------------------- 1 | # 使用说明 2 | 3 | 4 | 1. 设置编译目标为 esp32s3 5 | 6 | ```shell 7 | idf.py set-target esp32s3 8 | ``` 9 | 10 | 2. 修改配置 11 | 12 | ```shell 13 | cp main/boards/m5stack-core-s3/sdkconfig.cores3 sdkconfig 14 | ``` 15 | 16 | 3. 编译烧录程序 17 | 18 | ```shell 19 | idf.py build flash monitor 20 | ``` 21 | 22 | > [!NOTE] 23 | > 进入下载模式:长按复位按键(约3秒),直至内部指示灯亮绿色,松开按键。 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /main/boards/m5stack-core-s3/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "m5stack-core-s3", 6 | "sdkconfig_append": [ 7 | "CONFIG_SPIRAM_MODE_QUAD=y" 8 | ] 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /main/boards/m5stack-core-s3/cores3_audio_codec.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOX_AUDIO_CODEC_H 2 | #define _BOX_AUDIO_CODEC_H 3 | 4 | #include "audio_codec.h" 5 | 6 | #include 7 | #include 8 | 9 | class CoreS3AudioCodec : public AudioCodec { 10 | private: 11 | const audio_codec_data_if_t* data_if_ = nullptr; 12 | const audio_codec_ctrl_if_t* out_ctrl_if_ = nullptr; 13 | const audio_codec_if_t* out_codec_if_ = nullptr; 14 | const audio_codec_ctrl_if_t* in_ctrl_if_ = nullptr; 15 | const audio_codec_if_t* in_codec_if_ = nullptr; 16 | const audio_codec_gpio_if_t* gpio_if_ = nullptr; 17 | 18 | esp_codec_dev_handle_t output_dev_ = nullptr; 19 | esp_codec_dev_handle_t input_dev_ = nullptr; 20 | 21 | void CreateDuplexChannels(gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din); 22 | 23 | virtual int Read(int16_t* dest, int samples) override; 24 | virtual int Write(const int16_t* data, int samples) override; 25 | 26 | public: 27 | CoreS3AudioCodec(void* i2c_master_handle, int input_sample_rate, int output_sample_rate, 28 | gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din, 29 | uint8_t aw88298_addr, uint8_t es7210_addr, bool input_reference); 30 | virtual ~CoreS3AudioCodec(); 31 | 32 | virtual void SetOutputVolume(int volume) override; 33 | virtual void EnableInput(bool enable) override; 34 | virtual void EnableOutput(bool enable) override; 35 | }; 36 | 37 | #endif // _BOX_AUDIO_CODEC_H 38 | -------------------------------------------------------------------------------- /main/boards/m5stack-tab5/README.md: -------------------------------------------------------------------------------- 1 | # 使用说明 2 | 3 | * [M5Stack Tab5 docs](https://docs.m5stack.com/zh_CN/core/Tab5) 4 | 5 | ## 快速体验 6 | 7 | 下载编译好的 [固件](https://pan.baidu.com/s/1dgbUQtMyVLSCSBJLHARpwQ?pwd=1234) 提取码: 1234 8 | 9 | ```shell 10 | esptool.py --chip esp32p4 -p /dev/ttyACM0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 16MB 0x00 tab5_xiaozhi_v1_addr0.bin 11 | ``` 12 | 13 | ## 基础使用 14 | 15 | * idf version: v5.5-dev 16 | 17 | 1. 设置编译目标为 esp32p4 18 | 19 | ```shell 20 | idf.py set-target esp32p4 21 | ``` 22 | 23 | 2. 修改配置 24 | 25 | ```shell 26 | cp main/boards/m5stack-tab5/sdkconfig.tab5 sdkconfig 27 | ``` 28 | 29 | 3. 编译烧录程序 30 | 31 | ```shell 32 | idf.py build flash monitor 33 | ``` 34 | 35 | > [!NOTE] 36 | > 进入下载模式:长按复位按键(约 2 秒),直至内部绿色 LED 指示灯开始快速闪烁,松开按键。 37 | 38 | 39 | ## log 40 | 41 | @2025/05/17 测试问题 42 | 43 | 1. listening... 需要等几秒才能获取语音输入??? 44 | 2. 亮度调节不对 45 | 3. 音量调节不对 46 | 47 | ## TODO 48 | -------------------------------------------------------------------------------- /main/boards/m5stack-tab5/tab5_audio_codec.h: -------------------------------------------------------------------------------- 1 | #ifndef _TAB5_AUDIO_CODEC_H 2 | #define _TAB5_AUDIO_CODEC_H 3 | 4 | #include "audio_codec.h" 5 | #include 6 | #include 7 | 8 | 9 | class Tab5AudioCodec : public AudioCodec { 10 | private: 11 | const audio_codec_data_if_t* data_if_ = nullptr; 12 | const audio_codec_ctrl_if_t* out_ctrl_if_ = nullptr; 13 | const audio_codec_if_t* out_codec_if_ = nullptr; 14 | const audio_codec_ctrl_if_t* in_ctrl_if_ = nullptr; 15 | const audio_codec_if_t* in_codec_if_ = nullptr; 16 | const audio_codec_gpio_if_t* gpio_if_ = nullptr; 17 | 18 | esp_codec_dev_handle_t output_dev_ = nullptr; 19 | esp_codec_dev_handle_t input_dev_ = nullptr; 20 | 21 | void CreateDuplexChannels(gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din); 22 | 23 | virtual int Read(int16_t* dest, int samples) override; 24 | virtual int Write(const int16_t* data, int samples) override; 25 | 26 | public: 27 | Tab5AudioCodec(void* i2c_master_handle, int input_sample_rate, int output_sample_rate, 28 | gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din, 29 | gpio_num_t pa_pin, uint8_t es8388_addr, uint8_t es7210_addr, bool input_reference); 30 | virtual ~Tab5AudioCodec(); 31 | 32 | virtual void SetOutputVolume(int volume) override; 33 | virtual void EnableInput(bool enable) override; 34 | virtual void EnableOutput(bool enable) override; 35 | }; 36 | 37 | #endif // _TAB5_AUDIO_CODEC_H 38 | -------------------------------------------------------------------------------- /main/boards/magiclick-2p4/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_8 10 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_11 11 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_9 12 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_10 13 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_12 14 | 15 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_4 // pcb v2.4不起作用,适用于2.4A 16 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_5 17 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_6 18 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 19 | 20 | //led power 21 | #define BUILTIN_LED_POWER GPIO_NUM_39 // 低电平有效 22 | #define BUILTIN_LED_POWER_OUTPUT_INVERT true 23 | 24 | #define BUILTIN_LED_NUM 2 25 | #define BUILTIN_LED_GPIO GPIO_NUM_38 26 | 27 | #define MAIN_BUTTON_GPIO GPIO_NUM_21 28 | #define LEFT_BUTTON_GPIO GPIO_NUM_0 29 | #define RIGHT_BUTTON_GPIO GPIO_NUM_47 30 | 31 | // display 32 | #define DISPLAY_SDA_PIN GPIO_NUM_15 33 | #define DISPLAY_SCL_PIN GPIO_NUM_16 34 | #define DISPLAY_CS_PIN GPIO_NUM_17 35 | #define DISPLAY_DC_PIN GPIO_NUM_18 36 | #define DISPLAY_RST_PIN GPIO_NUM_14 37 | 38 | #define DISPLAY_WIDTH 128 39 | #define DISPLAY_HEIGHT 128 40 | #define DISPLAY_MIRROR_X false 41 | #define DISPLAY_MIRROR_Y true 42 | #define DISPLAY_SWAP_XY false 43 | 44 | #define DISPLAY_OFFSET_X 0 45 | #define DISPLAY_OFFSET_Y 0 46 | 47 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_13 48 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 49 | 50 | #endif // _BOARD_CONFIG_H_ 51 | -------------------------------------------------------------------------------- /main/boards/magiclick-2p4/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "magiclick-2p4", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/magiclick-2p5/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "magiclick-2p5", 6 | "sdkconfig_append": [ 7 | "CONFIG_PM_ENABLE=y", 8 | "CONFIG_FREERTOS_USE_TICKLESS_IDLE=y" 9 | ] 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /main/boards/magiclick-c3-v2/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_5 10 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_8 11 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_6 12 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_7 13 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_10 14 | 15 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_11 16 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_3 17 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_4 18 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 19 | 20 | #define BUILTIN_LED_NUM 1 21 | #define BUILTIN_LED_GPIO GPIO_NUM_0 22 | 23 | #define BOOT_BUTTON_GPIO GPIO_NUM_2 24 | 25 | //battery 26 | #define BUILTIN_BATTERY_GPIO GPIO_NUM_1 27 | 28 | // display 29 | #define DISPLAY_SDA_PIN GPIO_NUM_13 30 | #define DISPLAY_SCL_PIN GPIO_NUM_12 31 | #define DISPLAY_CS_PIN GPIO_NUM_20 32 | #define DISPLAY_DC_PIN GPIO_NUM_21 33 | #define DISPLAY_RST_PIN GPIO_NUM_NC 34 | 35 | #define DISPLAY_WIDTH 128 36 | #define DISPLAY_HEIGHT 128 37 | #define DISPLAY_MIRROR_X false 38 | #define DISPLAY_MIRROR_Y false 39 | #define DISPLAY_SWAP_XY false 40 | 41 | #define DISPLAY_OFFSET_X 0 42 | #define DISPLAY_OFFSET_Y 0 43 | 44 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_9 45 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT true 46 | 47 | #endif // _BOARD_CONFIG_H_ 48 | -------------------------------------------------------------------------------- /main/boards/magiclick-c3-v2/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32c3", 3 | "builds": [ 4 | { 5 | "name": "magiclick-c3-v2", 6 | "sdkconfig_append": [ 7 | "CONFIG_PM_ENABLE=y", 8 | "CONFIG_FREERTOS_USE_TICKLESS_IDLE=y", 9 | "CONFIG_USE_ESP_WAKE_WORD=n" 10 | ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /main/boards/magiclick-c3/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_5 10 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_8 11 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_6 12 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_7 13 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_10 14 | 15 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_11 16 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_3 17 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_4 18 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 19 | 20 | #define BUILTIN_LED_NUM 1 21 | #define BUILTIN_LED_GPIO GPIO_NUM_0 22 | 23 | #define BOOT_BUTTON_GPIO GPIO_NUM_2 24 | 25 | //battery 26 | #define BUILTIN_BATTERY_GPIO GPIO_NUM_1 27 | 28 | // display 29 | #define DISPLAY_SDA_PIN GPIO_NUM_12 30 | #define DISPLAY_SCL_PIN GPIO_NUM_13 31 | #define DISPLAY_CS_PIN GPIO_NUM_20 32 | #define DISPLAY_DC_PIN GPIO_NUM_21 33 | #define DISPLAY_RST_PIN GPIO_NUM_NC 34 | 35 | #define DISPLAY_WIDTH 128 36 | #define DISPLAY_HEIGHT 128 37 | #define DISPLAY_MIRROR_X false 38 | #define DISPLAY_MIRROR_Y true 39 | #define DISPLAY_SWAP_XY false 40 | 41 | #define DISPLAY_OFFSET_X 0 42 | #define DISPLAY_OFFSET_Y 0 43 | 44 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_9 45 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT true 46 | 47 | #endif // _BOARD_CONFIG_H_ 48 | -------------------------------------------------------------------------------- /main/boards/magiclick-c3/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32c3", 3 | "builds": [ 4 | { 5 | "name": "magiclick-c3", 6 | "sdkconfig_append": [ 7 | "CONFIG_PM_ENABLE=y", 8 | "CONFIG_FREERTOS_USE_TICKLESS_IDLE=y", 9 | "CONFIG_USE_ESP_WAKE_WORD=n" 10 | ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /main/boards/minsi-k08-dual/README.md: -------------------------------------------------------------------------------- 1 | 2 | minsi-k08-wifi和minsi-k08-ml307是敏思科技推出的基于ESP32S3N16R8,搭载MAX98357音频功率放大器和INMP441全向麦克风模块,通过改造K08透明机甲小钢炮音箱而成的带有朋克风格的大喇叭大电池小智AI聊天机器人方案。 3 | 4 | Minsi-k08 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | # 编译配置命令 13 | 14 | **配置编译目标为 ESP32S3:** 15 | 16 | ```bash 17 | idf.py set-target esp32s3 18 | ``` 19 | 20 | **打开 menuconfig:** 21 | 22 | ```bash 23 | idf.py menuconfig 24 | ``` 25 | 26 | **选择板子:** 27 | 28 | ``` 29 | Xiaozhi Assistant -> Board Type ->敏思科技K08(DUAL) 30 | ``` 31 | 32 | **编译烧入:** 33 | 34 | ```bash 35 | idf.py build flash 36 | ``` -------------------------------------------------------------------------------- /main/boards/minsi-k08-dual/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 16000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_9 10 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_10 11 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_18 12 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_4 13 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_5 14 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_6 15 | 16 | #define BUILTIN_LED_GPIO GPIO_NUM_40 17 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 18 | #define TOUCH_BUTTON_GPIO GPIO_NUM_NC 19 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_47 20 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_46 21 | 22 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_7 23 | #define DISPLAY_MOSI_PIN GPIO_NUM_17 24 | #define DISPLAY_CLK_PIN GPIO_NUM_8 25 | #define DISPLAY_DC_PIN GPIO_NUM_15 26 | #define DISPLAY_RST_PIN GPIO_NUM_16 27 | #define DISPLAY_CS_PIN GPIO_NUM_NC 28 | 29 | #define ML307_RX_PIN GPIO_NUM_11 30 | #define ML307_TX_PIN GPIO_NUM_12 31 | 32 | #define DISPLAY_WIDTH 240 33 | #define DISPLAY_HEIGHT 240 34 | #define DISPLAY_MIRROR_X false 35 | #define DISPLAY_MIRROR_Y true 36 | #define DISPLAY_SWAP_XY true 37 | #define DISPLAY_INVERT_COLOR true 38 | #define DISPLAY_RGB_ORDER LCD_RGB_ELEMENT_ORDER_RGB 39 | #define DISPLAY_OFFSET_X 80 40 | #define DISPLAY_OFFSET_Y 0 41 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 42 | 43 | 44 | // A MCP Test: Control a lamp 45 | #define LAMP_GPIO GPIO_NUM_18 46 | 47 | #endif // _BOARD_CONFIG_H_ 48 | -------------------------------------------------------------------------------- /main/boards/minsi-k08-dual/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "minsi-k08-dual", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/mixgo-nova/README.md: -------------------------------------------------------------------------------- 1 | # Mixgo_Nova(元控·青春) 开发板 2 | 3 | Mixgo_Nova 4 | 5 | ‌**[Mixgo_Nova](https://mixly.cn/fredqian/mixgo_nova)**‌ 是一款专为物联网、教育及创客项目设计的多功能开发板,集成丰富传感器与无线通信模块,支持图形化编程(Mixly)和离线语音交互,适合快速原型开发与教学。 6 | 7 | --- 8 | 9 | ## 🛠️ 编译配置命令 10 | 11 | **ES8374 CODE MIC采集问题:** 12 | 13 | ``` 14 | managed_components\espressif__esp_codec_dev\device\es8374 15 | 16 | static int es8374_config_adc_input(audio_codec_es8374_t *codec, es_adc_input_t input) 17 | { 18 | int ret = 0; 19 | int reg = 0; 20 | ret |= es8374_read_reg(codec, 0x21, ®); 21 | if (ret == 0) { 22 | reg = (reg & 0xcf) | 0x24; 23 | ret |= es8374_write_reg(codec, 0x21, reg); 24 | } 25 | return ret; 26 | } 27 | 28 | PS: L386 reg = (reg & 0xcf) | 0x14; 改成 reg = (reg & 0xcf) | 0x24; 29 | ``` 30 | 31 | **配置编译目标为 ESP32S3:** 32 | 33 | ```bash 34 | idf.py set-target esp32s3 35 | ``` 36 | 37 | **打开 menuconfig:** 38 | 39 | ```bash 40 | idf.py menuconfig 41 | ``` 42 | 43 | **选择板子:** 44 | 45 | ``` 46 | Xiaozhi Assistant -> Board Type -> 元控·青春 47 | ``` 48 | 49 | **修改 psram 配置:** 50 | 51 | ``` 52 | Component config -> ESP PSRAM -> SPI RAM config -> Mode (QUAD/OCT) -> QUAD Mode PSRAM 53 | ``` 54 | 55 | **修改 Flash 配置:** 56 | 57 | ``` 58 | Serial flasher config -> Flash size -> 8 MB 59 | Partition Table -> Custom partition CSV file -> partitions/v1/8m.csv 60 | ``` 61 | 62 | **编译:** 63 | 64 | ```bash 65 | idf.py build 66 | ``` 67 | 68 | **合并BIN:** 69 | 70 | ```bash 71 | idf.py merge-bin -o xiaozhi-nova.bin -f raw 72 | ``` -------------------------------------------------------------------------------- /main/boards/mixgo-nova/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_35 10 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_47 11 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_34 12 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_33 13 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_48 14 | 15 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_NC 16 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_37 17 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_36 18 | #define AUDIO_CODEC_ES8374_ADDR ES8374_CODEC_DEFAULT_ADDR 19 | 20 | #define BUILTIN_LED_GPIO GPIO_NUM_38 21 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 22 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC 23 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC 24 | 25 | #define DISPLAY_MOSI_PIN GPIO_NUM_40 26 | #define DISPLAY_CLK_PIN GPIO_NUM_41 27 | #define DISPLAY_DC_PIN GPIO_NUM_18 28 | #define DISPLAY_CS_PIN GPIO_NUM_45 29 | #define DISPLAY_RST_PIN GPIO_NUM_NC 30 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_14 31 | #define DISPLAY_WIDTH 128 32 | #define DISPLAY_HEIGHT 160 33 | #define DISPLAY_MIRROR_X true 34 | #define DISPLAY_MIRROR_Y true 35 | #define DISPLAY_SWAP_XY false 36 | #define DISPLAY_INVERT_COLOR false 37 | #define DISPLAY_OFFSET_X 2 38 | #define DISPLAY_OFFSET_Y 1 39 | #define DISPLAY_RGB_ORDER LCD_RGB_ELEMENT_ORDER_RGB 40 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 41 | 42 | #endif // _BOARD_CONFIG_H_ 43 | -------------------------------------------------------------------------------- /main/boards/mixgo-nova/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "mixgo-nova", 6 | "sdkconfig_append": [ 7 | "CONFIG_SPIRAM_MODE_QUAD=y", 8 | "CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y", 9 | "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\"", 10 | "CONFIG_LCD_ST7735_128X160=y" 11 | ] 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /main/boards/movecall-cuican-esp32s3/README.md: -------------------------------------------------------------------------------- 1 | # ESP32-S3 编译配置指南 2 | 3 | ## 基本命令 4 | 5 | ### 设置目标芯片 6 | 7 | ```bash 8 | idf.py set-target esp32s3 9 | ``` 10 | 11 | ### 打开配置界面: 12 | 13 | ```bash 14 | idf.py menuconfig 15 | ``` 16 | ### Flash 配置: 17 | 18 | ``` 19 | Serial flasher config -> Flash size -> 8 MB 20 | ``` 21 | 22 | ### 分区表配置: 23 | 24 | ``` 25 | Partition Table -> Custom partition CSV file -> partitions/v1/8m.csv 26 | ``` 27 | 28 | ### 开发板选择: 29 | 30 | ``` 31 | Xiaozhi Assistant -> Board Type -> Movecall CuiCan 璀璨·AI吊坠 32 | ``` 33 | 34 | ### 启用编译优化: 35 | 36 | ``` 37 | Component config → Compiler options → Optimization Level → Optimize for size (-Os) 38 | ``` 39 | 40 | ### 编译: 41 | 42 | ```bash 43 | idf.py build 44 | ``` -------------------------------------------------------------------------------- /main/boards/movecall-cuican-esp32s3/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | // Movecall CuiCan configuration 5 | 6 | #include 7 | 8 | #define AUDIO_INPUT_SAMPLE_RATE 24000 9 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 10 | 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_45 12 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_41 13 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_39 14 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_40 15 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_42 16 | 17 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_17 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_6 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_7 20 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 21 | 22 | #define BUILTIN_LED_GPIO GPIO_NUM_21 23 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 24 | 25 | #define DISPLAY_WIDTH 240 26 | #define DISPLAY_HEIGHT 240 27 | #define DISPLAY_MIRROR_X true 28 | #define DISPLAY_MIRROR_Y false 29 | #define DISPLAY_SWAP_XY false 30 | 31 | #define DISPLAY_OFFSET_X 0 32 | #define DISPLAY_OFFSET_Y 0 33 | 34 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_16 35 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 36 | 37 | #define DISPLAY_SPI_SCLK_PIN GPIO_NUM_12 38 | #define DISPLAY_SPI_MOSI_PIN GPIO_NUM_10 39 | #define DISPLAY_SPI_CS_PIN GPIO_NUM_13 40 | #define DISPLAY_SPI_DC_PIN GPIO_NUM_14 41 | #define DISPLAY_SPI_RESET_PIN GPIO_NUM_11 42 | 43 | #define DISPLAY_SPI_SCLK_HZ (40 * 1000 * 1000) 44 | 45 | #endif // _BOARD_CONFIG_H_ 46 | -------------------------------------------------------------------------------- /main/boards/movecall-cuican-esp32s3/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "movecall-cuican-esp32s3", 6 | "sdkconfig_append": [ 7 | "CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y", 8 | "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\"", 9 | "CONFIG_COMPILER_OPTIMIZATION_SIZE=y" 10 | ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /main/boards/movecall-moji-esp32s3/README.md: -------------------------------------------------------------------------------- 1 | # 编译配置命令 2 | 3 | **配置编译目标为 ESP32S3:** 4 | 5 | ```bash 6 | idf.py set-target esp32s3 7 | ``` 8 | 9 | **打开 menuconfig:** 10 | 11 | ```bash 12 | idf.py menuconfig 13 | ``` 14 | 15 | **选择板子:** 16 | 17 | ``` 18 | Xiaozhi Assistant -> Board Type -> Movecall Moji 小智AI衍生版 19 | ``` 20 | 21 | 22 | **编译:** 23 | 24 | ```bash 25 | idf.py build 26 | ``` -------------------------------------------------------------------------------- /main/boards/movecall-moji-esp32s3/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | // Movecall Moji configuration 5 | 6 | #include 7 | 8 | #define AUDIO_INPUT_SAMPLE_RATE 24000 9 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 10 | 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_6 12 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_12 13 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_14 14 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_13 15 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_11 16 | 17 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_9 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_5 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_4 20 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 21 | 22 | #define BUILTIN_LED_GPIO GPIO_NUM_21 23 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 24 | 25 | #define DISPLAY_WIDTH 240 26 | #define DISPLAY_HEIGHT 240 27 | #define DISPLAY_MIRROR_X true 28 | #define DISPLAY_MIRROR_Y false 29 | #define DISPLAY_SWAP_XY false 30 | 31 | #define DISPLAY_OFFSET_X 0 32 | #define DISPLAY_OFFSET_Y 0 33 | 34 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_3 35 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 36 | 37 | #define DISPLAY_SPI_SCLK_PIN GPIO_NUM_16 38 | #define DISPLAY_SPI_MOSI_PIN GPIO_NUM_17 39 | #define DISPLAY_SPI_CS_PIN GPIO_NUM_15 40 | #define DISPLAY_SPI_DC_PIN GPIO_NUM_7 41 | #define DISPLAY_SPI_RESET_PIN GPIO_NUM_18 42 | 43 | #define DISPLAY_SPI_SCLK_HZ (40 * 1000 * 1000) 44 | 45 | #endif // _BOARD_CONFIG_H_ 46 | -------------------------------------------------------------------------------- /main/boards/movecall-moji-esp32s3/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "movecall-moji-esp32s3", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/sensecap-watcher/README.md: -------------------------------------------------------------------------------- 1 | # 编译配置命令 2 | 3 | **配置编译目标为 ESP32S3:** 4 | 5 | ```bash 6 | idf.py set-target esp32s3 7 | ``` 8 | 9 | **打开 menuconfig:** 10 | 11 | ```bash 12 | idf.py menuconfig 13 | ``` 14 | 15 | **选择板子:** 16 | 17 | ``` 18 | Xiaozhi Assistant -> Board Type -> SenseCAP Watcher 19 | ``` 20 | 21 | **编译烧入:** 22 | 23 | ```bash 24 | idf.py build flash 25 | ``` 26 | 注意: 请特别小心处理闪存固件分区地址,以避免错误擦除 SenseCAP Watcher 的自身设备信息(EUI 等),否则设备可能无法正确连接到 SenseCraft 服务器!在刷写固件之前,请务必记录设备的相关必要信息,以确保有恢复的方法! 27 | 28 | 您可以使用以下命令备份生产信息 29 | 30 | ```bash 31 | # firstly backup the factory information partition which contains the credentials for connecting the SenseCraft server 32 | esptool.py --chip esp32s3 --baud 2000000 --before default_reset --after hard_reset --no-stub read_flash 0x9000 204800 nvsfactory.bin 33 | 34 | ``` -------------------------------------------------------------------------------- /main/boards/sensecap-watcher/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "sensecap-watcher", 6 | "sdkconfig_append": [ 7 | "CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y", 8 | "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/32m.csv\"", 9 | "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", 10 | "CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT=n", 11 | "CONFIG_IDF_EXPERIMENTAL_FEATURES=y" 12 | ] 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /main/boards/sensecap-watcher/sensecap_audio_codec.h: -------------------------------------------------------------------------------- 1 | #ifndef _SENSECAP_AUDIO_CODEC_H 2 | #define _SENSECAP_AUDIO_CODEC_H 3 | 4 | #include "audio_codec.h" 5 | 6 | #include 7 | #include 8 | 9 | class SensecapAudioCodec : public AudioCodec { 10 | private: 11 | const audio_codec_data_if_t* data_if_ = nullptr; 12 | const audio_codec_ctrl_if_t* out_ctrl_if_ = nullptr; 13 | const audio_codec_if_t* out_codec_if_ = nullptr; 14 | const audio_codec_ctrl_if_t* in_ctrl_if_ = nullptr; 15 | const audio_codec_if_t* in_codec_if_ = nullptr; 16 | const audio_codec_gpio_if_t* gpio_if_ = nullptr; 17 | 18 | esp_codec_dev_handle_t output_dev_ = nullptr; 19 | esp_codec_dev_handle_t input_dev_ = nullptr; 20 | gpio_num_t pa_pin_ = GPIO_NUM_NC; 21 | 22 | void CreateDuplexChannels(gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din); 23 | 24 | virtual int Read(int16_t* dest, int samples) override; 25 | virtual int Write(const int16_t* data, int samples) override; 26 | 27 | public: 28 | SensecapAudioCodec(void* i2c_master_handle, int input_sample_rate, int output_sample_rate, 29 | gpio_num_t mclk, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din, 30 | gpio_num_t pa_pin, uint8_t es8311_addr, uint8_t es7210_addr, bool input_reference); 31 | virtual ~SensecapAudioCodec(); 32 | 33 | virtual void SetOutputVolume(int volume) override; 34 | virtual void EnableInput(bool enable) override; 35 | virtual void EnableOutput(bool enable) override; 36 | }; 37 | 38 | #endif // _SENSECAP_AUDIO_CODEC_H 39 | -------------------------------------------------------------------------------- /main/boards/sp-esp32-s3-1.28-box/README.md: -------------------------------------------------------------------------------- 1 | 【产品简介】 2 | 】支持触摸 3 | 】支持充电 4 | 】独特外形设计 5 | 产品链接1:https://spotpear.cn/shop/ESP32-S3-N16R8-AI-DeepSeek-XiaoZhi-XiaGe-Qwen-DouBao-1.28-inch-LCD.html 6 | 产品链接2:https://spotpear.cn/shop/ESP32-S3-N16R8-AI-DeepSeek-XiaoZhi-XiaGe-Qwen-DouBao-1.28-inch-Round-LCD-BOX-TouchScreen.html 7 | # 编译配置命令 8 | 9 | **配置编译目标为 ESP32S3:** 10 | 11 | ```bash 12 | idf.py set-target esp32s3 13 | ``` 14 | 15 | **打开 menuconfig:** 16 | 17 | ```bash 18 | idf.py menuconfig 19 | ``` 20 | 21 | **选择板子:** 22 | 23 | ``` 24 | Xiaozhi Assistant -> Board Type -> Spotpear ESP32-S3-1.28-BOX 25 | ``` 26 | 27 | **编译:** 28 | 29 | ```bash 30 | idf.py build 31 | ``` 32 | -------------------------------------------------------------------------------- /main/boards/sp-esp32-s3-1.28-box/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | // Movecall Moji configuration 5 | 6 | #include 7 | 8 | #define AUDIO_INPUT_SAMPLE_RATE 24000 9 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 10 | 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_16 //MCLK 12 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_45 //LRCK 13 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_9 //SCLK 14 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_10 //DOUT 15 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_8 //DIN 16 | 17 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_46 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_15 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_14 20 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 21 | 22 | #define BUILTIN_LED_GPIO GPIO_NUM_48 23 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 24 | 25 | 26 | #define DISPLAY_WIDTH 240 27 | #define DISPLAY_HEIGHT 240 28 | #define DISPLAY_MIRROR_X true 29 | #define DISPLAY_MIRROR_Y false 30 | #define DISPLAY_SWAP_XY false 31 | 32 | #define DISPLAY_OFFSET_X 0 33 | #define DISPLAY_OFFSET_Y 0 34 | 35 | 36 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_42 37 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT true 38 | 39 | #define DISPLAY_SPI_SCLK_PIN GPIO_NUM_4 40 | #define DISPLAY_SPI_MOSI_PIN GPIO_NUM_2 41 | #define DISPLAY_SPI_CS_PIN GPIO_NUM_5 42 | #define DISPLAY_SPI_DC_PIN GPIO_NUM_47 43 | #define DISPLAY_SPI_RESET_PIN GPIO_NUM_38 44 | 45 | #define TP_PIN_NUM_TP_SDA (GPIO_NUM_11) 46 | #define TP_PIN_NUM_TP_SCL (GPIO_NUM_7) 47 | #define TP_PIN_NUM_TP_RST (GPIO_NUM_6) 48 | #define TP_PIN_NUM_TP_INT (GPIO_NUM_12) 49 | 50 | #define DISPLAY_SPI_SCLK_HZ (40 * 1000 * 1000) 51 | 52 | #endif // _BOARD_CONFIG_H_ 53 | -------------------------------------------------------------------------------- /main/boards/sp-esp32-s3-1.28-box/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "sp-esp32-s3-1.28-box", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /main/boards/sp-esp32-s3-1.54-muma/README.md: -------------------------------------------------------------------------------- 1 | 【产品简介】 2 | [] ESP32 S3小木马开发板1.54寸LCD小智muma虾哥AI DeepSeek人工智能语音聊天机器人N16R8 3 | 【功能】 4 | [] 可爱小木马,支持天气时钟, SD视频播放, AI智能对话所有固件源码开源,适合小孩编程学习,可开发更多功能。 5 | AI小智支持语音唤醒。触摸版本额外支持触摸唤醒和打断 6 | 显示屏:1.54寸ST7789 240x240分辨率 7 | 产品链接: 8 | https://spotpear.cn/shop/ESP32-S3-AI-1.54-inch-LCD-Display-TouchScreen-N16R8-muma-DeepSeek/sp-esp32-s3-1.54-muma-W-Bat.html 9 | 10 | # 编译配置命令 11 | 12 | **配置编译目标为 ESP32S3:** 13 | 14 | ```bash 15 | idf.py set-target esp32s3 16 | ``` 17 | 18 | **打开 menuconfig:** 19 | 20 | ```bash 21 | idf.py menuconfig 22 | ``` 23 | 24 | **选择板子:** 25 | 26 | ``` 27 | Xiaozhi Assistant -> Board Type -> Spotpear ESP32-S3-LCD-1.54-MUMA 28 | ``` 29 | 30 | **编译:** 31 | 32 | ```bash 33 | idf.py build 34 | ``` 35 | -------------------------------------------------------------------------------- /main/boards/sp-esp32-s3-1.54-muma/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "sp-esp32-s3-1.54-muma", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /main/boards/taiji-pi-s3/README.md: -------------------------------------------------------------------------------- 1 | # 编译配置命令 2 | 3 | **配置编译目标为 ESP32S3:** 4 | 5 | ```bash 6 | idf.py set-target esp32s3 7 | ``` 8 | 9 | **打开 menuconfig:** 10 | 11 | ```bash 12 | idf.py menuconfig 13 | ``` 14 | 15 | **选择板子:** 16 | 17 | ``` 18 | Xiaozhi Assistant -> Board Type -> 太极小派esp32s3 19 | ``` 20 | 21 | **编译:** 22 | 23 | ```bash 24 | idf.py build 25 | ``` 26 | -------------------------------------------------------------------------------- /main/boards/taiji-pi-s3/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "taiji-pi-s3", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/tudouzi/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_INPUT_REFERENCE true 10 | 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_40 12 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_47 13 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_38 14 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_39 15 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_48 16 | 17 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_9 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_42 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_41 20 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 21 | #define AUDIO_CODEC_ES7210_ADDR ES7210_CODEC_DEFAULT_ADDR 22 | 23 | #define BUILTIN_LED_GPIO GPIO_NUM_3 24 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 25 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_1 26 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_2 27 | 28 | #define DISPLAY_SDA_PIN GPIO_NUM_7 29 | #define DISPLAY_SCL_PIN GPIO_NUM_8 30 | #define DISPLAY_WIDTH 128 31 | #define DISPLAY_HEIGHT 64 32 | #define DISPLAY_MIRROR_X false 33 | #define DISPLAY_MIRROR_Y false 34 | 35 | #define ML307_RX_PIN GPIO_NUM_5 36 | #define ML307_TX_PIN GPIO_NUM_6 37 | 38 | #define AXP2101_I2C_ADDR 0x34 39 | 40 | 41 | #endif // _BOARD_CONFIG_H_ 42 | -------------------------------------------------------------------------------- /main/boards/tudouzi/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "tudouzi", 6 | "sdkconfig_append": [ 7 | "CONFIG_USE_WAKE_WORD_DETECT=n", 8 | "CONFIG_PM_ENABLE=y", 9 | "CONFIG_FREERTOS_USE_TICKLESS_IDLE=y" 10 | ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /main/boards/waveshare-p4-nano/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_13 10 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_10 11 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_12 12 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_11 13 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_9 14 | 15 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_53 16 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_7 17 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_8 18 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 19 | 20 | #define BOOT_BUTTON_GPIO GPIO_NUM_35 21 | 22 | #define DISPLAY_WIDTH 800 23 | #define DISPLAY_HEIGHT 1280 24 | 25 | #define LCD_BIT_PER_PIXEL (16) 26 | #define PIN_NUM_LCD_RST GPIO_NUM_NC 27 | 28 | #define DELAY_TIME_MS (3000) 29 | #define LCD_MIPI_DSI_LANE_NUM (2) // 2 data lanes 30 | 31 | #define MIPI_DSI_PHY_PWR_LDO_CHAN (3) 32 | #define MIPI_DSI_PHY_PWR_LDO_VOLTAGE_MV (2500) 33 | 34 | #define DISPLAY_SWAP_XY false 35 | #define DISPLAY_MIRROR_X false 36 | #define DISPLAY_MIRROR_Y false 37 | 38 | #define DISPLAY_OFFSET_X 0 39 | #define DISPLAY_OFFSET_Y 0 40 | 41 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_NC 42 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 43 | 44 | #endif // _BOARD_CONFIG_H_ 45 | -------------------------------------------------------------------------------- /main/boards/waveshare-p4-wifi6-touch-lcd-4b/README.md: -------------------------------------------------------------------------------- 1 | # Waveshare ESP32-P4-WIFI6-Touch-LCD-4B 2 | 3 | 4 | [ESP32-P4-WIFI6-Touch-LCD-4B](https://www.waveshare.com/esp32-p4-wifi6-touch-lcd-4b.htm) is waveshare electronics designed an intelligent 86 box based on ESP32-P4 module equipped with a 720*720 IPS capacitive touch screen 5 | 6 | 7 | ## Configuration 8 | 9 | Configuration in `menuconfig`. 10 | 11 | Selection Board Type `Xiaozhi Assistant --> Board Type` 12 | - Waveshare ESP32-P4-WIFI6-Touch-LCD-4B -------------------------------------------------------------------------------- /main/boards/waveshare-p4-wifi6-touch-lcd-4b/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_INPUT_REFERENCE true 10 | 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_13 12 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_10 13 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_12 14 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_11 15 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_9 16 | 17 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_53 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_7 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_8 20 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 21 | #define AUDIO_CODEC_ES7210_ADDR ES7210_CODEC_DEFAULT_ADDR 22 | 23 | #define BOOT_BUTTON_GPIO GPIO_NUM_35 24 | 25 | #define DISPLAY_WIDTH 720 26 | #define DISPLAY_HEIGHT 720 27 | 28 | #define LCD_BIT_PER_PIXEL (16) 29 | #define PIN_NUM_LCD_RST GPIO_NUM_27 30 | 31 | #define DELAY_TIME_MS (3000) 32 | #define LCD_MIPI_DSI_LANE_NUM (2) // 2 data lanes 33 | 34 | #define MIPI_DSI_PHY_PWR_LDO_CHAN (3) 35 | #define MIPI_DSI_PHY_PWR_LDO_VOLTAGE_MV (2500) 36 | 37 | #define DISPLAY_SWAP_XY false 38 | #define DISPLAY_MIRROR_X false 39 | #define DISPLAY_MIRROR_Y false 40 | 41 | #define DISPLAY_OFFSET_X 0 42 | #define DISPLAY_OFFSET_Y 0 43 | 44 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_26 45 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT true 46 | 47 | #endif // _BOARD_CONFIG_H_ 48 | -------------------------------------------------------------------------------- /main/boards/waveshare-s3-touch-amoled-1.75/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_INPUT_REFERENCE true 10 | 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_42 12 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_45 13 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_9 14 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_10 15 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_8 16 | 17 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_46 18 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_15 19 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_14 20 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 21 | #define AUDIO_CODEC_ES7210_ADDR ES7210_CODEC_DEFAULT_ADDR 22 | 23 | #define I2C_ADDRESS ESP_IO_EXPANDER_I2C_TCA9554_ADDRESS_000 24 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 25 | 26 | #define EXAMPLE_PIN_NUM_LCD_CS GPIO_NUM_12 27 | #define EXAMPLE_PIN_NUM_LCD_PCLK GPIO_NUM_38 28 | #define EXAMPLE_PIN_NUM_LCD_DATA0 GPIO_NUM_4 29 | #define EXAMPLE_PIN_NUM_LCD_DATA1 GPIO_NUM_5 30 | #define EXAMPLE_PIN_NUM_LCD_DATA2 GPIO_NUM_6 31 | #define EXAMPLE_PIN_NUM_LCD_DATA3 GPIO_NUM_7 32 | #define EXAMPLE_PIN_NUM_LCD_RST GPIO_NUM_39 33 | #define DISPLAY_WIDTH 466 34 | #define DISPLAY_HEIGHT 466 35 | #define DISPLAY_MIRROR_X false 36 | #define DISPLAY_MIRROR_Y false 37 | #define DISPLAY_SWAP_XY false 38 | 39 | #define DISPLAY_OFFSET_X 0 40 | #define DISPLAY_OFFSET_Y 0 41 | 42 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_NC 43 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 44 | #endif // _BOARD_CONFIG_H_ 45 | -------------------------------------------------------------------------------- /main/boards/waveshare-s3-touch-amoled-1.75/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "waveshare-s3-touch-amoled-1.75", 6 | "sdkconfig_append": [ 7 | "CONFIG_USE_WECHAT_MESSAGE_STYLE=n", 8 | "CONFIG_USE_DEVICE_AEC=y" 9 | ] 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /main/boards/xingzhi-cube-0.85tft-ml307/config.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _BOARD_CONFIG_H_ 3 | #define _BOARD_CONFIG_H_ 4 | 5 | #include 6 | 7 | #define AUDIO_INPUT_SAMPLE_RATE 16000 8 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 9 | 10 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_4 11 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_5 12 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_6 13 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_7 14 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_15 15 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_16 16 | 17 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 18 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC 19 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC 20 | 21 | #define DISPLAY_SDA GPIO_NUM_10 22 | #define DISPLAY_SCL GPIO_NUM_9 23 | #define DISPLAY_DC GPIO_NUM_8 24 | #define DISPLAY_CS GPIO_NUM_14 25 | #define DISPLAY_RES GPIO_NUM_18 26 | #define DISPLAY_WIDTH 128 27 | #define DISPLAY_HEIGHT 128 28 | #define DISPLAY_SWAP_XY false 29 | #define DISPLAY_MIRROR_X false 30 | #define DISPLAY_MIRROR_Y true 31 | #define BACKLIGHT_INVERT false 32 | #define DISPLAY_OFFSET_X 0 33 | #define DISPLAY_OFFSET_Y 0 34 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_13 35 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 36 | 37 | #define ML307_RX_PIN GPIO_NUM_11 38 | #define ML307_TX_PIN GPIO_NUM_12 39 | 40 | #endif // _BOARD_CONFIG_H_ 41 | -------------------------------------------------------------------------------- /main/boards/xingzhi-cube-0.85tft-ml307/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "xingzhi-cube-0.85tft-ml307", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/xingzhi-cube-0.85tft-wifi/config.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _BOARD_CONFIG_H_ 3 | #define _BOARD_CONFIG_H_ 4 | 5 | #include 6 | 7 | #define AUDIO_INPUT_SAMPLE_RATE 16000 8 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 9 | 10 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_4 11 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_5 12 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_6 13 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_7 14 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_15 15 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_16 16 | 17 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 18 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC 19 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC 20 | 21 | #define DISPLAY_SDA GPIO_NUM_10 22 | #define DISPLAY_SCL GPIO_NUM_9 23 | #define DISPLAY_DC GPIO_NUM_8 24 | #define DISPLAY_CS GPIO_NUM_14 25 | #define DISPLAY_RES GPIO_NUM_18 26 | #define DISPLAY_WIDTH 128 27 | #define DISPLAY_HEIGHT 128 28 | #define DISPLAY_SWAP_XY false 29 | #define DISPLAY_MIRROR_X false 30 | #define DISPLAY_MIRROR_Y true 31 | #define BACKLIGHT_INVERT false 32 | #define DISPLAY_OFFSET_X 0 33 | #define DISPLAY_OFFSET_Y 0 34 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_13 35 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 36 | 37 | #endif // _BOARD_CONFIG_H_ 38 | -------------------------------------------------------------------------------- /main/boards/xingzhi-cube-0.85tft-wifi/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "xingzhi-cube-0.85tft-wifi", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/xingzhi-cube-0.96oled-ml307/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 16000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_4 9 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_5 10 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_6 11 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_7 12 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_15 13 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_16 14 | 15 | #define BUILTIN_LED_GPIO GPIO_NUM_48 16 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 17 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_40 18 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_39 19 | 20 | #define DISPLAY_SDA_PIN GPIO_NUM_41 21 | #define DISPLAY_SCL_PIN GPIO_NUM_42 22 | #define DISPLAY_WIDTH 128 23 | #define DISPLAY_HEIGHT 64 24 | #define DISPLAY_MIRROR_X true 25 | #define DISPLAY_MIRROR_Y true 26 | 27 | #define ML307_RX_PIN GPIO_NUM_11 28 | #define ML307_TX_PIN GPIO_NUM_12 29 | 30 | #endif // _BOARD_CONFIG_H_ 31 | -------------------------------------------------------------------------------- /main/boards/xingzhi-cube-0.96oled-ml307/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "xingzhi-cube-0.96oled-ml307", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/xingzhi-cube-0.96oled-wifi/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 16000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_4 9 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_5 10 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_6 11 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_7 12 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_15 13 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_16 14 | 15 | #define BUILTIN_LED_GPIO GPIO_NUM_48 16 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 17 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_40 18 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_39 19 | 20 | #define DISPLAY_SDA_PIN GPIO_NUM_41 21 | #define DISPLAY_SCL_PIN GPIO_NUM_42 22 | #define DISPLAY_WIDTH 128 23 | #define DISPLAY_HEIGHT 64 24 | #define DISPLAY_MIRROR_X true 25 | #define DISPLAY_MIRROR_Y true 26 | 27 | #endif // _BOARD_CONFIG_H_ 28 | -------------------------------------------------------------------------------- /main/boards/xingzhi-cube-0.96oled-wifi/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "xingzhi-cube-0.96oled-wifi", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/xingzhi-cube-1.54tft-ml307/config.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _BOARD_CONFIG_H_ 3 | #define _BOARD_CONFIG_H_ 4 | 5 | #include 6 | 7 | #define AUDIO_INPUT_SAMPLE_RATE 16000 8 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 9 | 10 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_4 11 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_5 12 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_6 13 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_7 14 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_15 15 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_16 16 | 17 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 18 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_40 19 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_39 20 | 21 | #define DISPLAY_SDA GPIO_NUM_10 22 | #define DISPLAY_SCL GPIO_NUM_9 23 | #define DISPLAY_DC GPIO_NUM_8 24 | #define DISPLAY_CS GPIO_NUM_14 25 | #define DISPLAY_RES GPIO_NUM_18 26 | #define DISPLAY_WIDTH 240 27 | #define DISPLAY_HEIGHT 240 28 | #define DISPLAY_SWAP_XY false 29 | #define DISPLAY_MIRROR_X false 30 | #define DISPLAY_MIRROR_Y false 31 | #define BACKLIGHT_INVERT false 32 | #define DISPLAY_OFFSET_X 0 33 | #define DISPLAY_OFFSET_Y 0 34 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_13 35 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 36 | 37 | #define ML307_RX_PIN GPIO_NUM_11 38 | #define ML307_TX_PIN GPIO_NUM_12 39 | 40 | #endif // _BOARD_CONFIG_H_ 41 | -------------------------------------------------------------------------------- /main/boards/xingzhi-cube-1.54tft-ml307/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "xingzhi-cube-1.54tft-ml307", 6 | "sdkconfig_append": [] 7 | }, 8 | { 9 | "name": "xingzhi-cube-1.54tft-ml307-wechatui", 10 | "sdkconfig_append": [ 11 | "CONFIG_USE_WECHAT_MESSAGE_STYLE=y" 12 | ] 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /main/boards/xingzhi-cube-1.54tft-wifi/config.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _BOARD_CONFIG_H_ 3 | #define _BOARD_CONFIG_H_ 4 | 5 | #include 6 | 7 | #define AUDIO_INPUT_SAMPLE_RATE 16000 8 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 9 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_4 10 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_5 11 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_6 12 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_7 13 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_15 14 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_16 15 | 16 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 17 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_40 18 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_39 19 | 20 | #define DISPLAY_SDA GPIO_NUM_10 21 | #define DISPLAY_SCL GPIO_NUM_9 22 | #define DISPLAY_DC GPIO_NUM_8 23 | #define DISPLAY_CS GPIO_NUM_14 24 | #define DISPLAY_RES GPIO_NUM_18 25 | #define DISPLAY_WIDTH 240 26 | #define DISPLAY_HEIGHT 240 27 | #define DISPLAY_SWAP_XY false 28 | #define DISPLAY_MIRROR_X false 29 | #define DISPLAY_MIRROR_Y false 30 | #define BACKLIGHT_INVERT false 31 | #define DISPLAY_OFFSET_X 0 32 | #define DISPLAY_OFFSET_Y 0 33 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_13 34 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 35 | 36 | #endif // _BOARD_CONFIG_H_ 37 | -------------------------------------------------------------------------------- /main/boards/xingzhi-cube-1.54tft-wifi/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "xingzhi-cube-1.54tft-wifi", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/xmini-c3/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define AUDIO_INPUT_SAMPLE_RATE 24000 7 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 8 | 9 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_10 10 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_6 11 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_8 12 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_7 13 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_5 14 | 15 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_11 16 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_3 17 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_4 18 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 19 | 20 | #define BUILTIN_LED_GPIO GPIO_NUM_2 21 | #define BOOT_BUTTON_GPIO GPIO_NUM_9 22 | 23 | #define DISPLAY_WIDTH 128 24 | #define DISPLAY_HEIGHT 64 25 | #define DISPLAY_MIRROR_X true 26 | #define DISPLAY_MIRROR_Y true 27 | 28 | #endif // _BOARD_CONFIG_H_ 29 | -------------------------------------------------------------------------------- /main/boards/xmini-c3/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32c3", 3 | "builds": [ 4 | { 5 | "name": "xmini-c3", 6 | "sdkconfig_append": [ 7 | "CONFIG_PM_ENABLE=y", 8 | "CONFIG_FREERTOS_USE_TICKLESS_IDLE=y", 9 | "CONFIG_USE_ESP_WAKE_WORD=y" 10 | ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /main/boards/zhengchen-1.54tft-ml307/README.md: -------------------------------------------------------------------------------- 1 | # 产品相关介绍网址 2 | 3 | ```http 4 | https://e.tb.cn/h.6Gl2LC7rsrswQZp?tk=qFuaV9hzh0k CZ356 5 | ``` 6 | 7 | # 编译配置命令 8 | 9 | **配置编译目标为 ESP32S3:** 10 | 11 | ```bash 12 | idf.py set-target esp32s3 13 | ``` 14 | 15 | **打开 menuconfig:** 16 | 17 | ```bash 18 | idf.py menuconfig 19 | ``` 20 | 21 | **选择板子:** 22 | 23 | ``` 24 | Xiaozhi Assistant -> Board Type -> zhengchen-1.54tft-ml307 25 | ``` 26 | 27 | ``` 28 | 29 | **编译:** 30 | 31 | bash 32 | idf.py build 33 | ``` 34 | 35 | **下载:** 36 | idf.py build flash monitor 37 | 38 | 进行下载和显示日志 39 | 40 | 41 | **固件生成:** 42 | 43 | ```bash 44 | idf.py merge-bin 45 | ``` 46 | -------------------------------------------------------------------------------- /main/boards/zhengchen-1.54tft-ml307/config.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _BOARD_CONFIG_H_ 3 | #define _BOARD_CONFIG_H_ 4 | 5 | #include 6 | 7 | #define AUDIO_INPUT_SAMPLE_RATE 16000 8 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 9 | 10 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_4 11 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_5 12 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_6 13 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_7 14 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_15 15 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_16 16 | 17 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 18 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_10 19 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_39 20 | 21 | #define DISPLAY_SDA GPIO_NUM_41 22 | #define DISPLAY_SCL GPIO_NUM_42 23 | #define DISPLAY_RES GPIO_NUM_45 24 | #define DISPLAY_DC GPIO_NUM_40 25 | #define DISPLAY_CS GPIO_NUM_21 26 | 27 | #define DISPLAY_WIDTH 240 28 | #define DISPLAY_HEIGHT 240 29 | #define DISPLAY_SWAP_XY false 30 | #define DISPLAY_MIRROR_X false 31 | #define DISPLAY_MIRROR_Y false 32 | #define BACKLIGHT_INVERT false 33 | #define DISPLAY_OFFSET_X 0 34 | #define DISPLAY_OFFSET_Y 0 35 | 36 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_20 37 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 38 | 39 | #define ML307_RX_PIN GPIO_NUM_11 40 | #define ML307_TX_PIN GPIO_NUM_12 41 | 42 | #endif // _BOARD_CONFIG_H_ 43 | -------------------------------------------------------------------------------- /main/boards/zhengchen-1.54tft-ml307/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "zhengchen-1.54tft-ml307", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/boards/zhengchen-1.54tft-wifi/README.md: -------------------------------------------------------------------------------- 1 | # 产品相关介绍网址 2 | 3 | ```http 4 | https://e.tb.cn/h.6Gl2LC7rsrswQZp?tk=qFuaV9hzh0k CZ356 5 | ``` 6 | 7 | # 编译配置命令 8 | 9 | **配置编译目标为 ESP32S3:** 10 | 11 | ```bash 12 | idf.py set-target esp32s3 13 | ``` 14 | 15 | **打开 menuconfig:** 16 | 17 | ```bash 18 | idf.py menuconfig 19 | ``` 20 | 21 | **选择板子:** 22 | 23 | ``` 24 | Xiaozhi Assistant -> Board Type -> zhengchen-1.54tft-wifi 25 | ``` 26 | 27 | ``` 28 | 29 | **编译:** 30 | 31 | bash 32 | idf.py build 33 | ``` 34 | 35 | **下载:** 36 | idf.py build flash monitor 37 | 38 | 进行下载和显示日志 39 | 40 | 41 | **固件生成:** 42 | 43 | ```bash 44 | idf.py merge-bin 45 | ``` 46 | -------------------------------------------------------------------------------- /main/boards/zhengchen-1.54tft-wifi/config.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _BOARD_CONFIG_H_ 3 | #define _BOARD_CONFIG_H_ 4 | 5 | #include 6 | 7 | #define AUDIO_INPUT_SAMPLE_RATE 16000 8 | #define AUDIO_OUTPUT_SAMPLE_RATE 24000 9 | #define AUDIO_I2S_MIC_GPIO_WS GPIO_NUM_4 10 | #define AUDIO_I2S_MIC_GPIO_SCK GPIO_NUM_5 11 | #define AUDIO_I2S_MIC_GPIO_DIN GPIO_NUM_6 12 | #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_7 13 | #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_15 14 | #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_16 15 | 16 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 17 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_10 18 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_39 19 | 20 | #define DISPLAY_SDA GPIO_NUM_41 21 | #define DISPLAY_SCL GPIO_NUM_42 22 | #define DISPLAY_RES GPIO_NUM_45 23 | #define DISPLAY_DC GPIO_NUM_40 24 | #define DISPLAY_CS GPIO_NUM_21 25 | 26 | #define DISPLAY_WIDTH 240 27 | #define DISPLAY_HEIGHT 240 28 | #define DISPLAY_SWAP_XY false 29 | #define DISPLAY_MIRROR_X false 30 | #define DISPLAY_MIRROR_Y false 31 | #define BACKLIGHT_INVERT false 32 | #define DISPLAY_OFFSET_X 0 33 | #define DISPLAY_OFFSET_Y 0 34 | 35 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_20 36 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 37 | 38 | 39 | #endif // _BOARD_CONFIG_H_ 40 | -------------------------------------------------------------------------------- /main/boards/zhengchen-1.54tft-wifi/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "zhengchen-1.54tft-wifi", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /main/display/oled_display.h: -------------------------------------------------------------------------------- 1 | #ifndef OLED_DISPLAY_H 2 | #define OLED_DISPLAY_H 3 | 4 | #include "display.h" 5 | 6 | #include 7 | #include 8 | 9 | class OledDisplay : public Display { 10 | private: 11 | esp_lcd_panel_io_handle_t panel_io_ = nullptr; 12 | esp_lcd_panel_handle_t panel_ = nullptr; 13 | 14 | lv_obj_t* status_bar_ = nullptr; 15 | lv_obj_t* content_ = nullptr; 16 | lv_obj_t* content_left_ = nullptr; 17 | lv_obj_t* content_right_ = nullptr; 18 | lv_obj_t* container_ = nullptr; 19 | lv_obj_t* side_bar_ = nullptr; 20 | 21 | DisplayFonts fonts_; 22 | 23 | virtual bool Lock(int timeout_ms = 0) override; 24 | virtual void Unlock() override; 25 | 26 | void SetupUI_128x64(); 27 | void SetupUI_128x32(); 28 | 29 | public: 30 | OledDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel, int width, int height, bool mirror_x, bool mirror_y, 31 | DisplayFonts fonts); 32 | ~OledDisplay(); 33 | 34 | virtual void SetChatMessage(const char* role, const char* content) override; 35 | }; 36 | 37 | #endif // OLED_DISPLAY_H 38 | -------------------------------------------------------------------------------- /main/iot/thing_manager.h: -------------------------------------------------------------------------------- 1 | #ifndef THING_MANAGER_H 2 | #define THING_MANAGER_H 3 | 4 | 5 | #include "thing.h" 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | namespace iot { 15 | 16 | class ThingManager { 17 | public: 18 | static ThingManager& GetInstance() { 19 | static ThingManager instance; 20 | return instance; 21 | } 22 | ThingManager(const ThingManager&) = delete; 23 | ThingManager& operator=(const ThingManager&) = delete; 24 | 25 | void AddThing(Thing* thing); 26 | 27 | std::string GetDescriptorsJson(); 28 | bool GetStatesJson(std::string& json, bool delta = false); 29 | void Invoke(const cJSON* command); 30 | 31 | private: 32 | ThingManager() = default; 33 | ~ThingManager() = default; 34 | 35 | std::vector things_; 36 | std::map last_states_; 37 | }; 38 | 39 | 40 | } // namespace iot 41 | 42 | #endif // THING_MANAGER_H 43 | -------------------------------------------------------------------------------- /main/iot/things/battery.cc: -------------------------------------------------------------------------------- 1 | #include "iot/thing.h" 2 | #include "board.h" 3 | 4 | #include 5 | 6 | #define TAG "Battery" 7 | 8 | namespace iot { 9 | 10 | // 这里仅定义 Battery 的属性和方法,不包含具体的实现 11 | class Battery : public Thing { 12 | private: 13 | int level_ = 0; 14 | bool charging_ = false; 15 | bool discharging_ = false; 16 | 17 | public: 18 | Battery() : Thing("Battery", "The battery of the device") { 19 | // 定义设备的属性 20 | properties_.AddNumberProperty("level", "Current battery level", [this]() -> int { 21 | auto& board = Board::GetInstance(); 22 | if (board.GetBatteryLevel(level_, charging_, discharging_)) { 23 | return level_; 24 | } 25 | return 0; 26 | }); 27 | properties_.AddBooleanProperty("charging", "Whether the battery is charging", [this]() -> int { 28 | return charging_; 29 | }); 30 | } 31 | }; 32 | 33 | } // namespace iot 34 | 35 | DECLARE_THING(Battery); -------------------------------------------------------------------------------- /main/iot/things/speaker.cc: -------------------------------------------------------------------------------- 1 | #include "iot/thing.h" 2 | #include "board.h" 3 | #include "audio_codec.h" 4 | 5 | #include 6 | 7 | #define TAG "Speaker" 8 | 9 | namespace iot { 10 | 11 | // 这里仅定义 Speaker 的属性和方法,不包含具体的实现 12 | class Speaker : public Thing { 13 | public: 14 | Speaker() : Thing("AudioSpeaker", "The audio speaker of the device") { 15 | // 定义设备的属性 16 | properties_.AddNumberProperty("volume", "Current audio volume value", [this]() -> int { 17 | auto codec = Board::GetInstance().GetAudioCodec(); 18 | return codec->output_volume(); 19 | }); 20 | 21 | // 定义设备可以被远程执行的指令 22 | methods_.AddMethod("set_volume", "Set the audio volume", ParameterList({ 23 | Parameter("volume", "An integer between 0 and 100", kValueTypeNumber, true) 24 | }), [this](const ParameterList& parameters) { 25 | auto codec = Board::GetInstance().GetAudioCodec(); 26 | codec->SetOutputVolume(static_cast(parameters["volume"].number())); 27 | }); 28 | } 29 | }; 30 | 31 | } // namespace iot 32 | 33 | DECLARE_THING(Speaker); 34 | -------------------------------------------------------------------------------- /main/led/gpio_led.h: -------------------------------------------------------------------------------- 1 | #ifndef _GPIO_LED_H_ 2 | #define _GPIO_LED_H_ 3 | 4 | #include 5 | #include 6 | #include "led.h" 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class GpioLed : public Led { 14 | public: 15 | GpioLed(gpio_num_t gpio); 16 | GpioLed(gpio_num_t gpio, int output_invert); 17 | GpioLed(gpio_num_t gpio, int output_invert, ledc_timer_t timer_num, ledc_channel_t channel); 18 | virtual ~GpioLed(); 19 | 20 | void OnStateChanged() override; 21 | void TurnOn(); 22 | void TurnOff(); 23 | void SetBrightness(uint8_t brightness); 24 | 25 | private: 26 | std::mutex mutex_; 27 | TaskHandle_t blink_task_ = nullptr; 28 | ledc_channel_config_t ledc_channel_ = {0}; 29 | bool ledc_initialized_ = false; 30 | uint32_t duty_ = 0; 31 | int blink_counter_ = 0; 32 | int blink_interval_ms_ = 0; 33 | esp_timer_handle_t blink_timer_ = nullptr; 34 | bool fade_up_ = true; 35 | 36 | void StartBlinkTask(int times, int interval_ms); 37 | void OnBlinkTimer(); 38 | 39 | void BlinkOnce(); 40 | void Blink(int times, int interval_ms); 41 | void StartContinuousBlink(int interval_ms); 42 | void StartFadeTask(); 43 | void OnFadeEnd(); 44 | static bool IRAM_ATTR FadeCallback(const ledc_cb_param_t *param, void *user_arg); 45 | }; 46 | 47 | #endif // _GPIO_LED_H_ 48 | -------------------------------------------------------------------------------- /main/led/led.h: -------------------------------------------------------------------------------- 1 | #ifndef _LED_H_ 2 | #define _LED_H_ 3 | 4 | class Led { 5 | public: 6 | virtual ~Led() = default; 7 | // Set the led state based on the device state 8 | virtual void OnStateChanged() = 0; 9 | }; 10 | 11 | 12 | class NoLed : public Led { 13 | public: 14 | virtual void OnStateChanged() override {} 15 | }; 16 | 17 | #endif // _LED_H_ 18 | -------------------------------------------------------------------------------- /main/led/single_led.h: -------------------------------------------------------------------------------- 1 | #ifndef _SINGLE_LED_H_ 2 | #define _SINGLE_LED_H_ 3 | 4 | #include "led.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class SingleLed : public Led { 12 | public: 13 | SingleLed(gpio_num_t gpio); 14 | virtual ~SingleLed(); 15 | 16 | void OnStateChanged() override; 17 | 18 | private: 19 | std::mutex mutex_; 20 | TaskHandle_t blink_task_ = nullptr; 21 | led_strip_handle_t led_strip_ = nullptr; 22 | uint8_t r_ = 0, g_ = 0, b_ = 0; 23 | int blink_counter_ = 0; 24 | int blink_interval_ms_ = 0; 25 | esp_timer_handle_t blink_timer_ = nullptr; 26 | 27 | void StartBlinkTask(int times, int interval_ms); 28 | void OnBlinkTimer(); 29 | 30 | void BlinkOnce(); 31 | void Blink(int times, int interval_ms); 32 | void StartContinuousBlink(int interval_ms); 33 | void TurnOn(); 34 | void TurnOff(); 35 | void SetColor(uint8_t r, uint8_t g, uint8_t b); 36 | }; 37 | 38 | #endif // _SINGLE_LED_H_ 39 | -------------------------------------------------------------------------------- /main/main.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "application.h" 9 | #include "system_info.h" 10 | 11 | #define TAG "main" 12 | 13 | extern "C" void app_main(void) 14 | { 15 | // Initialize the default event loop 16 | ESP_ERROR_CHECK(esp_event_loop_create_default()); 17 | 18 | // Initialize NVS flash for WiFi configuration 19 | esp_err_t ret = nvs_flash_init(); 20 | if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { 21 | ESP_LOGW(TAG, "Erasing NVS flash to fix corruption"); 22 | ESP_ERROR_CHECK(nvs_flash_erase()); 23 | ret = nvs_flash_init(); 24 | } 25 | ESP_ERROR_CHECK(ret); 26 | 27 | // Launch the application 28 | Application::GetInstance().Start(); 29 | } 30 | -------------------------------------------------------------------------------- /main/protocols/mqtt_protocol.h: -------------------------------------------------------------------------------- 1 | #ifndef MQTT_PROTOCOL_H 2 | #define MQTT_PROTOCOL_H 3 | 4 | 5 | #include "protocol.h" 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #define MQTT_PING_INTERVAL_SECONDS 90 19 | #define MQTT_RECONNECT_INTERVAL_MS 10000 20 | 21 | #define MQTT_PROTOCOL_SERVER_HELLO_EVENT (1 << 0) 22 | 23 | class MqttProtocol : public Protocol { 24 | public: 25 | MqttProtocol(); 26 | ~MqttProtocol(); 27 | 28 | bool Start() override; 29 | bool SendAudio(const AudioStreamPacket& packet) override; 30 | bool OpenAudioChannel() override; 31 | void CloseAudioChannel() override; 32 | bool IsAudioChannelOpened() const override; 33 | 34 | private: 35 | EventGroupHandle_t event_group_handle_; 36 | 37 | std::string publish_topic_; 38 | 39 | std::mutex channel_mutex_; 40 | Mqtt* mqtt_ = nullptr; 41 | Udp* udp_ = nullptr; 42 | mbedtls_aes_context aes_ctx_; 43 | std::string aes_nonce_; 44 | std::string udp_server_; 45 | int udp_port_; 46 | uint32_t local_sequence_; 47 | uint32_t remote_sequence_; 48 | 49 | bool StartMqttClient(bool report_error=false); 50 | void ParseServerHello(const cJSON* root); 51 | std::string DecodeHexString(const std::string& hex_string); 52 | 53 | bool SendText(const std::string& text) override; 54 | std::string GetHelloMessage(); 55 | }; 56 | 57 | 58 | #endif // MQTT_PROTOCOL_H 59 | -------------------------------------------------------------------------------- /main/protocols/websocket_protocol.h: -------------------------------------------------------------------------------- 1 | #ifndef _WEBSOCKET_PROTOCOL_H_ 2 | #define _WEBSOCKET_PROTOCOL_H_ 3 | 4 | 5 | #include "protocol.h" 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define WEBSOCKET_PROTOCOL_SERVER_HELLO_EVENT (1 << 0) 12 | 13 | class WebsocketProtocol : public Protocol { 14 | public: 15 | WebsocketProtocol(); 16 | ~WebsocketProtocol(); 17 | 18 | bool Start() override; 19 | bool SendAudio(const AudioStreamPacket& packet) override; 20 | bool OpenAudioChannel() override; 21 | void CloseAudioChannel() override; 22 | bool IsAudioChannelOpened() const override; 23 | 24 | private: 25 | EventGroupHandle_t event_group_handle_; 26 | WebSocket* websocket_ = nullptr; 27 | int version_ = 1; 28 | 29 | void ParseServerHello(const cJSON* root); 30 | bool SendText(const std::string& text) override; 31 | std::string GetHelloMessage(); 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /main/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGS_H 2 | #define SETTINGS_H 3 | 4 | #include 5 | #include 6 | 7 | class Settings { 8 | public: 9 | Settings(const std::string& ns, bool read_write = false); 10 | ~Settings(); 11 | 12 | std::string GetString(const std::string& key, const std::string& default_value = ""); 13 | void SetString(const std::string& key, const std::string& value); 14 | int32_t GetInt(const std::string& key, int32_t default_value = 0); 15 | void SetInt(const std::string& key, int32_t value); 16 | void EraseKey(const std::string& key); 17 | void EraseAll(); 18 | 19 | private: 20 | std::string ns_; 21 | nvs_handle_t nvs_handle_ = 0; 22 | bool read_write_ = false; 23 | bool dirty_ = false; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /main/system_info.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYSTEM_INFO_H_ 2 | #define _SYSTEM_INFO_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | class SystemInfo { 10 | public: 11 | static size_t GetFlashSize(); 12 | static size_t GetMinimumFreeHeapSize(); 13 | static size_t GetFreeHeapSize(); 14 | static std::string GetMacAddress(); 15 | static std::string GetChipModelName(); 16 | static esp_err_t PrintTaskCpuUsage(TickType_t xTicksToWait); 17 | static void PrintTaskList(); 18 | static void PrintHeapStats(); 19 | }; 20 | 21 | #endif // _SYSTEM_INFO_H_ 22 | -------------------------------------------------------------------------------- /partitions/v1/16m.csv: -------------------------------------------------------------------------------- 1 | # ESP-IDF Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | nvs, data, nvs, 0x9000, 0x4000, 4 | otadata, data, ota, 0xd000, 0x2000, 5 | phy_init, data, phy, 0xf000, 0x1000, 6 | model, data, spiffs, 0x10000, 0xF0000, 7 | ota_0, app, ota_0, 0x100000, 6M, 8 | ota_1, app, ota_1, 0x700000, 6M, 9 | -------------------------------------------------------------------------------- /partitions/v1/32m.csv: -------------------------------------------------------------------------------- 1 | # ESP-IDF Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | nvsfactory, data, nvs, , 200K, 4 | nvs, data, nvs, , 840K, 5 | otadata, data, ota, , 0x2000, 6 | phy_init, data, phy, , 0x1000, 7 | model, data, spiffs, , 0xF0000, 8 | # According to scripts/versions.py, app partition must be aligned to 1MB 9 | ota_0, app, ota_0, 0x200000, 12M, 10 | ota_1, app, ota_1, , 12M, 11 | -------------------------------------------------------------------------------- /partitions/v1/4m.csv: -------------------------------------------------------------------------------- 1 | # ESP-IDF Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | nvs, data, nvs, 0x9000, 0x4000, 4 | otadata, data, ota, 0xd000, 0x2000, 5 | phy_init, data, phy, 0xf000, 0x1000, 6 | model, data, spiffs, 0x10000, 0xF0000, 7 | factory, app, factory, 0x100000, 3M, 8 | -------------------------------------------------------------------------------- /partitions/v1/4m_esp-hi.csv: -------------------------------------------------------------------------------- 1 | # ESP-IDF Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | nvs, data, nvs, 0x9000, 0x4000, 4 | otadata, data, ota, 0xd000, 0x2000, 5 | phy_init, data, phy, 0xf000, 0x1000, 6 | model, data, spiffs, 0x10000, 0xD0000, 7 | factory, app, factory, 0xe0000, 2200K, 8 | assets_A, data, spiffs, , 700K, 9 | -------------------------------------------------------------------------------- /partitions/v1/8m.csv: -------------------------------------------------------------------------------- 1 | # ESP-IDF Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | nvs, data, nvs, 0x9000, 0x4000, 4 | otadata, data, ota, 0xd000, 0x2000, 5 | phy_init, data, phy, 0xf000, 0x1000, 6 | model, data, spiffs, 0x10000, 0xF0000, 7 | ota_0, app, ota_0, 0x100000, 0x380000, 8 | ota_1, app, ota_1, 0x480000, 0x380000, 9 | -------------------------------------------------------------------------------- /scripts/Image_Converter/README.md: -------------------------------------------------------------------------------- 1 | # LVGL图片转换工具 2 | 3 | 这个目录包含两个用于处理和转换图片为LVGL格式的Python脚本: 4 | 5 | ## 1. LVGLImage (LVGLImage.py) 6 | 7 | 引用自LVGL[官方repo](https://github.com/lvgl/lvgl)的转换脚本[LVGLImage.py](https://github.com/lvgl/lvgl/blob/master/scripts/LVGLImage.py) 8 | 9 | ## 2. LVGL图片转换工具 (lvgl_tools_gui.py) 10 | 11 | 调用`LVGLImage.py`,将图片批量转换为LVGL图片格式 12 | 可用于修改小智的默认表情,具体修改教程[在这里](https://www.bilibili.com/video/BV12FQkYeEJ3/) 13 | 14 | ### 特性 15 | 16 | - 图形化操作,界面更友好 17 | - 支持批量转换图片 18 | - 自动识别图片格式并选择最佳的颜色格式转换 19 | - 多分辨率支持 20 | 21 | ### 使用方法 22 | 23 | 安装Pillow 24 | 25 | ```bash 26 | pip install Pillow # 处理图像需要 27 | ``` 28 | 29 | 运行转换工具 30 | 31 | ```bash 32 | python lvgl_tools_gui.py 33 | ``` 34 | -------------------------------------------------------------------------------- /scripts/flash.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | esptool.py -p /dev/ttyACM0 -b 2000000 write_flash 0 ../releases/v0.9.9_bread-compact-wifi/merged-binary.bin 3 | -------------------------------------------------------------------------------- /scripts/p3_tools/convert_p3_to_audio.py: -------------------------------------------------------------------------------- 1 | import struct 2 | import sys 3 | import opuslib 4 | import numpy as np 5 | from tqdm import tqdm 6 | import soundfile as sf 7 | 8 | 9 | def decode_p3_to_audio(input_file, output_file): 10 | sample_rate = 16000 11 | channels = 1 12 | decoder = opuslib.Decoder(sample_rate, channels) 13 | 14 | pcm_frames = [] 15 | frame_size = int(sample_rate * 60 / 1000) 16 | 17 | with open(input_file, "rb") as f: 18 | f.seek(0, 2) 19 | total_size = f.tell() 20 | f.seek(0) 21 | 22 | with tqdm(total=total_size, unit="B", unit_scale=True) as pbar: 23 | while True: 24 | header = f.read(4) 25 | if not header or len(header) < 4: 26 | break 27 | 28 | pkt_type, reserved, opus_len = struct.unpack(">BBH", header) 29 | opus_data = f.read(opus_len) 30 | if len(opus_data) != opus_len: 31 | break 32 | 33 | pcm = decoder.decode(opus_data, frame_size) 34 | pcm_frames.append(np.frombuffer(pcm, dtype=np.int16)) 35 | 36 | pbar.update(4 + opus_len) 37 | 38 | if not pcm_frames: 39 | raise ValueError("No valid audio data found") 40 | 41 | pcm_data = np.concatenate(pcm_frames) 42 | 43 | sf.write(output_file, pcm_data, sample_rate, subtype="PCM_16") 44 | 45 | 46 | if __name__ == "__main__": 47 | if len(sys.argv) != 3: 48 | print("Usage: python convert_p3_to_audio.py ") 49 | sys.exit(1) 50 | 51 | decode_p3_to_audio(sys.argv[1], sys.argv[2]) 52 | -------------------------------------------------------------------------------- /scripts/p3_tools/img/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/78/xiaozhi-esp32/d4ae55a4e3651874cd219c8282f1a4bfd258a89d/scripts/p3_tools/img/img.png -------------------------------------------------------------------------------- /scripts/p3_tools/requirements.txt: -------------------------------------------------------------------------------- 1 | librosa>=0.9.2 2 | opuslib>=3.0.1 3 | numpy>=1.20.0 4 | tqdm>=4.62.0 5 | sounddevice>=0.4.4 6 | pyloudnorm>=0.1.1 7 | soundfile>=0.13.1 8 | -------------------------------------------------------------------------------- /sdkconfig.defaults.esp32c3: -------------------------------------------------------------------------------- 1 | 2 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 3 | CONFIG_SR_WN_WN9S_NIHAOXIAOZHI=y 4 | -------------------------------------------------------------------------------- /sdkconfig.defaults.esp32p4: -------------------------------------------------------------------------------- 1 | CONFIG_IDF_TARGET="esp32p4" 2 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 3 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 4 | 5 | CONFIG_SPIRAM=y 6 | CONFIG_SPIRAM_SPEED_200M=y 7 | CONFIG_SPIRAM_XIP_FROM_PSRAM=y 8 | CONFIG_ESP_MAIN_TASK_STACK_SIZE=10240 9 | CONFIG_FREERTOS_HZ=1000 10 | CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID=y 11 | CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y 12 | 13 | CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096 14 | CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y 15 | CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=49152 16 | CONFIG_SPIRAM_MEMTEST=n 17 | CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y 18 | 19 | CONFIG_SLAVE_IDF_TARGET_ESP32C6=y 20 | 21 | CONFIG_SR_WN_WN9_NIHAOXIAOZHI_TTS=y 22 | 23 | CONFIG_IDF_EXPERIMENTAL_FEATURES=y 24 | -------------------------------------------------------------------------------- /sdkconfig.defaults.esp32s3: -------------------------------------------------------------------------------- 1 | 2 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 3 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 4 | 5 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y 6 | 7 | CONFIG_SPIRAM=y 8 | CONFIG_SPIRAM_MODE_OCT=y 9 | CONFIG_SPIRAM_SPEED_80M=y 10 | CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096 11 | CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=49152 12 | CONFIG_SPIRAM_MEMTEST=n 13 | CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y 14 | 15 | CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y 16 | CONFIG_ESP32S3_DATA_CACHE_64KB=y 17 | CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y 18 | 19 | CONFIG_SR_WN_WN9_NIHAOXIAOZHI_TTS=y 20 | 21 | CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 22 | --------------------------------------------------------------------------------