Skip to content

Commit 090f8db

Browse files
Raffael Rostagnonashif
authored andcommitted
tests: drivers: esp32h2: Add config
Add test config for the following drivers: - ADC - CAN - LEDC PWM - MCPWM - SPI - DMA Signed-off-by: Raffael Rostagno <[email protected]>
1 parent f3a54fc commit 090f8db

File tree

7 files changed

+134
-0
lines changed

7 files changed

+134
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_ADC_ASYNC=n
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd.
5+
*/
6+
7+
/ {
8+
zephyr,user {
9+
/* adjust channel number according to pinmux in board.dts */
10+
io-channels = <&adc0 2>, <&adc0 3>;
11+
};
12+
};
13+
14+
&adc0 {
15+
#address-cells = <1>;
16+
#size-cells = <0>;
17+
status = "okay";
18+
19+
channel@2 {
20+
reg = <2>;
21+
zephyr,gain = "ADC_GAIN_1_4";
22+
zephyr,reference = "ADC_REF_INTERNAL";
23+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
24+
zephyr,resolution = <12>;
25+
};
26+
27+
channel@3 {
28+
reg = <3>;
29+
zephyr,gain = "ADC_GAIN_1_4";
30+
zephyr,reference = "ADC_REF_INTERNAL";
31+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
32+
zephyr,resolution = <12>;
33+
};
34+
};

tests/drivers/can/api/testcase.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ tests:
1717
platform_allow:
1818
- esp32s3_devkitm/esp32s3/procpu
1919
- xiao_esp32s3/esp32s3/procpu
20+
- esp32h2_devkitm
2021
drivers.can.api.nxp_s32_canxl.non_rx_fifo:
2122
extra_configs:
2223
- CONFIG_CAN_NXP_S32_RX_FIFO=n
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_DMA_LOOP_TRANSFER_CHANNEL_NR=0
2+
CONFIG_DMA_LOOP_TRANSFER_SIZE=4094
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&dma {
8+
status = "okay";
9+
};
10+
11+
tst_dma0: &dma { };
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd.
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/gpio/gpio.h>
9+
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h>
10+
11+
/ {
12+
zephyr,user {
13+
/* GPIO input pins order must match PWM pinctrl config */
14+
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>,
15+
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>;
16+
17+
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>,
18+
<&ledc0 5 80000 PWM_POLARITY_INVERTED>;
19+
};
20+
};
21+
22+
&pinctrl {
23+
ledc0_default: ledc0_default {
24+
group1 {
25+
pinmux = <LEDC_CH0_GPIO2>,
26+
<LEDC_CH5_GPIO3>;
27+
input-enable;
28+
};
29+
};
30+
};
31+
32+
&ledc0 {
33+
pinctrl-0 = <&ledc0_default>;
34+
pinctrl-names = "default";
35+
status = "okay";
36+
#address-cells = <1>;
37+
#size-cells = <0>;
38+
39+
channel0@0 {
40+
reg = <0x0>;
41+
timer = <0>;
42+
};
43+
44+
channel5@5 {
45+
reg = <0x5>;
46+
timer = <1>;
47+
};
48+
};
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
9+
/ {
10+
pwm_loopback_0 {
11+
compatible = "test-pwm-loopback";
12+
/* first index must be a 32-Bit timer */
13+
pwms = <&mcpwm0 0 0 PWM_POLARITY_NORMAL>,
14+
<&mcpwm0 6 0 PWM_POLARITY_NORMAL>;
15+
};
16+
};
17+
18+
&pinctrl {
19+
mcpwm0_default: mcpwm0_default {
20+
group1 {
21+
pinmux = <MCPWM0_OUT0A_GPIO2>;
22+
input-enable;
23+
};
24+
group2 {
25+
pinmux = <MCPWM0_CAP0_GPIO2>;
26+
output-enable;
27+
};
28+
};
29+
};
30+
31+
&mcpwm0 {
32+
pinctrl-0 = <&mcpwm0_default>;
33+
pinctrl-names = "default";
34+
prescale = <220>;
35+
prescale-timer0 = <103>;
36+
status = "okay";
37+
};

0 commit comments

Comments
 (0)