mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-15 19:34:03 +00:00
ci(i2s): enable i2s ci tests on p4
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user