mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ci(i2s): enable i2s ci tests on p4
This commit is contained in:
parent
62ae0efa54
commit
b9e44b92b3
@ -45,13 +45,13 @@ extern "C" {
|
||||
#define DATA_IN_IO 19
|
||||
#define DATA_OUT_IO 18
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
#define MASTER_MCK_IO 36
|
||||
#define MASTER_BCK_IO 4
|
||||
#define MASTER_WS_IO 5
|
||||
#define SLAVE_BCK_IO 7
|
||||
#define SLAVE_WS_IO 8
|
||||
#define DATA_IN_IO 2
|
||||
#define DATA_OUT_IO 3
|
||||
#define MASTER_MCK_IO 51
|
||||
#define MASTER_BCK_IO 45
|
||||
#define MASTER_WS_IO 46
|
||||
#define SLAVE_BCK_IO 22
|
||||
#define SLAVE_WS_IO 23
|
||||
#define DATA_IN_IO 47
|
||||
#define DATA_OUT_IO 48
|
||||
#else
|
||||
#define MASTER_MCK_IO 0
|
||||
#define MASTER_BCK_IO 4
|
||||
|
@ -432,6 +432,9 @@ esp_err_t i2s_alloc_dma_desc(i2s_chan_handle_t handle, uint32_t num, uint32_t bu
|
||||
handle->dma.desc[i]->offset = 0;
|
||||
handle->dma.bufs[i] = (uint8_t *) i2s_dma_calloc(1, bufsize * sizeof(uint8_t), I2S_DMA_ALLOC_CAPS, NULL);
|
||||
ESP_GOTO_ON_FALSE(handle->dma.bufs[i], ESP_ERR_NO_MEM, err, TAG, "allocate DMA buffer failed");
|
||||
#if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
|
||||
esp_cache_msync(handle->dma.bufs[i], bufsize * sizeof(uint8_t), ESP_CACHE_MSYNC_FLAG_DIR_C2M);
|
||||
#endif
|
||||
handle->dma.desc[i]->buf = handle->dma.bufs[i];
|
||||
ESP_LOGV(TAG, "desc addr: %8p\tbuffer addr:%8p", handle->dma.desc[i], handle->dma.bufs[i]);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -47,13 +47,13 @@ extern "C" {
|
||||
#define DATA_IN_IO 19
|
||||
#define DATA_OUT_IO 18
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
#define MASTER_MCK_IO 34
|
||||
#define MASTER_BCK_IO 35
|
||||
#define MASTER_WS_IO 48
|
||||
#define SLAVE_BCK_IO 10
|
||||
#define SLAVE_WS_IO 11
|
||||
#define DATA_IN_IO 12
|
||||
#define DATA_OUT_IO 49
|
||||
#define MASTER_MCK_IO 51
|
||||
#define MASTER_BCK_IO 45
|
||||
#define MASTER_WS_IO 46
|
||||
#define SLAVE_BCK_IO 22
|
||||
#define SLAVE_WS_IO 23
|
||||
#define DATA_IN_IO 47
|
||||
#define DATA_OUT_IO 48
|
||||
#else
|
||||
#define MASTER_MCK_IO 0
|
||||
#define MASTER_BCK_IO 4
|
||||
|
@ -70,31 +70,19 @@ examples/peripherals/i2c/i2c_tools:
|
||||
|
||||
examples/peripherals/i2s/i2s_basic/i2s_pdm:
|
||||
disable:
|
||||
- if: SOC_I2S_SUPPORTS_PDM != 1 or IDF_TARGET == "esp32p4"
|
||||
disable_test:
|
||||
- if: IDF_TARGET == "esp32p4"
|
||||
temporary: true
|
||||
reason: lack of runners
|
||||
- if: SOC_I2S_SUPPORTS_PDM != 1
|
||||
depends_components:
|
||||
- esp_driver_i2s
|
||||
|
||||
examples/peripherals/i2s/i2s_basic/i2s_std:
|
||||
disable:
|
||||
- if: SOC_I2S_SUPPORTED != 1 or IDF_TARGET == "esp32p4"
|
||||
disable_test:
|
||||
- if: IDF_TARGET == "esp32p4"
|
||||
temporary: true
|
||||
reason: lack of runners
|
||||
- if: SOC_I2S_SUPPORTED != 1
|
||||
depends_components:
|
||||
- esp_driver_i2s
|
||||
|
||||
examples/peripherals/i2s/i2s_basic/i2s_tdm:
|
||||
disable:
|
||||
- if: SOC_I2S_SUPPORTS_TDM != 1 or IDF_TARGET == "esp32p4"
|
||||
disable_test:
|
||||
- if: IDF_TARGET == "esp32p4"
|
||||
temporary: true
|
||||
reason: lack of runners
|
||||
- if: SOC_I2S_SUPPORTS_TDM != 1
|
||||
depends_components:
|
||||
- esp_driver_i2s
|
||||
|
||||
@ -108,26 +96,20 @@ examples/peripherals/i2s/i2s_codec/i2s_es7210_tdm:
|
||||
reason: lack of runners
|
||||
depends_components:
|
||||
- esp_driver_i2s
|
||||
- esp_driver_i2c
|
||||
- esp_driver_spi
|
||||
depends_filepatterns:
|
||||
- components/driver/i2c/**/*
|
||||
|
||||
examples/peripherals/i2s/i2s_codec/i2s_es8311:
|
||||
disable:
|
||||
- if: (SOC_I2S_SUPPORTED != 1 or SOC_I2C_SUPPORTED != 1)
|
||||
reason: rely on I2S STD mode and I2C to config es7210
|
||||
disable_test:
|
||||
- if: IDF_TARGET == "esp32p4"
|
||||
temporary: true
|
||||
reason: lack of runners
|
||||
depends_components:
|
||||
- esp_driver_i2s
|
||||
depends_filepatterns:
|
||||
- components/driver/i2c/**/*
|
||||
- esp_driver_i2c
|
||||
|
||||
examples/peripherals/i2s/i2s_recorder:
|
||||
disable:
|
||||
- if: SOC_SDMMC_HOST_SUPPORTED != 1 or IDF_TARGET == "esp32p4"
|
||||
- if: SOC_SDMMC_HOST_SUPPORTED != 1 or SOC_I2S_SUPPORTED != 1
|
||||
enable:
|
||||
- if: SOC_I2S_SUPPORTS_PDM_RX > 0
|
||||
depends_components:
|
||||
|
71
examples/peripherals/i2s/common/i2s_example_pins.h
Normal file
71
examples/peripherals/i2s/common/i2s_example_pins.h
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#define EXAMPLE_I2S_BCLK_IO1 GPIO_NUM_4 // I2S bit clock io number
|
||||
#define EXAMPLE_I2S_WS_IO1 GPIO_NUM_5 // I2S word select io number
|
||||
#define EXAMPLE_I2S_DOUT_IO1 GPIO_NUM_18 // I2S data out io number
|
||||
#define EXAMPLE_I2S_DIN_IO1 GPIO_NUM_19 // I2S data in io number
|
||||
// STD simplex pins
|
||||
#define EXAMPLE_I2S_BCLK_IO2 GPIO_NUM_22 // I2S bit clock io number
|
||||
#define EXAMPLE_I2S_WS_IO2 GPIO_NUM_23 // I2S word select io number
|
||||
#define EXAMPLE_I2S_DOUT_IO2 GPIO_NUM_25 // I2S data out io number
|
||||
#define EXAMPLE_I2S_DIN_IO2 GPIO_NUM_26 // I2S data in io number
|
||||
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
#define EXAMPLE_I2S_BCLK_IO1 GPIO_NUM_45 // I2S bit clock io number
|
||||
#define EXAMPLE_I2S_WS_IO1 GPIO_NUM_46 // I2S word select io number
|
||||
#define EXAMPLE_I2S_DOUT_IO1 GPIO_NUM_47 // I2S data out io number
|
||||
#define EXAMPLE_I2S_DIN_IO1 GPIO_NUM_48 // I2S data in io number
|
||||
// PDM RX 4 line IO
|
||||
#define EXAMPLE_I2S_DIN1_IO1 GPIO_NUM_20 // I2S data in io number
|
||||
#define EXAMPLE_I2S_DIN2_IO1 GPIO_NUM_21 // I2S data in io number
|
||||
#define EXAMPLE_I2S_DIN3_IO1 GPIO_NUM_22 // I2S data in io number
|
||||
// STD/TDM simplex pins
|
||||
#define EXAMPLE_I2S_BCLK_IO2 GPIO_NUM_20 // I2S bit clock io number
|
||||
#define EXAMPLE_I2S_WS_IO2 GPIO_NUM_21 // I2S word select io number
|
||||
#define EXAMPLE_I2S_DOUT_IO2 GPIO_NUM_22 // I2S data out io number
|
||||
#define EXAMPLE_I2S_DIN_IO2 GPIO_NUM_23 // I2S data in io number
|
||||
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||
#define EXAMPLE_I2S_BCLK_IO1 GPIO_NUM_2 // I2S bit clock io number
|
||||
#define EXAMPLE_I2S_WS_IO1 GPIO_NUM_3 // I2S word select io number
|
||||
#define EXAMPLE_I2S_DOUT_IO1 GPIO_NUM_4 // I2S data out io number
|
||||
#define EXAMPLE_I2S_DIN_IO1 GPIO_NUM_5 // I2S data in io number
|
||||
// PDM RX 4 line IO
|
||||
#define EXAMPLE_I2S_DIN1_IO1 GPIO_NUM_6 // I2S data in io number
|
||||
#define EXAMPLE_I2S_DIN2_IO1 GPIO_NUM_7 // I2S data in io number
|
||||
#define EXAMPLE_I2S_DIN3_IO1 GPIO_NUM_8 // I2S data in io number
|
||||
// STD/TDM simplex pins
|
||||
#define EXAMPLE_I2S_BCLK_IO2 GPIO_NUM_6 // I2S bit clock io number
|
||||
#define EXAMPLE_I2S_WS_IO2 GPIO_NUM_7 // I2S word select io number
|
||||
#define EXAMPLE_I2S_DOUT_IO2 GPIO_NUM_8 // I2S data out io number
|
||||
#define EXAMPLE_I2S_DIN_IO2 GPIO_NUM_9 // I2S data in io number
|
||||
|
||||
#else
|
||||
#define EXAMPLE_I2S_BCLK_IO1 GPIO_NUM_2 // I2S bit clock io number
|
||||
#define EXAMPLE_I2S_WS_IO1 GPIO_NUM_3 // I2S word select io number
|
||||
#define EXAMPLE_I2S_DOUT_IO1 GPIO_NUM_4 // I2S data out io number
|
||||
#define EXAMPLE_I2S_DIN_IO1 GPIO_NUM_5 // I2S data in io number
|
||||
|
||||
#define EXAMPLE_I2S_BCLK_IO2 GPIO_NUM_6 // I2S bit clock io number
|
||||
#define EXAMPLE_I2S_WS_IO2 GPIO_NUM_7 // I2S word select io number
|
||||
#define EXAMPLE_I2S_DOUT_IO2 GPIO_NUM_8 // I2S data out io number
|
||||
#define EXAMPLE_I2S_DIN_IO2 GPIO_NUM_9 // I2S data in io number
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -1,5 +1,5 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
||||
# I2S Basic PDM Mode Example
|
||||
|
||||
|
@ -10,4 +10,4 @@ endif()
|
||||
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
PRIV_REQUIRES esp_driver_i2s esp_driver_gpio
|
||||
INCLUDE_DIRS ".")
|
||||
INCLUDE_DIRS "." "$ENV{IDF_PATH}/examples/peripherals/i2s/common")
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@ -8,18 +8,20 @@
|
||||
#include <stdlib.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "soc/soc_caps.h"
|
||||
#include "driver/i2s_pdm.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_err.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "i2s_pdm_example.h"
|
||||
#include "i2s_example_pins.h"
|
||||
|
||||
#define EXAMPLE_PDM_RX_CLK_IO GPIO_NUM_0 // I2S PDM RX clock io number
|
||||
#define EXAMPLE_PDM_RX_DIN_IO GPIO_NUM_4 // I2S PDM RX data in io number
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
#define EXAMPLE_PDM_RX_DIN1_IO GPIO_NUM_5 // I2S PDM RX data line1 in io number
|
||||
#define EXAMPLE_PDM_RX_DIN2_IO GPIO_NUM_6 // I2S PDM RX data line2 in io number
|
||||
#define EXAMPLE_PDM_RX_DIN3_IO GPIO_NUM_7 // I2S PDM RX data line3 in io number
|
||||
#define EXAMPLE_PDM_RX_CLK_IO EXAMPLE_I2S_BCLK_IO1 // I2S PDM RX clock io number
|
||||
#define EXAMPLE_PDM_RX_DIN_IO EXAMPLE_I2S_DIN_IO1 // I2S PDM RX data in io number
|
||||
#if SOC_I2S_PDM_MAX_RX_LINES == 4
|
||||
#define EXAMPLE_PDM_RX_DIN1_IO EXAMPLE_I2S_DIN1_IO1 // I2S PDM RX data line1 in io number
|
||||
#define EXAMPLE_PDM_RX_DIN2_IO EXAMPLE_I2S_DIN2_IO1 // I2S PDM RX data line2 in io number
|
||||
#define EXAMPLE_PDM_RX_DIN3_IO EXAMPLE_I2S_DIN3_IO1 // I2S PDM RX data line3 in io number
|
||||
#endif
|
||||
|
||||
#define EXAMPLE_PDM_RX_FREQ_HZ 16000 // I2S PDM RX frequency
|
||||
@ -43,8 +45,7 @@ static i2s_chan_handle_t i2s_example_init_pdm_rx(void)
|
||||
.slot_cfg = I2S_PDM_RX_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_MONO),
|
||||
.gpio_cfg = {
|
||||
.clk = EXAMPLE_PDM_RX_CLK_IO,
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
// Only ESP32-S3 can support 4-line PDM RX
|
||||
#if SOC_I2S_PDM_MAX_RX_LINES == 4
|
||||
.dins = {
|
||||
EXAMPLE_PDM_RX_DIN_IO,
|
||||
EXAMPLE_PDM_RX_DIN1_IO,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@ -13,11 +13,12 @@
|
||||
#include "esp_check.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "i2s_pdm_example.h"
|
||||
#include "i2s_example_pins.h"
|
||||
|
||||
#define EXAMPLE_PDM_TX_CLK_IO GPIO_NUM_4 // I2S PDM TX clock io number
|
||||
#define EXAMPLE_PDM_TX_DOUT_IO GPIO_NUM_5 // I2S PDM TX data out io number
|
||||
#define EXAMPLE_PDM_TX_CLK_IO EXAMPLE_I2S_BCLK_IO1 // I2S PDM TX clock io number
|
||||
#define EXAMPLE_PDM_TX_DOUT_IO EXAMPLE_I2S_DOUT_IO1 // I2S PDM TX data out io number
|
||||
|
||||
#define EXAMPLE_PDM_TX_FREQ_HZ 44100 // I2S PDM TX frequency
|
||||
#define EXAMPLE_PDM_TX_FREQ_HZ 16000 // I2S PDM TX frequency
|
||||
#define EXAMPLE_WAVE_AMPLITUDE (1000.0) // 1~32767
|
||||
#define CONST_PI (3.1416f)
|
||||
#define EXAMPLE_SINE_WAVE_LEN(tone) (uint32_t)((EXAMPLE_PDM_TX_FREQ_HZ / (float)tone) + 0.5) // The sample point number per sine wave to generate the tone
|
||||
|
@ -1,6 +1,5 @@
|
||||
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
|
||||
@ -10,6 +9,7 @@ from pytest_embedded import Dut
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
@ -31,6 +31,7 @@ def test_i2s_pdm_tx_example(dut: Dut) -> None:
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
|
@ -1,5 +1,5 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
||||
# I2S Basic Standard Mode Example
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
idf_component_register(SRCS "i2s_std_example_main.c"
|
||||
PRIV_REQUIRES esp_driver_i2s esp_driver_gpio
|
||||
INCLUDE_DIRS ".")
|
||||
INCLUDE_DIRS "." "$ENV{IDF_PATH}/examples/peripherals/i2s/common")
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@ -12,6 +12,7 @@
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_check.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "i2s_example_pins.h"
|
||||
|
||||
/* Set 1 to allocate rx & tx channels in duplex mode on a same I2S controller, they will share the BCLK and WS signal
|
||||
* Set 0 to allocate rx & tx channels in simplex mode, these two channels will be totally separated,
|
||||
@ -19,28 +20,15 @@
|
||||
* and ESP32-S2 has only one I2S controller, so it can't allocate two simplex channels */
|
||||
#define EXAMPLE_I2S_DUPLEX_MODE CONFIG_USE_DUPLEX
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#define EXAMPLE_STD_BCLK_IO1 GPIO_NUM_4 // I2S bit clock io number
|
||||
#define EXAMPLE_STD_WS_IO1 GPIO_NUM_5 // I2S word select io number
|
||||
#define EXAMPLE_STD_DOUT_IO1 GPIO_NUM_18 // I2S data out io number
|
||||
#define EXAMPLE_STD_DIN_IO1 GPIO_NUM_19 // I2S data in io number
|
||||
#define EXAMPLE_STD_BCLK_IO1 EXAMPLE_I2S_BCLK_IO1 // I2S bit clock io number
|
||||
#define EXAMPLE_STD_WS_IO1 EXAMPLE_I2S_WS_IO1 // I2S word select io number
|
||||
#define EXAMPLE_STD_DOUT_IO1 EXAMPLE_I2S_DOUT_IO1 // I2S data out io number
|
||||
#define EXAMPLE_STD_DIN_IO1 EXAMPLE_I2S_DIN_IO1 // I2S data in io number
|
||||
#if !EXAMPLE_I2S_DUPLEX_MODE
|
||||
#define EXAMPLE_STD_BCLK_IO2 GPIO_NUM_22 // I2S bit clock io number
|
||||
#define EXAMPLE_STD_WS_IO2 GPIO_NUM_23 // I2S word select io number
|
||||
#define EXAMPLE_STD_DOUT_IO2 GPIO_NUM_25 // I2S data out io number
|
||||
#define EXAMPLE_STD_DIN_IO2 GPIO_NUM_26 // I2S data in io number
|
||||
#endif
|
||||
#else
|
||||
#define EXAMPLE_STD_BCLK_IO1 GPIO_NUM_2 // I2S bit clock io number
|
||||
#define EXAMPLE_STD_WS_IO1 GPIO_NUM_3 // I2S word select io number
|
||||
#define EXAMPLE_STD_DOUT_IO1 GPIO_NUM_4 // I2S data out io number
|
||||
#define EXAMPLE_STD_DIN_IO1 GPIO_NUM_5 // I2S data in io number
|
||||
#if !EXAMPLE_I2S_DUPLEX_MODE
|
||||
#define EXAMPLE_STD_BCLK_IO2 GPIO_NUM_6 // I2S bit clock io number
|
||||
#define EXAMPLE_STD_WS_IO2 GPIO_NUM_7 // I2S word select io number
|
||||
#define EXAMPLE_STD_DOUT_IO2 GPIO_NUM_8 // I2S data out io number
|
||||
#define EXAMPLE_STD_DIN_IO2 GPIO_NUM_9 // I2S data in io number
|
||||
#endif
|
||||
#define EXAMPLE_STD_BCLK_IO2 EXAMPLE_I2S_BCLK_IO2 // I2S bit clock io number
|
||||
#define EXAMPLE_STD_WS_IO2 EXAMPLE_I2S_WS_IO2 // I2S word select io number
|
||||
#define EXAMPLE_STD_DOUT_IO2 EXAMPLE_I2S_DOUT_IO2 // I2S data out io number
|
||||
#define EXAMPLE_STD_DIN_IO2 EXAMPLE_I2S_DIN_IO2 // I2S data in io number
|
||||
#endif
|
||||
|
||||
#define EXAMPLE_BUFF_SIZE 2048
|
||||
|
@ -1,6 +1,5 @@
|
||||
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
|
||||
@ -11,6 +10,7 @@ from pytest_embedded import Dut
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.generic
|
||||
def test_i2s_basic_example(dut: Dut) -> None:
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
| Supported Targets | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S3 |
|
||||
| ----------------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S3 |
|
||||
| ----------------- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
||||
# I2S Basic TDM Mode Example
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
idf_component_register(SRCS "i2s_tdm_example_main.c"
|
||||
PRIV_REQUIRES esp_driver_i2s esp_driver_gpio
|
||||
INCLUDE_DIRS ".")
|
||||
INCLUDE_DIRS "." "$ENV{IDF_PATH}/examples/peripherals/i2s/common")
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@ -12,21 +12,22 @@
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_check.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "i2s_example_pins.h"
|
||||
|
||||
/* Set 1 to allocate rx & tx channels in duplex mode on a same I2S controller, they will share the BCLK and WS signal
|
||||
* Set 0 to allocate rx & tx channels in simplex mode, these two channels will be totally separated */
|
||||
#define EXAMPLE_I2S_DUPLEX_MODE 1
|
||||
|
||||
#define EXAMPLE_TDM_BCLK_IO1 GPIO_NUM_2 // I2S bit clock io number
|
||||
#define EXAMPLE_TDM_WS_IO1 GPIO_NUM_3 // I2S word select io number
|
||||
#define EXAMPLE_TDM_DOUT_IO1 GPIO_NUM_4 // I2S data out io number
|
||||
#define EXAMPLE_TDM_DIN_IO1 GPIO_NUM_5 // I2S data in io number
|
||||
#define EXAMPLE_TDM_BCLK_IO1 EXAMPLE_I2S_BCLK_IO1 // I2S bit clock io number
|
||||
#define EXAMPLE_TDM_WS_IO1 EXAMPLE_I2S_WS_IO1 // I2S word select io number
|
||||
#define EXAMPLE_TDM_DOUT_IO1 EXAMPLE_I2S_DOUT_IO1 // I2S data out io number
|
||||
#define EXAMPLE_TDM_DIN_IO1 EXAMPLE_I2S_DIN_IO1 // I2S data in io number
|
||||
#if !EXAMPLE_I2S_DUPLEX_MODE
|
||||
#define EXAMPLE_TDM_BCLK_IO2 GPIO_NUM_6 // I2S bit clock io number
|
||||
#define EXAMPLE_TDM_WS_IO2 GPIO_NUM_7 // I2S word select io number
|
||||
#define EXAMPLE_TDM_DOUT_IO2 GPIO_NUM_8 // I2S data out io number
|
||||
#define EXAMPLE_TDM_DIN_IO2 GPIO_NUM_9 // I2S data in io number
|
||||
#endif
|
||||
#define EXAMPLE_TDM_BCLK_IO2 EXAMPLE_I2S_BCLK_IO2 // I2S bit clock io number
|
||||
#define EXAMPLE_TDM_WS_IO2 EXAMPLE_I2S_WS_IO2 // I2S word select io number
|
||||
#define EXAMPLE_TDM_DOUT_IO2 EXAMPLE_I2S_DOUT_IO2 // I2S data out io number
|
||||
#define EXAMPLE_TDM_DIN_IO2 EXAMPLE_I2S_DIN_IO2 // I2S data in io number
|
||||
#endif // !EXAMPLE_I2S_DUPLEX_MODE
|
||||
|
||||
#define EXAMPLE_BUFF_SIZE 2048
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
|
||||
@ -9,6 +8,7 @@ from pytest_embedded import Dut
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.generic
|
||||
def test_i2s_tdm_example(dut: Dut) -> None:
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@ -30,6 +30,23 @@
|
||||
#define EXAMPLE_SD_SPI_MOSI_IO (17)
|
||||
#define EXAMPLE_SD_SPI_MISO_IO (16)
|
||||
#define EXAMPLE_SD_SPI_CS_IO (15)
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
#define EXAMPLE_I2C_NUM (0)
|
||||
#define EXAMPLE_I2C_SDA_IO (3)
|
||||
#define EXAMPLE_I2C_SCL_IO (2)
|
||||
|
||||
/* I2S port and GPIOs */
|
||||
#define EXAMPLE_I2S_NUM (0)
|
||||
#define EXAMPLE_I2S_MCK_IO (4)
|
||||
#define EXAMPLE_I2S_BCK_IO (5)
|
||||
#define EXAMPLE_I2S_WS_IO (6)
|
||||
#define EXAMPLE_I2S_DI_IO (7)
|
||||
|
||||
/* SD card SPI GPIOs */
|
||||
#define EXAMPLE_SD_SPI_CLK_IO (18)
|
||||
#define EXAMPLE_SD_SPI_MOSI_IO (19)
|
||||
#define EXAMPLE_SD_SPI_MISO_IO (14)
|
||||
#define EXAMPLE_SD_SPI_CS_IO (17)
|
||||
#else
|
||||
#define EXAMPLE_I2C_NUM (0)
|
||||
#define EXAMPLE_I2C_SDA_IO (3)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: CC0-1.0
|
||||
*/
|
||||
@ -28,6 +28,9 @@
|
||||
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||
#define I2C_SCL_IO (GPIO_NUM_8)
|
||||
#define I2C_SDA_IO (GPIO_NUM_9)
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
#define I2C_SCL_IO (GPIO_NUM_8)
|
||||
#define I2C_SDA_IO (GPIO_NUM_7)
|
||||
#else
|
||||
#define I2C_SCL_IO (GPIO_NUM_6)
|
||||
#define I2C_SDA_IO (GPIO_NUM_7)
|
||||
@ -35,6 +38,13 @@
|
||||
|
||||
/* I2S port and GPIOs */
|
||||
#define I2S_NUM (0)
|
||||
#if CONFIG_IDF_TARGET_ESP32P4
|
||||
#define I2S_MCK_IO (GPIO_NUM_13)
|
||||
#define I2S_BCK_IO (GPIO_NUM_12)
|
||||
#define I2S_WS_IO (GPIO_NUM_10)
|
||||
#define I2S_DO_IO (GPIO_NUM_11)
|
||||
#define I2S_DI_IO (GPIO_NUM_9)
|
||||
#else
|
||||
#define I2S_MCK_IO (GPIO_NUM_0)
|
||||
#define I2S_BCK_IO (GPIO_NUM_4)
|
||||
#define I2S_WS_IO (GPIO_NUM_5)
|
||||
@ -45,6 +55,7 @@
|
||||
#define I2S_DO_IO (GPIO_NUM_2)
|
||||
#define I2S_DI_IO (GPIO_NUM_3)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#else // CONFIG_EXAMPLE_BSP
|
||||
#include "bsp/esp-bsp.h"
|
||||
|
@ -1,6 +1,5 @@
|
||||
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
|
||||
@ -11,6 +10,7 @@ from pytest_embedded import Dut
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.generic
|
||||
def test_i2s_es8311_example_generic(dut: Dut) -> None:
|
||||
dut.expect('i2s es8311 codec example start')
|
||||
|
@ -1,5 +1,5 @@
|
||||
| Supported Targets | ESP32 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-P4 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- |
|
||||
|
||||
# I2S Digital Microphone Recording Example
|
||||
|
||||
|
@ -6,6 +6,7 @@ from pytest_embedded import Dut
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.generic
|
||||
def test_i2s_recorder_generic(dut: Dut) -> None:
|
||||
dut.expect('PDM microphone recording example start')
|
||||
|
Loading…
x
Reference in New Issue
Block a user