tests: esp32c3: Add USB variant
Add USB variant config files for esp32c3 boards. Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
This commit is contained in:
parent
8048a6ab67
commit
d20140d014
17 changed files with 282 additions and 0 deletions
9
tests/boards/espressif/wifi/socs/esp32c3_usb.overlay
Normal file
9
tests/boards/espressif/wifi/socs/esp32c3_usb.overlay
Normal file
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&wifi {
|
||||
status = "okay";
|
||||
};
|
1
tests/drivers/adc/adc_api/socs/esp32c3_usb.conf
Normal file
1
tests/drivers/adc/adc_api/socs/esp32c3_usb.conf
Normal file
|
@ -0,0 +1 @@
|
|||
CONFIG_ADC_ASYNC=n
|
35
tests/drivers/adc/adc_api/socs/esp32c3_usb.overlay
Normal file
35
tests/drivers/adc/adc_api/socs/esp32c3_usb.overlay
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) 2022 Wolter HV <wolterhv@gmx.de>
|
||||
* Copyright (c) 2023 Benjamin Björnsson <benjamin.bjornsson@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/ {
|
||||
zephyr,user {
|
||||
/* adjust channel number according to pinmux in board.dts */
|
||||
io-channels = <&adc0 0>, <&adc0 1>;
|
||||
};
|
||||
};
|
||||
|
||||
&adc0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
channel@0 {
|
||||
reg = <0>;
|
||||
zephyr,gain = "ADC_GAIN_1";
|
||||
zephyr,reference = "ADC_REF_INTERNAL";
|
||||
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
|
||||
zephyr,resolution = <12>;
|
||||
};
|
||||
|
||||
channel@1 {
|
||||
reg = <1>;
|
||||
zephyr,gain = "ADC_GAIN_1";
|
||||
zephyr,reference = "ADC_REF_INTERNAL";
|
||||
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
|
||||
zephyr,resolution = <12>;
|
||||
};
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
&timer0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&rtc {
|
||||
slow-clk-src = <ESP32_RTC_SLOW_CLK_SRC_RC_FAST_D256>;
|
||||
};
|
|
@ -0,0 +1,3 @@
|
|||
CONFIG_DMA_TRANSFER_CHANNEL_NR_0=5
|
||||
CONFIG_DMA_TRANSFER_CHANNEL_NR_1=0
|
||||
CONFIG_HEAP_MEM_POOL_SIZE=32768
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&dma {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
tst_dma0: &dma { };
|
2
tests/drivers/dma/loop_transfer/socs/esp32c3_usb.conf
Normal file
2
tests/drivers/dma/loop_transfer/socs/esp32c3_usb.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
CONFIG_DMA_LOOP_TRANSFER_CHANNEL_NR=0
|
||||
CONFIG_DMA_LOOP_TRANSFER_SIZE=4094
|
11
tests/drivers/dma/loop_transfer/socs/esp32c3_usb.overlay
Normal file
11
tests/drivers/dma/loop_transfer/socs/esp32c3_usb.overlay
Normal file
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&dma {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
tst_dma0: &dma { };
|
1
tests/drivers/flash/common/socs/esp32c3_usb.conf
Normal file
1
tests/drivers/flash/common/socs/esp32c3_usb.conf
Normal file
|
@ -0,0 +1 @@
|
|||
CONFIG_HEAP_MEM_POOL_SIZE=16384
|
13
tests/drivers/gpio/gpio_basic_api/socs/esp32c3_usb.overlay
Normal file
13
tests/drivers/gpio/gpio_basic_api/socs/esp32c3_usb.overlay
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/ {
|
||||
resources {
|
||||
compatible = "test-gpio-basic-api";
|
||||
out-gpios = <&gpio0 4 0>;
|
||||
in-gpios = <&gpio0 5 0>;
|
||||
};
|
||||
};
|
34
tests/drivers/pwm/pwm_api/socs/esp32c3_usb.overlay
Normal file
34
tests/drivers/pwm/pwm_api/socs/esp32c3_usb.overlay
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
|
||||
*/
|
||||
|
||||
#include <zephyr/dt-bindings/pwm/pwm.h>
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
pwm-0 = &ledc0;
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
ledc0_default: ledc0_default {
|
||||
group1 {
|
||||
pinmux = <LEDC_CH0_GPIO2>;
|
||||
output-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ledc0 {
|
||||
pinctrl-0 = <&ledc0_default>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
channel0@0 {
|
||||
reg = <0x0>;
|
||||
timer = <0>;
|
||||
};
|
||||
};
|
48
tests/drivers/pwm/pwm_gpio_loopback/socs/esp32c3_usb.overlay
Normal file
48
tests/drivers/pwm/pwm_gpio_loopback/socs/esp32c3_usb.overlay
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
|
||||
*/
|
||||
|
||||
#include <zephyr/dt-bindings/pwm/pwm.h>
|
||||
#include <zephyr/dt-bindings/gpio/gpio.h>
|
||||
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h>
|
||||
|
||||
/ {
|
||||
zephyr,user {
|
||||
/* GPIO input pins order must match PWM pinctrl config */
|
||||
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>,
|
||||
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>;
|
||||
|
||||
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>,
|
||||
<&ledc0 5 80000 PWM_POLARITY_INVERTED>;
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
ledc0_default: ledc0_default {
|
||||
group1 {
|
||||
pinmux = <LEDC_CH0_GPIO2>,
|
||||
<LEDC_CH5_GPIO3>;
|
||||
input-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ledc0 {
|
||||
pinctrl-0 = <&ledc0_default>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
channel0@0 {
|
||||
reg = <0x0>;
|
||||
timer = <0>;
|
||||
};
|
||||
|
||||
channel5@5 {
|
||||
reg = <0x5>;
|
||||
timer = <1>;
|
||||
};
|
||||
};
|
2
tests/drivers/spi/spi_loopback/socs/esp32c3_usb.conf
Normal file
2
tests/drivers/spi/spi_loopback/socs/esp32c3_usb.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
CONFIG_SPI_ESP32_INTERRUPT=y
|
||||
CONFIG_HEAP_MEM_POOL_SIZE=32768
|
44
tests/drivers/spi/spi_loopback/socs/esp32c3_usb.overlay
Normal file
44
tests/drivers/spi/spi_loopback/socs/esp32c3_usb.overlay
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
spim2_loopback: spim2_loopback {
|
||||
group1 {
|
||||
pinmux = <SPIM2_MISO_GPIO2>;
|
||||
output-enable; /* Enable internal loopback */
|
||||
};
|
||||
group2 {
|
||||
pinmux = <SPIM2_MOSI_GPIO2>;
|
||||
input-enable; /* Enable internal loopback */
|
||||
};
|
||||
group3 {
|
||||
pinmux = <SPIM2_SCLK_GPIO6>,
|
||||
<SPIM2_CSEL_GPIO10>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
slow@0 {
|
||||
compatible = "test-spi-loopback-slow";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <500000>;
|
||||
};
|
||||
fast@0 {
|
||||
compatible = "test-spi-loopback-fast";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <16000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
dma-enabled;
|
||||
pinctrl-0 = <&spim2_loopback>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
};
|
2
tests/drivers/uart/uart_async_api/socs/esp32c3_usb.conf
Normal file
2
tests/drivers/uart/uart_async_api/socs/esp32c3_usb.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
CONFIG_HEAP_MEM_POOL_SIZE=32768
|
||||
CONFIG_DMA=y
|
31
tests/drivers/uart/uart_async_api/socs/esp32c3_usb.overlay
Normal file
31
tests/drivers/uart/uart_async_api/socs/esp32c3_usb.overlay
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
uart1_test: uart1_test {
|
||||
group1 {
|
||||
pinmux = <UART1_TX_GPIO5>;
|
||||
input-enable;
|
||||
};
|
||||
group2 {
|
||||
pinmux = <UART1_RX_GPIO5>;
|
||||
output-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dut: &uart1 {
|
||||
status = "okay";
|
||||
current-speed = <115200>;
|
||||
pinctrl-0 = <&uart1_test>;
|
||||
pinctrl-names = "default";
|
||||
dmas = <&dma 0>, <&dma 1>;
|
||||
dma-names = "rx", "tx";
|
||||
};
|
||||
|
||||
&dma {
|
||||
status = "okay";
|
||||
};
|
28
tests/drivers/uart/uart_elementary/socs/esp32c3_usb.overlay
Normal file
28
tests/drivers/uart/uart_elementary/socs/esp32c3_usb.overlay
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
uart1_test: uart1_test {
|
||||
group1 {
|
||||
pinmux = <UART1_TX_GPIO2>,
|
||||
<UART1_RTS_GPIO3>;
|
||||
input-enable;
|
||||
output-high;
|
||||
};
|
||||
group2 {
|
||||
pinmux = <UART1_RX_GPIO2>,
|
||||
<UART1_CTS_GPIO3>;
|
||||
output-enable;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dut: &uart1 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&uart1_test>;
|
||||
pinctrl-names = "default";
|
||||
current-speed = <115200>;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue