Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/bsp_in_example' into 'master'
i2s: Add BSP support for es8311 example Closes BSP-165 See merge request espressif/esp-idf!21279
- Loading branch information
Showing
9 changed files
with
117 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
examples/peripherals/i2s/i2s_codec/i2s_es8311/main/example_config.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: CC0-1.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "sdkconfig.h" | ||
|
||
/* Example configurations */ | ||
#define EXAMPLE_RECV_BUF_SIZE (2400) | ||
#define EXAMPLE_SAMPLE_RATE (16000) | ||
#define EXAMPLE_MCLK_MULTIPLE (384) // If not using 24-bit data width, 256 should be enough | ||
#define EXAMPLE_MCLK_FREQ_HZ (EXAMPLE_SAMPLE_RATE * EXAMPLE_MCLK_MULTIPLE) | ||
#define EXAMPLE_VOICE_VOLUME CONFIG_EXAMPLE_VOICE_VOLUME | ||
#if CONFIG_EXAMPLE_MODE_ECHO | ||
#define EXAMPLE_MIC_GAIN CONFIG_EXAMPLE_MIC_GAIN | ||
#endif | ||
|
||
|
||
#if !defined(CONFIG_EXAMPLE_BSP) | ||
|
||
/* I2C port and GPIOs */ | ||
#define I2C_NUM (0) | ||
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 | ||
#define I2C_SCL_IO (GPIO_NUM_16) | ||
#define I2C_SDA_IO (GPIO_NUM_17) | ||
#else | ||
#define I2C_SCL_IO (GPIO_NUM_6) | ||
#define I2C_SDA_IO (GPIO_NUM_7) | ||
#endif | ||
|
||
/* I2S port and GPIOs */ | ||
#define I2S_NUM (0) | ||
#define I2S_MCK_IO (GPIO_NUM_0) | ||
#define I2S_BCK_IO (GPIO_NUM_4) | ||
#define I2S_WS_IO (GPIO_NUM_5) | ||
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 | ||
#define I2S_DO_IO (GPIO_NUM_18) | ||
#define I2S_DI_IO (GPIO_NUM_19) | ||
#else | ||
#define I2S_DO_IO (GPIO_NUM_2) | ||
#define I2S_DI_IO (GPIO_NUM_3) | ||
#endif | ||
|
||
|
||
#else // CONFIG_EXAMPLE_BSP | ||
#include "bsp/esp-bsp.h" | ||
#define I2C_NUM BSP_I2C_NUM | ||
|
||
#endif // CONFIG_EXAMPLE_BSP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 15 additions & 14 deletions
29
examples/peripherals/i2s/i2s_codec/i2s_es8311/main/idf_component.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
## IDF Component Manager Manifest File | ||
dependencies: | ||
idf: "^5.0" | ||
espressif/es8311: "^1.0.0" | ||
## Required IDF version | ||
idf: | ||
version: "^5.0" | ||
# # Put list of dependencies here | ||
# # For components maintained by Espressif: | ||
# component: "~1.0.0" | ||
# # For 3rd party components: | ||
# username/component: ">=1.0.0,<2.0.0" | ||
# username2/component2: | ||
# version: "~1.0.0" | ||
# # For transient dependencies `public` flag can be set. | ||
# # `public` flag doesn't have an effect dependencies of the `main` component. | ||
# # All dependencies of `main` are public by default. | ||
# public: true | ||
|
||
# After enabling Board Support Packages support in menuconfig, you can pick you specific BSP here | ||
espressif/esp-box: | ||
version: "^2" | ||
rules: | ||
- if: "target in [esp32s3]" | ||
#espressif/esp32_s2_kaluga_kit: | ||
# version: "^2.1.1" | ||
# rules: | ||
# - if: "target in [esp32s2]" | ||
#espressif/esp32_s3_lcd_ev_board: | ||
# version: "^1" | ||
# rules: | ||
# - if: "target in [esp32s3]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
2 changes: 2 additions & 0 deletions
2
examples/peripherals/i2s/i2s_codec/i2s_es8311/sdkconfig.ci.bsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CONFIG_IDF_TARGET="esp32s3" | ||
CONFIG_EXAMPLE_BSP=y |
Empty file.