Compare commits
94 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4b6be35735 | |||
| d634baf9be | |||
| c4eb278f6e | |||
| 21f18d4bd9 | |||
| f226295606 | |||
| d05df816ed | |||
| 04d5133114 | |||
| b60fc6d816 | |||
| a8bd52efe4 | |||
| 45df41c50c | |||
| cd36584474 | |||
| b990a011be | |||
| 04e05ad5b9 | |||
| 18c5d83f72 | |||
| 41f3ddc11a | |||
| 5e4a44f3f1 | |||
| 68b3514d96 | |||
| 77ad793a13 | |||
| 8a4b6be12c | |||
| 5df8cf47d8 | |||
| 40d58728f6 | |||
| f7f37d83e2 | |||
| 14662c90f3 | |||
| 7c46e28bb8 | |||
| 45dd66f174 | |||
| a8f62dd194 | |||
| 6601e1b0ed | |||
| 674f54ad63 | |||
| 6b3993bd03 | |||
| dbe8ef9c15 | |||
| 446fd125d9 | |||
| a9bbead698 | |||
| 24219f7100 | |||
| 78531c7a26 | |||
| 2c1388114d | |||
| 6881ee0ffe | |||
| 6cf010d723 | |||
| 9b28a3579c | |||
| e0ca3fa5aa | |||
| ee2160d233 | |||
| 3be4bda2b2 | |||
| af23ee56c3 | |||
| cecf3fb425 | |||
| fde9930ede | |||
| 26ff38347a | |||
| 6f004d667f | |||
| 69410ae557 | |||
| 980aa23d44 | |||
| 0b9666b263 | |||
| ca3e1f84bf | |||
| 88cca17b7e | |||
| fa49795d28 | |||
| 60fe08462e | |||
| 692f578346 | |||
| 2c764acf8c | |||
| 5108256570 | |||
| 82c39ab8d9 | |||
| 1eeb84f019 | |||
| 3bcc2a303f | |||
| e0acfb6ba1 | |||
| a2a063603d | |||
| eeb8b9162a | |||
| 10d166a1d4 | |||
| 1c94c54a52 | |||
| 71e06b381b | |||
| ffd5b181e6 | |||
| cfb4a005ae | |||
| 343083e94e | |||
| 133f2330e9 | |||
| 9dcf7f30c3 | |||
| 65f998bbc8 | |||
| b51268854b | |||
| c4c954888e | |||
| 73dca24048 | |||
| e2d289fdc6 | |||
| 9e90a1d255 | |||
| 0adf18d035 | |||
| 240a558aa9 | |||
| 0f6bb6721e | |||
| e8e1d73cae | |||
| 533d8e20a8 | |||
| 120d37091f | |||
| 405c5438b3 | |||
| 0710699f72 | |||
| 8b7b462a86 | |||
| 3e8f21f689 | |||
| 03b08e4c98 | |||
| e1d418a34a | |||
| e2bb387d67 | |||
| f12adf1c44 | |||
| 9444158a58 | |||
| c0e593554c | |||
| 59e7c921b2 | |||
| 316004289f |
@@ -0,0 +1,194 @@
|
||||
# Copyright 2022 Espressif Systems (Shanghai) PTE LTD
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# This workflow build examples, store the artifacts and deploy them to github pages.
|
||||
# Generates the launchpad configuration file that can be used with the url.
|
||||
|
||||
name: "Build examples to github pages"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow one concurrent deployment
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
delete-old-artifacts:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: List and Delete artifacts
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const artifacts = await github.rest.actions.listArtifactsForRepo({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
});
|
||||
|
||||
console.log('Found artifacts:', artifacts.data.artifacts.map(a => a.name));
|
||||
|
||||
for (const artifact of artifacts.data.artifacts) {
|
||||
if (artifact.name.startsWith('build-images-')) {
|
||||
console.log(`Deleting artifact: ${artifact.name}`);
|
||||
try {
|
||||
await github.rest.actions.deleteArtifact({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
artifact_id: artifact.id,
|
||||
});
|
||||
console.log(`Successfully deleted: ${artifact.name}`);
|
||||
} catch (error) {
|
||||
console.log(`Failed to delete ${artifact.name}:`, error.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
job1:
|
||||
needs: [delete-old-artifacts]
|
||||
runs-on: ubuntu-latest
|
||||
container: espressif/idf:release-v5.1
|
||||
strategy:
|
||||
matrix:
|
||||
build-dir: [
|
||||
'chatgpt_demo',
|
||||
'factory_demo',
|
||||
'image_display',
|
||||
'lv_demos',
|
||||
'mp3_demo',
|
||||
'usb_camera_lcd_display',
|
||||
'usb_headset',
|
||||
'watering_demo']
|
||||
boards: ['sdkconfig.ci.box', 'sdkconfig.ci.box-lite', 'sdkconfig.ci.box-3']
|
||||
exclude:
|
||||
- boards: sdkconfig.ci.box-lite
|
||||
build-dir: usb_camera_lcd_display
|
||||
- boards: sdkconfig.ci.box
|
||||
build-dir: usb_camera_lcd_display
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
- run: mkdir -p images
|
||||
- name: Build examples
|
||||
shell: bash
|
||||
run: |
|
||||
. $IDF_PATH/export.sh
|
||||
pip install --upgrade idf-component-manager
|
||||
pip install "idf_build_apps<2.0"
|
||||
|
||||
cd $GITHUB_WORKSPACE/examples/${{matrix.build-dir}}
|
||||
comm -23 <(grep -v '^#' ${{matrix.boards}} | sort) <(grep -v '^#' sdkconfig.defaults | sort) | sed 's/.*/\n&/' >> sdkconfig.defaults
|
||||
|
||||
if [[ ${{matrix.build-dir}} == chatgpt_demo ]]; then
|
||||
cd factory_nvs
|
||||
comm -23 <(grep -v '^#' ${{matrix.boards}} | sort) <(grep -v '^#' sdkconfig.defaults | sort) | sed 's/.*/\n&/' >> sdkconfig.defaults
|
||||
idf.py build
|
||||
cd ../
|
||||
fi
|
||||
|
||||
idf.py build
|
||||
cd build
|
||||
esptool.py --chip esp32s3 merge_bin -o "$GITHUB_WORKSPACE/images/${{matrix.build-dir}}_${{matrix.boards}}.bin" @flash_args
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-images-${{matrix.build-dir}}-${{matrix.boards}}
|
||||
path: images/
|
||||
overwrite: true
|
||||
|
||||
job2:
|
||||
needs: [delete-old-artifacts]
|
||||
runs-on: ubuntu-latest
|
||||
container: espressif/esp-matter:latest_idf_v5.1.1
|
||||
strategy:
|
||||
matrix:
|
||||
build-dir: ['matter_switch']
|
||||
boards: ['sdkconfig.ci.box', 'sdkconfig.ci.box-lite', 'sdkconfig.ci.box-3']
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
- run: mkdir -p images
|
||||
- name: Build examples
|
||||
shell: bash
|
||||
run: |
|
||||
. $IDF_PATH/export.sh
|
||||
. $ESP_MATTER_PATH/export.sh
|
||||
pip install --upgrade "idf-component-manager~=1.2"
|
||||
pip install "idf_build_apps<2.0"
|
||||
|
||||
cd $GITHUB_WORKSPACE/examples/${{matrix.build-dir}}
|
||||
comm -23 <(grep -v '^#' ${{matrix.boards}} | sort) <(grep -v '^#' sdkconfig.defaults | sort) | sed 's/.*/\n&/' >> sdkconfig.defaults
|
||||
|
||||
idf.py set-target esp32s3 build
|
||||
cd build
|
||||
esptool.py --chip esp32s3 merge_bin -o "$GITHUB_WORKSPACE/images/${{matrix.build-dir}}_${{matrix.boards}}.bin" @flash_args
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-images-${{matrix.build-dir}}-${{matrix.boards}}
|
||||
path: images/
|
||||
overwrite: true
|
||||
|
||||
deploy:
|
||||
needs: [job1, job2]
|
||||
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
|
||||
- name: Download builds
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: build-images-*
|
||||
path: images/
|
||||
merge-multiple: true
|
||||
|
||||
- name: generate launchpad config
|
||||
run: |
|
||||
cd images/
|
||||
mv $GITHUB_WORKSPACE/bin/*.bin ./
|
||||
ls *
|
||||
$GITHUB_WORKSPACE/tools/launchpad/rename.sh $GITHUB_WORKSPACE
|
||||
$GITHUB_WORKSPACE/tools/launchpad/generate_launchpad_config.sh $GITHUB_REPOSITORY
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v2
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: images/
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
@@ -1,45 +0,0 @@
|
||||
name: Build examples IDF5.1
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
Build-examples:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PROJECT_PATH: examples/factory_demo
|
||||
BIN_FILE: ESP-Box_Demo_V0.5.0.bin
|
||||
container: espressif/idf:release-v5.1
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
|
||||
- name: esp-idf build
|
||||
run: |
|
||||
pwd
|
||||
ls -al
|
||||
cd /opt/esp/idf
|
||||
git checkout 22cfbf30c3
|
||||
git submodule update --init --recursive
|
||||
tools/idf_tools.py --non-interactive install cmake
|
||||
./install.sh
|
||||
source ./export.sh
|
||||
cd $GITHUB_WORKSPACE/$PROJECT_PATH
|
||||
idf.py build
|
||||
cd build
|
||||
esptool.py --chip ESP32-S3 merge_bin -o $BIN_FILE @flash_args
|
||||
shell: bash
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v3.0.0
|
||||
with:
|
||||
# Artifact name
|
||||
name: factory-firmware_IDF5.1
|
||||
# A file, directory or wildcard pattern that describes what to upload
|
||||
path: |
|
||||
examples/factory_demo/build/ESP-*.bin
|
||||
retention-days: 90
|
||||
@@ -1,6 +1,7 @@
|
||||
.config
|
||||
*.o
|
||||
*.pyc
|
||||
*.orig
|
||||
|
||||
# gtags
|
||||
GTAGS
|
||||
@@ -77,6 +78,9 @@ flake8_output.txt
|
||||
|
||||
# ESP-IDF default build directory name
|
||||
build
|
||||
build_esp*/
|
||||
build_linux*/
|
||||
size_info.txt
|
||||
|
||||
# lock files for examples and components
|
||||
dependencies.lock
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
stages:
|
||||
- pre_check
|
||||
- build
|
||||
- deploy
|
||||
|
||||
@@ -23,18 +24,9 @@ variables:
|
||||
V: "0"
|
||||
IDF_CI_BUILD: "1"
|
||||
|
||||
before_script:
|
||||
# add gitlab ssh key
|
||||
- mkdir -p ~/.ssh
|
||||
- chmod 700 ~/.ssh
|
||||
- echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
|
||||
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
|
||||
- chmod 600 ~/.ssh/id_rsa
|
||||
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
||||
- git --version
|
||||
- git submodule update --init --recursive --force
|
||||
|
||||
include:
|
||||
- '.gitlab/ci/danger.yml'
|
||||
- '.gitlab/ci/rules.yml'
|
||||
- '.gitlab/ci/pre_check.yml'
|
||||
- '.gitlab/ci/build.yml'
|
||||
- '.gitlab/ci/deploy.yml'
|
||||
- '.gitlab/ci/deploy.yml'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
.build_template: &build_template
|
||||
stage: build
|
||||
image: espressif/idf:release-v5.0
|
||||
tags:
|
||||
- build
|
||||
image: ${IMAGE}
|
||||
variables:
|
||||
# Enable ccache for all build jobs. See configure_ci_environment.sh for more ccache related settings.
|
||||
IDF_CCACHE_ENABLE: "1"
|
||||
@@ -31,198 +31,181 @@
|
||||
expire_in: 1 week
|
||||
variables:
|
||||
IDF_CI_BUILD: "1"
|
||||
# By configuring this macro, you can append the compiled configuration file.
|
||||
# For example, using "sdkconf.etc=default" specifies the default sdkconfig file.
|
||||
EXAMPLE_CONFIG: "="
|
||||
script:
|
||||
- pip install --upgrade idf-component-manager
|
||||
- pip install idf_build_apps
|
||||
- python -m idf_build_apps build -vv
|
||||
-p $EXAMPLE_DIR
|
||||
-t all
|
||||
--config "sdkconfig.ci.*="
|
||||
--build-dir build_@t_@w
|
||||
--build-log build_log.txt
|
||||
--size-file size.json
|
||||
--check-warnings
|
||||
--ignore-warning-str "$WARNING_STR"
|
||||
--collect-size-info size_info.txt
|
||||
--default-build-targets $IDF_TARGET
|
||||
- pip install "idf_build_apps<2.0"
|
||||
- python tools/build_apps.py ${EXAMPLE_DIR} --config ${EXAMPLE_CONFIG} -t esp32s3 -vv
|
||||
|
||||
build_example_chatgpt_demo_v5.0:
|
||||
.build_matter_template: &build_matter_template
|
||||
before_script:
|
||||
- . ${ESP_MATTER_PATH}/export.sh
|
||||
|
||||
build_example_matter_switch:
|
||||
extends:
|
||||
- .build_matter_template
|
||||
- .build_examples_template
|
||||
- .rules:build:example_matter_switch
|
||||
image: espressif/esp-matter:latest_idf_v5.1.1
|
||||
variables:
|
||||
EXAMPLE_DIR: examples/matter_switch
|
||||
script:
|
||||
- pip install --upgrade "idf-component-manager~=1.2"
|
||||
- pip install "idf_build_apps<2.0"
|
||||
- python tools/build_apps.py ${EXAMPLE_DIR} --config ${EXAMPLE_CONFIG} -t esp32s3 -vv
|
||||
|
||||
build_example_chatgpt_demo:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_chatgpt_demo
|
||||
image: espressif/idf:release-v5.0
|
||||
parallel:
|
||||
matrix:
|
||||
- IMAGE: espressif/idf:release-v5.0
|
||||
- IMAGE: espressif/idf:release-v5.1
|
||||
- IMAGE: espressif/idf:release-v5.2
|
||||
- IMAGE: espressif/idf:release-v5.3
|
||||
- IMAGE: espressif/idf:release-v5.4
|
||||
- IMAGE: espressif/idf:release-v5.5
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/chatgpt_demo
|
||||
NVS_DIR: examples/chatgpt_demo/factory_nvs
|
||||
before_script:
|
||||
- pwd
|
||||
- mkdir ${NVS_DIR}/build
|
||||
- touch ${NVS_DIR}/build/factory_nvs.bin
|
||||
|
||||
build_example_chatgpt_demo_latest:
|
||||
build_example_chatgpt_demo_factory_nvs:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_chatgpt_demo
|
||||
image: espressif/idf:latest
|
||||
- .rules:build:example_chatgpt_demo_factory_nvs
|
||||
parallel:
|
||||
matrix:
|
||||
- IMAGE: espressif/idf:release-v5.0
|
||||
- IMAGE: espressif/idf:release-v5.1
|
||||
- IMAGE: espressif/idf:release-v5.2
|
||||
- IMAGE: espressif/idf:release-v5.3
|
||||
- IMAGE: espressif/idf:release-v5.4
|
||||
- IMAGE: espressif/idf:release-v5.5
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/chatgpt_demo
|
||||
EXAMPLE_DIR: examples/chatgpt_demo/factory_nvs
|
||||
|
||||
build_example_factory_demo_v5.0:
|
||||
build_example_factory_demo:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_factory_demo
|
||||
#image: espressif/idf:release-v5.0 don't support release-v5.0 now.
|
||||
image: espressif/idf:release-v5.1
|
||||
parallel:
|
||||
matrix:
|
||||
#- IMAGE: espressif/idf:release-v5.0 don't support release-v5.0 now.
|
||||
- IMAGE: espressif/idf:release-v5.1
|
||||
- IMAGE: espressif/idf:release-v5.2
|
||||
- IMAGE: espressif/idf:release-v5.3
|
||||
- IMAGE: espressif/idf:release-v5.4
|
||||
- IMAGE: espressif/idf:release-v5.5
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/factory_demo
|
||||
|
||||
build_example_factory_demo_v5.1:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_factory_demo
|
||||
image: espressif/idf:release-v5.1
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/factory_demo
|
||||
|
||||
build_example_factory_demo_latest:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_factory_demo
|
||||
image: espressif/idf:latest
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/factory_demo
|
||||
|
||||
build_example_image_display_v5.0:
|
||||
build_example_image_display:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_image_display
|
||||
image: espressif/idf:release-v5.0
|
||||
parallel:
|
||||
matrix:
|
||||
- IMAGE: espressif/idf:release-v5.0
|
||||
- IMAGE: espressif/idf:release-v5.1
|
||||
- IMAGE: espressif/idf:release-v5.2
|
||||
- IMAGE: espressif/idf:release-v5.3
|
||||
- IMAGE: espressif/idf:release-v5.4
|
||||
- IMAGE: espressif/idf:release-v5.5
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/image_display
|
||||
|
||||
build_example_image_display_v5.1:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_image_display
|
||||
image: espressif/idf:release-v5.1
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/image_display
|
||||
|
||||
build_example_image_display_latest:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_image_display
|
||||
image: espressif/idf:latest
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/image_display
|
||||
|
||||
build_example_lv_demos_v5.0:
|
||||
build_example_lv_demos:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_lv_demos
|
||||
image: espressif/idf:release-v5.0
|
||||
parallel:
|
||||
matrix:
|
||||
- IMAGE: espressif/idf:release-v5.0
|
||||
- IMAGE: espressif/idf:release-v5.1
|
||||
- IMAGE: espressif/idf:release-v5.2
|
||||
- IMAGE: espressif/idf:release-v5.3
|
||||
- IMAGE: espressif/idf:release-v5.4
|
||||
- IMAGE: espressif/idf:release-v5.5
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/lv_demos
|
||||
|
||||
build_example_lv_demos_v5.1:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_lv_demos
|
||||
image: espressif/idf:release-v5.1
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/lv_demos
|
||||
|
||||
build_example_lv_demos_latest:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_lv_demos
|
||||
image: espressif/idf:latest
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/lv_demos
|
||||
|
||||
build_example_mp3_demo_v5.0:
|
||||
build_example_mp3_demo:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_mp3_demo
|
||||
image: espressif/idf:release-v5.0
|
||||
parallel:
|
||||
matrix:
|
||||
- IMAGE: espressif/idf:release-v5.0
|
||||
- IMAGE: espressif/idf:release-v5.1
|
||||
- IMAGE: espressif/idf:release-v5.2
|
||||
- IMAGE: espressif/idf:release-v5.3
|
||||
- IMAGE: espressif/idf:release-v5.4
|
||||
- IMAGE: espressif/idf:release-v5.5
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/mp3_demo
|
||||
|
||||
build_example_mp3_demo_v5.1:
|
||||
build_example_usb_camera_lcd_display:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_mp3_demo
|
||||
image: espressif/idf:release-v5.1
|
||||
- .rules:build:example_usb_camera_lcd_display
|
||||
parallel:
|
||||
matrix:
|
||||
- IMAGE: espressif/idf:release-v5.0
|
||||
- IMAGE: espressif/idf:release-v5.1
|
||||
- IMAGE: espressif/idf:release-v5.2
|
||||
# - IMAGE: espressif/idf:release-v5.3 don't support release-v5.3 now.
|
||||
- IMAGE: espressif/idf:release-v5.4
|
||||
# - IMAGE: espressif/idf:latest usb_stream do not support release-v5.5
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/mp3_demo
|
||||
EXAMPLE_DIR: examples/usb_camera_lcd_display
|
||||
|
||||
build_example_mp3_demo_latest:
|
||||
build_example_esp_joystick:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_mp3_demo
|
||||
image: espressif/idf:latest
|
||||
- .rules:build:example_esp_joystick
|
||||
parallel:
|
||||
matrix:
|
||||
- IMAGE: espressif/idf:release-v5.1
|
||||
- IMAGE: espressif/idf:release-v5.2
|
||||
- IMAGE: espressif/idf:release-v5.3
|
||||
- IMAGE: espressif/idf:release-v5.4
|
||||
# - IMAGE: espressif/idf:release-v5.5 esp_now do not support release-v5.5
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/mp3_demo
|
||||
EXAMPLE_DIR: examples/esp_joystick
|
||||
|
||||
build_example_usb_headset_v5.0:
|
||||
build_example_usb_headset:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_usb_headset
|
||||
image: espressif/idf:release-v5.0
|
||||
parallel:
|
||||
matrix:
|
||||
- IMAGE: espressif/idf:release-v5.0
|
||||
- IMAGE: espressif/idf:release-v5.1
|
||||
- IMAGE: espressif/idf:release-v5.2
|
||||
- IMAGE: espressif/idf:release-v5.3
|
||||
- IMAGE: espressif/idf:release-v5.4
|
||||
- IMAGE: espressif/idf:release-v5.5
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/usb_headset
|
||||
|
||||
build_example_usb_headset_v5.1:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_usb_headset
|
||||
image: espressif/idf:release-v5.1
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/usb_headset
|
||||
|
||||
build_example_usb_headset_latest:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_usb_headset
|
||||
image: espressif/idf:latest
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/usb_headset
|
||||
|
||||
build_example_watering_demo_v5.0:
|
||||
build_example_watering_demo:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_watering_demo
|
||||
image: espressif/idf:release-v5.0
|
||||
parallel:
|
||||
matrix:
|
||||
- IMAGE: espressif/idf:release-v5.0
|
||||
- IMAGE: espressif/idf:release-v5.1
|
||||
- IMAGE: espressif/idf:release-v5.2
|
||||
- IMAGE: espressif/idf:release-v5.3
|
||||
- IMAGE: espressif/idf:release-v5.4
|
||||
- IMAGE: espressif/idf:release-v5.5
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/watering_demo
|
||||
|
||||
build_example_watering_demo_v5.1:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_watering_demo
|
||||
image: espressif/idf:release-v5.1
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/watering_demo
|
||||
|
||||
build_example_watering_demo_latest:
|
||||
extends:
|
||||
- .build_examples_template
|
||||
- .rules:build:example_watering_demo
|
||||
image: espressif/idf:latest
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
EXAMPLE_DIR: examples/watering_demo
|
||||
@@ -0,0 +1,12 @@
|
||||
# External DangerJS
|
||||
include:
|
||||
- project: espressif/shared-ci-dangerjs
|
||||
ref: master
|
||||
file: danger.yaml
|
||||
|
||||
run-danger-mr-linter:
|
||||
stage: pre_check
|
||||
# just ignore for now until the BOT_TOKEN is ready
|
||||
allow_failure: true
|
||||
tags:
|
||||
- dangerjs
|
||||
@@ -0,0 +1,50 @@
|
||||
.pre_check_template:
|
||||
stage: pre_check
|
||||
image: python:3.9
|
||||
tags: ["build", "amd64", "internet"]
|
||||
dependencies: []
|
||||
|
||||
check_readme_links:
|
||||
extends:
|
||||
- .pre_check_template
|
||||
- .rules:pre_check:readme
|
||||
allow_failure: false
|
||||
script:
|
||||
- python ${CI_PROJECT_DIR}/tools/ci/check_readme_links.py
|
||||
|
||||
check_copyright:
|
||||
extends:
|
||||
- .pre_check_template
|
||||
allow_failure: false
|
||||
before_script:
|
||||
- pip install git+https://github.com/espressif/check-copyright.git@master
|
||||
script:
|
||||
- python -m check_copyright --verbose --dry-run --ignore tools/ci/ignore_list_copyright.txt --config tools/ci/check_copyright_config.yaml .
|
||||
|
||||
check_pre_commit:
|
||||
extends:
|
||||
- .pre_check_template
|
||||
before_script:
|
||||
- pip install pre-commit
|
||||
script:
|
||||
- |
|
||||
# merged results pipelines, by default
|
||||
if [[ -n $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA ]]; then
|
||||
MODIFIED_FILES=$(git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA)
|
||||
# merge request pipelines, when the mr got conflicts
|
||||
elif [[ -n $CI_MERGE_REQUEST_DIFF_BASE_SHA ]]; then
|
||||
MODIFIED_FILES=$(git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_COMMIT_SHA)
|
||||
# other pipelines, like the protected branches pipelines
|
||||
else
|
||||
if [[ -z $CI_COMMIT_BEFORE_SHA || $CI_COMMIT_BEFORE_SHA == "0000000000000000000000000000000000000000" ]]; then
|
||||
echo "Warning: CI_COMMIT_BEFORE_SHA is empty or invalid. Cannot determine modified files based on this value."
|
||||
exit 0
|
||||
else
|
||||
MODIFIED_FILES=$(git diff --name-only $CI_COMMIT_BEFORE_SHA $CI_COMMIT_SHA)
|
||||
fi
|
||||
fi
|
||||
# print the MODIFIED_FILES
|
||||
echo "MODIFIED_FILES: $MODIFIED_FILES"
|
||||
- pre-commit install --allow-missing-config -t pre-commit -t commit-msg
|
||||
- export SKIP=check-copyright # copyrights has been checked in separate job
|
||||
- pre-commit run --files $MODIFIED_FILES
|
||||
@@ -10,6 +10,12 @@
|
||||
.patterns-example_chatgpt_demo: &patterns-example_chatgpt_demo
|
||||
- "examples/chatgpt_demo/**/*"
|
||||
|
||||
.patterns-example_chatgpt_demo_factory_nvs: &patterns-example_chatgpt_demo_factory_nvs
|
||||
- "examples/chatgpt_demo/factory_nvs/**/*"
|
||||
|
||||
.patterns-example_matter_switch: &patterns-example_matter_switch
|
||||
- "examples/matter_switch/**/*"
|
||||
|
||||
.patterns-example_factory_demo: &patterns-example_factory_demo
|
||||
- "examples/factory_demo/**/*"
|
||||
|
||||
@@ -22,12 +28,21 @@
|
||||
.patterns-example_mp3_demo: &patterns-example_mp3_demo
|
||||
- "examples/mp3_demo/**/*"
|
||||
|
||||
.patterns-example_usb_camera_lcd_display: &patterns-example_usb_camera_lcd_display
|
||||
- "examples/usb_camera_lcd_display/**/*"
|
||||
|
||||
.patterns-example_esp_joystick: &patterns-example_esp_joystick
|
||||
- "examples/esp_joystick/**/*"
|
||||
|
||||
.patterns-example_usb_headset: &patterns-example_usb_headset
|
||||
- "examples/usb_headset/**/*"
|
||||
|
||||
.patterns-example_watering_demo: &patterns-example_watering_demo
|
||||
- "examples/watering_demo/**/*"
|
||||
|
||||
.patterns-docs_md: &patterns-docs_md
|
||||
- "**/*.md"
|
||||
|
||||
##############
|
||||
# if anchors #
|
||||
##############
|
||||
@@ -43,6 +58,9 @@
|
||||
.if-label-build: &if-label-build
|
||||
if: '$CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*build(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
.if-label-pre_check: &if-label-pre_check
|
||||
if: '$BOT_LABEL_PRE_CHECK || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*pre_check(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
# rules for examples
|
||||
.rules:build:example_chatgpt_demo:
|
||||
rules:
|
||||
@@ -53,6 +71,24 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_chatgpt_demo
|
||||
|
||||
.rules:build:example_chatgpt_demo_factory_nvs:
|
||||
rules:
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-components_bsp
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_chatgpt_demo_factory_nvs
|
||||
|
||||
.rules:build:example_matter_switch:
|
||||
rules:
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-components_bsp
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_matter_switch
|
||||
|
||||
.rules:build:example_factory_demo:
|
||||
rules:
|
||||
- <<: *if-protected
|
||||
@@ -89,6 +125,24 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_mp3_demo
|
||||
|
||||
.rules:build:example_usb_camera_lcd_display:
|
||||
rules:
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-components_bsp
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_usb_camera_lcd_display
|
||||
|
||||
.rules:build:example_esp_joystick:
|
||||
rules:
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-components_bsp
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_esp_joystick
|
||||
|
||||
.rules:build:example_usb_headset:
|
||||
rules:
|
||||
- <<: *if-protected
|
||||
@@ -105,4 +159,13 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-components_bsp
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_watering_demo
|
||||
changes: *patterns-example_watering_demo
|
||||
|
||||
.rules:pre_check:readme:
|
||||
rules:
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-pre_check
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-components_bsp
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-docs_md
|
||||
|
||||
@@ -1,19 +1,70 @@
|
||||
repos:
|
||||
- repo: https://github.com/igrr/astyle_py.git
|
||||
rev: master
|
||||
hooks:
|
||||
- id: astyle_py
|
||||
args: ['--style=otbs', '--attach-namespaces', '--attach-classes', '--indent=spaces=4', '--convert-tabs', '--align-pointer=name', '--align-reference=name', '--keep-one-line-statements', '--pad-header', '--pad-oper']
|
||||
---
|
||||
minimum_pre_commit_version: 3.3.0
|
||||
default_install_hook_types: [pre-commit,commit-msg]
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.3.0
|
||||
repos:
|
||||
- repo: https://github.com/espressif/check-copyright/
|
||||
rev: v1.0.3
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
types_or: [c, c++]
|
||||
- id: end-of-file-fixer
|
||||
types_or: [c, c++]
|
||||
- id: check-merge-conflict
|
||||
- id: mixed-line-ending
|
||||
types_or: [c, c++]
|
||||
args: ['--fix=lf']
|
||||
description: Forces to replace line ending by the UNIX 'lf' character
|
||||
- id: check-copyright
|
||||
args: ['--config', 'tools/ci/check_copyright_config.yaml', '--ignore', 'tools/ci/check_copyright_ignore.txt']
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.6.0
|
||||
hooks:
|
||||
- id: file-contents-sorter
|
||||
files: 'tools\/ci\/(executable-list\.txt|check_copyright_ignore\.txt)'
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.6.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
# note: whitespace exclusions use multiline regex, see https://pre-commit.com/#regular-expressions
|
||||
# items are:
|
||||
# 1 - some file extensions
|
||||
# 2 - any file matching *test*/*expected* (for host tests, if possible use this naming pattern always)
|
||||
# 3 - any file with known-warnings in the name
|
||||
# 4 - any directory named 'testdata'
|
||||
# 5 - protobuf auto-generated files
|
||||
exclude: &whitespace_excludes |
|
||||
(?x)^(
|
||||
.+\.(md|rst|map|bin)|
|
||||
.+test.*\/.*expected.*|
|
||||
.+known-warnings.*|
|
||||
.+\/testdata\/.+|
|
||||
.*_pb2.py|
|
||||
.*.pb-c.h|
|
||||
.*.pb-c.c|
|
||||
.*.yuv
|
||||
)$
|
||||
- id: end-of-file-fixer
|
||||
exclude: *whitespace_excludes
|
||||
- id: check-executables-have-shebangs
|
||||
- id: check-shebang-scripts-are-executable
|
||||
- id: mixed-line-ending
|
||||
args: ['-f=lf']
|
||||
- id: double-quote-string-fixer
|
||||
- id: no-commit-to-branch
|
||||
name: Do not use more than one slash in the branch name
|
||||
args: ['--pattern', '^[^/]*/[^/]*/']
|
||||
- id: no-commit-to-branch
|
||||
name: Do not use uppercase letters in the branch name
|
||||
args: ['--pattern', '^[^A-Z]*[A-Z]']
|
||||
- repo: https://github.com/espressif/astyle_py.git
|
||||
rev: v1.0.5
|
||||
hooks:
|
||||
- id: astyle_py
|
||||
# If you are modifying astyle version, update tools/format.sh as well
|
||||
args: ['--astyle-version=3.4.7', '--rules=tools/ci/astyle-rules.yml']
|
||||
|
||||
- repo: https://github.com/espressif/conventional-precommit-linter
|
||||
rev: v1.8.0
|
||||
hooks:
|
||||
- id: conventional-precommit-linter
|
||||
stages: [commit-msg]
|
||||
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.3.0
|
||||
hooks:
|
||||
- id: codespell
|
||||
args: [-w, "--ignore-words=codespell-ignore-list"]
|
||||
|
||||
@@ -1,38 +1,49 @@
|
||||
* [中文版本](README_cn.md)
|
||||
<p align="center">
|
||||
<img src="docs/_static/banner2.jpg" width="auto" height="auto" alt="ESPRESSIF">
|
||||
</p>
|
||||
|
||||
* [中文版本](README_cn.md)
|
||||
* [Promotional Video](https://www.youtube.com/watch?v=KGVOi1Mrjb0)
|
||||
# ESP-BOX AIoT Development Framework
|
||||
|
||||
<p align="left">
|
||||
<a href="https://github.com/espressif/esp-box/blob/master/LICENSE" alt="Build examples">
|
||||
<img alt="GitHub" src="https://img.shields.io/github/license/espressif/esp-box"></a>
|
||||
<a href="https://github.com/espressif/esp-box/actions/workflows/build_IDF5.1.yml" alt="Build examples">
|
||||
<img src="https://github.com/espressif/esp-box/actions/workflows/build_IDF5.1.yml/badge.svg" /></a>
|
||||
<a href="https://github.com/espressif/esp-box/actions/workflows/build-examples-gh-pages-on-push.yml" alt="Build examples">
|
||||
<img src="https://github.com/espressif/esp-box/actions/workflows/build-examples-gh-pages-on-push.yml/badge.svg" /></a>
|
||||
<a href="https://github.com/espressif/esp-box/graphs/contributors" alt="Contributors">
|
||||
<img src="https://img.shields.io/github/contributors/espressif/esp-box" /></a>
|
||||
<a href="https://github.com/espressif/esp-box/releases" alt="GitHub all releases">
|
||||
<img src="https://img.shields.io/github/downloads/espressif/esp-box/total" /></a>
|
||||
</p>
|
||||
|
||||
<a href="https://espressif.github.io/esp-launchpad/?flashConfigURL=https://raw.githubusercontent.com/espressif/esp-box/master/launch.toml">
|
||||
<img alt="Try it with ESP Launchpad" src="https://espressif.github.io/esp-launchpad/assets/try_with_launchpad.png" width="200" height="56">
|
||||
<a href="https://espressif.github.io/esp-launchpad/?flashConfigURL=https://espressif.github.io/esp-box/launchpad.toml">
|
||||
<img alt="Try it with ESP Launchpad" src="https://espressif.github.io/esp-launchpad/assets/try_with_launchpad.png" width="250" height="70">
|
||||
</a>
|
||||
|
||||
**Important Note:**
|
||||
|
||||
> We recommend [updating the application firmware](./docs/firmware_update.md) when you first receive the product to have the new features and bugfix. Click [here](./docs/getting_started.md) to access the user guide of the latest release firmware. Click [here](https://github.com/espressif/esp-box/releases) to visit the older firmware.
|
||||
> Upon receiving the ESP32-S3-BOX-3, we advise updating the built-in factory firmware to ensure you have the latest bugfixes via Espressif's online firmware flashing tool ESP Launchpad. Up till now, the latest version is **ESP-BOX-3_Demo_V1.2.4**. To verify the software version, please go to the 'About Us' Page.
|
||||
|
||||
The ESP-BOX is a new generation AIoT development platform released by Espressif Systems. The ESP32-S3-BOX and ESP32-S3-BOX-Lite are AIoT development boards that are based on Espressif’s ESP32-S3 Wi-Fi + Bluetooth 5 (LE) SoC. They provide a platform for developing the control of home appliances using Voice Assistance + touch and screen controller, sensor, infrared controller, and intelligent Wi-Fi gateway. Development boards come with pre-built firmware that supports offline voice interaction, with the SDKs and examples provided by Espressif, you will be able to develop a wide variety of AIoT applications based on the BOX series products such as online and offline voice assistants, voice-enabled devices, human-computer interaction devices, control panels, multi-protocol gateways easily.
|
||||
The ESP-BOX is an advanced AIoT, Edge AI, and IIoT applications development platform released by Espressif Systems. The ESP32-S3-BOX, ESP32-S3-BOX-Lite, and ESP32-S3-BOX-3 are a series of development boards designed for this platform, they are built on Espressif’s powerful ESP32-S3 Wi-Fi + Bluetooth 5 (LE) SoC and feature compact and beautiful enclosures. Leveraging the multi-functional accessories and reliable examples from the repo’s, these development boards cater to both prototyping new projects and building complex IoT systems, providing a perfect balance of form and function.
|
||||
|
||||
| Product Name | Product Figure |
|
||||
| :-----: | :---------------------: |
|
||||
| [ESP32-S3-BOX](docs/hardware_overview/esp32_s3_box/hardware_overview_for_box.md) | <img src="docs/_static/esp32_s3_box.png" width="200px" /> |
|
||||
| [ESP32-S3-BOX-Lite](docs/hardware_overview/esp32_s3_box_lite/hardware_overview_for_lite.md) | <img src="docs/_static/esp32_s3_box_lite.png" width="200px" /> |
|
||||
ESP-BOX provides a platform for developing applications in various domains, including Offline Voice Assistants, Online AI Chatbots (developed using OpenAI and other large language model platforms), Matter Device/Controller, Robot Controller, USB Device/Host, Wireless Sensor Application and a wide range of Human Machine Interaction (HMI) applications. Experience the possibilities—add one to your toolkit and explore the limitless potential!
|
||||
|
||||
|
||||
| Product Name | Product Figure | Marketing Status |
|
||||
| :-----: | :---------------------: |:---------------------: |
|
||||
| [ESP32-S3-BOX<sup> **1** </sup>](docs/hardware_overview/esp32_s3_box/hardware_overview_for_box.md) | <img src="docs/_static/esp32_s3_box.png" width="200px" /> |End of Life <br> [User Guide](https://github.com/espressif/esp-box/blob/v0.5.0/docs/getting_started.md) |
|
||||
| [ESP32-S3-BOX-Lite<sup> **1**</sup>](docs/hardware_overview/esp32_s3_box_lite/hardware_overview_for_lite.md) | <img src="docs/_static/esp32_s3_box_lite.png" width="200px" /> |End of Life <br> [User Guide](https://github.com/espressif/esp-box/blob/v0.5.0/docs/getting_started.md)|
|
||||
| [ESP32-S3-BOX-3<sup> **2**</sup>](docs/hardware_overview/esp32_s3_box_3/hardware_overview_for_box_3.md) | <img src="docs/_static/esp32_s3_box_3.png" width="200px" /> |[Active](https://www.aliexpress.com/item/1005005920207976.html) <br> [User Guide](./docs/getting_started.md)|
|
||||
|
||||
**Note 1**: Upon receiving the ESP32-S3-BOX and ESP32-S3-BOX-Lite, we advise updating the [built-in factory firmware](./docs/firmware_update.md) to ensure you have the latest bug fixes. In the master branch, we will gradually offer limited support for these two development boards. For further information, kindly refer to the examples readme.
|
||||
|
||||
**Note 2**: The ESP32-S3-BOX-3 offers two different versions: ESP32-S3-BOX-3 and ESP32-S3-BOX-3B. The ESP32-S3-BOX-3 represents the standard edition with four blue accessories, the ESP32-S3-BOX-3B provides fewer accessories to meet starters who don’t need much unnecessary hardware. For more details on the distinctions, please check [here](https://github.com/espressif/esp-box/blob/master/docs/getting_started.md#variant-description).
|
||||
## Versions
|
||||
|
||||
| ESP-BOX | Dependent ESP-IDF | Branch Note | Support State |
|
||||
| :--------------: | :---------------: | :----------------------------------------------------: | -------------- |
|
||||
| master | >= release/v5.1<br/>commit id: 22cfbf30c3 | Latest developing firmware <br/>esp-sr components version: v1.3.4 | Compatible with ESP32-S3-BOX and ESP32-S3-BOX-Lite <br/>Use menuconfig to select board |
|
||||
| master | >= release/v5.1<br/>commit id: 22cfbf30c3 | Latest developing firmware <br/>esp-sr components version: v1.4.1 | Partial support for ESP32-S3-BOX, ESP32-S3-BOX-Lite, and ESP32-S3-BOX-3 <br>**Use menuconfig to select board**<br> Refer to the Examples **README** for more details. |
|
||||
| Tag 0.5.0 | release/v5.1<br>commit id: 22cfbf30c3 | esp-sr components version: v1.3.4 | Compatible with ESP32-S3-BOX and ESP32-S3-BOX-Lite <br/>Use menuconfig to select board |
|
||||
| Tag 0.3.0 | release/v4.4<br>commit id: 2bdea81b2a | esp-sr version: dev/v2.0<br>commit id: c873a35 | Compatible with ESP32-S3-BOX and ESP32-S3-BOX-Lite |
|
||||
| Tag 0.2.1 | release/v4.4 with [patch](https://github.com/espressif/esp-box/tree/v0.2.1/idf_patch) | esp-sr version: close v1.0<br/>commit id: 3ce34fe | Support ESP32-S3-BOX only |
|
||||
@@ -40,47 +51,63 @@ The ESP-BOX is a new generation AIoT development platform released by Espressif
|
||||
|
||||
## Features
|
||||
|
||||
* Supports far-field voice interaction with 2 mics
|
||||
* Offline voice wake-up with high wake-up rate
|
||||
* Offline speech commands recognition in Chinese and English languages with high recognition rate
|
||||
* Reconfigurable 200+ speech commands in Chinese and English languages
|
||||
* Continuous Identification and Wakeup Interrupt
|
||||
* Flexible and reusable GUI framework
|
||||
* End-to-end AIoT dvelopment framwork ESP-RainMaker
|
||||
* Pmod™ compatible headers support expand peripheral modules
|
||||
* An out-of-the-box entry-level edge AI + HMI application development board.
|
||||
* FreeRTOS-based four-in-one voice interaction panel: offline voice recognition, network communication, screen display, peripheral control.
|
||||
* Supports far-field voice interaction with 2 mics.
|
||||
* Offline voice wake-up and commands recognition with high wake-up rate.
|
||||
* Allows continuous recognition, wake-up interrupt, and over 200 customizable command words.
|
||||
* Flexible and versatile home automation solutions: Matter, Home Assistant, ESP-RainMaker
|
||||
* Visual drag-and-drop GUI development: LVGL SquareLine Studio, Embedded Wizard, etc.
|
||||
* Rich development framework: ESP-IDF, Arduino, PlatformIO, Circuit Python, and more.
|
||||
|
||||
|
||||
## Open-Source Content
|
||||
|
||||
* [Schematic and PCB Source File](./hardware)
|
||||
* [Shell 3D Print Source File](./hardware)
|
||||
* [Firmware Source Code](./examples/factory_demo)
|
||||
* [Examples Source Code](./examples)
|
||||
* [Built-in Firmware Source Code](./examples/factory_demo)
|
||||
* [Other Examples](./examples)
|
||||
|
||||
> Based on [Apache 2.0](https://github.com/espressif/esp-box/blob/master/LICENSE) open source license, you can modify, develop, or distribute the contents freely.
|
||||
> Based on [Apache 2.0](https://github.com/espressif/esp-box/blob/master/LICENSE) open source license, you can modify, develop, or distribute the contents freely.
|
||||
|
||||
## User Guide
|
||||
## Built-in Firmware User Guide
|
||||
|
||||
* For getting start of BOX serial development boards, please refer to the [Getting Started](./docs/getting_started.md).
|
||||
* For experiencing voice assistant, please refer to the [Voice Assistance Control and Customization](./docs/getting_started.md#offline-voice-assistant-with-your-device).
|
||||
* For experiencing a more humanized interactive experience, please refer to the [Continuous Speech Recognition](./docs/getting_started.md#continuous-recognition).
|
||||
* It is recommended to start by reading the product [Hardware Overview](./docs/hardware_overview/esp32_s3_box_3/hardware_overview_for_box_3.md).
|
||||
* Next you can explore the [Getting Started](./docs/getting_started.md).
|
||||
* For exploring interesting sensor demos, please refer to [Sensor Applications](./docs/getting_started.md#sensor-monitor).
|
||||
* For experiencing voice assistant, please refer to the [Voice Assistance Control](./docs/getting_started.md#offline-voice-assistant).
|
||||
* For experiencing a more humanized interactive experience, please refer to the [Continuous Speech Recognition](./docs/getting_started.md#continuous-speech-recognition).
|
||||
* For defining the speech commands by mobile APP, please refer to the [ESP BOX APP User Guide](./docs/getting_started.md#voice-command-customization).
|
||||
* For switching the voice model language, please refer to [Switch Voice Model Language](./docs/getting_started.md#switch-voice-model-language).
|
||||
* For product exploded-view and disassembly tutorial, please refer to [Disassembly Tutorial](docs/disassembly_tutorial.md).
|
||||
* For more details of hardware information, please refer to the [Hardware Overview](./docs/hardware_overview).
|
||||
* For latest version firmware, please refer to the [Firmware Update](./docs/firmware_update.md).
|
||||
|
||||
## Developer Guide
|
||||
|
||||
ESP-BOX integrates components commonly used in AIoT development that you can leverage to build your own applications. Read more development guide [here](./docs/development_guide.md) (Updates in Progress).
|
||||
ESP-BOX integrates ESP-IDF components commonly used in AIoT development from [ESP Registry](https://components.espressif.com/components?q=lcd) that you can leverage to build your own applications.
|
||||
|
||||
### Quick Start
|
||||
|
||||
* **Step 1**. ESP-IDF (Espressif IoT Development Framework) is required to build the application. If this is your first time using the ESP-IDF, please refer to [ESP-IDF development guide](https://docs.espressif.com/projects/esp-idf/en/release-v5.1/esp32s3/index.html) to understand the open-source drivers and components provided by Espressif.
|
||||
* **Step 2**. Next, setting up development environment. Please refer to [ESP-IDF(release/v5.1) Installation Step by Step](https://docs.espressif.com/projects/esp-idf/en/release-v5.1/esp32s3/get-started/index.html).
|
||||
* **Step 1**. ESP-IDF (Espressif IoT Development Framework) is required to build the application. If this is your first time using the ESP-IDF, please refer to [ESP-IDF development guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/index.html) to understand the open-source drivers and components provided by Espressif.
|
||||
* **Step 2**. Next, setting up development environment. Please refer to [ESP-IDF (release/v5.1) Installation Step by Step](https://docs.espressif.com/projects/esp-idf/en/release-v5.1/esp32s3/get-started/index.html#ide).
|
||||
* **Step 3**. Run command `git clone --recursive https://github.com/espressif/esp-box.git` to download the code of this project and then switch the ESP-IDF version to [specified version](#versions);
|
||||
* **Step 4**. Take a small step, you can [build and flash a simple example](./examples/image_display).
|
||||
* **Step 5**. Moving further, please read [ESP-BOX technical architecture](./docs/technical_architecture.md) to understand the technical details.
|
||||
* **Step 6**. Going deeper, please read [ESP Speech Recognition Application Guide](https://github.com/espressif/esp-sr), [ESP RainMaker Programming Guide](https://docs.espressif.com/projects/esp-rainmaker/en/latest/), [LVGL GUI Quick overview](https://docs.lvgl.io/8.3/).
|
||||
* **Step 7**. For extended function, please read [Pmod™ compatible headers](./docs/hardware_overview) and [ESP-IDF API reference](https://docs.espressif.com/projects/esp-idf/en/release-v5.1/esp32s3/api-reference/index.html), to develop drivers for more extended devices.
|
||||
### Cloud Quick Start
|
||||
The ESP BOX APP is built based on the commercial mobile APP architecture, Nova Home, which provides fancy UI and better user experience but has limited openness. To gain access to it, customers are required to contact us commercially via email at sales@espressif.com.
|
||||
For developer, we offer [ESP RainMaker](https://rainmaker.espressif.com/) solution, which includes publicly available development document and API guide. Below is the pathway to access them:
|
||||
* [ESP RainMaker Get Started](https://rainmaker.espressif.com/docs/get-started.html)
|
||||
* [ESP RainMaker Programming Guide](https://docs.espressif.com/projects/esp-rainmaker/en/latest/)
|
||||
* [RainMaker App APIs Definitions](https://swaggerapis.rainmaker.espressif.com)
|
||||
|
||||
### NuttX
|
||||
The ESP32-S3-BOX-3 also supports integration with [NuttX](https://github.com/apache/nuttx/tree/master/boards/xtensa/esp32s3/esp32s3-box), offering further flexibility and functionality. Nuttx is a real-time operating system (RTOS) known for its compact size, efficiency, and real-time performance, making it an excellent choice for embedded systems.
|
||||
|
||||
### Great Projects from Developers
|
||||
We actively collect [outstanding projects](./docs/great_projects.md) based on ESP-BOX to inspire more developers to innovate. We thank the enthusiasts promoting thriving community culture and welcome more developers to contribute to the vibrant ESP32 community.
|
||||
|
||||
## Contact Us
|
||||
|
||||
@@ -89,5 +116,5 @@ ESP-BOX integrates components commonly used in AIoT development that you can lev
|
||||
|
||||
## Contributing Examples
|
||||
|
||||
We welcome any open-source software or hardware contribution. If you have any examples you want to share with us, please click the [Contributions Guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/contribute/index.html) and commit to the [Pull Requests](https://github.com/espressif/esp-box/pulls) to contribute your code.
|
||||
We welcome any open-source software or hardware contribution. If you have any examples you want to share with us, please click the [Contributions Guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/contribute/index.html) and commit to the [Pull Requests](https://github.com/espressif/esp-box/pulls) to contribute your code.
|
||||
|
||||
|
||||
@@ -1,93 +1,122 @@
|
||||
* [English Version](./README.md)
|
||||
* [Gitee 镜像仓库](https://gitee.com/EspressifSystems/esp-box)
|
||||
|
||||
# ESP-BOX AIoT 开发框架
|
||||
|
||||
<p align="left">
|
||||
<a href="https://github.com/espressif/esp-box/blob/master/LICENSE" alt="Build examples">
|
||||
<img alt="GitHub" src="https://img.shields.io/github/license/espressif/esp-box"></a>
|
||||
<a href="https://github.com/espressif/esp-box/actions/workflows/build_IDF5.1.yml" alt="Build examples">
|
||||
<img src="https://github.com/espressif/esp-box/actions/workflows/build_IDF5.1.yml/badge.svg" /></a>
|
||||
<a href="https://github.com/espressif/esp-box/graphs/contributors" alt="Contributors">
|
||||
<img src="https://img.shields.io/github/contributors/espressif/esp-box" /></a>
|
||||
<a href="https://github.com/espressif/esp-box/releases" alt="GitHub all releases">
|
||||
<img src="https://img.shields.io/github/downloads/espressif/esp-box/total" /></a>
|
||||
</p>
|
||||
|
||||
<a href="https://espressif.github.io/esp-launchpad/?flashConfigURL=https://raw.githubusercontent.com/espressif/esp-box/master/launch.toml">
|
||||
<img alt="Try it with ESP Launchpad" src="https://espressif.github.io/esp-launchpad/assets/try_with_launchpad.png" width="200" height="56">
|
||||
</a>
|
||||
|
||||
**重要提醒:**
|
||||
> 我们建议您在第一次收到产品时[更新应用固件](./docs/firmware_update_cn.md)以获得最新功能和 bug 的修复,点此[链接](./docs/getting_started_cn.md)获取应用固件的使用说明。点击[此处](https://github.com/espressif/esp-box/releases)查看历史固件。
|
||||
|
||||
ESP-BOX 是乐鑫信息科技发布的新一代 AIoT 应用开发平台。ESP32-S3-BOX 和 ESP32-S3-BOX-Lite 是目前对应的 AIoT 应用开发板,搭载支持 AI 加速的 ESP32-S3 Wi-Fi + Bluetooth 5 (LE) SoC。他们为用户提供了一个基于语音助手 + 触摸屏控制、传感器、红外控制器和智能 Wi-Fi 网关等功能,开发和控制智能家居设备的平台。开发板出厂支持离线语音交互功能,用户通过乐鑫丰富的 SDK 和解决方案,能够轻松构建在线和离线语音助手、智能语音设备、HMI 人机交互设备、控制面板、多协议网关等多样的应用。
|
||||
|
||||
| 开发板名称 | 产品图 |
|
||||
| :-----: | :---------------------: |
|
||||
| [ESP32-S3-BOX](docs/hardware_overview/esp32_s3_box/hardware_overview_for_box_cn.md) | <img src="docs/_static/esp32_s3_box.png" width="200px" /> |
|
||||
| [ESP32-S3-BOX-Lite](docs/hardware_overview/esp32_s3_box_lite/hardware_overview_for_lite_cn.md) | <img src="docs/_static/esp32_s3_box_lite.png" width="200px" /> |
|
||||
|
||||
## 版本信息
|
||||
|
||||
| ESP-BOX | 依赖的 ESP-IDF | 分支信息 | 支持状态 |
|
||||
| :-------: | :----------------------------------------------------------: | :----------------------------------------------------------: | ------------------------------------------------------- |
|
||||
| master | >= release/v5.1<br/>commit id: 22cfbf30c3 | Latest developing firmware <br/>esp-sr components version: v1.3.4 | 兼容 ESP32-S3-BOX 和 ESP32-S3-BOX-Lite<br/>使用 menuconfig 选择开发板 |
|
||||
| Tag 0.5.0 | release/v5.1<br/>commit id: 22cfbf30c3 | esp-sr components version: v1.3.4 | 兼容 ESP32-S3-BOX 和 ESP32-S3-BOX-Lite<br/>使用 menuconfig 选择开发板 |
|
||||
| Tag 0.3.0 | release/v4.4<br/>commit id: 22cfbf30c3 | esp-sr version: dev/v2.0<br/>commit id: c873a35 | 兼容 ESP32-S3-BOX 和 ESP32-S3-BOX-Lite |
|
||||
| Tag 0.2.1 | release/v4.4 with [patch](https://github.com/espressif/esp-box/tree/v0.2.1/idf_patch) | esp-sr version: close v1.0<br/>commit id: 3ce34fe | 仅支持 ESP32-S3-BOX |
|
||||
| Tag 0.1.1 | Release/v4.4 with [patch](https://github.com/espressif/esp-box/tree/v0.1.1/idf_patch) | esp-sr version: v0.9.6<br/>commit id: 3ce34fe | 仅支持 ESP32-S3-BOX |
|
||||
|
||||
## 支持特性
|
||||
|
||||
* 双麦克风支持远场语音交互
|
||||
* 高唤醒率的离线语音唤醒
|
||||
* 高识别率的离线中英文命令词识别
|
||||
* 可动态配置 200+ 中英文命令词
|
||||
* 连续识别和唤醒打断
|
||||
* 灵活可复用的 GUI 框架
|
||||
* 端到端一站式接入云平台
|
||||
* Pmod™ 兼容接口支持多种外设扩展
|
||||
|
||||
## 开源内容
|
||||
|
||||
* [原理图与 PCB 源文件](./hardware)
|
||||
* [外壳 3D 打印源文件](./hardware)
|
||||
* [出厂固件源代码](./examples/factory_demo)
|
||||
* [示例程序源代码](./examples)
|
||||
|
||||
> 基于 [Apache 2.0](https://github.com/espressif/esp-box/blob/master/LICENSE) 开源协议,你可以免费且自由的修改、创作和分享。
|
||||
|
||||
## 使用指引
|
||||
|
||||
* 首次拿到 BOX 系列开发板,您可以查看 [首次使用操作指引](./docs/getting_started_cn.md#给设备供电);
|
||||
* 想要体验离线语音助手功能,您可以查看 [离线语音识别](./docs/getting_started_cn.md#体验离线语音识别);
|
||||
* 体验更人性化的语音交互,可查看 [连续语音识别](./docs/getting_started_cn.md#连续语音识别);
|
||||
* 想要通过手机 APP 设置独特的语音命令词,请查看 [ESP BOX APP 操作指引](./docs/getting_started_cn.md#语音命令词自定义);
|
||||
* 想要了解产品爆炸图和拆机说明,请查看 [拆机教程](docs/disassembly_tutorial.md);
|
||||
* 想要了解开发板硬件和接口细节,请查看 [硬件总览](./docs/hardware_overview);
|
||||
* 想要使用最新版本固件,请查看 [固件更新说明](./docs/firmware_update_cn.md)。
|
||||
|
||||
## 开发指引
|
||||
|
||||
ESP-BOX 调用乐鑫包管理器 ESP Registry 中常用的组件,您可以利用这些组件构建自己的应用。点击了解更多[开发指南](./docs/development_guide_cn.md)(持续更新中)。
|
||||
|
||||
### 快速开始
|
||||
|
||||
* **Step 1**. 如果您首次接触 ESP-IDF 开发,建议先浏览 [ESP-IDF 编程指南](https://docs.espressif.com/projects/esp-idf/zh_CN/release-v5.1/esp32s3/index.html),了解乐鑫已经提供的开源驱动和组件;
|
||||
* **Step 2**. 接下来您可以详细阅读 [ESP-IDF(release/v5.1) 环境搭建指引](https://docs.espressif.com/projects/esp-idf/en/release-v5.1/esp32s3/get-started/index.html),一步一步完成开发环境搭建;
|
||||
* **Step 3**. 使用指令 `git clone --recursive https://github.com/espressif/esp-box.git` 下载本项目的代码,然后需要将 esp-idf 版本切换到[指定的版本](#版本信息);
|
||||
* **Step 4**. 小试牛刀,您可以尝试 [构建并烧录一个新的示例程序](./examples/image_display);
|
||||
* **Step 5**. 更进一步,您可以阅读 [ESP-BOX 技术架构说明](./docs/technical_architecture_cn.md),了解更多技术细节;
|
||||
* **Step 6**. 深入开发,您可以阅读 [ESP 语音识别应用开发指南](https://github.com/espressif/esp-sr),[ESP RainMaker 编程指南](https://docs.espressif.com/projects/esp-rainmaker/en/latest/),[LVGL UI 界面开发快速总览](https://docs.lvgl.io/8.3/);
|
||||
* **Step 7**. 扩展功能,您可以阅读 [开发板 Pmod™ 兼容接口介绍](./docs/hardware_overview) 和 [ESP-IDF API 参考手册](https://docs.espressif.com/projects/esp-idf/en/release-v5.1/esp32s3/api-reference/index.html),为更多扩展设备开发驱动。
|
||||
|
||||
## 联系我们
|
||||
|
||||
* 如果有任何开发和使用问题,您可添加 [GitHub Issues](https://github.com/espressif/esp-box/issues) 或到 [esp32.com](https://esp32.com/) 论坛寻求帮助;
|
||||
* 如果你对 ESP-BOX 项目感兴趣,欢迎到论坛 [ESP-BOX 版块](https://www.esp32.com/viewforum.php?f=43) 交流想法。
|
||||
|
||||
|
||||
## 贡献示例
|
||||
|
||||
我们欢迎任何软件或硬件相关的开源贡献,如果您有任何要与我们分享的示例,请参考 [贡献指南](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/contribute/index.html) 后提交 [Pull Requests](https://github.com/espressif/esp-box/pulls) 贡献代码。
|
||||
<p align="center">
|
||||
<img src="docs/_static/banner2.jpg" width="auto" height="auto" alt="ESPRESSIF">
|
||||
</p>
|
||||
|
||||
* [English Version](./README.md)
|
||||
* [Gitee 镜像仓库](https://gitee.com/EspressifSystems/esp-box)
|
||||
* [宣传视频](https://www.bilibili.com/video/BV11N4y197Qu/?spm_id_from=333.337.search-card.all.click)
|
||||
# ESP-BOX AIoT 开发框架
|
||||
|
||||
<p align="left">
|
||||
<a href="https://github.com/espressif/esp-box/blob/master/LICENSE" alt="Build examples">
|
||||
<img alt="GitHub" src="https://img.shields.io/github/license/espressif/esp-box"></a>
|
||||
<a href="https://github.com/espressif/esp-box/actions/workflows/build-examples-gh-pages-on-push.yml" alt="Build examples">
|
||||
<img src="https://github.com/espressif/esp-box/actions/workflows/build-examples-gh-pages-on-push.yml/badge.svg" /></a>
|
||||
<a href="https://github.com/espressif/esp-box/graphs/contributors" alt="Contributors">
|
||||
<img src="https://img.shields.io/github/contributors/espressif/esp-box" /></a>
|
||||
<a href="https://github.com/espressif/esp-box/releases" alt="GitHub all releases">
|
||||
<img src="https://img.shields.io/github/downloads/espressif/esp-box/total" /></a>
|
||||
</p>
|
||||
|
||||
<a href="https://espressif.github.io/esp-launchpad/?flashConfigURL=https://espressif.github.io/esp-box/launchpad.toml">
|
||||
<img alt="Try it with ESP Launchpad" src="https://espressif.github.io/esp-launchpad/assets/try_with_launchpad.png" width="250" height="70">
|
||||
</a>
|
||||
|
||||
**重要提醒:**
|
||||
> 在收到 ESP32-S3-BOX-3 后,我们建议您更新内置的出厂固件,以确保拥有最新的 bug 修复。您可以使用乐鑫在线固件烧录工具 ESP Launchpad 进行此操作。截止目前,最新版本为 **ESP-BOX-3_Demo_V1.2.4**。请前往 “About Us” 页面验证设备出厂固件版本。
|
||||
|
||||
ESP-BOX 是乐鑫科技推出的面向 AIoT、边缘 AI 和 IIoT 应用的开发平台。ESP32-S3-BOX、ESP32-S3-BOX-Lite 和 ESP32-S3-BOX-3 是为该平台设计的系列开发板,它们基于乐鑫强大的 ESP32-S3 Wi-Fi + Bluetooth 5(LE) SoC 构建,并拥有紧凑美观的外壳结构。借助多功能配件和 ESP-BOX 项目内的可靠例程,这些开发板既适用于构建新项目原型,也适用于打造复杂的物联网系统,提供了形式上和功能上的完美平衡。
|
||||
|
||||
ESP-BOX 为各个领域的应用提供了开发资源,包括离线语音助手、在线 AI 聊天机器人(使用 OpenAI 和其他大型语言模型平台开发)、Matter 设备/控制器、机器人控制器、USB 主从设备、无线传感器应用以及广泛的人机交互(HMI)应用。将其加入工具箱,尽情体验各种可能性,发掘无限潜力!
|
||||
|
||||
|
||||
| 产品名称 | 产品图 | 市场状态 |
|
||||
| :-----: | :---------------------: |:---------------------: |
|
||||
| [ESP32-S3-BOX<sup> **1** </sup>](docs/hardware_overview/esp32_s3_box/hardware_overview_for_box_cn.md) | <img src="docs/_static/esp32_s3_box.png" width="200px" /> |寿命终止 <br> [用户指南](https://github.com/espressif/esp-box/blob/v0.5.0/docs/getting_started_cn.md) |
|
||||
| [ESP32-S3-BOX-Lite<sup> **1** **2** </sup>](docs/hardware_overview/esp32_s3_box_lite/hardware_overview_for_lite_cn.md) | <img src="docs/_static/esp32_s3_box_lite.png" width="200px" /> |寿命终止 <br> [用户指南](https://github.com/espressif/esp-box/blob/v0.5.0/docs/getting_started_cn.md)|
|
||||
| [ESP32-S3-BOX-3<sup> **3** </sup>](docs/hardware_overview/esp32_s3_box_3/hardware_overview_for_box_3_cn.md) | <img src="docs/_static/esp32_s3_box_3.png" width="200px" /> |[在售](https://item.taobao.com/item.htm?ft=t&id=732842971319) <br> [用户指南](./docs/getting_started_cn.md)|
|
||||
|
||||
**Note 1**: 对于 ESP32-S3-BOX 和 ESP32-S3-BOX-Lite,我们建议您更新内置的[出厂应用固件](./docs/firmware_update_cn.md)以确保拥有最新的 bug 修复。在 Master 分支,我们将逐步对这两款开发板提供有限的支持。有关更多信息,请阅读各例程的 README。
|
||||
|
||||
**Note 2**: ESP32-S3-BOX-Lite 整个工程包括 PCB,外壳结构已开源到[立创开源硬件平台](https://oshwhub.com/esp-college/esp32-s3-box_lite),有需要复刻该项目的开发者,请自行购买 LCD 后进行工程复刻,LCD 屏[购买链接](https://item.taobao.com/item.htm?id=658634202331&spm=a312a.7700824.w4002-8715811646.9.4048605fNqggSF&skuId=5283401261405)。
|
||||
|
||||
**Note 3**: ESP32-S3-BOX-3 提供两款不同配置的套件:分别命名为 ESP32-S3-BOX-3 和 ESP32-S3-BOX-3B。ESP32-S3-BOX-3 代表标准版,配备四款蓝色配件,而 ESP32-S3-BOX-3B 代表基础版,仅提供了一款配件,适用于不需要太多不必要硬件的初学者。点击[此处](https://github.com/espressif/esp-box/blob/master/docs/getting_started_cn.md#%E5%8F%98%E4%BD%93%E8%AF%B4%E6%98%8E)了解两者区别。
|
||||
## 版本信息
|
||||
| ESP-BOX | 依赖的 ESP-IDF | 分支信息 | 支持状态 |
|
||||
| :-------: | :----------------------------------------------------------: | :----------------------------------------------------------: | ------------------------------------------------------- |
|
||||
| master | >= release/v5.1<br/>commit id: 22cfbf30c3 | Latest developing firmware <br/>esp-sr components version: v1.4.1 | 部分支持 ESP32-S3-BOX,ESP32-S3-BOX-Lite 和 ESP32-S3-BOX-3<br/>**使用 menuconfig 选择开发板**<br/>详见 Examples **README** |
|
||||
| Tag 0.5.0 | release/v5.1<br/>commit id: 22cfbf30c3 | esp-sr components version: v1.3.4 | 兼容 ESP32-S3-BOX 和 ESP32-S3-BOX-Lite<br/>使用 menuconfig 选择开发板 |
|
||||
| Tag 0.3.0 | release/v4.4<br/>commit id: 22cfbf30c3 | esp-sr version: dev/v2.0<br/>commit id: c873a35 | 兼容 ESP32-S3-BOX 和 ESP32-S3-BOX-Lite |
|
||||
| Tag 0.2.1 | release/v4.4 with [patch](https://github.com/espressif/esp-box/tree/v0.2.1/idf_patch) | esp-sr version: close v1.0<br/>commit id: 3ce34fe | 仅支持 ESP32-S3-BOX |
|
||||
| Tag 0.1.1 | Release/v4.4 with [patch](https://github.com/espressif/esp-box/tree/v0.1.1/idf_patch) | esp-sr version: v0.9.6<br/>commit id: 3ce34fe | 仅支持 ESP32-S3-BOX |
|
||||
|
||||
## 支持特性
|
||||
|
||||
* 即开即用的入门级边缘 AI + HMI 应用开发板
|
||||
* 基于 FreeRTOS 的四合一语音交互面板:离线语音识别、网络通信、屏幕显示、外设控制
|
||||
* 双麦克风支持远场语音交互
|
||||
* 支持高唤醒率的离线语音唤醒和命令词识别
|
||||
* 允许连续命令词识别、唤醒打断以及自定义配置 200+ 中英文命令词
|
||||
* 灵活多样的家庭自动化解决方案:Matter、Home Assistant、ESP-RainMaker
|
||||
* 可视化拖放式 GUI 开发:LVGL SquareLine Studio、Embedded Wizard 等
|
||||
* 丰富的开发框架:ESP-IDF、Arduino、PlatformIO、Circuit Python 等
|
||||
|
||||
## 开源内容
|
||||
|
||||
* [原理图与 PCB 源文件](./hardware)
|
||||
* [外壳 3D 打印源文件](./hardware)
|
||||
* [出厂固件源代码](./examples/factory_demo)
|
||||
* [示例程序源代码](./examples)
|
||||
|
||||
> 基于 [Apache 2.0](https://github.com/espressif/esp-box/blob/master/LICENSE) 开源协议,你可以免费且自由的修改、创作和分享。
|
||||
|
||||
## 内置固件使用指引
|
||||
|
||||
* 首次拿到开发板,建议先阅读产品[硬件概览](./docs/hardware_overview);
|
||||
* 接着可以查看[首次使用操作指引](./docs/getting_started_cn.md#开始使用);
|
||||
* 体验有意思的[传感器应用](./docs/getting_started_cn.md#传感器监测);
|
||||
* 体验离线语音助手功能,您可以查看[离线语音识别](./docs/getting_started_cn.md#体验离线语音识别);
|
||||
* 体验更人性化的语音交互,可查看[连续语音识别](./docs/getting_started_cn.md#连续语音识别);
|
||||
* 通过手机 APP 设置独特的语音命令词,请查看 [ESP BOX APP 操作指引](./docs/getting_started_cn.md#语音命令词自定义);
|
||||
* 如需切换语音模型语言,请查看[中英文语音模型切换](./docs/getting_started_cn.md#中英文语音模型切换);
|
||||
* 了解产品爆炸图和拆机说明,请查看[拆机教程](./docs/disassembly_tutorial.md);
|
||||
* 更新最新版本固件,请查看[固件更新说明](./docs/firmware_update_cn.md)。
|
||||
|
||||
## 开发指引
|
||||
|
||||
ESP-BOX 调用乐鑫 ESP-IDF 的包管理器 [ESP Registry](https://components.espressif.com/components?q=lcd) 中常用的组件,您可以利用这些组件构建自己的应用。
|
||||
|
||||
### 快速开始
|
||||
|
||||
* **Step 1**. 如果您首次接触 ESP-IDF 开发,建议先浏览 [ESP-IDF 编程指南](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32s3/index.html),了解乐鑫已经提供的开源驱动和组件;
|
||||
* **Step 2**. 接下来您可以详细阅读 [ESP-IDF(release/v5.1) 环境搭建指引](https://docs.espressif.com/projects/esp-idf/en/release-v5.1/esp32s3/get-started/index.html#ide),一步一步完成开发环境搭建;
|
||||
* **Step 3**. 使用指令 `git clone --recursive https://github.com/espressif/esp-box.git` 下载本项目的代码,然后需要将 esp-idf 版本切换到[指定的版本](#版本信息);
|
||||
* **Step 4**. 小试牛刀,您可以尝试 [构建并烧录一个新的示例程序](./examples/image_display);
|
||||
* **Step 5**. 更进一步,您可以阅读 [ESP-BOX 技术架构说明](./docs/technical_architecture_cn.md),了解更多技术细节;
|
||||
* **Step 6**. 深入开发,您可以阅读 [ESP 语音识别应用开发指南](https://github.com/espressif/esp-sr),[ESP RainMaker 编程指南](https://docs.espressif.com/projects/esp-rainmaker/en/latest/),[LVGL UI 界面开发快速总览](https://docs.lvgl.io/8.3/);
|
||||
* **Step 7**. 扩展功能,您可以阅读 [开发板 Pmod™ 兼容接口介绍](./docs/hardware_overview) 和 [ESP-IDF API 参考手册](https://docs.espressif.com/projects/esp-idf/en/release-v5.1/esp32s3/api-reference/index.html),为更多扩展设备开发驱动。
|
||||
|
||||
### 云连接开发指南
|
||||
|
||||
ESP BOX APP 基于商业版 Nova Home 应用 APP 构建,拥有精美的用户界面和更好的用户体验,但由于 Nova Home App 有限开放,客户如需项目资源,可通过 sales@espressif.com 邮件与我们联系。
|
||||
对于个人开发者,我们提供 [ESP RainMaker](https://rainmaker.espressif.com/zh-hans/) 解决方案,其中包括公开可用的开发文档和 API 指南。以下是开发资源访问路径:
|
||||
|
||||
- [ESP RainMaker 快速入门](https://rainmaker.espressif.com/docs/get-started.html)
|
||||
- [RainMaker App API 定义](https://swaggerapis.rainmaker.espressif.com)
|
||||
- [ESP RainMaker 编程指南](https://docs.espressif.com/projects/esp-rainmaker/en/latest/index.html#)
|
||||
|
||||
|
||||
### NuttX
|
||||
ESP32-S3-BOX-3 支持与 [NuttX](https://github.com/apache/nuttx/tree/master/boards/xtensa/esp32s3/esp32s3-box) 集成,提供了更多的灵活性和功能。Nuttx 是一款以其小巧、高效和实时性能而闻名的实时操作系统(RTOS),使其成为嵌入式系统的绝佳选择。
|
||||
|
||||
### 优秀开源社区项目
|
||||
我们积极搜集基于 ESP-BOX 的[优秀项目](./docs/great_projects.md),以激发更多 makers 的创新思维。我们对推动社区文化繁荣的倡导者表示由衷的感谢,并欢迎更多的开发人员为充满活力的ESP32社区贡献力量。
|
||||
|
||||
## 联系我们
|
||||
|
||||
* 如果有任何开发和使用问题,您可添加 [GitHub Issues](https://github.com/espressif/esp-box/issues) 或到 [esp32.com](https://esp32.com/) 论坛寻求帮助;
|
||||
* 如果你对 ESP-BOX 项目感兴趣,欢迎到论坛 [ESP-BOX 版块](https://www.esp32.com/viewforum.php?f=43)交流想法。
|
||||
|
||||
## 贡献示例
|
||||
|
||||
我们欢迎任何软件或硬件相关的开源贡献,如果您有任何要与我们分享的示例,请参考[贡献指南](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/contribute/index.html)后提交 [Pull Requests](https://github.com/espressif/esp-box/pulls) 贡献代码。
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
ALS
|
||||
ALS
|
||||
ANS
|
||||
ans
|
||||
co-ordinate
|
||||
co-ordinates
|
||||
compresed
|
||||
DOUT
|
||||
dout
|
||||
ERRO
|
||||
ges
|
||||
gien
|
||||
MOT
|
||||
regist
|
||||
ser
|
||||
TE
|
||||
uncompressible
|
||||
wHeigh
|
||||
@@ -1,36 +1,56 @@
|
||||
set(bsp_src "src/storage/bsp_sdcard.c")
|
||||
|
||||
message(STATUS "PROJECT_DIR: " ${PROJECT_DIR})
|
||||
string(REGEX MATCH "factory_demo" PROJECT_IS_FACTORY_DEMO "${PROJECT_DIR}")
|
||||
|
||||
if(EXISTS ${PROJECT_DIR}/sdkconfig)
|
||||
message(STATUS "use sdkconfig")
|
||||
file(READ ${PROJECT_DIR}/sdkconfig SDKCONFIG_RULE)
|
||||
string(REGEX MATCH "CONFIG_BSP_BOARD_ESP32_S3_BOX_Lite=y" CMAKE_TARGET_IS_BOX_LITE "${SDKCONFIG_RULE}")
|
||||
string(REGEX MATCH "CONFIG_BSP_BOARD_ESP32_S3_BOX=y" CMAKE_TARGET_IS_ESP_BOX "${SDKCONFIG_RULE}")
|
||||
else()
|
||||
message(STATUS "sdkconfig not exist")
|
||||
file(READ ${CMAKE_CURRENT_LIST_DIR}/Kconfig.projbuild SDKCONFIG_RULE)
|
||||
string(REGEX MATCH "default BSP_BOARD_ESP32_S3_BOX_Lite" CMAKE_TARGET_IS_BOX_LITE "${SDKCONFIG_RULE}")
|
||||
string(REGEX MATCH "default BSP_BOARD_ESP32_S3_BOX" CMAKE_TARGET_IS_ESP_BOX "${SDKCONFIG_RULE}")
|
||||
elseif(EXISTS ${PROJECT_DIR}/sdkconfig.defaults)
|
||||
message(STATUS "use sdkconfig.defaults")
|
||||
file(READ ${PROJECT_DIR}/sdkconfig.defaults SDKCONFIG_RULE)
|
||||
endif()
|
||||
|
||||
if (CMAKE_TARGET_IS_ESP_BOX)
|
||||
message(STATUS "PLATFORM ESP32_S3_BOX.")
|
||||
list(APPEND bsp_src "src/boards/esp32_s3_box.c")
|
||||
elseif (CMAKE_TARGET_IS_BOX_LITE)
|
||||
if(SDKCONFIG_RULE)
|
||||
string(REGEX MATCH "CONFIG_BSP_BOARD_ESP32_S3_BOX_Lite=y" COMPILER_TARGET_IS_BOX_LITE "${SDKCONFIG_RULE}")
|
||||
string(REGEX MATCH "CONFIG_BSP_BOARD_ESP32_S3_BOX=y" COMPILER_TARGET_IS_ESP_BOX "${SDKCONFIG_RULE}")
|
||||
string(REGEX MATCH "CONFIG_BSP_BOARD_ESP32_S3_BOX_3=y" COMPILER_TARGET_IS_ESP_BOX_3 "${SDKCONFIG_RULE}")
|
||||
endif()
|
||||
|
||||
if(NOT COMPILER_TARGET_IS_BOX_LITE AND NOT COMPILER_TARGET_IS_ESP_BOX AND NOT COMPILER_TARGET_IS_ESP_BOX_3)
|
||||
message(STATUS "use Kconfig.projbuild")
|
||||
file(READ ${CMAKE_CURRENT_LIST_DIR}/Kconfig.projbuild SDKCONFIG_RULE)
|
||||
string(REGEX MATCH "default BSP_BOARD_ESP32_S3_BOX_Lite" COMPILER_TARGET_IS_BOX_LITE "${SDKCONFIG_RULE}")
|
||||
string(REGEX MATCH "default BSP_BOARD_ESP32_S3_BOX_3" COMPILER_TARGET_IS_ESP_BOX_3 "${SDKCONFIG_RULE}")
|
||||
string(REGEX MATCH "default BSP_BOARD_ESP32_S3_\\bBOX\\b$" COMPILER_TARGET_IS_ESP_BOX "${SDKCONFIG_RULE}")
|
||||
endif()
|
||||
|
||||
if(COMPILER_TARGET_IS_ESP_BOX_3)
|
||||
message(STATUS "PLATFORM ESP32_S3_BOX_3.")
|
||||
set(box_alias "-3")
|
||||
elseif(COMPILER_TARGET_IS_BOX_LITE)
|
||||
message(STATUS "PLATFORM ESP32_S3_BOX_Lite.")
|
||||
list(APPEND bsp_src "src/boards/esp32_s3_box_lite.c")
|
||||
set(box_lite "-lite")
|
||||
set(box_alias "-lite")
|
||||
set(bsp_src "src/storage/bsp_sdcard.c")
|
||||
elseif(COMPILER_TARGET_IS_ESP_BOX)
|
||||
message(STATUS "PLATFORM ESP32_S3_BOX.")
|
||||
set(bsp_src "src/storage/bsp_sdcard.c")
|
||||
else()
|
||||
message(FATAL_ERROR "PLATFORM unknown.")
|
||||
endif()
|
||||
|
||||
set(priv_requires "esp-box${box_lite}")
|
||||
set(requires "driver" "fatfs")
|
||||
set(priv_requires "esp-box${box_alias}")
|
||||
|
||||
if (PROJECT_IS_FACTORY_DEMO AND COMPILER_TARGET_IS_ESP_BOX_3)
|
||||
list(APPEND priv_requires "aht20" "at581x")
|
||||
list(APPEND bsp_src "src/boards/esp32_bsp_sensor.c")
|
||||
else()
|
||||
list(APPEND bsp_src "src/boards/esp32_bsp_no_sensor.c")
|
||||
endif()
|
||||
|
||||
list(APPEND bsp_src "src/boards/esp32_bsp_board.c")
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${bsp_src}
|
||||
INCLUDE_DIRS
|
||||
"src/boards"
|
||||
"include"
|
||||
INCLUDE_DIRS "src/boards" "include"
|
||||
PRIV_INCLUDE_DIRS "priv_include"
|
||||
PRIV_REQUIRES ${priv_requires}
|
||||
REQUIRES ${requires})
|
||||
|
||||
@@ -1,18 +1,115 @@
|
||||
menu "HMI Board Config"
|
||||
|
||||
choice BSP_LCD_BOARD
|
||||
prompt "Select BSP board"
|
||||
default BSP_BOARD_ESP32_S3_BOX
|
||||
default BSP_BOARD_ESP32_S3_BOX_3
|
||||
|
||||
config BSP_BOARD_ESP32_S3_BOX
|
||||
bool "BSP board esp32_s3_box"
|
||||
bool "BSP board ESP32-S3-BOX"
|
||||
|
||||
config BSP_BOARD_ESP32_S3_BOX_Lite
|
||||
bool "BSP board esp32_s3_box_lite"
|
||||
bool "BSP board ESP32-S3-BOX-Lite"
|
||||
|
||||
config BSP_BOARD_ESP32_S3_BOX_3
|
||||
bool "BSP board ESP32-S3-BOX-3"
|
||||
|
||||
endchoice
|
||||
endmenu
|
||||
|
||||
menu "Power Save Configuration"
|
||||
depends on BSP_BOARD_ESP32_S3_BOX_3
|
||||
config EXAMPLE_WIFI_LISTEN_INTERVAL
|
||||
int "WiFi listen interval"
|
||||
default 3
|
||||
help
|
||||
Interval for station to listen to beacon from AP. The unit of listen interval is one beacon interval.
|
||||
For example, if beacon interval is 100 ms and listen interval is 3, the interval for station to listen
|
||||
to beacon is 300 ms.
|
||||
|
||||
config EXAMPLE_WIFI_BEACON_TIMEOUT
|
||||
int "WiFi beacon timeout"
|
||||
default 6
|
||||
range 6 30
|
||||
help
|
||||
For Station, If the station does not receive a beacon frame from the connected SoftAP during the
|
||||
inactive time, disconnect from SoftAP. Default 6s.
|
||||
|
||||
choice EXAMPLE_POWER_SAVE_MODE
|
||||
prompt "power save mode"
|
||||
default EXAMPLE_POWER_SAVE_MIN_MODEM
|
||||
help
|
||||
Power save mode for the esp32 to use. Modem sleep mode includes minimum and maximum power save modes.
|
||||
In minimum power save mode, station wakes up every DTIM to receive beacon. Broadcast data will not be
|
||||
lost because it is transmitted after DTIM. However, it can not save much more power if DTIM is short
|
||||
for DTIM is determined by AP.
|
||||
In maximum power save mode, station wakes up every listen interval to receive beacon. Broadcast data
|
||||
may be lost because station may be in sleep state at DTIM time. If listen interval is longer, more power
|
||||
is saved but broadcast data is more easy to lose.
|
||||
|
||||
config EXAMPLE_POWER_SAVE_NONE
|
||||
bool "none"
|
||||
config EXAMPLE_POWER_SAVE_MIN_MODEM
|
||||
bool "minimum modem"
|
||||
config EXAMPLE_POWER_SAVE_MAX_MODEM
|
||||
bool "maximum modem"
|
||||
endchoice
|
||||
|
||||
config BSP_TOUCH_BUTTON
|
||||
depends on BSP_BOARD_ESP32_S3_BOX
|
||||
bool "Enable esp32_s3_box touch button"
|
||||
default y
|
||||
choice EXAMPLE_MAX_CPU_FREQ
|
||||
prompt "Maximum CPU frequency"
|
||||
default EXAMPLE_MAX_CPU_FREQ_80
|
||||
depends on PM_ENABLE
|
||||
help
|
||||
Whether to enable the touch button.
|
||||
endmenu
|
||||
Maximum CPU frequency to use for dynamic frequency scaling.
|
||||
|
||||
config EXAMPLE_MAX_CPU_FREQ_80
|
||||
bool "80 MHz"
|
||||
config EXAMPLE_MAX_CPU_FREQ_120
|
||||
bool "120 MHz"
|
||||
depends on IDF_TARGET_ESP32C2
|
||||
config EXAMPLE_MAX_CPU_FREQ_160
|
||||
bool "160 MHz"
|
||||
depends on !IDF_TARGET_ESP32C2
|
||||
config EXAMPLE_MAX_CPU_FREQ_240
|
||||
bool "240 MHz"
|
||||
depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
||||
endchoice
|
||||
|
||||
config EXAMPLE_MAX_CPU_FREQ_MHZ
|
||||
int
|
||||
default 80 if EXAMPLE_MAX_CPU_FREQ_80
|
||||
default 120 if EXAMPLE_MAX_CPU_FREQ_120
|
||||
default 160 if EXAMPLE_MAX_CPU_FREQ_160
|
||||
default 240 if EXAMPLE_MAX_CPU_FREQ_240
|
||||
|
||||
choice EXAMPLE_MIN_CPU_FREQ
|
||||
prompt "Minimum CPU frequency"
|
||||
default EXAMPLE_MIN_CPU_FREQ_10M
|
||||
depends on PM_ENABLE
|
||||
help
|
||||
Minimum CPU frequency to use for dynamic frequency scaling.
|
||||
Should be set to XTAL frequency or XTAL frequency divided by integer.
|
||||
|
||||
config EXAMPLE_MIN_CPU_FREQ_40M
|
||||
bool "40 MHz (use with 40MHz XTAL)"
|
||||
depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO
|
||||
config EXAMPLE_MIN_CPU_FREQ_20M
|
||||
bool "20 MHz (use with 40MHz XTAL)"
|
||||
depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO
|
||||
config EXAMPLE_MIN_CPU_FREQ_10M
|
||||
bool "10 MHz (use with 40MHz XTAL)"
|
||||
depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO
|
||||
config EXAMPLE_MIN_CPU_FREQ_26M
|
||||
bool "26 MHz (use with 26MHz XTAL)"
|
||||
depends on XTAL_FREQ_26 || XTAL_FREQ_AUTO
|
||||
config EXAMPLE_MIN_CPU_FREQ_13M
|
||||
bool "13 MHz (use with 26MHz XTAL)"
|
||||
depends on XTAL_FREQ_26 || XTAL_FREQ_AUTO
|
||||
endchoice
|
||||
|
||||
config EXAMPLE_MIN_CPU_FREQ_MHZ
|
||||
int
|
||||
default 40 if EXAMPLE_MIN_CPU_FREQ_40M
|
||||
default 20 if EXAMPLE_MIN_CPU_FREQ_20M
|
||||
default 10 if EXAMPLE_MIN_CPU_FREQ_10M
|
||||
default 26 if EXAMPLE_MIN_CPU_FREQ_26M
|
||||
default 13 if EXAMPLE_MIN_CPU_FREQ_13M
|
||||
endmenu
|
||||
|
||||
@@ -1,10 +1,21 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
espressif/button: ^2
|
||||
|
||||
esp_codec_dev:
|
||||
public: true
|
||||
version: "1.1.0"
|
||||
|
||||
espressif/button:
|
||||
version: "^3.5.0"
|
||||
|
||||
espressif/esp-box:
|
||||
version: "3.*"
|
||||
version: "3.0.*"
|
||||
require: "no"
|
||||
|
||||
espressif/esp-box-lite:
|
||||
version: "2.0.*"
|
||||
require: "no"
|
||||
|
||||
espressif/esp-box-3:
|
||||
version: "1.1.*"
|
||||
require: "no"
|
||||
|
||||
@@ -10,34 +10,32 @@
|
||||
#include "esp_err.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "driver/spi_master.h"
|
||||
// #include "bsp/esp-bsp.h"
|
||||
#include "driver/i2s_std.h"
|
||||
|
||||
#include "bsp/esp-bsp.h"
|
||||
#include "iot_button.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
BOARD_S3_BOX,
|
||||
BOARD_S3_BOX_LITE,
|
||||
} boards_id_t;
|
||||
#define BSP_I2C_EXPAND_SCL (GPIO_NUM_40)
|
||||
#define BSP_I2C_EXPAND_SDA (GPIO_NUM_41)
|
||||
|
||||
#define BSP_RADAR_OUT_IO (GPIO_NUM_21)
|
||||
#define BSP_IR_CTRL_GPIO (GPIO_NUM_44)
|
||||
#define BSP_IR_TX_GPIO (GPIO_NUM_39)
|
||||
#define BSP_IR_RX_GPIO (GPIO_NUM_38)
|
||||
|
||||
typedef enum {
|
||||
#if CONFIG_BSP_BOARD_ESP32_S3_BOX
|
||||
BOARD_BTN_ID_BOOT = 0,
|
||||
BOARD_BTN_ID_MUTE,
|
||||
BOARD_BTN_ID_HOME,
|
||||
BOARD_BTN_ID_NUM
|
||||
#elif CONFIG_BSP_BOARD_ESP32_S3_BOX_Lite
|
||||
BOARD_BTN_ID_BOOT = 0,
|
||||
BOARD_BTN_ID_NUM
|
||||
#endif
|
||||
} bsp_button_id_t;
|
||||
BOTTOM_ID_SENSOR, /*!< bottom is ESP32-S3-BOX-3-SENSOR */
|
||||
BOTTOM_ID_UNKNOW, /*!< bottom isn't ESP32-S3-BOX-3-SENSOR */
|
||||
BOTTOM_ID_LOST, /*!< bottom ESP32-S3-BOX-3-SENSOR is connect when poweron, and lost */
|
||||
} bottom_id_t;
|
||||
|
||||
typedef struct {
|
||||
gpio_num_t row1[4]; //The first row
|
||||
gpio_num_t row2[4];
|
||||
gpio_num_t row1[4]; /*!< first row */
|
||||
gpio_num_t row2[4]; /*!< second row */
|
||||
} pmod_pins_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -90,40 +88,151 @@ typedef struct {
|
||||
|
||||
} board_res_desc_t;
|
||||
|
||||
typedef esp_err_t (*bsp_codec_reconfig_fn)();
|
||||
/**
|
||||
* @brief Get sleep mode
|
||||
*
|
||||
* @return
|
||||
* - true: sleep mode
|
||||
* - false: nornal mode
|
||||
*/
|
||||
typedef bool (*bsp_sys_get_sleep_mode)();
|
||||
|
||||
typedef esp_err_t (*bsp_codec_mute_fn)(bool enable);
|
||||
/**
|
||||
* @brief Get radar status
|
||||
*
|
||||
* @return
|
||||
* - true: active
|
||||
* - false: passive
|
||||
*/
|
||||
typedef bool (*bsp_bottom_get_radar_status)();
|
||||
|
||||
typedef esp_err_t (*bsp_codec_volume_fn)(int volume, int *volume_set);
|
||||
/**
|
||||
* @brief Set radar onoff
|
||||
*
|
||||
* @param enable: Enable or disable radar module
|
||||
*/
|
||||
typedef void (*bsp_bottom_set_radar_enable)(bool enable);
|
||||
|
||||
typedef esp_err_t (*bsp_i2s_reconfig_clk_fn)(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch);
|
||||
/**
|
||||
* @brief Get bottom status
|
||||
*
|
||||
* @return
|
||||
* - BOTTOM_ID_SENSOR: sensor bottom connected
|
||||
* - BOTTOM_ID_LOST: sensor bottom lost
|
||||
* - BOTTOM_ID_UNKNOW: unknow
|
||||
*/
|
||||
typedef bottom_id_t (*bsp_sys_get_bottom_id)();
|
||||
|
||||
typedef esp_err_t (*bsp_i2s_read_fn)(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms);
|
||||
/**
|
||||
* @brief Get temp and humidity data
|
||||
*
|
||||
* @param temperature: Output temperature
|
||||
* @param humidity: Output humidity
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: read successfully
|
||||
* - ESP_FAIL: read failed
|
||||
*/
|
||||
typedef esp_err_t (*bsp_bottom_get_humiture)(float *temperature, float *humidity);
|
||||
|
||||
typedef esp_err_t (*bsp_i2s_write_fn)(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms);
|
||||
/**
|
||||
* @brief Player set mute.
|
||||
*
|
||||
* @param enable: true or false
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Success
|
||||
* - Others: Fail
|
||||
*/
|
||||
esp_err_t bsp_codec_mute_set(bool enable);
|
||||
|
||||
/**
|
||||
* @brief Player set volume.
|
||||
*
|
||||
* @param volume: volume set
|
||||
* @param volume_set: volume set response
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Success
|
||||
* - Others: Fail
|
||||
*/
|
||||
esp_err_t bsp_codec_volume_set(int volume, int *volume_set);
|
||||
|
||||
/**
|
||||
* @brief Stop I2S function.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Success
|
||||
* - Others: Fail
|
||||
*/
|
||||
esp_err_t bsp_codec_dev_stop(void);
|
||||
|
||||
/**
|
||||
* @brief Resume I2S function.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Success
|
||||
* - Others: Fail
|
||||
*/
|
||||
esp_err_t bsp_codec_dev_resume(void);
|
||||
|
||||
/**
|
||||
* @brief Set I2S format to codec.
|
||||
*
|
||||
* @param rate: Sample rate of sample
|
||||
* @param bits_cfg: Bit lengths of one channel data
|
||||
* @param ch: Channels of sample
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Success
|
||||
* - Others: Fail
|
||||
*/
|
||||
esp_err_t bsp_codec_set_fs(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch);
|
||||
|
||||
/**
|
||||
* @brief Read data from recoder.
|
||||
*
|
||||
* @param audio_buffer: The pointer of receiving data buffer
|
||||
* @param len: Max data buffer length
|
||||
* @param bytes_read: Byte number that actually be read, can be NULL if not needed
|
||||
* @param timeout_ms: Max block time
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Success
|
||||
* - Others: Fail
|
||||
*/
|
||||
esp_err_t bsp_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms);
|
||||
|
||||
/**
|
||||
* @brief Write data to player.
|
||||
*
|
||||
* @param audio_buffer: The pointer of sent data buffer
|
||||
* @param len: Max data buffer length
|
||||
* @param bytes_written: Byte number that actually be sent, can be NULL if not needed
|
||||
* @param timeout_ms: Max block time
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Success
|
||||
* - Others: Fail
|
||||
*/
|
||||
esp_err_t bsp_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms);
|
||||
|
||||
typedef struct {
|
||||
bsp_codec_mute_fn mute_set_fn;
|
||||
bsp_codec_volume_fn volume_set_fn;
|
||||
bsp_codec_reconfig_fn codec_reconfig_fn;
|
||||
bsp_sys_get_sleep_mode get_sleep_mode;
|
||||
bsp_sys_get_bottom_id get_bottom_id;
|
||||
|
||||
bsp_i2s_read_fn i2s_read_fn;
|
||||
bsp_i2s_write_fn i2s_write_fn;
|
||||
bsp_i2s_reconfig_clk_fn i2s_reconfig_clk_fn;
|
||||
} bsp_codec_config_t;
|
||||
bsp_bottom_set_radar_enable set_radar_enable;
|
||||
bsp_bottom_get_radar_status get_radar_status;
|
||||
bsp_bottom_get_humiture get_humiture;
|
||||
} bsp_bottom_property_t;
|
||||
|
||||
typedef struct {
|
||||
boards_id_t id;
|
||||
const char *name;
|
||||
/**
|
||||
* @brief Get board description
|
||||
*/
|
||||
const board_res_desc_t *board_desc;
|
||||
|
||||
const board_res_desc_t *board_desc; /*!< Get board description */
|
||||
} boards_info_t;
|
||||
|
||||
/**
|
||||
* @brief Special config for dev board
|
||||
* @brief Special config for board
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Success
|
||||
@@ -146,11 +255,11 @@ const boards_info_t *bsp_board_get_info(void);
|
||||
const board_res_desc_t *bsp_board_get_description(void);
|
||||
|
||||
/**
|
||||
* @brief Get the codec operation function
|
||||
* @brief Get the sensor operation function
|
||||
*
|
||||
* @return pointer of bsp_codec_config
|
||||
* @return pointer of bsp_bottom_property_t
|
||||
*/
|
||||
bsp_codec_config_t *bsp_board_get_codec_handle(void);
|
||||
bsp_bottom_property_t *bsp_board_get_sensor_handle(void);
|
||||
|
||||
/**
|
||||
* @brief Call default button init code
|
||||
@@ -164,29 +273,39 @@ esp_err_t bsp_btn_init(void);
|
||||
/**
|
||||
* @brief Register the button event callback function.
|
||||
*
|
||||
* @param btn A button handle to register
|
||||
* @param event Button event
|
||||
* @param callback Callback function.
|
||||
* @param user_data user data
|
||||
* @param btn: A button handle to register
|
||||
* @param event: Button event
|
||||
* @param callback: Callback function.
|
||||
* @param user_data: user data
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK on success
|
||||
* - ESP_ERR_INVALID_ARG Arguments is invalid.
|
||||
*/
|
||||
esp_err_t bsp_btn_register_callback(bsp_button_id_t btn, button_event_t event, button_cb_t callback, void *user_data);
|
||||
esp_err_t bsp_btn_register_callback(bsp_button_t btn, button_event_t event, button_cb_t callback, void *user_data);
|
||||
|
||||
/**
|
||||
* @brief Unregister the button event callback function.
|
||||
*
|
||||
* @param btn A button handle to unregister
|
||||
* @param btn: A button handle to unregister
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK on success
|
||||
* - ESP_ERR_INVALID_ARG Arguments is invalid.
|
||||
*/
|
||||
esp_err_t bsp_btn_rm_all_callback(bsp_button_id_t btn);
|
||||
esp_err_t bsp_btn_rm_all_callback(bsp_button_t btn);
|
||||
|
||||
esp_err_t bsp_btn_rm_event_callback(bsp_button_id_t btn, size_t event);
|
||||
/**
|
||||
* @brief Unregister the button event callback function.
|
||||
*
|
||||
* @param btn: A button handle to unregister
|
||||
* @param event: Unregister event
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK on success
|
||||
* - ESP_ERR_INVALID_ARG Arguments is invalid.
|
||||
*/
|
||||
esp_err_t bsp_btn_rm_event_callback(bsp_button_t btn, size_t event);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief init sensor module
|
||||
*
|
||||
*/
|
||||
esp_err_t bsp_sensor_init(bsp_bottom_property_t *handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,257 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "esp_log.h"
|
||||
#include "esp_check.h"
|
||||
|
||||
#include "bsp/esp-bsp.h"
|
||||
#include "bsp_board.h"
|
||||
#include "bsp_board_priv.h"
|
||||
|
||||
#define CODEC_DEFAULT_SAMPLE_RATE (16000)
|
||||
#define CODEC_DEFAULT_BIT_WIDTH (16)
|
||||
#define CODEC_DEFAULT_ADC_VOLUME (24.0)
|
||||
#define CODEC_DEFAULT_CHANNEL (2)
|
||||
|
||||
static const pmod_pins_t g_pmod[2] = {
|
||||
{
|
||||
{BSP_PMOD2_IO5, BSP_PMOD2_IO6, BSP_PMOD2_IO7, BSP_PMOD2_IO8},
|
||||
{BSP_PMOD2_IO1, BSP_PMOD2_IO2, BSP_PMOD2_IO3, BSP_PMOD2_IO4},
|
||||
},
|
||||
{
|
||||
{BSP_PMOD1_IO5, BSP_PMOD1_IO6, BSP_PMOD1_IO7, BSP_PMOD1_IO8},
|
||||
{BSP_PMOD1_IO1, BSP_PMOD1_IO2, BSP_PMOD1_IO3, BSP_PMOD1_IO4},
|
||||
},
|
||||
};
|
||||
|
||||
static const board_res_desc_t g_board_box_res = {
|
||||
|
||||
.FUNC_SDMMC_EN = (1),
|
||||
.SDMMC_BUS_WIDTH = (4),
|
||||
.GPIO_SDMMC_CLK = (BSP_PMOD2_IO3),
|
||||
.GPIO_SDMMC_CMD = (BSP_PMOD2_IO2),
|
||||
.GPIO_SDMMC_D0 = (BSP_PMOD2_IO8),
|
||||
.GPIO_SDMMC_D1 = (BSP_PMOD2_IO4),
|
||||
.GPIO_SDMMC_D2 = (BSP_PMOD2_IO1),
|
||||
.GPIO_SDMMC_D3 = (BSP_PMOD2_IO5),
|
||||
.GPIO_SDMMC_DET = (GPIO_NUM_NC),
|
||||
|
||||
.FUNC_SDSPI_EN = (0),
|
||||
.SDSPI_HOST = (SPI2_HOST),
|
||||
.GPIO_SDSPI_CS = (GPIO_NUM_NC),
|
||||
.GPIO_SDSPI_SCLK = (GPIO_NUM_NC),
|
||||
.GPIO_SDSPI_MISO = (GPIO_NUM_NC),
|
||||
.GPIO_SDSPI_MOSI = (GPIO_NUM_NC),
|
||||
|
||||
.FUNC_SPI_EN = (0),
|
||||
.GPIO_SPI_CS = (GPIO_NUM_NC),
|
||||
.GPIO_SPI_MISO = (GPIO_NUM_NC),
|
||||
.GPIO_SPI_MOSI = (GPIO_NUM_NC),
|
||||
.GPIO_SPI_SCLK = (GPIO_NUM_NC),
|
||||
|
||||
.FUNC_RMT_EN = (0),
|
||||
.GPIO_RMT_IR = (GPIO_NUM_NC),
|
||||
.GPIO_RMT_LED = (GPIO_NUM_39),
|
||||
|
||||
.PMOD1 = &g_pmod[0],
|
||||
.PMOD2 = &g_pmod[1],
|
||||
};
|
||||
|
||||
static esp_codec_dev_handle_t play_dev_handle;
|
||||
static esp_codec_dev_handle_t record_dev_handle;
|
||||
|
||||
static button_handle_t *g_btn_handle = NULL;
|
||||
static bsp_bottom_property_t g_bottom_handle;
|
||||
|
||||
static const boards_info_t g_boards_info = {
|
||||
#ifdef CONFIG_BSP_BOARD_ESP32_S3_BOX_3
|
||||
.name = "S3_BOX_3",
|
||||
#elif CONFIG_BSP_BOARD_ESP32_S3_BOX
|
||||
.name = "S3_BOX",
|
||||
#else
|
||||
.name = "S3_BOX_LITE",
|
||||
#endif
|
||||
.board_desc = &g_board_box_res
|
||||
};
|
||||
|
||||
static const char *TAG = "bsp_board";
|
||||
|
||||
esp_err_t bsp_btn_init(void)
|
||||
{
|
||||
ESP_ERROR_CHECK((NULL != g_btn_handle));
|
||||
|
||||
int btn_num = 0;
|
||||
g_btn_handle = calloc(BSP_BUTTON_NUM, sizeof(button_handle_t));
|
||||
assert((g_btn_handle) && "memory is insufficient for button");
|
||||
esp_log_level_set("button", ESP_LOG_NONE);
|
||||
return bsp_iot_button_create(g_btn_handle, &btn_num, BSP_BUTTON_NUM);
|
||||
}
|
||||
|
||||
esp_err_t bsp_btn_register_callback(bsp_button_t btn, button_event_t event, button_cb_t callback, void *user_data)
|
||||
{
|
||||
assert((g_btn_handle) && "button not initialized");
|
||||
assert((btn < BSP_BUTTON_NUM) && "button id incorrect");
|
||||
|
||||
if (NULL == callback) {
|
||||
return iot_button_unregister_cb(g_btn_handle[btn], event);
|
||||
}
|
||||
return iot_button_register_cb(g_btn_handle[btn], event, callback, user_data);
|
||||
}
|
||||
|
||||
esp_err_t bsp_btn_rm_all_callback(bsp_button_t btn)
|
||||
{
|
||||
assert((g_btn_handle) && "button not initialized");
|
||||
assert((btn < BSP_BUTTON_NUM) && "button id incorrect");
|
||||
|
||||
for (size_t event = 0; event < BUTTON_EVENT_MAX; event++) {
|
||||
iot_button_unregister_cb(g_btn_handle[btn], event);
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t bsp_btn_rm_event_callback(bsp_button_t btn, size_t event)
|
||||
{
|
||||
assert((g_btn_handle) && "button not initialized");
|
||||
assert((btn < BSP_BUTTON_NUM) && "button id incorrect");
|
||||
|
||||
iot_button_unregister_cb(g_btn_handle[btn], event);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t bsp_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
ret = esp_codec_dev_read(record_dev_handle, audio_buffer, len);
|
||||
*bytes_read = len;
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp_err_t bsp_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
ret = esp_codec_dev_write(play_dev_handle, audio_buffer, len);
|
||||
*bytes_written = len;
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp_err_t bsp_codec_set_fs(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
esp_codec_dev_sample_info_t fs = {
|
||||
.sample_rate = rate,
|
||||
.channel = ch,
|
||||
.bits_per_sample = bits_cfg,
|
||||
};
|
||||
|
||||
if (play_dev_handle) {
|
||||
ret = esp_codec_dev_close(play_dev_handle);
|
||||
}
|
||||
if (record_dev_handle) {
|
||||
ret |= esp_codec_dev_close(record_dev_handle);
|
||||
ret |= esp_codec_dev_set_in_gain(record_dev_handle, CODEC_DEFAULT_ADC_VOLUME);
|
||||
}
|
||||
|
||||
if (play_dev_handle) {
|
||||
ret |= esp_codec_dev_open(play_dev_handle, &fs);
|
||||
}
|
||||
if (record_dev_handle) {
|
||||
ret |= esp_codec_dev_open(record_dev_handle, &fs);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp_err_t bsp_codec_volume_set(int volume, int *volume_set)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
float v = volume;
|
||||
ret = esp_codec_dev_set_out_vol(play_dev_handle, (int)v);
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp_err_t bsp_codec_mute_set(bool enable)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
ret = esp_codec_dev_set_out_mute(play_dev_handle, enable);
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp_err_t bsp_codec_dev_stop(void)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
if (play_dev_handle) {
|
||||
ret = esp_codec_dev_close(play_dev_handle);
|
||||
}
|
||||
|
||||
if (record_dev_handle) {
|
||||
ret = esp_codec_dev_close(record_dev_handle);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp_err_t bsp_codec_dev_resume(void)
|
||||
{
|
||||
return bsp_codec_set_fs(CODEC_DEFAULT_SAMPLE_RATE, CODEC_DEFAULT_BIT_WIDTH, CODEC_DEFAULT_CHANNEL);
|
||||
}
|
||||
|
||||
static esp_err_t bsp_codec_init()
|
||||
{
|
||||
play_dev_handle = bsp_audio_codec_speaker_init();
|
||||
assert((play_dev_handle) && "play_dev_handle not initialized");
|
||||
|
||||
record_dev_handle = bsp_audio_codec_microphone_init();
|
||||
assert((record_dev_handle) && "record_dev_handle not initialized");
|
||||
|
||||
bsp_codec_set_fs(CODEC_DEFAULT_SAMPLE_RATE, CODEC_DEFAULT_BIT_WIDTH, CODEC_DEFAULT_CHANNEL);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
const boards_info_t *bsp_board_get_info(void)
|
||||
{
|
||||
return &g_boards_info;
|
||||
}
|
||||
|
||||
const board_res_desc_t *bsp_board_get_description(void)
|
||||
{
|
||||
return g_boards_info.board_desc;
|
||||
}
|
||||
|
||||
bsp_bottom_property_t *bsp_board_get_sensor_handle(void)
|
||||
{
|
||||
return &g_bottom_handle;
|
||||
}
|
||||
|
||||
__attribute__((weak)) void mute_btn_handler(void *handle, void *arg)
|
||||
{
|
||||
button_event_t event = (button_event_t)arg;
|
||||
|
||||
if (BUTTON_PRESS_DOWN == event) {
|
||||
esp_rom_printf(DRAM_STR("Mute On\r\n"));
|
||||
} else {
|
||||
esp_rom_printf(DRAM_STR("Mute Off\r\n"));
|
||||
}
|
||||
}
|
||||
|
||||
esp_err_t bsp_board_init(void)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
ESP_LOGD(TAG, "Board init");
|
||||
|
||||
ESP_ERROR_CHECK(bsp_btn_init());
|
||||
#if !CONFIG_BSP_BOARD_ESP32_S3_BOX_Lite
|
||||
ESP_ERROR_CHECK(bsp_btn_register_callback(BSP_BUTTON_MUTE, BUTTON_PRESS_DOWN, mute_btn_handler, (void *)BUTTON_PRESS_DOWN));
|
||||
ESP_ERROR_CHECK(bsp_btn_register_callback(BSP_BUTTON_MUTE, BUTTON_PRESS_UP, mute_btn_handler, (void *)BUTTON_PRESS_UP));
|
||||
#endif
|
||||
|
||||
ESP_ERROR_CHECK(bsp_codec_init());
|
||||
bsp_sensor_init(&g_bottom_handle);
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "esp_log.h"
|
||||
#include "esp_check.h"
|
||||
#include "bsp_board.h"
|
||||
|
||||
static const char *TAG = "bsp_sensor";
|
||||
|
||||
static bool bsp_get_sleep_mode()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static bottom_id_t bsp_get_bottom_id()
|
||||
{
|
||||
return BOTTOM_ID_UNKNOW;
|
||||
}
|
||||
|
||||
static bool bsp_sensor_get_radar_status()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static void bsp_sensor_set_radar_enable(bool enable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_sensor_get_humiture(float *temperature, float *humidity)
|
||||
{
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
esp_err_t bsp_sensor_init(bsp_bottom_property_t *handle)
|
||||
{
|
||||
ESP_LOGW(TAG, "This example don't support Sensor!!");
|
||||
|
||||
handle->get_sleep_mode = bsp_get_sleep_mode;
|
||||
handle->get_bottom_id = bsp_get_bottom_id;
|
||||
handle->get_radar_status = bsp_sensor_get_radar_status;
|
||||
handle->set_radar_enable = bsp_sensor_set_radar_enable;
|
||||
handle->get_humiture = bsp_sensor_get_humiture;
|
||||
|
||||
return ESP_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "esp_log.h"
|
||||
#include "esp_check.h"
|
||||
#include "esp_pm.h"
|
||||
|
||||
#include "bsp_board.h"
|
||||
#include "aht20.h"
|
||||
#include "at581x.h"
|
||||
|
||||
#define BSP_I2C_EXPAND_NUM ((1 == BSP_I2C_NUM) ? (0):(1))
|
||||
#define BSP_I2C_EXPAND_CLK_SPEED_HZ CONFIG_BSP_I2C_CLK_SPEED_HZ
|
||||
|
||||
#define RADAE_POWER_DELAY (60 * 2) // 2min
|
||||
#define RADAE_FUNC_STOP (RADAE_POWER_DELAY + 1)
|
||||
|
||||
static bool sys_sleep_entered = false;
|
||||
static bottom_id_t sys_bottom_id;
|
||||
|
||||
static float sys_temp_result;
|
||||
static float sys_RH_result;
|
||||
static uint16_t power_off_delay;
|
||||
|
||||
static aht20_dev_handle_t aht20 = NULL;
|
||||
static esp_pm_lock_handle_t g_pm_apb_lock = NULL;
|
||||
static esp_pm_lock_handle_t g_pm_light_lock = NULL;
|
||||
static esp_pm_lock_handle_t g_pm_cpu_lock = NULL;
|
||||
|
||||
static const char *TAG = "bsp_sensor";
|
||||
|
||||
static esp_err_t bsp_pm_init();
|
||||
static esp_err_t bsp_pm_exit_sleep();
|
||||
static esp_err_t bsp_pm_enter_sleep();
|
||||
|
||||
static bool bsp_i2c_device_probe(i2c_port_t i2c_num, uint8_t addr);
|
||||
|
||||
static bool bsp_get_sleep_mode()
|
||||
{
|
||||
return sys_sleep_entered;
|
||||
}
|
||||
|
||||
static bottom_id_t bsp_get_bottom_id()
|
||||
{
|
||||
return sys_bottom_id;
|
||||
}
|
||||
|
||||
static bool bsp_sensor_get_radar_status()
|
||||
{
|
||||
if (BOTTOM_ID_SENSOR == sys_bottom_id) {
|
||||
return ((power_off_delay > RADAE_POWER_DELAY / 2) ? (true) : (false));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static void bsp_sensor_set_radar_onoff(bool enable)
|
||||
{
|
||||
if (enable) {
|
||||
power_off_delay = RADAE_POWER_DELAY;
|
||||
} else {
|
||||
power_off_delay = RADAE_FUNC_STOP;
|
||||
}
|
||||
}
|
||||
|
||||
static esp_err_t bsp_sensor_get_humiture(float *temperature, float *humidity)
|
||||
{
|
||||
if (BOTTOM_ID_SENSOR == sys_bottom_id) {
|
||||
*temperature = sys_temp_result;
|
||||
*humidity = sys_RH_result;
|
||||
return ESP_OK;
|
||||
} else {
|
||||
return ESP_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
static void low_power_monitor_task(void *arg)
|
||||
{
|
||||
static uint8_t gpio_level_prev = 1;
|
||||
uint32_t temp_raw, RH_raw;
|
||||
uint8_t gpio_level;
|
||||
|
||||
gpio_config_t io_conf = {};
|
||||
io_conf.intr_type = GPIO_INTR_POSEDGE;
|
||||
io_conf.pin_bit_mask = (1ULL << BSP_RADAR_OUT_IO);
|
||||
io_conf.mode = GPIO_MODE_INPUT;
|
||||
io_conf.pull_up_en = 1;
|
||||
gpio_config(&io_conf);
|
||||
vTaskDelay(pdMS_TO_TICKS(1500));
|
||||
|
||||
while (1) {
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
|
||||
if (sys_bottom_id != BOTTOM_ID_UNKNOW) {
|
||||
sys_bottom_id = (bsp_i2c_device_probe(BSP_I2C_EXPAND_NUM, AT581X_ADDRRES_0)) ? BOTTOM_ID_SENSOR : BOTTOM_ID_LOST;
|
||||
}
|
||||
|
||||
if (BOTTOM_ID_SENSOR == sys_bottom_id) {
|
||||
gpio_level = gpio_get_level(BSP_RADAR_OUT_IO);
|
||||
if ((RADAE_FUNC_STOP != power_off_delay) && power_off_delay) {
|
||||
power_off_delay--;
|
||||
}
|
||||
aht20_read_temperature_humidity(aht20, &temp_raw, &sys_temp_result, &RH_raw, &sys_RH_result);
|
||||
} else {
|
||||
gpio_level = 1;
|
||||
}
|
||||
|
||||
if (gpio_level_prev ^ gpio_level) {
|
||||
gpio_level_prev = gpio_level;
|
||||
if (gpio_level && (RADAE_FUNC_STOP != power_off_delay)) {
|
||||
power_off_delay = RADAE_POWER_DELAY;
|
||||
ESP_LOGD(TAG, "Radar: %s", "active");
|
||||
}
|
||||
}
|
||||
|
||||
if ((gpio_level) && (true == sys_sleep_entered)) {
|
||||
bsp_pm_exit_sleep();
|
||||
|
||||
ESP_LOGD(TAG, "power on");
|
||||
bsp_display_exit_sleep();
|
||||
|
||||
lvgl_port_resume();
|
||||
iot_button_resume();
|
||||
bsp_codec_dev_resume();
|
||||
sys_sleep_entered = false;
|
||||
} else if ((1 == power_off_delay) && (BOTTOM_ID_SENSOR == sys_bottom_id)) {
|
||||
ESP_LOGD(TAG, "power off");
|
||||
sys_sleep_entered = true;
|
||||
bsp_display_enter_sleep();
|
||||
|
||||
lvgl_port_stop();
|
||||
iot_button_stop();
|
||||
bsp_codec_dev_stop();
|
||||
bsp_pm_enter_sleep();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static esp_err_t bsp_init_temp_humudity()
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
aht20_i2c_config_t i2c_conf = {
|
||||
.i2c_port = BSP_I2C_EXPAND_NUM,
|
||||
.i2c_addr = AHT20_ADDRRES_0,
|
||||
};
|
||||
|
||||
ret |= aht20_new_sensor(&i2c_conf, &aht20);
|
||||
if (ret == ESP_OK) {
|
||||
ESP_LOGI(TAG, "Temp & humidity init ok");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_init_radar()
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
at581x_dev_handle_t at581x = NULL;
|
||||
|
||||
at581x_default_cfg_t def_cfg = ATH581X_INITIALIZATION_CONFIG();
|
||||
|
||||
at581x_i2c_config_t i2c_conf = {
|
||||
.i2c_port = BSP_I2C_EXPAND_NUM,
|
||||
.i2c_addr = AT581X_ADDRRES_0,
|
||||
.def_conf = &def_cfg,
|
||||
};
|
||||
|
||||
ret |= at581x_new_sensor(&i2c_conf, &at581x);
|
||||
if (ret == ESP_OK) {
|
||||
ESP_LOGI(TAG, "Radar init ok");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_pm_exit_sleep()
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
ret |= esp_pm_lock_acquire(g_pm_apb_lock);
|
||||
ret |= esp_pm_lock_acquire(g_pm_light_lock);
|
||||
ret |= esp_pm_lock_acquire(g_pm_cpu_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_pm_enter_sleep()
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
ret |= esp_pm_lock_release(g_pm_apb_lock);
|
||||
ret |= esp_pm_lock_release(g_pm_light_lock);
|
||||
ret |= esp_pm_lock_release(g_pm_cpu_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_pm_init()
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
#if CONFIG_PM_ENABLE
|
||||
esp_pm_config_t pm_config = {
|
||||
.max_freq_mhz = CONFIG_EXAMPLE_MAX_CPU_FREQ_MHZ,
|
||||
.min_freq_mhz = CONFIG_EXAMPLE_MIN_CPU_FREQ_MHZ,
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
.light_sleep_enable = true
|
||||
#endif
|
||||
};
|
||||
ESP_ERROR_CHECK(esp_pm_configure(&pm_config));
|
||||
#endif
|
||||
|
||||
if (g_pm_apb_lock == NULL) {
|
||||
ESP_RETURN_ON_ERROR(esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "l_apb", &g_pm_apb_lock),
|
||||
TAG, "create l_apb pm lock failed");
|
||||
}
|
||||
|
||||
if (g_pm_light_lock == NULL) {
|
||||
ESP_RETURN_ON_ERROR(esp_pm_lock_create(ESP_PM_NO_LIGHT_SLEEP, 0, "l_ls", &g_pm_light_lock),
|
||||
TAG, "create l_ls pm lock failed");
|
||||
}
|
||||
if (g_pm_cpu_lock == NULL) {
|
||||
ESP_RETURN_ON_ERROR(esp_pm_lock_create(ESP_PM_CPU_FREQ_MAX, 0, "l_cpu", &g_pm_cpu_lock),
|
||||
TAG, "create l_cpu pm lock failed");
|
||||
}
|
||||
bsp_pm_exit_sleep();
|
||||
|
||||
ret = xTaskCreatePinnedToCore(&low_power_monitor_task, "Lowpower Task", 4 * 1024, NULL, 5, NULL, 1);
|
||||
ESP_RETURN_ON_ERROR(pdPASS != ret, TAG, "create Lowpower task failed");
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool bsp_i2c_device_probe(i2c_port_t i2c_num, uint8_t addr)
|
||||
{
|
||||
bool probe_result = false;
|
||||
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
|
||||
i2c_master_start(cmd);
|
||||
i2c_master_write_byte(cmd, addr | I2C_MASTER_WRITE, true);
|
||||
i2c_master_stop(cmd);
|
||||
if (i2c_master_cmd_begin(i2c_num, cmd, 2000) == ESP_OK) {
|
||||
probe_result = true;
|
||||
}
|
||||
i2c_cmd_link_delete(cmd);
|
||||
return probe_result;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_i2c_expand_init(void)
|
||||
{
|
||||
static bool i2c_initialized = false;
|
||||
|
||||
/* I2C was initialized before */
|
||||
if (i2c_initialized) {
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
const i2c_config_t i2c_expand_conf = {
|
||||
.mode = I2C_MODE_MASTER,
|
||||
.sda_io_num = BSP_I2C_EXPAND_SDA,
|
||||
.sda_pullup_en = GPIO_PULLUP_DISABLE,
|
||||
.scl_io_num = BSP_I2C_EXPAND_SCL,
|
||||
.scl_pullup_en = GPIO_PULLUP_DISABLE,
|
||||
.master.clk_speed = BSP_I2C_EXPAND_CLK_SPEED_HZ
|
||||
};
|
||||
ESP_RETURN_ON_ERROR(i2c_param_config(BSP_I2C_EXPAND_NUM, &i2c_expand_conf),
|
||||
TAG, "create expand i2c failed");
|
||||
ESP_RETURN_ON_ERROR(i2c_driver_install(BSP_I2C_EXPAND_NUM, i2c_expand_conf.mode, 0, 0, 0),
|
||||
TAG, "install expand i2c failed");
|
||||
|
||||
i2c_initialized = true;
|
||||
|
||||
ESP_LOGI(TAG, "I2C num: %d, [%d, %d], speed:%d",
|
||||
BSP_I2C_EXPAND_NUM, BSP_I2C_EXPAND_SCL, BSP_I2C_EXPAND_SDA, BSP_I2C_EXPAND_CLK_SPEED_HZ);
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_i2c_expand_deinit(void)
|
||||
{
|
||||
ESP_RETURN_ON_ERROR(i2c_driver_delete(BSP_I2C_EXPAND_NUM),
|
||||
TAG, "uninstall expand i2c failed");
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t bsp_sensor_init(bsp_bottom_property_t *handle)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
ret |= bsp_pm_init();
|
||||
ret |= bsp_i2c_expand_init();
|
||||
|
||||
if (bsp_i2c_device_probe(BSP_I2C_EXPAND_NUM, AT581X_ADDRRES_0)) {
|
||||
ESP_LOGW(TAG, "Sensor bottom connected");
|
||||
ret |= bsp_init_radar();
|
||||
ret |= bsp_init_temp_humudity();
|
||||
sys_bottom_id = BOTTOM_ID_SENSOR;
|
||||
} else {
|
||||
ESP_LOGW(TAG, "Sensor bottom lost");
|
||||
sys_bottom_id = BOTTOM_ID_UNKNOW;
|
||||
bsp_i2c_expand_deinit();
|
||||
}
|
||||
|
||||
handle->get_sleep_mode = bsp_get_sleep_mode;
|
||||
handle->get_bottom_id = bsp_get_bottom_id;
|
||||
handle->get_radar_status = bsp_sensor_get_radar_status;
|
||||
handle->set_radar_enable = bsp_sensor_set_radar_onoff;
|
||||
handle->get_humiture = bsp_sensor_get_humiture;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1,308 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "esp_log.h"
|
||||
#include "esp_check.h"
|
||||
|
||||
#include "bsp/esp-bsp.h"
|
||||
#include "bsp_board.h"
|
||||
#include "iot_button.h"
|
||||
|
||||
#define ES8311_SAMPLE_RATE (16000)
|
||||
#define ES8311_DEFAULT_VOLUME (60)
|
||||
|
||||
#define ES7210_SAMPLE_RATE (16000)
|
||||
#define ES7210_BIT_WIDTH (16)
|
||||
#define ES7210_ADC_VOLUME (24.0)
|
||||
#define ES7210_CHANNEL (2)
|
||||
|
||||
static uint8_t bsp_home_button_get(void *param);
|
||||
|
||||
static const pmod_pins_t g_pmod[2] = {
|
||||
{
|
||||
{BSP_PMOD2_IO5, BSP_PMOD2_IO6, BSP_PMOD2_IO7, BSP_PMOD2_IO8},
|
||||
{BSP_PMOD2_IO1, BSP_PMOD2_IO2, BSP_PMOD2_IO3, BSP_PMOD2_IO4},
|
||||
},
|
||||
{
|
||||
{BSP_PMOD1_IO5, BSP_PMOD1_IO6, BSP_PMOD1_IO7, BSP_PMOD1_IO8},
|
||||
{BSP_PMOD1_IO1, BSP_PMOD1_IO2, BSP_PMOD1_IO3, BSP_PMOD1_IO4},
|
||||
},
|
||||
};
|
||||
|
||||
static const board_res_desc_t g_board_s3_box_res = {
|
||||
|
||||
.FUNC_SDMMC_EN = (1),
|
||||
.SDMMC_BUS_WIDTH = (4),
|
||||
.GPIO_SDMMC_CLK = (BSP_PMOD2_IO3),
|
||||
.GPIO_SDMMC_CMD = (BSP_PMOD2_IO2),
|
||||
.GPIO_SDMMC_D0 = (BSP_PMOD2_IO8),
|
||||
.GPIO_SDMMC_D1 = (BSP_PMOD2_IO4),
|
||||
.GPIO_SDMMC_D2 = (BSP_PMOD2_IO1),
|
||||
.GPIO_SDMMC_D3 = (BSP_PMOD2_IO5),
|
||||
.GPIO_SDMMC_DET = (GPIO_NUM_NC),
|
||||
|
||||
.FUNC_SDSPI_EN = (0),
|
||||
.SDSPI_HOST = (SPI2_HOST),
|
||||
.GPIO_SDSPI_CS = (GPIO_NUM_NC),
|
||||
.GPIO_SDSPI_SCLK = (GPIO_NUM_NC),
|
||||
.GPIO_SDSPI_MISO = (GPIO_NUM_NC),
|
||||
.GPIO_SDSPI_MOSI = (GPIO_NUM_NC),
|
||||
|
||||
.FUNC_SPI_EN = (0),
|
||||
.GPIO_SPI_CS = (GPIO_NUM_NC),
|
||||
.GPIO_SPI_MISO = (GPIO_NUM_NC),
|
||||
.GPIO_SPI_MOSI = (GPIO_NUM_NC),
|
||||
.GPIO_SPI_SCLK = (GPIO_NUM_NC),
|
||||
|
||||
.FUNC_RMT_EN = (0),
|
||||
.GPIO_RMT_IR = (GPIO_NUM_NC),
|
||||
.GPIO_RMT_LED = (GPIO_NUM_39),
|
||||
|
||||
.PMOD1 = &g_pmod[0],
|
||||
.PMOD2 = &g_pmod[1],
|
||||
};
|
||||
|
||||
static const button_config_t BOARD_BTN_ID_config[BOARD_BTN_ID_NUM] = {
|
||||
{
|
||||
.type = BUTTON_TYPE_GPIO,
|
||||
.gpio_button_config.active_level = false,
|
||||
.gpio_button_config.gpio_num = BOARD_BTN_ID_BOOT,
|
||||
},
|
||||
{
|
||||
.type = BUTTON_TYPE_GPIO,
|
||||
.gpio_button_config.active_level = false,
|
||||
.gpio_button_config.gpio_num = BOARD_BTN_ID_MUTE,
|
||||
},
|
||||
{
|
||||
.type = BUTTON_TYPE_CUSTOM,
|
||||
.custom_button_config.priv = NULL,
|
||||
.custom_button_config.button_custom_get_key_value = bsp_home_button_get,
|
||||
.custom_button_config.active_level = true,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
static esp_codec_dev_handle_t play_dev_handle;
|
||||
static esp_codec_dev_handle_t record_dev_handle;
|
||||
|
||||
static button_handle_t *g_btn_handle = NULL;
|
||||
static bsp_codec_config_t g_codec_handle;
|
||||
|
||||
static const boards_info_t g_boards_info = {
|
||||
.id = BOARD_S3_BOX,
|
||||
.name = "S3_BOX",
|
||||
.board_desc = &g_board_s3_box_res
|
||||
};
|
||||
|
||||
static const char *TAG = "board";
|
||||
|
||||
static uint8_t bsp_home_button_get(void *param)
|
||||
{
|
||||
#if CONFIG_BSP_TOUCH_BUTTON
|
||||
return bsp_button_get(BSP_BUTTON_MAIN);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
esp_err_t bsp_btn_init(void)
|
||||
{
|
||||
ESP_ERROR_CHECK((NULL != g_btn_handle));
|
||||
|
||||
g_btn_handle = calloc(sizeof(button_handle_t), BOARD_BTN_ID_NUM);
|
||||
assert((g_btn_handle) && "memory is insufficient for button");
|
||||
|
||||
ESP_LOGI(TAG, "[+ Btn Init] ID");
|
||||
/* Init buttons */
|
||||
for (int i = 0; i < BOARD_BTN_ID_NUM; i++) {
|
||||
g_btn_handle[i] = iot_button_create(&BOARD_BTN_ID_config[i]);
|
||||
assert(g_btn_handle[i]);
|
||||
}
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t bsp_btn_register_callback(bsp_button_id_t btn, button_event_t event, button_cb_t callback, void *user_data)
|
||||
{
|
||||
assert((g_btn_handle) && "button not initialized");
|
||||
assert((btn < BOARD_BTN_ID_NUM) && "button id incorrect");
|
||||
|
||||
ESP_LOGI(TAG, "[+ register] ID:%d, event:%d", btn, event);
|
||||
|
||||
if (NULL == callback) {
|
||||
return iot_button_unregister_cb(g_btn_handle[btn], event);
|
||||
}
|
||||
|
||||
return iot_button_register_cb(g_btn_handle[btn], event, callback, user_data);
|
||||
}
|
||||
|
||||
esp_err_t bsp_btn_rm_all_callback(bsp_button_id_t btn)
|
||||
{
|
||||
assert((g_btn_handle) && "button not initialized");
|
||||
assert((btn < BOARD_BTN_ID_NUM) && "button id incorrect");
|
||||
|
||||
ESP_LOGI(TAG, "[- register] ID:%d", btn);
|
||||
|
||||
for (size_t event = 0; event < BUTTON_EVENT_MAX; event++) {
|
||||
iot_button_unregister_cb(g_btn_handle[btn], event);
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t bsp_btn_rm_event_callback(bsp_button_id_t btn, size_t event)
|
||||
{
|
||||
assert((g_btn_handle) && "button not initialized");
|
||||
assert((btn < BOARD_BTN_ID_NUM) && "button id incorrect");
|
||||
|
||||
iot_button_unregister_cb(g_btn_handle[btn], event);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
ret = esp_codec_dev_read(record_dev_handle, audio_buffer, len);
|
||||
*bytes_read = len;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
ret = esp_codec_dev_write(play_dev_handle, audio_buffer, len);
|
||||
*bytes_written = len;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_codec_es8311_set(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
esp_codec_dev_sample_info_t fs = {
|
||||
.sample_rate = rate,
|
||||
.channel = ch,
|
||||
.bits_per_sample = bits_cfg,
|
||||
};
|
||||
|
||||
ret = esp_codec_dev_close(play_dev_handle);
|
||||
ret = esp_codec_dev_close(record_dev_handle);
|
||||
|
||||
ret = esp_codec_dev_open(play_dev_handle, &fs);
|
||||
ret = esp_codec_dev_open(record_dev_handle, &fs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_codec_volume_set(int volume, int *volume_set)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
float v = volume;
|
||||
ret = esp_codec_dev_set_out_vol(play_dev_handle, (int)v);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_codec_mute_set(bool enable)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
ret = esp_codec_dev_set_out_mute(play_dev_handle, enable);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_codec_es7210_set()
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
esp_codec_dev_sample_info_t fs = {
|
||||
.sample_rate = ES7210_SAMPLE_RATE,
|
||||
.channel = ES7210_CHANNEL,
|
||||
.bits_per_sample = ES7210_BIT_WIDTH,
|
||||
};
|
||||
|
||||
assert(record_dev_handle);
|
||||
|
||||
if (play_dev_handle) {
|
||||
ret = esp_codec_dev_close(play_dev_handle);
|
||||
}
|
||||
|
||||
if (record_dev_handle) {
|
||||
ret = esp_codec_dev_close(record_dev_handle);
|
||||
}
|
||||
ret = esp_codec_dev_open(record_dev_handle, &fs);
|
||||
esp_codec_dev_set_in_gain(record_dev_handle, ES7210_ADC_VOLUME);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void bsp_codec_init()
|
||||
{
|
||||
play_dev_handle = bsp_audio_codec_speaker_init();
|
||||
assert((play_dev_handle) && "play_dev_handle not initialized");
|
||||
|
||||
record_dev_handle = bsp_audio_codec_microphone_init();
|
||||
assert((record_dev_handle) && "record_dev_handle not initialized");
|
||||
|
||||
bsp_codec_es7210_set();
|
||||
bsp_codec_es8311_set(ES7210_SAMPLE_RATE, ES7210_BIT_WIDTH, ES7210_CHANNEL);
|
||||
|
||||
bsp_codec_config_t *codec_config = bsp_board_get_codec_handle();
|
||||
codec_config->volume_set_fn = bsp_codec_volume_set;
|
||||
codec_config->mute_set_fn = bsp_codec_mute_set;
|
||||
codec_config->codec_reconfig_fn = bsp_codec_es7210_set;
|
||||
codec_config->i2s_read_fn = bsp_i2s_read;
|
||||
codec_config->i2s_write_fn = bsp_i2s_write;
|
||||
codec_config->i2s_reconfig_clk_fn = bsp_codec_es8311_set;
|
||||
}
|
||||
|
||||
__attribute__((weak)) void mute_btn_handler(void *handle, void *arg)
|
||||
{
|
||||
button_event_t event = (button_event_t)arg;
|
||||
|
||||
if (BUTTON_PRESS_DOWN == event) {
|
||||
esp_rom_printf(DRAM_STR("Mute On\r\n"));
|
||||
} else {
|
||||
esp_rom_printf(DRAM_STR("Mute Off\r\n"));
|
||||
}
|
||||
}
|
||||
|
||||
esp_err_t bsp_board_s3_box_init(void)
|
||||
{
|
||||
bsp_btn_init();
|
||||
bsp_btn_register_callback(BOARD_BTN_ID_MUTE, BUTTON_PRESS_DOWN, mute_btn_handler, (void *)BUTTON_PRESS_DOWN);
|
||||
bsp_btn_register_callback(BOARD_BTN_ID_MUTE, BUTTON_PRESS_UP, mute_btn_handler, (void *)BUTTON_PRESS_UP);
|
||||
|
||||
/**
|
||||
* @brief Initialize I2S and audio codec
|
||||
*
|
||||
* @note Actually the sampling rate can be reconfigured.
|
||||
* `MP3GetLastFrameInfo` can fill the `MP3FrameInfo`, which includes `samprate`.
|
||||
* So theoretically, the sampling rate can be dynamically changed according to the MP3 frame information.
|
||||
*/
|
||||
bsp_codec_init();
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
const boards_info_t *bsp_board_get_info(void)
|
||||
{
|
||||
return &g_boards_info;
|
||||
}
|
||||
|
||||
const board_res_desc_t *bsp_board_get_description(void)
|
||||
{
|
||||
return g_boards_info.board_desc;
|
||||
}
|
||||
|
||||
bsp_codec_config_t *bsp_board_get_codec_handle(void)
|
||||
{
|
||||
return &g_codec_handle;
|
||||
}
|
||||
|
||||
esp_err_t bsp_board_init(void)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
ret |= bsp_board_s3_box_init();
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1,256 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "esp_log.h"
|
||||
#include "esp_check.h"
|
||||
|
||||
#include "bsp/esp-bsp.h"
|
||||
|
||||
#include "bsp_board.h"
|
||||
#include "iot_button.h"
|
||||
|
||||
#define es8156_SAMPLE_RATE (16000)
|
||||
#define es8156_DEFAULT_VOLUME (60)
|
||||
|
||||
#define ES7243_SAMPLE_RATE (16000)
|
||||
#define ES7243_BIT_WIDTH (16)
|
||||
#define ES7243_ADC_VOLUME (24.0)
|
||||
#define ES7243_CHANNEL (2)
|
||||
|
||||
static const pmod_pins_t g_pmod[2] = {
|
||||
{
|
||||
{BSP_PMOD2_IO5, BSP_PMOD2_IO6, BSP_PMOD2_IO7, BSP_PMOD2_IO8},
|
||||
{BSP_PMOD2_IO1, BSP_PMOD2_IO2, BSP_PMOD2_IO3, BSP_PMOD2_IO4},
|
||||
},
|
||||
{
|
||||
{BSP_PMOD1_IO5, BSP_PMOD1_IO6, BSP_PMOD1_IO7, BSP_PMOD1_IO8},
|
||||
{BSP_PMOD1_IO1, BSP_PMOD1_IO2, BSP_PMOD1_IO3, BSP_PMOD1_IO4},
|
||||
},
|
||||
};
|
||||
|
||||
static const board_res_desc_t g_board_s3_box_lite_res = {
|
||||
|
||||
.FUNC_SDMMC_EN = (1),
|
||||
.SDMMC_BUS_WIDTH = (4),
|
||||
.GPIO_SDMMC_CLK = (GPIO_NUM_13),
|
||||
.GPIO_SDMMC_CMD = (GPIO_NUM_11),
|
||||
.GPIO_SDMMC_D0 = (GPIO_NUM_14),
|
||||
.GPIO_SDMMC_D1 = (GPIO_NUM_12),
|
||||
.GPIO_SDMMC_D2 = (GPIO_NUM_10),
|
||||
.GPIO_SDMMC_D3 = (GPIO_NUM_9),
|
||||
.GPIO_SDMMC_DET = (GPIO_NUM_NC),
|
||||
|
||||
.FUNC_SDSPI_EN = (0),
|
||||
.SDSPI_HOST = (SPI2_HOST),
|
||||
.GPIO_SDSPI_CS = (GPIO_NUM_NC),
|
||||
.GPIO_SDSPI_SCLK = (GPIO_NUM_NC),
|
||||
.GPIO_SDSPI_MISO = (GPIO_NUM_NC),
|
||||
.GPIO_SDSPI_MOSI = (GPIO_NUM_NC),
|
||||
|
||||
.FUNC_SPI_EN = (0),
|
||||
.GPIO_SPI_CS = (GPIO_NUM_NC),
|
||||
.GPIO_SPI_MISO = (GPIO_NUM_NC),
|
||||
.GPIO_SPI_MOSI = (GPIO_NUM_NC),
|
||||
.GPIO_SPI_SCLK = (GPIO_NUM_NC),
|
||||
|
||||
.FUNC_RMT_EN = (0),
|
||||
.GPIO_RMT_IR = (GPIO_NUM_NC),
|
||||
.GPIO_RMT_LED = (GPIO_NUM_39),
|
||||
|
||||
.PMOD1 = &g_pmod[0],
|
||||
.PMOD2 = &g_pmod[1],
|
||||
};
|
||||
|
||||
|
||||
const button_config_t BOARD_BTN_ID_config[BOARD_BTN_ID_NUM] = {
|
||||
{
|
||||
.type = BUTTON_TYPE_GPIO,
|
||||
.gpio_button_config.active_level = false,
|
||||
.gpio_button_config.gpio_num = BOARD_BTN_ID_BOOT,
|
||||
},
|
||||
};
|
||||
|
||||
static esp_codec_dev_handle_t play_dev_handle;
|
||||
static esp_codec_dev_handle_t record_dev_handle;
|
||||
|
||||
static button_handle_t *g_btn_handle = NULL;
|
||||
static bsp_codec_config_t g_codec_handle;
|
||||
|
||||
static const boards_info_t g_boards_info = {
|
||||
.id = BOARD_S3_BOX_LITE,
|
||||
.name = "S3_BOX_LITE",
|
||||
.board_desc = &g_board_s3_box_lite_res
|
||||
};
|
||||
|
||||
static const char *TAG = "board";
|
||||
|
||||
esp_err_t bsp_btn_init(void)
|
||||
{
|
||||
ESP_ERROR_CHECK((NULL != g_btn_handle));
|
||||
|
||||
g_btn_handle = calloc(sizeof(button_handle_t), BOARD_BTN_ID_NUM);
|
||||
assert((g_btn_handle) && "memory is insufficient for button");
|
||||
|
||||
ESP_LOGI(TAG, "[+ Btn Init] ID");
|
||||
/* Init buttons */
|
||||
for (int i = 0; i < BOARD_BTN_ID_NUM; i++) {
|
||||
g_btn_handle[i] = iot_button_create(&BOARD_BTN_ID_config[i]);
|
||||
assert(g_btn_handle[i]);
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t bsp_btn_register_callback(bsp_button_id_t btn, button_event_t event, button_cb_t callback, void *user_data)
|
||||
{
|
||||
assert((g_btn_handle) && "button not initialized");
|
||||
assert((btn < BOARD_BTN_ID_NUM) && "button id incorrect");
|
||||
|
||||
ESP_LOGI(TAG, "[+ register] ID:%d, event:%d", btn, event);
|
||||
|
||||
if (NULL == callback) {
|
||||
return iot_button_unregister_cb(g_btn_handle[btn], event);
|
||||
}
|
||||
|
||||
return iot_button_register_cb(g_btn_handle[btn], event, callback, user_data);
|
||||
}
|
||||
|
||||
esp_err_t bsp_btn_rm_all_callback(bsp_button_id_t btn)
|
||||
{
|
||||
assert((g_btn_handle) && "button not initialized");
|
||||
assert((btn < BOARD_BTN_ID_NUM) && "button id incorrect");
|
||||
|
||||
ESP_LOGI(TAG, "[- register] ID:%d", btn);
|
||||
|
||||
for (size_t event = 0; event < BUTTON_EVENT_MAX; event++) {
|
||||
iot_button_unregister_cb(g_btn_handle[btn], event);
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t bsp_btn_rm_event_callback(bsp_button_id_t btn, size_t event)
|
||||
{
|
||||
assert((g_btn_handle) && "button not initialized");
|
||||
assert((btn < BOARD_BTN_ID_NUM) && "button id incorrect");
|
||||
|
||||
iot_button_unregister_cb(g_btn_handle[btn], event);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
ret = esp_codec_dev_read(record_dev_handle, audio_buffer, len);
|
||||
*bytes_read = len;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
ret = esp_codec_dev_write(play_dev_handle, audio_buffer, len);
|
||||
*bytes_written = len;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_codec_es8156_set(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
esp_codec_dev_sample_info_t fs = {
|
||||
.sample_rate = rate,
|
||||
.channel = ch,
|
||||
.bits_per_sample = bits_cfg,
|
||||
};
|
||||
|
||||
ret = esp_codec_dev_close(play_dev_handle);
|
||||
ret = esp_codec_dev_close(record_dev_handle);
|
||||
|
||||
ret = esp_codec_dev_open(play_dev_handle, &fs);
|
||||
ret = esp_codec_dev_open(record_dev_handle, &fs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_codec_volume_set(int volume, int *volume_set)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
float v = volume;
|
||||
ret = esp_codec_dev_set_out_vol(play_dev_handle, (int)v);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_codec_mute_set(bool enable)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
ret = esp_codec_dev_set_out_mute(play_dev_handle, enable);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static esp_err_t bsp_codec_es7243_set()
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
esp_codec_dev_sample_info_t fs = {
|
||||
.sample_rate = ES7243_SAMPLE_RATE,
|
||||
.channel = ES7243_CHANNEL,
|
||||
.bits_per_sample = ES7243_BIT_WIDTH,
|
||||
};
|
||||
|
||||
assert(record_dev_handle);
|
||||
ret = esp_codec_dev_open(record_dev_handle, &fs);
|
||||
esp_codec_dev_set_in_gain(record_dev_handle, ES7243_ADC_VOLUME);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void bsp_codec_init()
|
||||
{
|
||||
play_dev_handle = bsp_audio_codec_speaker_init();
|
||||
assert((play_dev_handle) && "play_dev_handle not initialized");
|
||||
|
||||
record_dev_handle = bsp_audio_codec_microphone_init();
|
||||
assert((record_dev_handle) && "record_dev_handle not initialized");
|
||||
|
||||
bsp_codec_es7243_set();
|
||||
bsp_codec_es8156_set(ES7243_SAMPLE_RATE, ES7243_BIT_WIDTH, ES7243_CHANNEL);
|
||||
|
||||
bsp_codec_config_t *codec_config = bsp_board_get_codec_handle();
|
||||
codec_config->volume_set_fn = bsp_codec_volume_set;
|
||||
codec_config->mute_set_fn = bsp_codec_mute_set;
|
||||
codec_config->codec_reconfig_fn = bsp_codec_es7243_set;
|
||||
codec_config->i2s_read_fn = bsp_i2s_read;
|
||||
codec_config->i2s_write_fn = bsp_i2s_write;
|
||||
codec_config->i2s_reconfig_clk_fn = bsp_codec_es8156_set;
|
||||
}
|
||||
|
||||
esp_err_t bsp_board_s3_box_lite_init(void)
|
||||
{
|
||||
bsp_btn_init();
|
||||
bsp_codec_init();
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
const boards_info_t *bsp_board_get_info(void)
|
||||
{
|
||||
return &g_boards_info;
|
||||
}
|
||||
|
||||
const board_res_desc_t *bsp_board_get_description(void)
|
||||
{
|
||||
return g_boards_info.board_desc;
|
||||
}
|
||||
|
||||
bsp_codec_config_t *bsp_board_get_codec_handle(void)
|
||||
{
|
||||
return &g_codec_handle;
|
||||
}
|
||||
|
||||
esp_err_t bsp_board_init(void)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
ret |= bsp_board_s3_box_lite_init();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 241 KiB |
|
After Width: | Height: | Size: 2.9 MiB |
|
After Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 9.2 MiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 429 KiB After Width: | Height: | Size: 756 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 146 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 4.4 MiB |
|
Before Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 210 KiB |
|
After Width: | Height: | Size: 242 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 133 KiB |
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 123 KiB |
|
After Width: | Height: | Size: 142 KiB |
|
After Width: | Height: | Size: 922 KiB |
|
After Width: | Height: | Size: 376 KiB |
|
After Width: | Height: | Size: 267 KiB |
|
After Width: | Height: | Size: 295 KiB |
|
After Width: | Height: | Size: 337 KiB |
|
After Width: | Height: | Size: 388 KiB |
|
After Width: | Height: | Size: 184 KiB |
|
After Width: | Height: | Size: 163 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 105 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 270 KiB |
|
After Width: | Height: | Size: 354 KiB |
|
After Width: | Height: | Size: 3.2 MiB |
|
After Width: | Height: | Size: 312 KiB |
|
After Width: | Height: | Size: 4.9 MiB |
|
After Width: | Height: | Size: 5.4 MiB |
|
After Width: | Height: | Size: 5.2 MiB |
|
After Width: | Height: | Size: 4.8 MiB |
|
After Width: | Height: | Size: 5.3 MiB |
|
After Width: | Height: | Size: 5.4 MiB |
|
After Width: | Height: | Size: 5.6 MiB |
|
After Width: | Height: | Size: 6.2 MiB |
|
After Width: | Height: | Size: 5.9 MiB |
|
After Width: | Height: | Size: 5.9 MiB |
|
After Width: | Height: | Size: 922 KiB |
|
After Width: | Height: | Size: 141 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 446 KiB |
|
After Width: | Height: | Size: 304 KiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 250 KiB |
@@ -111,7 +111,7 @@ Includes the following components:
|
||||
|
||||
**bsp_board.c** is the system call file used to be compatible with different hardware platforms. Currently, the box project supports two hardware platforms: [BOARD_S3_BOX](./hardware_overview/esp32_s3_box/hardware_overview_for_box.md) and [BOARD_S3_BOX_LITE](./hardware_overview/esp32_s3_box_lite/hardware_overview_for_lite.md). After the system initialization, based on the different device addresses detected by IIC, it determines the current hardware platform and calls different hardware initialization interfaces accordingly.
|
||||
|
||||
**esp32_s3_box.c** and **esp32_s3_box_lite.c** are the specific hardware pin configurations and initialization implementations for `BOARD_S3_BOX` and `BOARD_S3_BOX_LITE`, respectively. Users need to manually select the hardware platform they are running on in menuconfig to invoke the corresponding hardware initialization interface.
|
||||
**esp32_s3_box.c** and **esp32_s3_box_lite.c** are the specific hardware pin configurations and initialization implementations for `BOARD_S3_BOX` and `BOARD_S3_BOX_LITE`, respectively.
|
||||
|
||||
- codec
|
||||
|
||||
|
||||
@@ -112,7 +112,9 @@ idf.py -p PORT flash monitor
|
||||
### bsp 组件
|
||||
- boards
|
||||
|
||||
**esp32_s3_box.c** 和 **esp32_s3_box_lite.c** 分别是 `BOARD_S3_BOX` 和 `BOARD_S3_BOX_LITE` 的具体硬件管脚配置和初始化实现。用户需要在 menuconfig 中手动选择当前运行在哪个硬件平台,以分别调用不同的硬件初始化接口。
|
||||
**bsp_board.c** 是系统调用文件,用以兼容不同硬件平台,目前 box 工程支持 [BOARD_S3_BOX](hardware_overview/esp32_s3_box/hardware_overview_for_box_cn.md) 和 [BOARD_S3_BOX_LITE](hardware_overview/esp32_s3_box_lite/hardware_overview_for_lite_cn.md) 两个硬件平台。系统初始化后,根据 iic detect 到的不同器件地址判断当前运行在哪个硬件平台,以分别调用不同的硬件初始化接口。
|
||||
|
||||
**esp32_s3_box.c** 和 **esp32_s3_box_lite.c** 分别是 `BOARD_S3_BOX` 和 `BOARD_S3_BOX_LITE` 的具体硬件管脚配置和初始化实现。
|
||||
|
||||
- codec
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
# ESP32-S3-BOX Disassembly Tutorial
|
||||
|
||||
The case of the BOX series products have three different versions. Please match the corresponding disassembly tutorial according to the appearance of your product.
|
||||
|
||||
| Version | Tutorial |Note|
|
||||
| :-----: | :---------------------: |:---------------------: |
|
||||
| ESP32-S3-BOX V1 <img src="_static/disassembly_pictures/figure_10.png" width="350px"/> | [Disassembly Tutorial for ESP32-S3-BOX V1](hardware_overview/esp32_s3_box/disassembly_tutorial_v1.md) | Not available |
|
||||
| ESP32-S3-BOX V2 <img src="_static/disassembly_pictures_v2/figure_10.png" width="350px"/> | [Disassembly Tutorial for ESP32-S3-BOX V2](hardware_overview/esp32_s3_box/disassembly_tutorial_v2.md) |Not available|
|
||||
| ESP32-S3-BOX-Lite <img src="_static/lite_back.png" width="350px"/> | Please refer to ESP32-S3-BOX V2 as they are similar in structure.|On sale now|
|
||||
# ESP32-S3-BOX Disassembly Tutorial
|
||||
|
||||
The case of the BOX series products have three different versions. Please match the corresponding disassembly tutorial according to the appearance of your product.
|
||||
|
||||
| Version | Tutorial |Note|
|
||||
| :-----: | :---------------------: |:---------------------: |
|
||||
| ESP32-S3-BOX V1 <img src="_static/disassembly_pictures/figure_10.png" width="350px"/> | [Disassembly Tutorial for ESP32-S3-BOX V1](hardware_overview/esp32_s3_box/disassembly_tutorial_v1.md) | Not available |
|
||||
| ESP32-S3-BOX V2 <img src="_static/disassembly_pictures_v2/figure_10.png" width="350px"/> | [Disassembly Tutorial for ESP32-S3-BOX V2](hardware_overview/esp32_s3_box/disassembly_tutorial_v2.md) |Not available|
|
||||
| ESP32-S3-BOX-Lite <img src="_static/lite_back.png" width="350px"/> | Please refer to ESP32-S3-BOX V2 as they are similar in structure.|On sale now|
|
||||
| ESP32-S3-BOX-3 <img src="_static/box_3_back.png" width="430px"/> |[Disassembly Tutorial for ESP32-S3-BOX-3](hardware_overview/esp32_s3_box_3/disassembly_tutorial_3.md)|On sale now|
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Updating Firmware
|
||||
|
||||
**Warning:**
|
||||
> The firmware released in the latest Tag branch (Version v0.5.0) is only applicable to ESP32-S3-BOX and ESP32-S3-BOX-Lite. We suggest that users update the firmware via Espressif's online firmware flashing tool **[ESP Launchpad](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://raw.githubusercontent.com/espressif/esp-box/master/launch.toml)**.
|
||||
> The firmware released in the latest Tag branch ([Version v0.5.0](https://github.com/espressif/esp-box/releases)) is only applicable to ESP32-S3-BOX and ESP32-S3-BOX-Lite. For users who have purchased ESP32-S3-BOX-3, we will release firmware updates during the project's progression. We suggest that users update the firmware via Espressif's online firmware flashing tool **[ESP Launchpad](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://espressif.github.io/esp-box/launchpad.toml)**.
|
||||
|
||||
The BOX series development boards support updating firmware through USB. To update firmware, you only need:
|
||||
|
||||
@@ -29,23 +29,23 @@ For the latest firmware, please go to https://github.com/espressif/esp-box/relea
|
||||
|
||||
Please follow the link below corresponding to your OS to update the firmware.
|
||||
|
||||
| [<center> ESP Launchpad </center>](#Updating-Firmware-with-ESP-Launchpad) | [<center> Windows </center>](#Updating-Firmware-for-Windows) | [<center> Linux </center>](#Updating-Firmware-for-Linux) | [<center> macOS </center>](#Updating-Firmware-for-macOS) |
|
||||
| [<center> ESP Launchpad </center>](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://espressif.github.io/esp-box/launchpad.toml) | [<center> Windows </center>](#Updating-Firmware-for-Windows) | [<center> Linux </center>](#Updating-Firmware-for-Linux) | [<center> macOS </center>](#Updating-Firmware-for-macOS) |
|
||||
|:----:|:----:|:----:|:----:|
|
||||
|<img alt="Try it with ESP Launchpad" src="https://espressif.github.io/esp-launchpad/assets/try_with_launchpad.png" width="200" height="56"> | [<img src="_static/windows-logo.png" width="40" align="center" />](#Updating-Firmware-for-Windows) | [<img src="_static/linux-logo.png" width="40" align="center" />](#Updating-Firmware-for-Linux) | [<img src="_static/macos-logo.jpg" width="40" align="center" />](#Updating-Firmware-for-macOS) |
|
||||
|
||||
### Updating Firmware with ESP-Launchpad (Recommended)
|
||||
|
||||
ESP Launchpad is a web based tool, available for flashing firmware application to the ESP32 device connected via USB serial port. You can just click [here](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://raw.githubusercontent.com/espressif/esp-box/master/launch.toml) to start.
|
||||
ESP Launchpad is a web based tool, available for flashing firmware application to the ESP32 device connected via USB serial port. You can just click [here](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://espressif.github.io/esp-box/launchpad.toml) to start.
|
||||
|
||||
1. Connect your development board to the computer through a USB Type-C cable.
|
||||
2. `Connect` the device device follow indicated steps in the figure below.
|
||||
2. `Connect` the device follow indicated steps in the figure below.
|
||||
3. Choose a bin from `Select Application` and click `Flash` to update.
|
||||
|
||||
<div align="center">
|
||||
<img src="_static/launchpad_en.png" width="580">
|
||||
</div>
|
||||
|
||||
### Updating Firmware for Windows
|
||||
### Updating Firmware for Windows
|
||||
|
||||
We recommend using `Windows 10` and above. Under `Windows 10` system, the driver of `USB-Serial-Jtag` will be downloaded automatically. If you use `Windows 7`, please download and install [USB-Serial-JTAG drive](https://dl.espressif.com/dl/idf-driver/idf-driver-esp32-usb-jtag-2021-07-15.zip) manually.
|
||||
|
||||
@@ -79,7 +79,7 @@ We recommend using `Windows 10` and above. Under `Windows 10` system, the driver
|
||||
<img src="_static/dl_tool_windows_3.png" width="300">
|
||||
</div>
|
||||
|
||||
### Updating Firmware for Linux
|
||||
### Updating Firmware for Linux
|
||||
|
||||
1. [Download the latest firmware](#latest-firmware-download).
|
||||
2. Connect your development board to the computer through a USB Type-C cable. There is no need to install the driver of `USB-Serial-Jtag` under Linux system.
|
||||
@@ -99,7 +99,7 @@ We recommend using `Windows 10` and above. Under `Windows 10` system, the driver
|
||||
python -m esptool --chip esp32s3 write_flash 0x0 download_path/test_bin.bin
|
||||
```
|
||||
|
||||
1. `0x0` is the fixed flash address.
|
||||
1. `0x0` is the fixed flash address.
|
||||
2. `download_path/test_bin.bin` should be replaced with your firmware path and name.
|
||||
|
||||
5. After the firmware is updated, the download tool will prompt `Hash of data verified`. Next, **please press the `Reset` button to run the new firmware!**
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# 更新固件
|
||||
**警告:**
|
||||
> 当前 Tag 分支 (最新 Tag v0.5.0)发布的固件仅适用于 ESP32-S3-BOX 和 ESP32-S3-BOX-Lite。我们推荐用户通过乐鑫在线固件烧录工具 **[ESP Launchpad](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://raw.githubusercontent.com/espressif/esp-box/master/launch.toml)** 来更新固件。
|
||||
> 当前 Tag 分支 (最新 [Tag v0.5.0](https://github.com/espressif/esp-box/releases))发布的固件仅适用于 ESP32-S3-BOX 和 ESP32-S3-BOX-Lite,对于购买了 ESP32-S3-BOX-3 用户,在项目进展期间我们会发布可更新的固件。我们推荐用户通过乐鑫在线固件烧录工具 **[ESP Launchpad](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://espressif.github.io/esp-box/launchpad.toml)** 来更新固件。
|
||||
|
||||
BOX 系列开发板支持使用 USB 接口更新固件,您仅需要准备:
|
||||
1. 一根 USB Type-C 数据线
|
||||
@@ -27,13 +27,13 @@ BOX 系列开发板支持使用 USB 接口更新固件,您仅需要准备:
|
||||
|
||||
不同操作系统的固件更新方法,请参考以下链接:
|
||||
|
||||
| [<center> ESP Launchpad </center>](#ESP-Launchpad-更新固件说明) | [<center> Windows </center>](#windows-系统更新固件说明) | [<center> Linux </center>](#linux-系统更新固件说明) | [<center> macOS </center>](#macos-系统更新固件说明) |
|
||||
| [<center> ESP Launchpad </center>](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://espressif.github.io/esp-box/launchpad.toml) | [<center> Windows </center>](#windows-系统更新固件说明) | [<center> Linux </center>](#linux-系统更新固件说明) | [<center> macOS </center>](#macos-系统更新固件说明) |
|
||||
|:----:|:----:|:----:|:----:|
|
||||
|[<img alt="Try it with ESP Launchpad" src="https://espressif.github.io/esp-launchpad/assets/try_with_launchpad.png" width="200" height="56">](#ESP-Launchpad-更新固件说明) | [<img src="_static/windows-logo.png" width="40" align="center" />](#windows-系统更新固件说明) | [<img src="_static/linux-logo.png" width="40" align="center" />](#linux-系统更新固件说明) | [<img src="_static/macos-logo.jpg" width="40" align="center" />](#macos-系统更新固件说明) |
|
||||
|
||||
### ESP-Launchpad 更新固件说明
|
||||
|
||||
ESP Launchpad 是一个基于 web 的 ESP32 固件下载工具,用户可以通过 USB 接口直接在[网页](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://raw.githubusercontent.com/espressif/esp-box/master/launch.toml)上操作。
|
||||
ESP Launchpad 是一个基于 web 的 ESP32 固件下载工具,用户可以通过 USB 接口直接在[网页](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://espressif.github.io/esp-box/launchpad.toml)上操作。
|
||||
|
||||
1. 使用 USB Type-C 数据线将开发板接入电脑。
|
||||
2. 如下图所示,点击 `Connect` 选择并连接设备。
|
||||
@@ -64,7 +64,7 @@ ESP Launchpad 是一个基于 web 的 ESP32 固件下载工具,用户可以通
|
||||
|
||||
6. 请按照下图指示配置下载工具:
|
||||
1. 首先选择 `xxxx.bin` 路径,将地址设置为 `0x0`。
|
||||
2. 选择下载端口 COMX,此电脑为 `COM2`。
|
||||
2. 选择下载端口 COMX,此电脑为 `COM2`。
|
||||
3. 点击 `START` 开始固件下载。
|
||||
|
||||
<div align="center">
|
||||
|
||||
@@ -1,63 +1,92 @@
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/started_banner.png" width="700px">
|
||||
</div>
|
||||
|
||||
* [中文版本](./getting_started_cn.md)
|
||||
|
||||
The guide is applicable to ESP32-S3-BOX Kits and ESP32-S3-BOX-Lite Kits with the latest version of firmware flashed. They are collectively referred to as BOX series of development boards in this guide.
|
||||
The guide is applicable to ESP32-S3-BOX-3 only. For the user guide to the ESP32-S3-BOX and ESP32-S3-BOX-Lite built-in firmware, please refer to the [latest release Tag branch](https://github.com/espressif/esp-box/blob/v0.5.0/docs/getting_started.md).
|
||||
|
||||
|
||||
# Overview
|
||||
|
||||
In a world where innovation combines with artistry, where sharing and collaboration are paramount, we introduce the ESP32-S3-BOX-3, a fully open-source AIoT development kit based on the powerful ESP32-S3 SoC. This next-generation tool brings a positive change to traditional development boards, it features a compact and beautiful enclosure also provides rich assemblies, empowering developers to easily customize and expand its functionality with Espressif trusted software solutions such as ESP-BOX, ESP-SR, ESP-Rainmaker and ESP-Matter. Whether you're prototyping a new project or building a complex IoT system, the ESP32-S3-BOX-3 strikes the perfect balance of form and function, propelling the future of development board ecology.
|
||||
|
||||
The ESP32-S3-BOX-3 comes with pre-built firmware supporting offline voice wake-up and speech recognition in both Chinese and English. The ESP-BOX mobile APP facilitates reconfigurable AI voice interaction, enabling you to create personalized commands for controlling smart devices. Furthermore, the firmware showcases various sensor demos and enables users to perform IR learning, transforming the box into a controller for in-house air conditioners.
|
||||
|
||||
This guide provides a comprehensive overview of the built-in firmware's capabilities to get you started on your journey. As you read through, you'll gain valuable experience on developing your applications independently. Let's embark on this exciting adventure together!
|
||||
|
||||
# Target Group
|
||||
The target group for this product includes individuals and organizations engaged in making, prototyping, and development activities. It is designed to cater to a wide range of users, such as hobbyists, makers, engineers, educators, and professionals seeking versatile and expandable solutions for their projects.
|
||||
|
||||
# Target Application
|
||||
* Smart Home
|
||||
* Smart Agriculture
|
||||
* Smart City
|
||||
* Energy Management
|
||||
* IoT Prototyping and Education
|
||||
* Industrial Internet of Things
|
||||
* Smart Retail
|
||||
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/application.png" width="700px">
|
||||
</div>
|
||||
|
||||
# Getting Started
|
||||
|
||||
The BOX series of development boards integrated with ESP32-S3 SoCs provide a platform for users to develop the control system of smart home appliances, using the voice assistance + touch screen controller, sensor, infrared remote controller, and intelligent Wi-Fi gateway. The BOX series of development boards come with the pre-built firmware that supports voice wake-up and offline speech recognition both in Chinese and English. The ESP-BOX SDK features reconfigurable AI voice interaction, allowing you to customize commands to control home appliances. This guide briefly introduces what you can do with the latest version of firmware to help you get started. After you read through the guide, you may start developing an application by yourself. Now, let’s begin!
|
||||
|
||||
**The BOX Kit contains:**
|
||||
|
||||
| ESP32-S3-BOX | ESP32-S3-BOX-Lite |
|
||||
| :-----: | :---------------------: |
|
||||
| A main unit that can work on its own | A main unit that can work on its own|
|
||||
| An RGB LED module and Dupont wires for testing | An RGB LED module and Dupont wires for testing|
|
||||
| Dock, an accessory that serves as a stand for the main unit | N/A|
|
||||
|
||||
**Required Hardware:**
|
||||
|
||||
Please find yourself a USB-C cable.
|
||||
|
||||
## Connect the RGB LED Module to Your Device
|
||||
|
||||
Please refer to the pin definition below, and connect the RGB LED module to the BOX using DuPont wires. The module has four male pins, R, G, B, and GND. Please connect them to the female ports G39, G40, G41, and GND on PMOD 1.
|
||||
|
||||
## Contents of the Kit
|
||||
### ESP32-S3-BOX-3 Kit
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/hardware_pmod.png">
|
||||
<img src="./_static/_get_started_static/ESP32_S3_BOX_3_KitFigure.png" width="700px">
|
||||
</div>
|
||||
|
||||
- ESP32-S3-BOX-3, a main unit that can work on its own
|
||||
- ESP32-S3-BOX-3-DOCK, a functional accessory serving as a stand for the main box
|
||||
- ESP32-S3-BOX-3-SENSOR, a functional accessory showcasing sensor applications
|
||||
- ESP32-S3-BOX-3-BRACKET, an adapter accessory for mounting the main box to other devices
|
||||
- ESP32-S3-BOX-3-BREAD, an adapter accessory facilitating easy connection of the main box to a standard breadboard
|
||||
- A USB-C Power Cable
|
||||
- An RGB LED module and Dupont wires for testing
|
||||
|
||||
### ESP32-S3-BOX-3B Kit
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/ESP32_S3_BOX_3B_KitFigure.png" width="700px">
|
||||
</div>
|
||||
|
||||
- ESP32-S3-BOX-3, a main unit that can work on its own
|
||||
- ESP32-S3-BOX-3-DOCK, a functional accessory serving as a stand for the main box
|
||||
- A USB-C Power Cable
|
||||
- An RGB LED module and Dupont wires for testing
|
||||
|
||||
## Variant Description
|
||||
The ESP32-S3-BOX-3 offers two different versions: ESP32-S3-BOX-3 and ESP32-S3-BOX-3B. The ESP32-S3-BOX-3 represents the standard edition with four blue accessories, the ESP32-S3-BOX-3B provides fewer accessories to meet starters who don’t need much unnecessary hardware. Here are the distinctions between the two versions:
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/ESP32_S3_BOX_3_Compare.jpg" width="700px">
|
||||
</div>
|
||||
|
||||
## Power on Your Device
|
||||
1. Power on your device using the USB-C cable.
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/usb_power.png" width="800px">
|
||||
<img src="./_static/_get_started_static/usb_power_box.png" width="800px">
|
||||
</div>
|
||||
|
||||
2. Once the device is powered on, the screen will play the Espressif logo boot animation.
|
||||
2. Once the device is powered on, the screen will play the Espressif logo boot animation.
|
||||
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/boot_animation.png" width="700px">
|
||||
<img src="./_static/_get_started_static/boot_animation.png" width="500px">
|
||||
</div>
|
||||
|
||||
## Let's Play Around!
|
||||
|
||||
1. The first two pages of the quick guide introduce what the buttons do on your BOX series of development boards. Tap `Next` to go to the next page.
|
||||
1. The initial two pages of the quick guide provide an overview of the functions of the buttons on your BOX. Press the `Next` button to proceed to the subsequent page.
|
||||
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
<td><b>ESP32-S3-BOX </b></td>
|
||||
<td><b>ESP32-S3-BOX-Lite </b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="./_static/_get_started_static/0.png" width="300px"/></td>
|
||||
<td><img src="./_static/_get_started_static/1.png" width="300px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="./_static/_get_started_static/2.png" width="280px"/></td>
|
||||
<td><img src="./_static/_get_started_static/2.png" width="280px"/></td>
|
||||
<td><img src="./_static/_get_started_static/0.png"></td>
|
||||
<td><img src="./_static/_get_started_static/2.png"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
2. The last two pages of the quick guide introduces how to use AI voice control. Tap `OK Let’s Go` to enter the menu.
|
||||
2. The subsequent pages of the quick guide introduce how to use AI voice control. Tap `OK Let’s Go` to access the menu.
|
||||
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
@@ -66,7 +95,7 @@ Please refer to the pin definition below, and connect the RGB LED module to the
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
3. There are five options in the menu: `Device Control`, `Network`, `Media Player`, `Help`, and `About Us`. You can navigate to different options by swiping left and right. For example, enter `Device Control` screen, tap `Light` to turn on or off the LED light on the module. Then you may go back to the menu, and enter `Media Player` screen to play music or adjust the volume.
|
||||
3. The menu consists of six options: `Sensor Monitor`, `Device Control`, `Network`, `Media Player`, `Help`, and `About Us`. You can move between these options by swiping left or right. For instance, you can access the `Device Control` screen, tap on `Light` to toggle the light on or off. Afterward, you can return to the menu, enter the `Media Player` screen, and either play music or adjust the system volume.
|
||||
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
@@ -79,65 +108,114 @@ Please refer to the pin definition below, and connect the RGB LED module to the
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
**Only ESP32-S3-BOX supports the following features:**
|
||||
|
||||
4. Press the mute button on the top of the device to disable voice wake-up and speech recognition. Press again to enable them.
|
||||
4. Press the mute button on the top of the device to disable voice wake-up and speech recognition. Press it again to enable them.
|
||||
<div align="center">
|
||||
<img src="_static/_get_started_static/hardware_mute_button.jpg" width="350px">
|
||||
<img src="./_static/_get_started_static/hardware_mute.png" width="350px">
|
||||
</div>
|
||||
|
||||
5. Tap the red circle located below the screen to go back to the previous page. This red circle serves as a customizable touch region, allowing users to customize extra touch capabilities according to their preferences.
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/hardware_home.png" width="350px">
|
||||
<img src="./_static/_get_started_static/hardware_home.png" width="250px">
|
||||
</div>
|
||||
|
||||
## Sensor Monitor
|
||||
This feature needs ESP32-S3-BOX-3 is mounted to the ESP32-S3-BOX-3-SENSOR dock. ESP32-S3-BOX-3-SENSOR is a versatile accessory, which integrates a Temp&Hum Sensor, a pair of IR Emitter and Receiver, and a Radar Sensor. It empowers user to create sensor network and other sensor applications with ease. The built-in firmware provides a real-time environment Temp&Hum display, a demonstration of human presence monitoring through a 2.4 GHz radar. Additionally, it offers an IR learning interface, allowing users to use the ESP-BOX for IR learning of their air conditioning controller, thereby enabling control over the air conditioner. This learning capability also extends to other in-house IR controllers, such as Fan, TV, projector, providing a truly engaging experience.
|
||||
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
<td><img src="./_static/_get_started_static/23.png"></td>
|
||||
<td><img src="./_static/_get_started_static/23.1.png"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Radar Monitoring
|
||||
Enter the `Sensor Monitor` screen and tap `ON/OFF` button to enable/ disable radar monitoring feature. When the radar enables switch is set to `ON`, a red body icon will be shown if a person is detected in front of the device, and the icon will turn gray if no person is detected within 2 minutes.
|
||||
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
<td><img src="./_static/_get_started_static/25.png"></td>
|
||||
<td><img src="./_static/_get_started_static/24.png"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### IR Learning
|
||||
Below the temperature and humidity data and radar functions is the infrared learning module. Currently, this module can only learn the `ON/OFF` function of a remote controller. Please follow the interface instructions to iteratively learn the `ON/OFF` command of your remote controller a total of **four** times. The interface upon successful learning will appear as follows:
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
<td><img src="./_static/_get_started_static/27.png"></td>
|
||||
<td><img src="./_static/_get_started_static/28.png"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="./_static/_get_started_static/29.png"></td>
|
||||
<td><img src="./_static/_get_started_static/30.png"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Perform an `ON/OFF` test on your air conditioner by pointing the ESP32-S3-BOX-3-SENSOR towards it. If you find that the logic of the air conditioner's `ON/OFF` function is opposite to your expectations, please click the `Reversal` button below to correct it. Of course, you can also click on `Relearn` to learn other remote controllers.
|
||||
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/31.png">
|
||||
</div>
|
||||
|
||||
>**Tips:**
|
||||
>* Please be aware that when the ESP32-S3-BOX-3 is not mounted to the ESP32-S3-BOX-3-SENSOR dock, the entire `Sensor Monitor` function will not be operational.
|
||||
>* During the period of experiencing the built-in firmware with ESP32-S3-BOX-3-DOCK, **avoid hot-plugging** ESP32-S3-BOX-3-DOCK and switching to ESP32-S3-BOX-3-SENSOR. This action could result in ESP32-S3-BOX-3-SENSOR **not being recognized and functioning properly**. To resolve this, simply power again ESP32-S3-BOX-3-SENSOR to restore normal operation.
|
||||
>* Due to the power limitations of the infrared emitter and differences among air conditioner brands, the effective control range for the **IR learning** feature has been tested to be between **1 to 1.5 meters**.
|
||||
|
||||
## Offline Voice Assistant
|
||||
|
||||
1. You may say "Hi E. S. P." at any screen to wake up your device. When it wakes up, the screen will display the wake word you just used. If the wake word is not displayed, give it another shot. The screen below indicates your device is listening.
|
||||
Firstly, connect the RGB LED module to your device. Refer to the pin definitions in the table below, and use Dupont wires to connect the R, G, B, and GND pins of the RGB LED module to the female header connector on the Pmod™ interface of the ESP32-S3-BOX-3-DOCK.
|
||||
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/LED_pin_defination.png">
|
||||
</div>
|
||||
|
||||
1. You may say `"Hi E. S. P." (pronounce in alphabet)` at any screen to wake up your device. When it wakes up, the screen will display the wake word you just used. If the wake word isn't displayed, give it another try. The screen below indicates your device is listening.
|
||||
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/17.png">
|
||||
</div>
|
||||
|
||||
2. Utter a command within 6 seconds after the beep, such as "turn on the light". You will see the command shown on the screen and the LED light on the module turned on, and hear "OK". Around 6 seconds later you will exit the voice control screen if there is no more command.
|
||||
2. Utter a command within 6 seconds after the beep, such as `"Turn on the light"`. You will see the command shown on the screen and the LED light on the module turned on, and you will hear an `"OK"`. If no more commands follow in around 6 seconds, you'll exit the voice control screen.
|
||||
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/21.png">
|
||||
</div>
|
||||
|
||||
3. You can use voice commands to enjoy music. Please wake up the device first, then say "play music". The music player will open and start playing built-in music. You can also use voice commands to skip songs or pause music. There are two build-in songs.
|
||||
|
||||
3. You can use voice commands to enjoy music. First, wake up the device, then say `"Sing a song"`. This will launch the music player and start playing built-in music. You can also use voice commands to pause or skip songs. There are two built-in songs.
|
||||
|
||||
>**Tips:**
|
||||
|
||||
|
||||
>* If the LED light fails to turn on, check whether the module pins are inserted into the right ports.
|
||||
>* If the BOX recognizes no command within the specified time, you will see `Timeout` and exit the screen in about 1 second.
|
||||
|
||||
>* If the BOX doesn't recognize any command within the designated timeframe, a `Timeout` message will appear, and the screen will exit in approximately 1 second.
|
||||
|
||||
|
||||
<div align="center">
|
||||
<img src="_static/_get_started_static/19.png">
|
||||
</div>
|
||||
|
||||
4. The default commands are: **turn on the light**, **turn off the light**, **turn red**, **turn green**, **turn blue**, **play music**, **next song**, **pause playing**.
|
||||
4. The default commands are: **turn on the light**, **turn off the light**, **turn red**, **turn green**, **turn blue**, **sing a song**, **next song**, **pause playing**.
|
||||
|
||||
## Continuous Speech Recognition
|
||||
## Continuous Speech Recognition
|
||||
|
||||
More interestingly, the device supports continuous speech recognition after waking up. This feature makes voice interaction natural and smooth, and brings a human touch to interactive experience.
|
||||
More interestingly, the device supports continuous speech recognition after waking up. This feature adds a natural and seamless quality to voice interaction, enhancing the interactive experience with a human touch.
|
||||
|
||||
**How to use**
|
||||
|
||||
- Say "hi, E. S. P" to wake up the device, and you will hear a beep.
|
||||
- Say your command. If the device recognizes the command, you will hear "OK", and then it will continue to recognize other commands.
|
||||
- If no command is recognized, the device will wait. If there is not any command in 6 seconds, the device will automatically exit the voice control screen and you need to wake it up again.
|
||||
- Say `"Hi, E. S. P"` to wake up the device, and you will hear a beep.
|
||||
- Speak your command. Upon successful recognition, you will hear `"OK"`, and the device will remain ready for further commands.
|
||||
- If no command is identified, the device will wait. Should no commands be given within 6 seconds, the device will autonomously exit the voice control screen and you need to wake it up again.
|
||||
|
||||
**Attention**
|
||||
|
||||
- If the device fails to recognize your command for many times, please wait for timeout and wake it up again to use the feature.
|
||||
- After you say the wake-up word, please do not move the device. Otherwise, the device will fail to recognize your command.
|
||||
- We recommend voice commands of 3-5 words.
|
||||
- Currently, the device cannot recognize commands when it plays prompts.
|
||||
- If your commands are repeatedly unrecognized by the device, allow it to time out and then wake it up again before utilizing the feature.
|
||||
- Upon saying the wake-up word, please do not move the device, as this could impact command recognition.
|
||||
- We recommend that voice commands comprise 3-5 words for optimal results.
|
||||
- Currently, the device cannot recognize commands while it's playing beep.
|
||||
|
||||
## Voice Command Customization
|
||||
|
||||
The BOX series of development boards are equipped with Espressif proprietary AI Speech Recognition System, which allows you to customize commands through our ESP BOX app. We will take the LED light on the module as an example, to show how to create your own voice commands. For algorithm details, please refer to [Technical Architecture](./technical_architecture.md).
|
||||
The ESP32-S3-BOX-3 is also equipped with Espressif proprietary AI Speech Recognition System, which allows you to customize commands through our ESP BOX APP. We will take the LED light on the module as an example, to show how to create your own voice commands. For a deeper understanding of the algorithms involved, please refer to the introduction of the ESP-SR speech model in the [Technical Architecture](technical_architecture.md).
|
||||
|
||||
**1. Connect to the ESP BOX mobile app**
|
||||
|
||||
@@ -149,7 +227,7 @@ The BOX series of development boards are equipped with Espressif proprietary AI
|
||||
<div align="center">
|
||||
<img src="_static/_get_started_static/Picture1.png" width="100 px">
|
||||
</div>
|
||||
|
||||
|
||||
1.2. If you are new to this app, please register an account first.
|
||||
|
||||
1.3. Sign in with your ESP BOX account and turn on the Bluetooth on your phone. Tap `+` at the bottom of the screen, and scan the QR code on your device to set up the network.
|
||||
@@ -158,7 +236,6 @@ The BOX series of development boards are equipped with Espressif proprietary AI
|
||||
<tr>
|
||||
<td><img src="_static/_get_started_static/1.jpeg"width="300"/></td>
|
||||
<td><img src="_static/_get_started_static/2.jpeg"width="300"/></td>
|
||||
<td><img src="_static/_get_started_static/3.jpeg"width="300"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -176,17 +253,18 @@ The BOX series of development boards are equipped with Espressif proprietary AI
|
||||
</div>
|
||||
|
||||
>**Tips:**
|
||||
|
||||
|
||||
>* Please do not exit the QR code page during the network provisioning.
|
||||
>* Make sure you connect the device to 2.4 GHz Wi-Fi instead of 5 GHz, and enter the correct Wi-Fi password. If the Wi-Fi password is incorrect, the prompt "Wi-Fi Authentication failed" will pop up.
|
||||
>* Long press the `Boot` button (i.e. `Funtion` button) for 5 seconds to clear the network information and restore the device to factory settings. After the device is reset, if the QR code or Bluetooth is not working, please restart your device by pressing the `Reset` button.
|
||||
|
||||
|
||||
<div align="center">
|
||||
<img src="_static/_get_started_static/7.jpeg"width="300" />
|
||||
</div>
|
||||
|
||||
**2. Customize Voice Commands**
|
||||
|
||||
2.1. Tap the ESP-BOX device icon and enter the below screen. You can turn on or off the light easily by toggling the button as shown in the picture. You may develop the Fan and Switch features by yourself.
|
||||
2.1. Select the ESP-BOX device icon and access the screen displayed below. You can conveniently turn the light on or off by simply toggling the button, as indicated in the image. You may need to develop the Fan and Switch functionalities by yourself.
|
||||
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
@@ -204,7 +282,7 @@ The BOX series of development boards are equipped with Espressif proprietary AI
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
2.3 In the `Configure` tab, you may also customize commands to turn on or off the light and change its color. For example, you can set "good morning" as the command to turn on the light. Click `Save` to return to the previous screen. Then click `Save` again as shown below.
|
||||
2.3 In the `Configure` tab, you may also customize commands to turn on or off the light and change its color. For example, you can set "Good Morning" as the command to turn on the light. Click `Save` to return to the previous screen. Then click `Save` again as shown below.
|
||||
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
@@ -219,35 +297,35 @@ The BOX series of development boards are equipped with Espressif proprietary AI
|
||||
<img src="_static/_get_started_static/12.jpeg"width="300" />
|
||||
</div>
|
||||
|
||||
2.5 Now, you can try out your new command! First, say "Hi E. S. P." to wake up your device. Then say "good morning" within 6 seconds to turn on the light. The new command will show on the screen with the module light turned on.
|
||||
2.5 Now, you can try out your new command! First, say `"Hi E. S. P."` to wake up your device. Then say `"Good Morning"` within 6 seconds to turn on the light. The new command will show on the screen with the module light turned on.
|
||||
|
||||
<div align="center">
|
||||
<img src="_static/_get_started_static/15.png">
|
||||
</div>
|
||||
|
||||
>**To ensure the commands work well, please note:**
|
||||
>
|
||||
>* Length of commands: A command should consists of 2-8 words. When creating a series of commands, please try to keep them at similar lengths.
|
||||
>* Avoid repeating: Please do not include shorter commands in longer commands, or shorter commands will not be recognized. For example, if you create both "turn on" and "turn on the light" commands, "turn on" will not be recognized.
|
||||
>**For effective command performance, kindly consider the following:**
|
||||
>* Command Length: A command should consists of 2-8 words. While crafting a sequence of commands, it's advisable to maintain a consistent length across them.
|
||||
>* Avoid Repetition: Please do not include shorter commands within longer ones. For example, if you create both "turn on" and "turn on the light" commands, the shorter "turn on" command won't be identified.
|
||||
|
||||
**3. switch CN and EN voice model:**
|
||||
|
||||
3.1. Click on your ESP-BOX `About Us` device icon to enter the `About Us` details page. In this page, press `Boot` button, the device will enter `factory Mode` language setting page, and then you can select the voice wake-up model by yourself. After switching the model, the device will reset and restart automatically.
|
||||
## Switch Voice Model Language
|
||||
|
||||
Access the `About Us` details page. In this page, press `Boot` button, the device will enter `factory Mode` voice model language setting page. Here, you can personally select the voice model. After switching the model, the device will reset and restart automatically.
|
||||
|
||||
<div align="center">
|
||||
<img src="_static/_get_started_static/language_select.png"width="300" />
|
||||
<img src="_static/_get_started_static/22.png"width="300" />
|
||||
</div>
|
||||
|
||||
## FCC Regulations:
|
||||
## FCC Regulations
|
||||
|
||||
This device complies with part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. This device has been tested and found to comply with the limits for a Class B digital device, pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation. This equipment generates, uses and can radiated radio frequency energy and, if not installed and used in accordance with the instructions, may cause harmful interference to radio communications. However, there is no guarantee that interference will not occur in a particular installation. If this equipment does cause harmful interference to radio or television reception, which can be determined by turning the equipment off and on, the user is encouraged to try to correct the interference by one or more of the following measures:
|
||||
This device complies with part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. This device has been tested and found to comply with the limits for a Class B digital device, pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation. This equipment generates, uses, and can radiate radio frequency energy and, if not installed and used in accordance with the instructions, may cause harmful interference to radio communications. However, there is no guarantee that interference will not occur in a particular installation. If this equipment does cause harmful interference to radio or television reception, which can be determined by turning the equipment off and on, the user is encouraged to try to correct the interference by one or more of the following measures:
|
||||
|
||||
- Reorient or relocate the receiving antenna.
|
||||
- Increase the separation between the equipment and receiver.
|
||||
- Connect the equipment into an outlet on a circuit different from that to which the receiver is connected.
|
||||
- Connect the equipment to an outlet on a circuit different from that to which the receiver is connected.
|
||||
- Consult the dealer or an experienced radio/TV technician for help.
|
||||
|
||||
**FCC Note** Caution: Changes or modifications not expressly approved by the party responsible for compliance could void the user‘s authority to operate the equipment.
|
||||
**FCC Note Caution:** Changes or modifications not expressly approved by the party responsible for compliance could void the user's authority to operate the equipment.
|
||||
|
||||
## RF Exposure Information
|
||||
|
||||
|
||||
@@ -1,64 +1,91 @@
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/started_banner.png" width="700px">
|
||||
</div>
|
||||
|
||||
* [English Version](./getting_started.md)
|
||||
|
||||
本指南适用于已烧录最新固件的 ESP32-S3-BOX、ESP32-S3-BOX-Lite 产品,下文将其统称为 BOX 系列开发板。
|
||||
本指南仅适用于 ESP32-S3-BOX-3。对于 ESP32-S3-BOX 和 ESP32-S3-BOX-Lite 的用户指南,请参考最新发布的 [Tag 分支](https://github.com/espressif/esp-box/blob/v0.5.0/docs/getting_started_cn.md)。
|
||||
|
||||
# 概览
|
||||
|
||||
在一个融合创新与艺术、分享与合作至关重要的世界中,我们隆重推出 ESP32-S3-BOX-3,这是一款全开源的 AIoT 开发套件,基于强大的 ESP32-S3 SoC。这款新一代工具为传统开发板带来了积极的改变,它拥有紧凑美观的外壳,并提供丰富的组件,让开发者可以轻松定制和扩展功能,借助 Espressif 的可靠软件解决方案, 如 ESP-BOX、ESP-SR、ESP-Rainmaker 和 ESP-Matter。无论是原型开发还是构建复杂的物联网系统,ESP32-S3-BOX-3 均能提供完美的外形和功能上的平衡,推动着开发板生态的未来发展。
|
||||
|
||||
ESP32-S3-BOX-3 出厂固件支持中文和英文离线语音唤醒和命令词识别。ESP-BOX 手机 APP 支持可重配置的 AI 语音交互,您可以创建个性化的命令词来控制智能设备。此外,固件还展示了多种传感器演示,并允许用户进行红外学习,快速将 BOX 转变为空调遥控器。
|
||||
|
||||
本用户指南详细介绍了内置固件的基本功能,帮助您开始新的探索之旅。在学习过程中,您将获得开发应用方案的宝贵经验。让我们一起踏上这激动人心的冒险吧!
|
||||
|
||||
# 目标群体
|
||||
包括从事制作、原型设计和开发活动的个人和组织。它旨在满足广泛的用户群体,如业余爱好者、创客、工程师、教育工作者和寻求多功能扩展解决方案的专业人士,以满足他们项目的需求。
|
||||
|
||||
# 目标应用
|
||||
|
||||
* 智能家居
|
||||
* 智慧农业
|
||||
* 智慧城市
|
||||
* 能源管理
|
||||
* 物联网原型开发与教育
|
||||
* 工业物联网
|
||||
* 智能零售
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/application.png" width="700px">
|
||||
</div>
|
||||
|
||||
# 开始使用
|
||||
|
||||
搭载 ESP32-S3 芯片的 BOX 系列开发板借助语音助手 + 屏幕控制、传感器、红外控制器和智能 Wi-Fi 网关等功能,为用户提供了一个开发智能家居设备控制系统的平台。BOX 系列开发板出厂支持语音唤醒和离线中英文命令词识别,其 SDK 具备可重构 AI 语音交互功能,用户可以通过自定义命令词控制家居设备。本文仅简要介绍最新固件能够实现的参考功能,供您了解如何开始使用开发板。阅读完该指南,您可以尝试自己开发应用。让我们开始吧!
|
||||
|
||||
**BOX 套件包含:**
|
||||
|
||||
| ESP32-S3-BOX | ESP32-S3-BOX-Lite |
|
||||
| :-----: | :---------------------: |
|
||||
| 主机,可独立使用 | 主机,可独立使用 |
|
||||
| 供测试的 RGB LED 模块和杜邦线 | 供测试的 RGB LED 模块和杜邦线 |
|
||||
| Dock 配件,辅助主机立于桌面 | N/A|
|
||||
|
||||
|
||||
**所需硬件:**
|
||||
|
||||
请您自行准备一根 USB-C 数据线。
|
||||
|
||||
## 连接 RGB LED 模块
|
||||
参考下面的管脚定义,用杜邦线连接 RGB LED 模块和设备。RGB LED 模块有 R、G、B、GND 四根公头针脚,请将其与 PMOD 1 的 G39、G40、G41、GND 母头端口连接。
|
||||
|
||||
## 套件内容
|
||||
### ESP32-S3-BOX-3 套件
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/hardware_pmod.png">
|
||||
<img src="./_static/_get_started_static/ESP32_S3_BOX_3_KitFigure.png" width="700px">
|
||||
</div>
|
||||
|
||||
- ESP32-S3-BOX-3,独立工作的主模块
|
||||
- ESP32-S3-BOX-3-DOCK,功能配件,可作为主机的座子
|
||||
- ESP32-S3-BOX-3-SENSOR,功能配件,展示传感器应用
|
||||
- ESP32-S3-BOX-3-BRACKET,转接配件,用于将主机安装在其他设备上
|
||||
- ESP32-S3-BOX-3-BREAD,转接配件,方便主机与标准面包板连接
|
||||
- 一根 USB-C 数据线
|
||||
- 一个 RGB LED 模块和杜邦线,用于测试
|
||||
|
||||
### ESP32-S3-BOX-3B 套件
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/ESP32_S3_BOX_3B_KitFigure.png" width="700px">
|
||||
</div>
|
||||
|
||||
- ESP32-S3-BOX-3,独立工作的主模块
|
||||
- ESP32-S3-BOX-3-DOCK,功能配件,可作为主机的座子
|
||||
- 一根 USB-C 数据线
|
||||
- 一个 RGB LED 模块和杜邦线,用于测试
|
||||
|
||||
## 变体说明
|
||||
ESP32-S3-BOX-3 提供两款不同配置的套件:分别命名为 ESP32-S3-BOX-3 和 ESP32-S3-BOX-3B。ESP32-S3-BOX-3 代表标准版,配备四款蓝色配件,而 ESP32-S3-BOX-3B 代表基础版,仅提供了一款配件,适用于不需要太多不必要硬件的初学者。以下是两个版本之间的区别:
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/ESP32_S3_BOX_3_Compare.jpg" width="700px">
|
||||
</div>
|
||||
|
||||
## 给设备供电
|
||||
1. 使用 USB-C 数据线给设备供电。
|
||||
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/usb_power.png" width="800px">
|
||||
<img src="./_static/_get_started_static/usb_power_box.png" width="800px">
|
||||
</div>
|
||||
|
||||
2. 设备启动后,屏幕上将显示 Espressif logo 的开机动画。
|
||||
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/boot_animation.png" width="700px">
|
||||
<img src="./_static/_get_started_static/boot_animation.png" width="500px">
|
||||
</div>
|
||||
|
||||
## 开始体验
|
||||
|
||||
1. 请阅读按键引导页,了解 BOX 系列开发板的按键功能,随后点按 `Next` 进入下一页。
|
||||
1. 请阅读按键引导页,了解 BOX 开发板的按键功能,随后点按 `Next` 进入下一页。
|
||||
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
<td><b>ESP32-S3-BOX 按键引导页</b></td>
|
||||
<td><b>ESP32-S3-BOX-Lite 按键引导页</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="./_static/_get_started_static/0.png" width="300px"/></td>
|
||||
<td><img src="./_static/_get_started_static/1.png" width="300px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="./_static/_get_started_static/2.png" width="280px"/></td>
|
||||
<td><img src="./_static/_get_started_static/2.png" width="280px"/></td>
|
||||
<td><img src="./_static/_get_started_static/0.png"></td>
|
||||
<td><img src="./_static/_get_started_static/2.png"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
2. 请阅读语音助手使用说明引导页,了解 AI 语音功能,随后点按 `OK Let's Go` 进入菜单页。
|
||||
2. 请阅读语音助手使用说明引导页,了解 AI 语音控制功能,随后点按 `OK Let's Go` 进入主页。
|
||||
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
@@ -67,7 +94,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
3. 菜单页有五大功能,分别是 `Device Control`、`Network`、`Media Player`、`Help` 以及 `About Us`,左右滑动可选择功能。比如,进入 `Device Control` 界面,点按 `Light` 可打开或关闭模块上的 LED 灯。回到菜单页,再进入 `Media Player` 界面播放歌曲或调节音量。
|
||||
3. 主页包含六大功能,分别是 `Sensor Monitor`、`Device Control`、`Network`、`Media Player`、`Help` 以及 `About Us`,左右滑动可在这些选项之间切换。比如,进入 `Device Control` 界面,点按 `Light` 可打开或关闭灯。回到菜单页,再进入 `Media Player` 界面,可播放音乐或调节系统音量。
|
||||
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
@@ -80,41 +107,87 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
**仅 ESP32-S3-BOX 支持以下功能:**
|
||||
|
||||
4. 按下 ESP32-S3-BOX 顶部的静音按钮之后,语音唤醒和识别功能将被禁用,再次按下则会恢复语音功能。
|
||||
4. 按下设备顶部的静音按钮以关闭语音唤醒和识别功能,再次按下即可恢复语音功能。
|
||||
|
||||
<div align="center">
|
||||
<img src="_static/_get_started_static/hardware_mute_button.jpg" width="350px">
|
||||
<img src="./_static/_get_started_static/hardware_mute.png" width="350px">
|
||||
</div>
|
||||
|
||||
5. 轻触屏幕下方的红色圆圈以返回上一页。红圈是一块可自定义的触摸区域,允许用户根据自己的喜好配置额外的触摸功能。
|
||||
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/hardware_home.png" width="350px">
|
||||
<img src="./_static/_get_started_static/hardware_home.png" width="250px">
|
||||
</div>
|
||||
|
||||
## 传感器监测
|
||||
此功能需要将 ESP32-S3-BOX-3 安装到 ESP32-S3-BOX-3-SENSOR 底座上。ESP32-S3-BOX-3-SENSOR 是一款多功能配件,集成了温湿度传感器、红外发射和接收器以及雷达传感器。它使用户能够轻松构建传感器网络和其他传感器应用。出厂固件提供实时环境温湿度显示,通过 2.4 GHz 雷达进行人体存在监测。此外,它还提供了红外学习接口,允许用户使用 ESP-BOX 来学习空调遥控器的红外信号,从而实现对空调的控制。这种学习功能还能扩展到其他红外遥控器,如风扇、电视、投影仪,提供别样的互动体验。
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
<td><img src="./_static/_get_started_static/23.png"></td>
|
||||
<td><img src="./_static/_get_started_static/23.1.png"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### 雷达监测
|
||||
进入 `Sensor Monitor`,点击 `ON/OFF`按钮以启用/禁用雷达监测功能。当雷达使能开关设置为`开`时,如果设备前方检测到人体存在,将显示红色人体图标;如果在两分钟内未检测到人体,图标将变为灰色。
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
<td><img src="./_static/_get_started_static/25.png"></td>
|
||||
<td><img src="./_static/_get_started_static/24.png"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### 红外学习
|
||||
在温湿度数据和雷达功能的下方是红外学习模块。目前,此模块只提供了学习遥控器的`开/关`功能。请按照界面指示,连续学习您遥控器的`开/关`命令**四次**。成功学习时的界面显示如下:
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
<td><img src="./_static/_get_started_static/27.png"></td>
|
||||
<td><img src="./_static/_get_started_static/28.png"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="./_static/_get_started_static/29.png"></td>
|
||||
<td><img src="./_static/_get_started_static/26.png"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
此刻,将 ESP32-S3-BOX-3-SENSOR 对准你的空调来进行开关测试,如您发现空调`开/关`功能逻辑与预期相反,请点按下方的 `Reversal` 按钮进行更正。当然,您也可以点击 `Relearn` 来学习其他遥控器。
|
||||
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/31.png">
|
||||
</div>
|
||||
|
||||
>**注意:**
|
||||
>* 当 ESP32-S3-BOX-3 未安装到 ESP32-S3-BOX-3-SENSOR 底座上时,整个`Sensor Monitor`功能将无法运行。
|
||||
>* 当使用 ESP32-S3-BOX-3-DOCK 体验出厂固件时,请**避免将 ESP32-S3-BOX-3-DOCK 热插拔**切换到 ESP32-S3-BOX-3-SENSOR。这样的操作会导致 ESP32-S3-BOX-3-SENSOR **无法被识别和正常工作**。若遇到这种情况,只需给 ESP32-S3-BOX-3-SENSOR 重新上下电即可恢复正常运行。
|
||||
>* 由于红外发射管功率的限制以及空调品牌之间的差异,红外学习功能实际控制距离,经测试在 1~1.5m 之间。
|
||||
|
||||
## 离线语音识别
|
||||
1. 您可以在任意界面使用唤醒词来唤醒设备,唤醒词为“Hi 乐鑫”。设备唤醒后,唤醒词将显示在屏幕上并伴有提示音“我在”。如果唤醒词未出现,请再次尝试。出现如下界面表示您的设备正在倾听。
|
||||
首先,参考下表的管脚定义,将 RGB LED 模块的 R、G、B、GND 四个引脚用杜邦线连接至 ESP32-S3-BOX-3-DOCK PMOD 接口的母头连接器上。
|
||||
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/LED_pin_defination.png">
|
||||
</div>
|
||||
|
||||
1. 您可以在任意界面使用唤醒词来唤醒设备,唤醒词为`“Hi 乐鑫”`。设备唤醒后,唤醒词将显示在屏幕上并伴有提示音`“我在”`。如果唤醒词未出现,请再次尝试。出现如下界面表示您的设备正在倾听。
|
||||
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/16.png">
|
||||
</div>
|
||||
|
||||
2. 请在提示音响起后的 6 秒内对设备说出命令词,比如“打开电灯”。您将看到命令词显示在屏幕上,模块的 LED 灯亮起,同时听到语音反馈“好的”。若无其他命令词,设备将在 6 秒左右退出语音控制界面。
|
||||
2. 请在提示音响起后的 6 秒内对设备说出命令词,比如`“打开电灯”`。您将看到命令词显示在屏幕上,RGB LED 模块的灯亮起,同时听到语音反馈`“好的”`。若无其他命令词,设备将在 6 秒左右退出语音控制界面。
|
||||
<div align="center">
|
||||
<img src="./_static/_get_started_static/20.png">
|
||||
</div>
|
||||
|
||||
3. 您还可以使用语音命令词欣赏音乐。请先唤醒设备,然后说出命令词“播放音乐”,设备将打开音乐播放器并开始播放内置音乐。您也可以用语音命令词切换歌曲或者暂停播放。最新固件默认自带两歌曲。
|
||||
|
||||
3. 您还可以使用语音命令词欣赏音乐。请先唤醒设备,然后说出命令词`“播放音乐”`,设备将打开音乐播放器并开始播放内置音乐。您也可以用语音命令词切换歌曲或者暂停播放。出厂固件默认自带两首歌曲。
|
||||
|
||||
>**注意:**
|
||||
>
|
||||
>* 如果模块上的 LED 灯没有亮起,请检查模块管脚是否插错。
|
||||
>* 若在规定时间内未识别到命令词,则会显示 `超时`,约 1 秒后界面关闭。
|
||||
|
||||
|
||||
<div align="center">
|
||||
<img src="_static/_get_started_static/19.png">
|
||||
<img src="_static/_get_started_static/18.png">
|
||||
</div>
|
||||
|
||||
4. 默认命令词包括:**打开电灯**,**关闭电灯**,**调成红色**,**调成绿色**,**调成蓝色**,**播放音乐**,**切歌**,**暂停播放**。
|
||||
@@ -125,64 +198,53 @@
|
||||
|
||||
**使用方式**
|
||||
|
||||
- 使用“Hi,乐鑫”唤醒设备,唤醒后设备播放提示音“我在”。
|
||||
- 说出命令词。如设备识别出命令词,则会播放提示音“好的”,然后将继续识别其他命令词。
|
||||
- 使用`“Hi,乐鑫”`唤醒设备,唤醒后设备播放提示音`“我在”`。
|
||||
- 说出命令词。如设备识别出命令词,则会播放提示音`“好的”`,然后将继续识别其他命令词。
|
||||
- 如设备未识别命令词则会继续等待,6 秒内没有新命令将自动退出语音控制界面,使用语音识别功能需要再次唤醒设备。
|
||||
|
||||
**注意**
|
||||
|
||||
- 如设备多次未能识别命令词,请再次唤醒重新识别
|
||||
- 说出唤醒词后请勿移动设备,设备不支持在移动中识别命令词
|
||||
- 我们推荐使用长度为 3-5 个汉字的命令词
|
||||
- 暂不支持播放提示音时识别命令词
|
||||
- 如设备多次未能识别命令词,请再次唤醒重新识别。
|
||||
- 说出唤醒词后请勿移动设备,设备不支持在移动中识别命令词。
|
||||
- 我们推荐使用长度为 3-5 个汉字的命令词。
|
||||
- 暂不支持播放提示音时识别命令词。
|
||||
|
||||
**额外支持的命令词**
|
||||
**中文模型额外支持的命令词**
|
||||
|
||||
| command ID | 命令词 | command ID | 命令词 | command ID | 命令词 |
|
||||
| :--------: | :----------: | :--------: | :----------: | :--------: | :------------: |
|
||||
| 0 | 打开空调 | 24 | 二十六度 | 48 | 音量调到最小 |
|
||||
| 1 | 关闭空调 | 25 | 二十七度 | 49 | 打开电灯 |
|
||||
| 2 | 舒适模式 | 26 | 二十八度 | 50 | 关闭电灯 |
|
||||
| 3 | 制冷模式 | 27 | 二十九度 | 51 | 打开卧室灯 |
|
||||
| 4 | 制热模式 | 28 | 三十度 | 52 | 关闭卧室灯 |
|
||||
| 5 | 加热模式 | 29 | 增大风速 | 53 | 打开客厅灯 |
|
||||
| 6 | 除湿模式 | 30 | 减小风速 | 54 | 关闭客厅灯 |
|
||||
| 7 | 送风模式 | 31 | 高速风 | 55 | 打开音箱 |
|
||||
| 8 | 升高温度 | 32 | 中速风 | 56 | 关闭音箱 |
|
||||
| 9 | 降低温度 | 33 | 低速风 | 57 | 拉开窗帘 |
|
||||
| 10 | 温度调到最高 | 34 | 自动风 | 58 | 关闭窗帘 |
|
||||
| 11 | 温度调到最低 | 35 | 打开左右摆风 | 59 | 打开风扇 |
|
||||
| 12 | 太热了 | 36 | 打开上下摆风 | 60 | 关闭风扇 |
|
||||
| 13 | 太冷了 | 37 | 关闭左右摆风 | 61 | 打开饮水机插座 |
|
||||
| 14 | 十六度 | 38 | 关闭上下摆风 | 62 | 关闭饮水机插座 |
|
||||
| 15 | 十七度 | 39 | 打开辅热 | 63 | 打开投影仪 |
|
||||
| 16 | 十八度 | 40 | 关闭辅热 | 64 | 关闭投影仪 |
|
||||
| 17 | 十九度 | 41 | 打开自清洁 | 65 | 灯光调暗 |
|
||||
| 18 | 二十度 | 42 | 关闭自清洁 | 66 | 灯光调亮 |
|
||||
| 19 | 二十一度 | 43 | 打开静音 | | |
|
||||
| 20 | 二十二度 | 44 | 关闭静音 | | |
|
||||
| 21 | 二十三度 | 45 | 音量大点 | | |
|
||||
| 22 | 二十四度 | 46 | 音量小点 | | |
|
||||
| 23 | 二十五度 | 47 | 音量调到最大 | | |
|
||||
| command ID | 命令词 |
|
||||
| :--------: | :----------:|
|
||||
| 0 | 打开空调 |
|
||||
| 1 | 关闭空调 |
|
||||
| 2 | 舒适模式 |
|
||||
| 3 | 制冷模式 |
|
||||
| 4 | 制热模式 |
|
||||
| 5 | 加热模式 |
|
||||
| 6 | 除湿模式 |
|
||||
| 7 | 送风模式 |
|
||||
| 8 | 升高温度 |
|
||||
| 9 | 降低温度 |
|
||||
|
||||
> 上述命令词仅供演示,由于没有接入相关智能设备,所以无法实现命令词功能。
|
||||
>**注意:**
|
||||
>
|
||||
> 上述命令词仅供演示,您可以自行开发接入相关智能设备,用语音识别实现真实的控制效果。
|
||||
|
||||
## 语音命令词自定义
|
||||
BOX 系列开发板配备乐鑫专有的 AI 语音识别系统,您可以通过 ESP BOX 应用程序自定义任意命令词。我们将以模块上的 LED 灯为例,介绍如何自定义语音命令词。如需了解算法详细信息,请参阅[技术架构](./technical_architecture_cn.md)。
|
||||
|
||||
ESP32-S3-BOX-3 还配备了乐鑫专有的 AI 语音识别系统,通过我们的 ESP BOX APP,您可以自定义命令词。我们将以模块上的 LED 灯为例,展示如何创建您自己的语音命令词。如需深入了解所涉及的算法,请参考[技术架构](technical_architecture_cn.md)内对 ESP-SR 语音模型的介绍。
|
||||
|
||||
**1. 连接 ESP BOX 手机应用程序**
|
||||
|
||||
1.1. 进入 `Network` 界面,点按右上角 `To install APP`。扫描二维码下载并安装 ESP BOX 应用程序,或者直接在 App Store 或 Google Play 中搜索 "ESP BOX" 下载应用程序。
|
||||
|
||||
|
||||
|
||||
<div align="center">
|
||||
<img src="_static/_get_started_static/8.png">
|
||||
</div>
|
||||
<div align="center">
|
||||
<img src="_static/_get_started_static/Picture1.png" width="100 px">
|
||||
</div>
|
||||
|
||||
1.2. 如您第一次使用此应用程序,请先注册账户。
|
||||
|
||||
1.2. 如您第一次使用此应用程序,请先注册账号。
|
||||
|
||||
1.3. 登录您的 ESP BOX 账号并打开手机蓝牙。点按界面下方 `+`,扫描设备上的二维码配置网络。
|
||||
|
||||
@@ -190,7 +252,6 @@ BOX 系列开发板配备乐鑫专有的 AI 语音识别系统,您可以通过
|
||||
<tr>
|
||||
<td><img src="_static/_get_started_static/1.jpeg"width="300"/></td>
|
||||
<td><img src="_static/_get_started_static/2.jpeg"width="300"/></td>
|
||||
<td><img src="_static/_get_started_static/3.jpeg"width="300"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -207,9 +268,9 @@ BOX 系列开发板配备乐鑫专有的 AI 语音识别系统,您可以通过
|
||||
<img src="_static/_get_started_static/7.png">
|
||||
</div>
|
||||
|
||||
|
||||
>**注意:**
|
||||
>
|
||||
>* 配网期间,请不要退出二维码界面。
|
||||
>* 请确保设备接入 2.4 GHz Wi-Fi 而非 5 GHz,且 Wi-Fi 密码输入正确。如果 Wi-Fi 密码错误,设备将会提示 "Wi-Fi Authentication failed"。
|
||||
>* 长按 `Boot` 键(即 `Function` 键)5 秒可清除网络配置信息,恢复出厂设置。设备重置后,如遇二维码扫码失败或蓝牙搜索不到设备,请按 `Reset` 键重启设备。
|
||||
|
||||
@@ -217,7 +278,7 @@ BOX 系列开发板配备乐鑫专有的 AI 语音识别系统,您可以通过
|
||||
<img src="_static/_get_started_static/7.jpeg"width="300" />
|
||||
</div>
|
||||
|
||||
**2. 自定义语音命令词:**
|
||||
**2. 自定义语音命令词**
|
||||
|
||||
2.1. 点按您的 ESP-BOX 设备图标,进入如下界面。在此界面,您可轻松控制开灯或者关灯。此外,我们预留了 `Switch` 和 `Fan` 功能供您自行开发。
|
||||
|
||||
@@ -253,7 +314,7 @@ BOX 系列开发板配备乐鑫专有的 AI 语音识别系统,您可以通过
|
||||
<img src="_static/_get_started_static/12.jpeg"width="300" />
|
||||
</div>
|
||||
|
||||
2.5. 现在,您可以体验新命令词了!请先使用“Hi 乐鑫”唤醒设备,然后在 6 秒内说出打开电灯的新命令词“早上好”,新命令词将显示在屏幕上,同时模块上的 LED 灯会亮起。
|
||||
2.5. 现在,您可以体验新命令词了!请先使用`“Hi 乐鑫”`唤醒设备,然后在 6 秒内说出打开电灯的新命令词`“早上好”`,新命令词将显示在屏幕上,同时模块上的 LED 灯会亮起。
|
||||
|
||||
<div align="center">
|
||||
<img src="_static/_get_started_static/14.png"width="300" />
|
||||
@@ -264,13 +325,11 @@ BOX 系列开发板配备乐鑫专有的 AI 语音识别系统,您可以通过
|
||||
>* 命令词长度:命令词长度需要在 2-8 个汉字之间。在定义一系列命令词时,最好可以保持不同命令词的长度相似。
|
||||
>* 避免重复:请勿在长命令词中包含短命令词,否则短命令词将无法识别。比如“打开”和“打开灯”,设备将无法识别“打开”。
|
||||
|
||||
**3. 中英文语音模型切换:**
|
||||
## 中英文语音模型切换
|
||||
|
||||
3.1. 点按您的 ESP-BOX `About Us` 设备图标,进入 `About Us` 详情页。在此界面,按下 `Boot` 按键,设备会快速进入 `factory Mode` 语言设置页面,用户可以自行设置语音的唤醒模型。模型切换后设备将自动重置重启。
|
||||
点按您的 ESP-BOX `About Us` 设备图标,进入 `About Us` 详情页。在此界面,按下 `Boot` 按键,设备会快速进入 `factory Mode` AI 语音模型语言设置页面,用户可自行选择偏好的模型语言。模型切换后设备将自动重置重启。
|
||||
|
||||
<div align="center">
|
||||
<img src="_static/_get_started_static/language_select.png"width="300" />
|
||||
<img src="_static/_get_started_static/22.png"width="300" />
|
||||
</div>
|
||||
|
||||
此指南仅供您简要了解如何在 BOX 系列开发板上使用最新的固件。现在,请开始编写自己的应用程序,开启物联网之旅吧!
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
# Great projects using ESP-BOX serials
|
||||
|
||||
## Willow - A Practical, Open Source, Privacy-focused Platform for Voice Assistants and Other Applications
|
||||
|
||||
<td><img src="./_static/great_projects_picture/willow1.png" width="400"/></td>
|
||||
|
||||
### Project Source
|
||||
|
||||
[GitHub link](https://github.com/toverainc/willow)
|
||||
|
||||
[GitHub URL](https://heywillow.io)
|
||||
|
||||
### Project description
|
||||
|
||||
Willow is a powerful and privacy-focused voice assistant platform designed for the ESP32-BOX hardware family, offering a cost-effective, open-source, and highly customizable solution for voice interaction and home automation.
|
||||
|
||||
<td><img src="./_static/great_projects_picture/willow2.jpg" width="200"/></td>
|
||||
|
||||
Willow is an ESP IDF-based project primarily designed for the ESP32-BOX hardware family from Espressif. The project's main objectives are to deliver performance, accuracy, cost-effectiveness, and functionality comparable to Amazon Echo and Google Home when used with Home Assistant, openHAB, and other platforms.
|
||||
|
||||
It is 100% open source and self-hosted, providing fast response times (500ms or less), high wake word accuracy, and low false activation rates. Willow offers flexibility with the option to use the Willow Inference Server or perform command recognition solely on the device. The project is known for its reliability, having been tested extensively with a failure rate of less than 1%.
|
||||
|
||||
Willow is not only fast and accurate but also prioritizes privacy. Users can inspect the source code, build and flash it themselves, proxy through another server for traffic inspection, use it on their own server, or operate it without internet access. It is a practical and aesthetically pleasing solution, ready to be deployed without drawing attention. The hardware cost is approximately $50, making it a cost-effective choice.
|
||||
|
||||
Willow supports features such as wake word detection, voice activity detection, integration with Home Assistant, openHAB, and generic REST APIs, far-field voice recognition, excellent audio quality, and reliable performance in challenging Wi-Fi environments.
|
||||
|
||||
The project's future plans include running the Willow Inference Server without CUDA, improving the LCD and touchscreen features, adding support for buttons and custom wake words, and configuring GPIO for user customization.
|
||||
|
||||
|
||||
|
||||
## ESP-BOX-EMU - A Retro Game Emulation System
|
||||
|
||||
<td><img src="./_static/great_projects_picture/esp-box-emu1.png" width="200"/></td>
|
||||
|
||||
### Project Source
|
||||
|
||||
[GitHub link](https://github.com/esp-cpp/esp-box-emu)
|
||||
|
||||
### Project description
|
||||
|
||||
ESP-BOX-EMU is a comprehensive project that allows users to enjoy retro game emulation on the ESP32-BOX hardware, with a user-friendly interface and various features for an enhanced gaming experience.
|
||||
|
||||
<td><img src="./_static/great_projects_picture/esp-box-emu2.jpg" width="400"/></td>
|
||||
|
||||
This project, "esp-box-emu," is an emulation system running on the ESP32-BOX hardware. It is designed to emulate retro games and is built using various components and software libraries, including ESPP, LVGL, Squareline Studio for LVGL design, Nofrendo for NES emulation, and GNUBoy for Game Boy/Game Boy Color emulation.
|
||||
|
||||
The project offers videos showcasing its capabilities, including emulation for Game Boy Color, NES games (e.g: Super Mario Bros. and Zelda), and Game Boy games (e.g: Pokemon and Link's Awakening). The videos demonstrate features like audio and video settings, ROM scaling options, and audio control.
|
||||
|
||||
The project supports both internal storage using LittleFS and external storage via a uSD card with a FAT filesystem. ROM images and metadata are organized in a specific format for ease of use.
|
||||
|
||||
|
||||
|
||||
## **ESP32-S3-BOX-3-JoyStick** - A JoyStick Combines Gaming Controller And Aircraft Remote
|
||||
|
||||
<td><img src="./_static/great_projects_picture/joystick.png" width="200"/></td>
|
||||
|
||||
### Project Source
|
||||
|
||||
[OSHWHub link](https://oshwhub.com/esp-college/esp_box_3_joystick)
|
||||
|
||||
### Project description
|
||||
|
||||
The ESP32-S3-BOX-3-JoyStick hardware system comprises the ESP32-S3-BOX-3 development board, JoyStick controller, and ESP32-S3-USB-Bridge receiver. The ESP32-S3-BOX-3 serves as the main controller, connecting to the JoyStick controller and ESP32-S3-USB-Bridge receiver through a PCI-E interface. The system operates in "Game Mode" and "RC Remote Control Mode." In Game Mode, it supports USB-HID and BLE-HID protocols for computer gaming control, as well as an NES emulator mode. In RC Remote Control Mode, it utilizes the ESP-NOW wireless communication protocol to pair with ESP32-S3-USB-Bridge and other Espressif development boards, enabling wireless control of RC vehicles and ESP-Drone quadcopters.
|
||||