├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── README_en.md ├── README_ja.md ├── components ├── 78__esp-opus-encoder │ ├── .gitignore │ ├── CMakeLists.txt │ ├── idf_component.yml │ ├── include │ │ ├── opus_decoder.h │ │ ├── opus_encoder.h │ │ ├── opus_resampler.h │ │ └── resampler_structs.h │ ├── opus_decoder.cc │ ├── opus_encoder.cc │ ├── opus_resampler.cc │ └── silk_resampler.h ├── espressif__esp_codec_dev │ ├── CHANGELOG.md │ ├── CMakeLists.txt │ ├── Kconfig │ ├── LICENSE │ ├── README.md │ ├── README_CN.md │ ├── audio_codec_sw_vol.c │ ├── audio_codec_sw_vol.h │ ├── device │ │ ├── aw88298 │ │ │ ├── aw88298.c │ │ │ └── aw88298_reg.h │ │ ├── es7210 │ │ │ ├── es7210.c │ │ │ └── es7210_reg.h │ │ ├── es7243 │ │ │ └── es7243.c │ │ ├── es7243e │ │ │ └── es7243e.c │ │ ├── es8156 │ │ │ ├── es8156.c │ │ │ └── es8156_reg.h │ │ ├── es8311 │ │ │ ├── es8311.c │ │ │ └── es8311_reg.h │ │ ├── es8374 │ │ │ └── es8374.c │ │ ├── es8388 │ │ │ ├── es8388.c │ │ │ └── es8388_reg.h │ │ ├── include │ │ │ ├── aw88298_dac.h │ │ │ ├── es7210_adc.h │ │ │ ├── es7243_adc.h │ │ │ ├── es7243e_adc.h │ │ │ ├── es8156_dac.h │ │ │ ├── es8311_codec.h │ │ │ ├── es8374_codec.h │ │ │ ├── es8388_codec.h │ │ │ ├── tas5805m_dac.h │ │ │ └── zl38063_codec.h │ │ ├── priv_include │ │ │ └── es_common.h │ │ ├── tas5805m │ │ │ ├── tas5805m.c │ │ │ ├── tas5805m_reg.h │ │ │ └── tas5805m_reg_cfg.h │ │ └── zl38063 │ │ │ ├── LICENSE.txt │ │ │ ├── Readme_twolf.txt │ │ │ ├── api_lib │ │ │ ├── tw_spi_access.h │ │ │ ├── vprocTwolf_access.c │ │ │ ├── vprocTwolf_access.h │ │ │ ├── vproc_common.c │ │ │ ├── vproc_common.h │ │ │ └── vproc_data_types.h │ │ │ ├── example_apps │ │ │ ├── tw_hal_verify.c │ │ │ ├── tw_ldcfg.c │ │ │ ├── tw_ldfw.c │ │ │ ├── tw_ldfwcfg.c │ │ │ └── tw_spi_access.c │ │ │ ├── firmware │ │ │ ├── libfirmware.a │ │ │ ├── zl38063_config.h │ │ │ └── zl38063_firmware.h │ │ │ └── zl38063.c │ ├── esp_codec_dev.c │ ├── esp_codec_dev_if.c │ ├── esp_codec_dev_vol.c │ ├── idf_component.yml │ ├── include │ │ ├── esp_codec_dev.h │ │ ├── esp_codec_dev_defaults.h │ │ ├── esp_codec_dev_os.h │ │ ├── esp_codec_dev_types.h │ │ └── esp_codec_dev_vol.h │ ├── interface │ │ ├── audio_codec_ctrl_if.h │ │ ├── audio_codec_data_if.h │ │ ├── audio_codec_gpio_if.h │ │ ├── audio_codec_if.h │ │ └── audio_codec_vol_if.h │ ├── platform │ │ ├── audio_codec_ctrl_i2c.c │ │ ├── audio_codec_ctrl_spi.c │ │ ├── audio_codec_data_i2s.c │ │ ├── audio_codec_gpio.c │ │ └── esp_codec_dev_os.c │ └── test_apps │ │ └── codec_dev_test │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── main │ │ ├── CMakeLists.txt │ │ ├── idf_component.yml │ │ ├── my_codec.c │ │ ├── my_codec.h │ │ ├── test_app_main.c │ │ ├── test_board.c │ │ ├── test_board.h │ │ └── test_my_codec.c └── vb6824 │ ├── CMakeLists.txt │ ├── Kconfig │ ├── assets │ └── update.html │ ├── https.c │ ├── idf_component.yml │ ├── libs │ ├── libesp32.a │ ├── libesp32c2.a │ ├── libesp32c3.a │ └── libesp32s3.a │ ├── vb6824.c │ ├── vb6824.h │ └── vb_ota.h ├── docs ├── AI-01_使用手册.pdf ├── 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 ├── 开发板生产资料AI-01-DevKit-v1.1.zip ├── 模组原理图.png ├── 模组实物图.png └── 模组引脚分布图.png ├── 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 │ │ ├── start_ota.p3 │ │ ├── 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 │ │ ├── start_ota.p3 │ │ ├── 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 │ ├── vb6824_audio_codec.cc │ └── vb6824_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-ai-01-kit-lcd │ │ ├── boards.cfg │ │ ├── boards.defaults │ │ ├── config.h │ │ └── doit-ai-01-kit-lcd.cc │ ├── doit-ai-01-kit │ │ ├── boards.cfg │ │ ├── boards.defaults │ │ ├── config.h │ │ └── doit-ai-01-kit.cc │ ├── doit-ai-02-kit-lcd │ │ ├── boards.cfg │ │ ├── boards.defaults │ │ ├── config.h │ │ └── doit-ai-02-kit-lcd.cc │ ├── doit-ai-speaker │ │ ├── boards.cfg │ │ ├── boards.defaults │ │ ├── config.h │ │ └── doit-ai-speaker.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 │ ├── 2m.csv │ ├── 32m.csv │ ├── 4m.csv │ ├── 4m_esp-hi.csv │ ├── 4m_ota.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.esp32c2 ├── sdkconfig.defaults.esp32c3 ├── sdkconfig.defaults.esp32p4 ├── sdkconfig.defaults.esp32s3 └── sdkconfig.defaults.mem_opt.esp32c2 /.gitignore: -------------------------------------------------------------------------------- 1 | tmp/ 2 | managed_components/ 3 | build/ 4 | .vscode/ 5 | .devcontainer/ 6 | sdkconfig.old 7 | sdkconfig 8 | dependencies.lock 9 | .env 10 | releases/ 11 | main/assets/lang_config.h 12 | main/mmap_generate_emoji.h 13 | .DS_Store 14 | .cache 15 | main/mmap_generate_emoji.h 16 | -------------------------------------------------------------------------------- /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.7.0") 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) 2025 yichone 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 | -------------------------------------------------------------------------------- /components/78__esp-opus-encoder/.gitignore: -------------------------------------------------------------------------------- 1 | dist/ -------------------------------------------------------------------------------- /components/78__esp-opus-encoder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register( 2 | SRCS 3 | "opus_encoder.cc" 4 | "opus_decoder.cc" 5 | "opus_resampler.cc" 6 | INCLUDE_DIRS 7 | "include" 8 | PRIV_INCLUDE_DIRS 9 | "." 10 | ) -------------------------------------------------------------------------------- /components/78__esp-opus-encoder/idf_component.yml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | 78/esp-opus: ^1.0.4 3 | idf: ^5.3 4 | description: ESP32 Opus Encoder C++ wrapper 5 | files: 6 | exclude: 7 | - .git 8 | license: MIT 9 | repository: https://github.com/78/esp-opus-encoder 10 | url: https://github.com/78/esp-opus-encoder 11 | version: 2.3.1 12 | -------------------------------------------------------------------------------- /components/78__esp-opus-encoder/include/opus_decoder.h: -------------------------------------------------------------------------------- 1 | #ifndef _OPUS_DECODER_WRAPPER_H_ 2 | #define _OPUS_DECODER_WRAPPER_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "opus.h" 10 | 11 | 12 | class OpusDecoderWrapper { 13 | public: 14 | OpusDecoderWrapper(int sample_rate, int channels, int duration_ms = 60); 15 | ~OpusDecoderWrapper(); 16 | 17 | bool Decode(std::vector&& opus, std::vector& pcm); 18 | void ResetState(); 19 | void Config(int sample_rate, int channels, int duration_ms); 20 | 21 | inline int sample_rate() const { 22 | return sample_rate_; 23 | } 24 | 25 | inline int duration_ms() const { 26 | return duration_ms_; 27 | } 28 | 29 | private: 30 | std::mutex mutex_; 31 | struct OpusDecoder* audio_dec_ = nullptr; 32 | int frame_size_; 33 | int sample_rate_; 34 | int duration_ms_; 35 | }; 36 | 37 | #endif // _OPUS_DECODER_WRAPPER_H_ 38 | -------------------------------------------------------------------------------- /components/78__esp-opus-encoder/include/opus_encoder.h: -------------------------------------------------------------------------------- 1 | #ifndef _OPUS_ENCODER_WRAPPER_H_ 2 | #define _OPUS_ENCODER_WRAPPER_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "opus.h" 11 | 12 | #define MAX_OPUS_PACKET_SIZE 1000 13 | 14 | 15 | class OpusEncoderWrapper { 16 | public: 17 | OpusEncoderWrapper(int sample_rate, int channels, int duration_ms = 60); 18 | ~OpusEncoderWrapper(); 19 | 20 | inline int sample_rate() const { 21 | return sample_rate_; 22 | } 23 | 24 | inline int duration_ms() const { 25 | return duration_ms_; 26 | } 27 | 28 | void SetDtx(bool enable); 29 | void SetComplexity(int complexity); 30 | void Encode(std::vector&& pcm, std::function&& opus)> handler); 31 | bool IsBufferEmpty() const { return in_buffer_.empty(); } 32 | void ResetState(); 33 | void Config(int sample_rate, int channels, int duration_ms); 34 | 35 | private: 36 | std::mutex mutex_; 37 | struct OpusEncoder* audio_enc_ = nullptr; 38 | int sample_rate_; 39 | int duration_ms_; 40 | int frame_size_; 41 | std::vector in_buffer_; 42 | }; 43 | 44 | #endif // _OPUS_ENCODER_H_ 45 | -------------------------------------------------------------------------------- /components/78__esp-opus-encoder/include/opus_resampler.h: -------------------------------------------------------------------------------- 1 | #ifndef OPUS_RESAMPLER_H 2 | #define OPUS_RESAMPLER_H 3 | 4 | #include 5 | #include "opus.h" 6 | #include "resampler_structs.h" 7 | 8 | class OpusResampler { 9 | public: 10 | OpusResampler(); 11 | ~OpusResampler(); 12 | 13 | void Configure(int input_sample_rate, int output_sample_rate); 14 | void Process(const int16_t *input, int input_samples, int16_t *output); 15 | int GetOutputSamples(int input_samples) const; 16 | 17 | int input_sample_rate() const { return input_sample_rate_; } 18 | int output_sample_rate() const { return output_sample_rate_; } 19 | 20 | private: 21 | silk_resampler_state_struct resampler_state_; 22 | int input_sample_rate_; 23 | int output_sample_rate_; 24 | }; 25 | 26 | #endif 27 | 28 | 29 | -------------------------------------------------------------------------------- /components/78__esp-opus-encoder/opus_resampler.cc: -------------------------------------------------------------------------------- 1 | #include "opus_resampler.h" 2 | #include "silk_resampler.h" 3 | #include "esp_log.h" 4 | 5 | #define TAG "OpusResampler" 6 | 7 | OpusResampler::OpusResampler() { 8 | } 9 | 10 | OpusResampler::~OpusResampler() { 11 | } 12 | 13 | void OpusResampler::Configure(int input_sample_rate, int output_sample_rate) { 14 | int encode = input_sample_rate > output_sample_rate ? 1 : 0; 15 | auto ret = silk_resampler_init(&resampler_state_, input_sample_rate, output_sample_rate, encode); 16 | if (ret != 0) { 17 | ESP_LOGE(TAG, "Failed to initialize resampler"); 18 | return; 19 | } 20 | input_sample_rate_ = input_sample_rate; 21 | output_sample_rate_ = output_sample_rate; 22 | ESP_LOGI(TAG, "Resampler configured with input sample rate %d and output sample rate %d", input_sample_rate_, output_sample_rate_); 23 | } 24 | 25 | void OpusResampler::Process(const int16_t *input, int input_samples, int16_t *output) { 26 | auto ret = silk_resampler(&resampler_state_, output, input, input_samples); 27 | if (ret != 0) { 28 | ESP_LOGE(TAG, "Failed to process resampler"); 29 | } 30 | } 31 | 32 | int OpusResampler::GetOutputSamples(int input_samples) const { 33 | return input_samples * output_sample_rate_ / input_sample_rate_; 34 | } 35 | -------------------------------------------------------------------------------- /components/78__esp-opus-encoder/silk_resampler.h: -------------------------------------------------------------------------------- 1 | #ifndef _SILK_RESAMPLER_H_ 2 | #define _SILK_RESAMPLER_H_ 3 | 4 | #include "opus.h" 5 | #include "resampler_structs.h" 6 | /*! 7 | * Initialize/reset the resampler state for a given pair of input/output sampling rates 8 | */ 9 | extern "C" opus_int silk_resampler_init( 10 | silk_resampler_state_struct *S, /* I/O Resampler state */ 11 | opus_int32 Fs_Hz_in, /* I Input sampling rate (Hz) */ 12 | opus_int32 Fs_Hz_out, /* I Output sampling rate (Hz) */ 13 | opus_int forEnc /* I If 1: encoder; if 0: decoder */ 14 | ); 15 | 16 | /*! 17 | * Resampler: convert from one sampling rate to another 18 | */ 19 | extern "C" opus_int silk_resampler( 20 | silk_resampler_state_struct *S, /* I/O Resampler state */ 21 | opus_int16 out[], /* O Output signal */ 22 | const opus_int16 in[], /* I Input signal */ 23 | opus_int32 inLen /* I Number of input samples */ 24 | ); 25 | 26 | #endif // _SILK_RESAMPLER_H_ 27 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/audio_codec_sw_vol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | #ifndef _AUDIO_CODEC_SW_VOL_H_ 7 | #define _AUDIO_CODEC_SW_VOL_H_ 8 | 9 | #include "audio_codec_vol_if.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | /** 16 | * @brief New software volume processor interface 17 | * Notes: currently only support 16bits input 18 | * @return NULL: Memory not enough 19 | * -Others: Software volume interface handle 20 | */ 21 | const audio_codec_vol_if_t* audio_codec_new_sw_vol(void); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/device/include/aw88298_dac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | #ifndef _AW88298_DAC_H_ 7 | #define _AW88298_DAC_H_ 8 | 9 | #include "audio_codec_if.h" 10 | #include "audio_codec_ctrl_if.h" 11 | #include "audio_codec_gpio_if.h" 12 | #include "esp_codec_dev_vol.h" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #define AW88298_CODEC_DEFAULT_ADDR (0x36 << 1) 19 | 20 | /** 21 | * @brief AW88298 codec configuration 22 | */ 23 | typedef struct { 24 | const audio_codec_ctrl_if_t *ctrl_if; /*!< Codec Control interface */ 25 | const audio_codec_gpio_if_t *gpio_if; /*!< Codec GPIO interface */ 26 | int16_t reset_pin; /*!< Reset pin */ 27 | esp_codec_dev_hw_gain_t hw_gain; /*!< Hardware gain */ 28 | } aw88298_codec_cfg_t; 29 | 30 | /** 31 | * @brief New AW88298 codec interface 32 | * @attention Need set mclk_multiple to I2S_MCLK_MULTIPLE_384 in esp_codec_dev_sample_info_t to support 44100 33 | * @param codec_cfg: AW88298 codec configuration 34 | * @return NULL: Fail to new AW88298 codec interface 35 | * -Others: AW88298 codec interface 36 | */ 37 | const audio_codec_if_t *aw88298_codec_new(aw88298_codec_cfg_t *codec_cfg); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/device/include/es7243_adc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | #ifndef _ES7243_ADC_H_ 7 | #define _ES7243_ADC_H_ 8 | 9 | #include "audio_codec_if.h" 10 | #include "audio_codec_ctrl_if.h" 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #define ES7243_CODEC_DEFAULT_ADDR (0x26) 17 | 18 | /** 19 | * @brief ES7243 codec configuration, only support ADC feature 20 | */ 21 | typedef struct { 22 | const audio_codec_ctrl_if_t *ctrl_if; /*!< Codec Control interface */ 23 | } es7243_codec_cfg_t; 24 | 25 | /** 26 | * @brief New ES7243 codec interface 27 | * Notes: this API should called after I2S clock ready 28 | * Or else write register may fail 29 | * @param codec_cfg: ES7243 codec configuration 30 | * @return NULL: Fail to new ES7243 codec interface 31 | * -Others: ES7243 codec interface 32 | */ 33 | const audio_codec_if_t *es7243_codec_new(es7243_codec_cfg_t *codec_cfg); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/device/include/es7243e_adc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | #ifndef _ES7243E_ADC_H_ 7 | #define _ES7243E_ADC_H_ 8 | 9 | #include "audio_codec_if.h" 10 | #include "audio_codec_ctrl_if.h" 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #define ES7243E_CODEC_DEFAULT_ADDR (0x20) 17 | 18 | /** 19 | * @brief ES7243E codec configuration 20 | */ 21 | typedef struct { 22 | const audio_codec_ctrl_if_t *ctrl_if; /*!< Codec Control interface */ 23 | } es7243e_codec_cfg_t; 24 | 25 | /** 26 | * @brief New ES7243E codec interface 27 | * @param codec_cfg: ES7243E codec configuration 28 | * @return NULL: Fail to new ES7243E codec interface 29 | * -Others: ES7243E codec interface 30 | */ 31 | const audio_codec_if_t *es7243e_codec_new(es7243e_codec_cfg_t *codec_cfg); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/device/include/es8156_dac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | #ifndef _ES8156_DAC_H_ 7 | #define _ES8156_DAC_H_ 8 | 9 | #include "audio_codec_if.h" 10 | #include "audio_codec_ctrl_if.h" 11 | #include "audio_codec_gpio_if.h" 12 | #include "esp_codec_dev_vol.h" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #define ES8156_CODEC_DEFAULT_ADDR (0x10) 19 | 20 | /** 21 | * @brief ES8156 codec configuration 22 | */ 23 | typedef struct { 24 | const audio_codec_ctrl_if_t *ctrl_if; /*!< Codec Control interface */ 25 | const audio_codec_gpio_if_t *gpio_if; /*!< Codec GPIO interface */ 26 | int16_t pa_pin; /*!< PA chip power pin */ 27 | bool pa_reverted; /*!< false: enable PA when pin set to 1, true: enable PA when pin set to 0 */ 28 | esp_codec_dev_hw_gain_t hw_gain; /*!< Hardware gain */ 29 | } es8156_codec_cfg_t; 30 | 31 | /** 32 | * @brief New ES8156 codec interface 33 | * @param codec_cfg: ES8156 codec configuration 34 | * @return NULL: Fail to new ES8156 codec interface 35 | * -Others: ES8156 codec interface 36 | */ 37 | const audio_codec_if_t *es8156_codec_new(es8156_codec_cfg_t *codec_cfg); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/device/include/tas5805m_dac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | #ifndef _TAS5805M_DAC_H_ 7 | #define _TAS5805M_DAC_H_ 8 | 9 | #include "audio_codec_if.h" 10 | #include "audio_codec_ctrl_if.h" 11 | #include "audio_codec_gpio_if.h" 12 | #include "esp_codec_dev_vol.h" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #define TAS5805M_CODEC_DEFAULT_ADDR (0x5c) 19 | 20 | /** 21 | * @brief TAS5805M codec configuration 22 | */ 23 | typedef struct { 24 | const audio_codec_ctrl_if_t *ctrl_if; /*!< Codec Control interface */ 25 | const audio_codec_gpio_if_t *gpio_if; /*!< Codec GPIO interface */ 26 | esp_codec_dec_work_mode_t codec_mode; /*!< Codec work mode: ADC or DAC */ 27 | bool master_mode; /*!< Whether codec works as I2S master or not */ 28 | int16_t reset_pin; /*!< Reset pin */ 29 | esp_codec_dev_hw_gain_t hw_gain; /*!< Hardware gain */ 30 | } tas5805m_codec_cfg_t; 31 | 32 | /** 33 | * @brief New TAS5805M codec interface 34 | * @param codec_cfg: TAS5805M codec configuration 35 | * @return NULL: Fail to new TAS5805M codec interface 36 | * -Others: TAS5805M codec interface 37 | */ 38 | const audio_codec_if_t *tas5805m_codec_new(tas5805m_codec_cfg_t *codec_cfg); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/device/tas5805m/tas5805m_reg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | #ifndef _TAS5805M_REG_H_ 7 | #define _TAS5805M_REG_H_ 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | #define TAS5805M_REG_00 0x00 14 | #define TAS5805M_REG_02 0x02 15 | #define TAS5805M_REG_03 0x03 16 | #define TAS5805M_REG_24 0x24 17 | #define TAS5805M_REG_25 0x25 18 | #define TAS5805M_REG_26 0x26 19 | #define TAS5805M_REG_27 0x27 20 | #define TAS5805M_REG_28 0x28 21 | #define TAS5805M_REG_29 0x29 22 | #define TAS5805M_REG_2A 0x2a 23 | #define TAS5805M_REG_2B 0x2b 24 | #define TAS5805M_REG_35 0x35 25 | #define TAS5805M_REG_7E 0x7e 26 | #define TAS5805M_REG_7F 0x7f 27 | 28 | #define TAS5805M_PAGE_00 0x00 29 | #define TAS5805M_PAGE_2A 0x2a 30 | 31 | #define TAS5805M_BOOK_00 0x00 32 | #define TAS5805M_BOOK_8C 0x8c 33 | 34 | #define MASTER_VOL_REG_ADDR 0X4C 35 | #define MUTE_TIME_REG_ADDR 0X51 36 | 37 | #define TAS5805M_DAMP_MODE_BTL 0x0 38 | #define TAS5805M_DAMP_MODE_PBTL 0x04 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/device/zl38063/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright 2018 Microsemi Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/device/zl38063/api_lib/tw_spi_access.h: -------------------------------------------------------------------------------- 1 | #ifndef TW_SPI_ACCESS_H 2 | #define TW_SPI_ACCESS_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | int tw_upload_dsp_firmware(int mode); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/device/zl38063/firmware/libfirmware.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/components/espressif__esp_codec_dev/device/zl38063/firmware/libfirmware.a -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/device/zl38063/firmware/zl38063_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | /*Configuration file version: Microsemi_ZLS38063_1_P1_4_0_Config.cr2, modified: Tue Sep 18 20:48:31 2018*/ 8 | 9 | #ifndef _ZL38063_CONFIG_H_ 10 | #define _ZL38063_CONFIG_H_ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | extern const unsigned short configStreamLen; 17 | extern const dataArr st_twConfig[]; 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/device/zl38063/firmware/zl38063_firmware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | /*Firmware Version : Microsemi_ZLS38063_1_P1_4_0_Firmware.s3, modified: Tue Sep 18 20:50:24 2018 */ 8 | 9 | #ifndef _ZL38063_FIRMWARE_H_ 10 | #define _ZL38063_FIRMWARE_H_ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | extern const twFwr st_twFirmware[]; 17 | 18 | extern const unsigned short firmwareStreamLen; 19 | extern const unsigned long programBaseAddress; 20 | extern const unsigned long executionAddress; 21 | extern const unsigned char haveProgramBaseAddress; 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/idf_component.yml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | idf: 3 | version: '>=4.0' 4 | description: Audio codec device support for Espressif SOC 5 | repository: git://github.com/espressif/esp-adf.git 6 | repository_info: 7 | commit_sha: 60054d26e02b358de2ac3db0d2b631a46ae240b8 8 | path: components/esp_codec_dev 9 | url: https://github.com/espressif/esp-adf/tree/master/components/esp_codec_dev 10 | version: 1.3.4 11 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/include/esp_codec_dev_os.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | #ifndef _ESP_CODEC_DEV_OS_H_ 7 | #define _ESP_CODEC_DEV_OS_H_ 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /** 14 | * @brief Sleep in milliseconds 15 | * @param ms: Sleep time (unit ms) 16 | */ 17 | void esp_codec_dev_sleep(int ms); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/interface/audio_codec_vol_if.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | #ifndef _AUDIO_CODEC_VOL_IF_H_ 7 | #define _AUDIO_CODEC_VOL_IF_H_ 8 | 9 | #include "esp_codec_dev_types.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct audio_codec_vol_if_t audio_codec_vol_if_t; 16 | 17 | /** 18 | * @brief Structure for volume interface 19 | */ 20 | struct audio_codec_vol_if_t { 21 | int (*open)(const audio_codec_vol_if_t *h, 22 | esp_codec_dev_sample_info_t *fs, int fade_time); /*!< Open for software volume processor */ 23 | int (*set_vol)(const audio_codec_vol_if_t *h, float db_value); /*!< Set volume in decibel unit */ 24 | int (*process)(const audio_codec_vol_if_t *h, 25 | uint8_t *in, int len, uint8_t *out, int out_len); /*!< Process data */ 26 | int (*close)(const audio_codec_vol_if_t *h); /*!< Close volume processor */ 27 | }; 28 | 29 | /** 30 | * @brief Delete volume interface instance 31 | * @param vol_if: Volume interface 32 | * @return ESP_CODEC_DEV_OK: Delete success 33 | * ESP_CODEC_DEV_INVALID_ARG: Input is NULL pointer 34 | */ 35 | int audio_codec_delete_vol_if(const audio_codec_vol_if_t *vol_if); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/platform/esp_codec_dev_os.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | #include "freertos/FreeRTOS.h" 7 | #include "freertos/task.h" 8 | #include "esp_idf_version.h" 9 | #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) 10 | #define TICK_PER_MS portTICK_PERIOD_MS 11 | #else 12 | #define TICK_PER_MS portTICK_RATE_MS 13 | #endif 14 | 15 | void esp_codec_dev_sleep(int ms) 16 | { 17 | vTaskDelay(ms / TICK_PER_MS); 18 | } 19 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/test_apps/codec_dev_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | 3 | list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") 4 | 5 | set(COMPONENTS main) 6 | 7 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 8 | project(codec_dev_test) 9 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/test_apps/codec_dev_test/README.md: -------------------------------------------------------------------------------- 1 | | Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-S2 | ESP32-S3 | ESP32-P4 | 2 | | ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | 3 | 4 | # esp_codec_dev: Codec device test application 5 | 6 | There are two sets of tests in this application: 7 | 1. Using customized codec to test all related API 8 | 2. Test codec device on special board 9 | 10 | The default test board is ESP32S3_KORVO2_V3, if you are using other board, please change definition in [test_boards.h](main/test_board.h) and realization code is [test_board.c](main/test_board.c). -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/test_apps/codec_dev_test/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(priv_requires 3 | unity 4 | driver 5 | esp_codec_dev 6 | ) 7 | 8 | idf_component_register(SRC_DIRS . 9 | PRIV_INCLUDE_DIRS . 10 | PRIV_REQUIRES unity esp_codec_dev 11 | PRIV_REQUIRES ${priv_requires} 12 | WHOLE_ARCHIVE TRUE 13 | ) 14 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/test_apps/codec_dev_test/main/idf_component.yml: -------------------------------------------------------------------------------- 1 | description: Codec Device Test 2 | 3 | dependencies: 4 | esp_codec_dev: 5 | version: ">=1.1" 6 | override_path: "../../../" -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/test_apps/codec_dev_test/main/test_app_main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: CC0-1.0 5 | */ 6 | 7 | #include "unity.h" 8 | #include "unity_test_utils.h" 9 | #include "esp_heap_caps.h" 10 | #include "sdkconfig.h" 11 | 12 | #define TEST_MEMORY_LEAK_THRESHOLD (400) 13 | 14 | void setUp(void) 15 | { 16 | unity_utils_record_free_mem(); 17 | } 18 | 19 | void tearDown(void) 20 | { 21 | unity_utils_evaluate_leaks_direct(TEST_MEMORY_LEAK_THRESHOLD); 22 | } 23 | 24 | void app_main(void) 25 | { 26 | unity_run_menu(); 27 | } 28 | -------------------------------------------------------------------------------- /components/espressif__esp_codec_dev/test_apps/codec_dev_test/main/test_board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | #ifndef _TEST_BOARD_H_ 7 | #define _TEST_BOARD_H_ 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /** 14 | * @brief Codec configuration by ESP32S3_KORVO2_V3 15 | */ 16 | #define TEST_BOARD_I2C_SDA_PIN (17) 17 | #define TEST_BOARD_I2C_SCL_PIN (18) 18 | 19 | #define TEST_BOARD_I2S_BCK_PIN (9) 20 | #define TEST_BOARD_I2S_MCK_PIN (16) 21 | #define TEST_BOARD_I2S_DATA_IN_PIN (10) 22 | #define TEST_BOARD_I2S_DATA_OUT_PIN (8) 23 | #define TEST_BOARD_I2S_DATA_WS_PIN (45) 24 | 25 | #define TEST_BOARD_PA_PIN (48) 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /components/vb6824/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(incs ) 2 | set(srcs ) 3 | set(assets ) 4 | list(APPEND srcs 5 | vb6824.c 6 | ) 7 | 8 | list(APPEND incs 9 | . 10 | ) 11 | 12 | 13 | if(CONFIG_VB6824_OTA_SUPPORT) 14 | list(APPEND assets assets/update.html) 15 | list(APPEND srcs https.c) 16 | endif() 17 | 18 | idf_component_register(SRCS "${srcs}" 19 | INCLUDE_DIRS "${incs}" 20 | EMBED_TXTFILES "${assets}" 21 | REQUIRES driver esp_wifi esp_http_client esp_http_server json esp_timer) 22 | 23 | 24 | 25 | if(CONFIG_IDF_TARGET_ESP32) 26 | set(lib_target "esp32") 27 | elseif(CONFIG_IDF_TARGET_ESP32S2) 28 | set(lib_target "esp32s2") 29 | elseif(CONFIG_IDF_TARGET_ESP32S3) 30 | set(lib_target "esp32s3") 31 | elseif(CONFIG_IDF_TARGET_ESP32C2) 32 | set(lib_target "esp32c2") 33 | elseif(CONFIG_IDF_TARGET_ESP32C3) 34 | set(lib_target "esp32c3") 35 | endif() 36 | 37 | 38 | add_prebuilt_library(vbota "libs/lib${lib_target}.a") 39 | target_link_libraries(${COMPONENT_LIB} PRIVATE vbota) -------------------------------------------------------------------------------- /components/vb6824/Kconfig: -------------------------------------------------------------------------------- 1 | menu "VB6824" 2 | choice VB6824_TYPE 3 | prompt "VB6924" 4 | default VB6824_TYPE_OPUS_16K_20MS_PCM_16K 5 | help 6 | VB6824支持的类型 7 | config VB6824_TYPE_PCM_16K 8 | depends on !IDF_TARGET_ESP32C2 9 | bool "PCM 16K" 10 | config VB6824_TYPE_OPUS_16K_20MS_PCM_16K 11 | bool "OPUS 16K 20ms(input) + PCM 16K(output)" 12 | endchoice 13 | config VB6824_OTA_SUPPORT 14 | bool "6824支持升级" 15 | default n 16 | select HTTPD_WS_SUPPORT 17 | 18 | config VB6824_UART_PORT 19 | int "uart port" 20 | default 1 21 | 22 | config VB6824_UART_TASK_STACK_SIZE 23 | int "uart task stack size" 24 | default 3072 if IDF_TARGET_ESP32C2 25 | default 4096 26 | 27 | config VB6824_SEND_USE_TASK 28 | bool "send use task" 29 | default y 30 | 31 | config VB6824_SEND_TASK_STACK_SIZE 32 | int "send task stack size" 33 | depends on VB6824_SEND_USE_TASK 34 | default 2048 35 | 36 | endmenu 37 | -------------------------------------------------------------------------------- /components/vb6824/idf_component.yml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | espressif/mdns: ^1.8.2 3 | idf: ^5.3 4 | description: MDNS 5 | files: 6 | exclude: 7 | - .git 8 | license: MIT 9 | version: 2.3.0 10 | repository: https://github.com/78/vb6824 -------------------------------------------------------------------------------- /components/vb6824/libs/libesp32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/components/vb6824/libs/libesp32.a -------------------------------------------------------------------------------- /components/vb6824/libs/libesp32c2.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/components/vb6824/libs/libesp32c2.a -------------------------------------------------------------------------------- /components/vb6824/libs/libesp32c3.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/components/vb6824/libs/libesp32c3.a -------------------------------------------------------------------------------- /components/vb6824/libs/libesp32s3.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/components/vb6824/libs/libesp32s3.a -------------------------------------------------------------------------------- /components/vb6824/vb6824.h: -------------------------------------------------------------------------------- 1 | #ifndef __VB6824_H__ 2 | #define __VB6824_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #include "driver/gpio.h" 11 | 12 | typedef enum { 13 | VB6824_EVT_OTA_ENTER = 0, 14 | VB6824_EVT_OTA_START = 2, 15 | VB6824_EVT_OTA_EXIT = 3, 16 | VB6824_EVT_OTA_PROGRESS = 4, 17 | VB6824_EVT_OTA_SUCCESS = 5, 18 | VB6824_EVT_OTA_FAIL = 6, 19 | } vb6824_evt_t; 20 | 21 | typedef void (*vb_voice_command_cb_t)(char *command, uint16_t len, void *arg); 22 | typedef void (*vb_voice_event_cb_t)(vb6824_evt_t event_id, uint32_t data, void *arg); 23 | 24 | void jl_ws_stop(); 25 | int jl_ws_is_start(); 26 | int jl_ws_start(char *code); 27 | bool vb6824_is_support_ota(); 28 | 29 | void vb6824_register_voice_command_cb(vb_voice_command_cb_t cb, void *arg); 30 | void vb6824_register_event_cb(vb_voice_event_cb_t cb, void *arg); 31 | 32 | void vb6824_audio_enable_input(bool enable); 33 | void vb6824_audio_enable_output(bool enable); 34 | 35 | void vb6824_audio_set_output_volume(uint8_t volume); 36 | 37 | void vb6824_audio_write(uint8_t *data, uint16_t len); 38 | uint16_t vb6824_audio_read(uint8_t *data, uint16_t size); 39 | 40 | void vb6824_init(gpio_num_t tx, gpio_num_t rx); 41 | 42 | char *vb6824_get_wakeup_word(); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif //__VB6824_H__ -------------------------------------------------------------------------------- /components/vb6824/vb_ota.h: -------------------------------------------------------------------------------- 1 | #ifndef _JL_OTA_H_ 2 | #define _JL_OTA_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "freertos/FreeRTOS.h" 14 | #include "freertos/task.h" 15 | #include "freertos/queue.h" 16 | #include "driver/uart.h" 17 | 18 | typedef enum{ 19 | JL_OTA_START, 20 | JL_OTA_STOP, 21 | JL_OTA_FAIL, 22 | JL_OTA_PROCESS, 23 | JL_OTA_SUCCESS, 24 | JL_OTA_RETRY, 25 | JL_OTA_REGET_WAKE, 26 | }jl_ota_evt_id; 27 | 28 | typedef void (*jl_ota_event_t)(jl_ota_evt_id evt, uint32_t data); 29 | 30 | void jl_ondata(uint8_t *buf, uint16_t len); 31 | int jl_set_ota_url(const char* url); 32 | int jl_ota_start(jl_ota_event_t evt_cb); 33 | int jl_ota_set_code(char *code); 34 | void jl_set_uart_port(uint8_t port); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif -------------------------------------------------------------------------------- /docs/AI-01_使用手册.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/AI-01_使用手册.pdf -------------------------------------------------------------------------------- /docs/mcp-based-graph.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/mcp-based-graph.jpg -------------------------------------------------------------------------------- /docs/v0/AtomMatrix-echo-base.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v0/AtomMatrix-echo-base.jpg -------------------------------------------------------------------------------- /docs/v0/ESP32-BreadBoard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v0/ESP32-BreadBoard.jpg -------------------------------------------------------------------------------- /docs/v0/atoms3r-echo-base.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v0/atoms3r-echo-base.jpg -------------------------------------------------------------------------------- /docs/v0/esp32s3-box3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v0/esp32s3-box3.jpg -------------------------------------------------------------------------------- /docs/v0/lichuang-s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v0/lichuang-s3.jpg -------------------------------------------------------------------------------- /docs/v0/m5stack-cores3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v0/m5stack-cores3.jpg -------------------------------------------------------------------------------- /docs/v0/magiclick-2p4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v0/magiclick-2p4.jpg -------------------------------------------------------------------------------- /docs/v0/waveshare-esp32-s3-touch-amoled-1.8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v0/waveshare-esp32-s3-touch-amoled-1.8.jpg -------------------------------------------------------------------------------- /docs/v0/wiring.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v0/wiring.jpg -------------------------------------------------------------------------------- /docs/v1/atoms3r.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/atoms3r.jpg -------------------------------------------------------------------------------- /docs/v1/esp-hi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/esp-hi.jpg -------------------------------------------------------------------------------- /docs/v1/esp-sparkbot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/esp-sparkbot.jpg -------------------------------------------------------------------------------- /docs/v1/espbox3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/espbox3.jpg -------------------------------------------------------------------------------- /docs/v1/lichuang-s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/lichuang-s3.jpg -------------------------------------------------------------------------------- /docs/v1/lilygo-t-circle-s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/lilygo-t-circle-s3.jpg -------------------------------------------------------------------------------- /docs/v1/m5cores3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/m5cores3.jpg -------------------------------------------------------------------------------- /docs/v1/magiclick.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/magiclick.jpg -------------------------------------------------------------------------------- /docs/v1/movecall-cuican-esp32s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/movecall-cuican-esp32s3.jpg -------------------------------------------------------------------------------- /docs/v1/movecall-moji-esp32s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/movecall-moji-esp32s3.jpg -------------------------------------------------------------------------------- /docs/v1/sensecap_watcher.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/sensecap_watcher.jpg -------------------------------------------------------------------------------- /docs/v1/waveshare.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/waveshare.jpg -------------------------------------------------------------------------------- /docs/v1/wiring2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/wiring2.jpg -------------------------------------------------------------------------------- /docs/v1/wmnologo_xingzhi_0.96.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/wmnologo_xingzhi_0.96.jpg -------------------------------------------------------------------------------- /docs/v1/wmnologo_xingzhi_1.54.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/wmnologo_xingzhi_1.54.jpg -------------------------------------------------------------------------------- /docs/v1/xmini-c3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/v1/xmini-c3.jpg -------------------------------------------------------------------------------- /docs/开发板生产资料AI-01-DevKit-v1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/开发板生产资料AI-01-DevKit-v1.1.zip -------------------------------------------------------------------------------- /docs/模组原理图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/模组原理图.png -------------------------------------------------------------------------------- /docs/模组实物图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/模组实物图.png -------------------------------------------------------------------------------- /docs/模组引脚分布图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/docs/模组引脚分布图.png -------------------------------------------------------------------------------- /main/assets/common/exclamation.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/common/exclamation.p3 -------------------------------------------------------------------------------- /main/assets/common/low_battery.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/common/low_battery.p3 -------------------------------------------------------------------------------- /main/assets/common/popup.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/common/popup.p3 -------------------------------------------------------------------------------- /main/assets/common/success.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/common/success.p3 -------------------------------------------------------------------------------- /main/assets/common/vibration.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/common/vibration.p3 -------------------------------------------------------------------------------- /main/assets/en-US/0.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/0.p3 -------------------------------------------------------------------------------- /main/assets/en-US/1.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/1.p3 -------------------------------------------------------------------------------- /main/assets/en-US/2.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/2.p3 -------------------------------------------------------------------------------- /main/assets/en-US/3.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/3.p3 -------------------------------------------------------------------------------- /main/assets/en-US/4.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/4.p3 -------------------------------------------------------------------------------- /main/assets/en-US/5.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/5.p3 -------------------------------------------------------------------------------- /main/assets/en-US/6.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/6.p3 -------------------------------------------------------------------------------- /main/assets/en-US/7.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/7.p3 -------------------------------------------------------------------------------- /main/assets/en-US/8.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/8.p3 -------------------------------------------------------------------------------- /main/assets/en-US/9.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/9.p3 -------------------------------------------------------------------------------- /main/assets/en-US/activation.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/activation.p3 -------------------------------------------------------------------------------- /main/assets/en-US/err_pin.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/err_pin.p3 -------------------------------------------------------------------------------- /main/assets/en-US/err_reg.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/err_reg.p3 -------------------------------------------------------------------------------- /main/assets/en-US/start_ota.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/start_ota.p3 -------------------------------------------------------------------------------- /main/assets/en-US/upgrade.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/upgrade.p3 -------------------------------------------------------------------------------- /main/assets/en-US/welcome.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/welcome.p3 -------------------------------------------------------------------------------- /main/assets/en-US/wificonfig.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/en-US/wificonfig.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/0.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/0.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/1.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/1.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/2.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/2.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/3.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/3.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/4.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/4.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/5.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/5.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/6.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/6.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/7.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/7.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/8.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/8.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/9.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/9.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/activation.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/activation.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/err_pin.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/err_pin.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/err_reg.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/err_reg.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/upgrade.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/upgrade.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/welcome.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/welcome.p3 -------------------------------------------------------------------------------- /main/assets/ja-JP/wificonfig.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/ja-JP/wificonfig.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/0.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/0.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/1.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/1.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/2.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/2.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/3.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/3.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/4.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/4.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/5.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/5.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/6.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/6.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/7.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/7.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/8.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/8.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/9.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/9.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/activation.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/activation.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/err_pin.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/err_pin.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/err_reg.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/err_reg.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/start_ota.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/start_ota.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/upgrade.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/upgrade.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/welcome.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/welcome.p3 -------------------------------------------------------------------------------- /main/assets/zh-CN/wificonfig.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-CN/wificonfig.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/0.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/0.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/1.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/1.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/2.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/2.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/3.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/3.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/4.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/4.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/5.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/5.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/6.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/6.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/7.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/7.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/8.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/8.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/9.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/9.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/activation.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/activation.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/err_pin.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/err_pin.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/err_reg.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/err_reg.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/upgrade.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/upgrade.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/welcome.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/main/assets/zh-TW/welcome.p3 -------------------------------------------------------------------------------- /main/assets/zh-TW/wificonfig.p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/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/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.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.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/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.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/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 | virtual 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-ai-01-kit-lcd/boards.cfg: -------------------------------------------------------------------------------- 1 | -DSDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32c2;sdkconfig.defaults;main/boards/doit-ai-01-kit-lcd/boards.defaults" -DIDF_TARGET=esp32c2 -------------------------------------------------------------------------------- /main/boards/doit-ai-01-kit-lcd/boards.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_BOARD_TYPE_DOIT_AI_01_KIT_LCD=y 2 | 3 | CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y 4 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/v1/4m.csv" 5 | CONFIG_PARTITION_TABLE_FILENAME="partitions/v1/4m.csv" 6 | 7 | CONFIG_COMPILER_OPTIMIZATION_SIZE=y 8 | CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=2 9 | CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=4 10 | CONFIG_ESP_WIFI_RX_BA_WIN=4 11 | CONFIG_ESP_WIFI_TX_BA_WIN=4 12 | CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS=y 13 | CONFIG_LWIP_TCP_SND_BUF_DEFAULT=4320 14 | CONFIG_LWIP_TCP_WND_DEFAULT=4320 15 | CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048 16 | CONFIG_TCPIP_TASK_STACK_SIZE=2048 17 | CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16 -------------------------------------------------------------------------------- /main/boards/doit-ai-01-kit-lcd/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define BOOT_BUTTON_GPIO GPIO_NUM_9 7 | 8 | #define CODEC_TX_GPIO GPIO_NUM_10 9 | #define CODEC_RX_GPIO GPIO_NUM_18 10 | 11 | #define LCD_ST7789 12 | 13 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_4 14 | #define DISPLAY_MOSI_PIN GPIO_NUM_1 15 | #define DISPLAY_CLK_PIN GPIO_NUM_0 16 | #define DISPLAY_DC_PIN GPIO_NUM_3 17 | #define DISPLAY_RST_PIN GPIO_NUM_2 18 | #define DISPLAY_CS_PIN GPIO_NUM_NC 19 | 20 | #ifdef LCD_ST7789 21 | #define DISPLAY_WIDTH 240 22 | #define DISPLAY_HEIGHT 240 23 | #define DISPLAY_MIRROR_X false 24 | #define DISPLAY_MIRROR_Y false 25 | #define DISPLAY_SWAP_XY false 26 | #define DISPLAY_INVERT_COLOR true 27 | #define DISPLAY_RGB_ORDER LCD_RGB_ELEMENT_ORDER_RGB 28 | #define DISPLAY_OFFSET_X 0 29 | #define DISPLAY_OFFSET_Y 0 30 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 31 | #endif 32 | 33 | #endif // _BOARD_CONFIG_H_ 34 | -------------------------------------------------------------------------------- /main/boards/doit-ai-01-kit/boards.cfg: -------------------------------------------------------------------------------- 1 | -DSDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32c2;sdkconfig.defaults;main/boards/doit-ai-01-kit/boards.defaults" -DIDF_TARGET=esp32c2 -------------------------------------------------------------------------------- /main/boards/doit-ai-01-kit/boards.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_BOARD_TYPE_DOIT_AI_01_KIT=y 2 | 3 | CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y 4 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/v1/4m_ota.csv" 5 | CONFIG_PARTITION_TABLE_FILENAME="partitions/v1/4m_ota.csv" -------------------------------------------------------------------------------- /main/boards/doit-ai-01-kit/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define BOOT_BUTTON_GPIO GPIO_NUM_9 7 | 8 | #define CODEC_TX_GPIO GPIO_NUM_10 9 | #define CODEC_RX_GPIO GPIO_NUM_18 10 | 11 | #endif // _BOARD_CONFIG_H_ 12 | -------------------------------------------------------------------------------- /main/boards/doit-ai-02-kit-lcd/boards.cfg: -------------------------------------------------------------------------------- 1 | -DSDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32c3;sdkconfig.defaults;main/boards/doit-ai-02-kit-lcd/boards.defaults" -DIDF_TARGET=esp32c3 -------------------------------------------------------------------------------- /main/boards/doit-ai-02-kit-lcd/boards.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_BOARD_TYPE_DOIT_AI_02_KIT_LCD=y 2 | 3 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y 4 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/v1/8m.csv" 5 | CONFIG_PARTITION_TABLE_FILENAME="partitions/v1/8m.csv" -------------------------------------------------------------------------------- /main/boards/doit-ai-02-kit-lcd/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOARD_CONFIG_H_ 2 | #define _BOARD_CONFIG_H_ 3 | 4 | #include 5 | 6 | #define BOOT_BUTTON_GPIO GPIO_NUM_9 7 | #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_8 8 | #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_7 9 | 10 | #define CODEC_TX_GPIO GPIO_NUM_20 11 | #define CODEC_RX_GPIO GPIO_NUM_10 12 | 13 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_5 14 | #define DISPLAY_MOSI_PIN GPIO_NUM_1 15 | #define DISPLAY_CLK_PIN GPIO_NUM_3 16 | #define DISPLAY_DC_PIN GPIO_NUM_0 17 | #define DISPLAY_RST_PIN GPIO_NUM_2 18 | #define DISPLAY_CS_PIN GPIO_NUM_12 19 | 20 | #define DISPLAY_WIDTH 240 21 | #define DISPLAY_HEIGHT 240 22 | #define DISPLAY_MIRROR_X false 23 | #define DISPLAY_MIRROR_Y false 24 | #define DISPLAY_SWAP_XY false 25 | #define DISPLAY_INVERT_COLOR true 26 | #define DISPLAY_RGB_ORDER LCD_RGB_ELEMENT_ORDER_RGB 27 | #define DISPLAY_OFFSET_X 0 28 | #define DISPLAY_OFFSET_Y 0 29 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 30 | 31 | #endif // _BOARD_CONFIG_H_ 32 | -------------------------------------------------------------------------------- /main/boards/doit-ai-speaker/boards.cfg: -------------------------------------------------------------------------------- 1 | -DSDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32s3;sdkconfig.defaults;main/boards/doit-ai-speaker/boards.defaults" -DIDF_TARGET=esp32s3 -------------------------------------------------------------------------------- /main/boards/doit-ai-speaker/boards.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_BOARD_TYPE_DOIT_AI_SPEAKER=y -------------------------------------------------------------------------------- /main/boards/doit-ai-speaker/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_CODEC_I2C_SDA_PIN GPIO_NUM_46 10 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_45 11 | #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_42 12 | #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_41 13 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_39 14 | #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_38 15 | #define AUDIO_I2S_GPIO_DIN GPIO_NUM_40 16 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_9 17 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR 18 | 19 | #define BOOT_BUTTON_GPIO GPIO_NUM_7 20 | #define BUILTIN_LED_GPIO GPIO_NUM_8 21 | 22 | #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_10 23 | #define DISPLAY_MOSI_PIN GPIO_NUM_13 24 | #define DISPLAY_CLK_PIN GPIO_NUM_14 25 | #define DISPLAY_DC_PIN GPIO_NUM_11 26 | #define DISPLAY_RST_PIN GPIO_NUM_12 27 | #define DISPLAY_CS_PIN GPIO_NUM_NC 28 | 29 | #define DISPLAY_WIDTH 240 30 | #define DISPLAY_HEIGHT 240 31 | #define DISPLAY_MIRROR_X false 32 | #define DISPLAY_MIRROR_Y false 33 | #define DISPLAY_SWAP_XY false 34 | #define DISPLAY_INVERT_COLOR true 35 | #define DISPLAY_RGB_ORDER LCD_RGB_ELEMENT_ORDER_RGB 36 | #define DISPLAY_OFFSET_X 0 37 | #define DISPLAY_OFFSET_Y 0 38 | #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false 39 | 40 | #endif // _BOARD_CONFIG_H_ 41 | -------------------------------------------------------------------------------- /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/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/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-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.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-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.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-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/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-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/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.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "esp32s3", 3 | "builds": [ 4 | { 5 | "name": "minsi-k08-dual", 6 | "sdkconfig_append": [] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /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/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.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-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/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/2m.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 | factory, app, factory, 0x10000, 0x1E0000, 7 | -------------------------------------------------------------------------------- /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 | factory, app, factory, 0x10000, 0x3F0000, 7 | -------------------------------------------------------------------------------- /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/4m_ota.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 | ota_0, app, ota_0, 0x10000, 0x1F0000, 7 | ota_1, app, ota_1, , 0x1F0000, 8 | -------------------------------------------------------------------------------- /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/img/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmartArduino/DOIT_AI/689624612c7726a5fafc033b77872e2a77be3a94/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.esp32c2: -------------------------------------------------------------------------------- 1 | 2 | CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y 3 | 4 | CONFIG_PARTITION_TABLE_CUSTOM=y 5 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/v1/2m.csv" 6 | CONFIG_PARTITION_TABLE_FILENAME="partitions/v1/2m.csv" 7 | CONFIG_PARTITION_TABLE_OFFSET=0x8000 8 | 9 | CONFIG_FREERTOS_HZ=1000 10 | 11 | CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=768 12 | CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=1536 13 | CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2560 14 | CONFIG_IPC_TASK_STACK_SIZE=1024 15 | CONFIG_TIMER_TASK_STACK_SIZE=2048 16 | CONFIG_XTAL_FREQ_26=y 17 | 18 | CONFIG_COMPILER_OPTIMIZATION_SIZE=y 19 | 20 | CONFIG_UART_ISR_IN_IRAM=y 21 | 22 | CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096 23 | 24 | CONFIG_MQTT_USE_CUSTOM_CONFIG=y 25 | CONFIG_MQTT_TASK_STACK_SIZE=3584 -------------------------------------------------------------------------------- /sdkconfig.defaults.esp32c3: -------------------------------------------------------------------------------- 1 | CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y 2 | 3 | CONFIG_PARTITION_TABLE_CUSTOM=y 4 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/v1/4m.csv" 5 | CONFIG_PARTITION_TABLE_FILENAME="partitions/v1/4m.csv" 6 | CONFIG_PARTITION_TABLE_OFFSET=0x8000 7 | 8 | CONFIG_FREERTOS_HZ=1000 9 | 10 | CONFIG_COMPILER_OPTIMIZATION_SIZE=y 11 | 12 | CONFIG_UART_ISR_IN_IRAM=y 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /sdkconfig.defaults.mem_opt.esp32c2: -------------------------------------------------------------------------------- 1 | 2 | CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y 3 | 4 | CONFIG_PARTITION_TABLE_CUSTOM=y 5 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/v1/2m.csv" 6 | CONFIG_PARTITION_TABLE_FILENAME="partitions/v1/2m.csv" 7 | CONFIG_PARTITION_TABLE_OFFSET=0x8000 8 | 9 | CONFIG_FREERTOS_HZ=1000 10 | 11 | CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=768 12 | CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=1536 13 | CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 14 | CONFIG_IPC_TASK_STACK_SIZE=1024 15 | CONFIG_TIMER_TASK_STACK_SIZE=2048 16 | CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048 17 | CONFIG_TCPIP_TASK_STACK_SIZE=2048 18 | 19 | CONFIG_XTAL_FREQ_26=y 20 | 21 | CONFIG_COMPILER_OPTIMIZATION_SIZE=y 22 | 23 | CONFIG_UART_ISR_IN_IRAM=y 24 | 25 | CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096 26 | 27 | CONFIG_MQTT_USE_CUSTOM_CONFIG=y 28 | CONFIG_MQTT_TASK_STACK_SIZE=3072 29 | 30 | CONFIG_AUDIO_LOOP_TASK_STACK_SIZE=1280 31 | CONFIG_VB6824_UART_TASK_STACK_SIZE=2560 32 | CONFIG_VB6824_SEND_USE_TASK=n 33 | # CONFIG_VB6824_SEND_TASK_STACK_SIZE=1280 34 | --------------------------------------------------------------------------------