mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
remove(i2s_es8311): remove the bsp support since the broken dependency
This commit is contained in:
@@ -81,8 +81,6 @@ You can find configurations for this example in 'Example Configuration' tag.
|
||||
|
||||
* In 'Voice volume', you can set the volume between 0 to 100.
|
||||
|
||||
* In 'Enable Board Support Package (BSP) support' you can enable support for BSP. You can pick specific BSP in [idf_component.yml](main/idf_component.yml).
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Build the project and flash it to the board, then run monitor tool to view serial output:
|
||||
|
||||
@@ -9,7 +9,6 @@ menu "Example Configuration"
|
||||
config EXAMPLE_MODE_MUSIC
|
||||
bool "music"
|
||||
config EXAMPLE_MODE_ECHO
|
||||
depends on !EXAMPLE_BSP
|
||||
bool "echo"
|
||||
endchoice
|
||||
|
||||
@@ -56,9 +55,4 @@ menu "Example Configuration"
|
||||
help
|
||||
Set voice volume
|
||||
|
||||
config EXAMPLE_BSP
|
||||
bool "Enable Board Support Package (BSP) support"
|
||||
default n
|
||||
help
|
||||
Use BSP to setup all hardware settings. Specific board must be selected in main/idf_component.yml file.
|
||||
endmenu
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: CC0-1.0
|
||||
*/
|
||||
@@ -18,8 +18,6 @@
|
||||
#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
|
||||
@@ -45,9 +43,3 @@
|
||||
#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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: CC0-1.0
|
||||
*/
|
||||
@@ -31,7 +31,6 @@ extern const uint8_t music_pcm_end[] asm("_binary_canon_pcm_end");
|
||||
static esp_err_t es8311_codec_init(void)
|
||||
{
|
||||
/* Initialize I2C peripheral */
|
||||
#if !defined(CONFIG_EXAMPLE_BSP)
|
||||
const i2c_config_t es_i2c_cfg = {
|
||||
.sda_io_num = I2C_SDA_IO,
|
||||
.scl_io_num = I2C_SCL_IO,
|
||||
@@ -42,9 +41,6 @@ static esp_err_t es8311_codec_init(void)
|
||||
};
|
||||
ESP_RETURN_ON_ERROR(i2c_param_config(I2C_NUM, &es_i2c_cfg), TAG, "config i2c failed");
|
||||
ESP_RETURN_ON_ERROR(i2c_driver_install(I2C_NUM, I2C_MODE_MASTER, 0, 0, 0), TAG, "install i2c driver failed");
|
||||
#else
|
||||
ESP_ERROR_CHECK(bsp_i2c_init());
|
||||
#endif
|
||||
|
||||
/* Initialize es8311 codec */
|
||||
es8311_handle_t es_handle = es8311_create(I2C_NUM, ES8311_ADDRRES_0);
|
||||
@@ -69,7 +65,6 @@ static esp_err_t es8311_codec_init(void)
|
||||
|
||||
static esp_err_t i2s_driver_init(void)
|
||||
{
|
||||
#if !defined(CONFIG_EXAMPLE_BSP)
|
||||
i2s_chan_config_t chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM, I2S_ROLE_MASTER);
|
||||
chan_cfg.auto_clear = true; // Auto clear the legacy data in the DMA buffer
|
||||
ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &tx_handle, &rx_handle));
|
||||
@@ -95,17 +90,7 @@ static esp_err_t i2s_driver_init(void)
|
||||
ESP_ERROR_CHECK(i2s_channel_init_std_mode(rx_handle, &std_cfg));
|
||||
ESP_ERROR_CHECK(i2s_channel_enable(tx_handle));
|
||||
ESP_ERROR_CHECK(i2s_channel_enable(rx_handle));
|
||||
#else
|
||||
ESP_LOGI(TAG, "Using BSP for HW configuration");
|
||||
i2s_std_config_t std_cfg = {
|
||||
.clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(EXAMPLE_SAMPLE_RATE),
|
||||
.slot_cfg = I2S_STD_PHILIPS_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_STEREO),
|
||||
.gpio_cfg = BSP_I2S_GPIO_CFG,
|
||||
};
|
||||
std_cfg.clk_cfg.mclk_multiple = EXAMPLE_MCLK_MULTIPLE;
|
||||
ESP_ERROR_CHECK(bsp_audio_init(&std_cfg, &tx_handle, &rx_handle));
|
||||
ESP_ERROR_CHECK(bsp_audio_poweramp_enable(true));
|
||||
#endif
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,19 +2,3 @@
|
||||
dependencies:
|
||||
idf: "^5.0"
|
||||
espressif/es8311: "^1.0.0"
|
||||
|
||||
# After enabling Board Support Packages support in menuconfig, you can pick you specific BSP here
|
||||
espressif/esp-box:
|
||||
version: "^2.4.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]"
|
||||
i2s_examples_common:
|
||||
path: ${IDF_PATH}/examples/peripherals/i2s/i2s_examples_common
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
|
||||
@@ -16,19 +15,3 @@ def test_i2s_es8311_example_generic(dut: Dut) -> None:
|
||||
dut.expect('i2s es8311 codec example start')
|
||||
dut.expect('-----------------------------')
|
||||
dut.expect('I \\(([0-9]+)\\) i2s_es8311: i2s driver init success')
|
||||
|
||||
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'bsp',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
def test_i2s_es8311_example_bsp(dut: Dut) -> None:
|
||||
dut.expect('i2s es8311 codec example start')
|
||||
dut.expect('-----------------------------')
|
||||
dut.expect('Using BSP for HW configuration')
|
||||
dut.expect('I \\(([0-9]+)\\) i2s_es8311: i2s driver init success')
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
||||
CONFIG_EXAMPLE_BSP=y
|
||||
Reference in New Issue
Block a user