Skip to content

Commit abc36a6

Browse files
Raffael Rostagnokartben
authored andcommitted
tests: drivers: spi: esp32h2: Add testcase
Add SPI testcase for ESP32-H2. Signed-off-by: Raffael Rostagno <[email protected]>
1 parent 5304062 commit abc36a6

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_SPI_ESP32_INTERRUPT=y
2+
CONFIG_HEAP_MEM_POOL_SIZE=32768
3+
CONFIG_DMA=y
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&pinctrl {
8+
spim2_loopback: spim2_loopback {
9+
group1 {
10+
pinmux = <SPIM2_MISO_GPIO10>;
11+
output-enable; /* Enable internal loopback */
12+
};
13+
group2 {
14+
pinmux = <SPIM2_MOSI_GPIO10>;
15+
input-enable; /* Enable internal loopback */
16+
};
17+
group3 {
18+
pinmux = <SPIM2_SCLK_GPIO11>,
19+
<SPIM2_CSEL_GPIO12>;
20+
};
21+
};
22+
};
23+
24+
&spi2 {
25+
slow@0 {
26+
compatible = "test-spi-loopback-slow";
27+
reg = <0>;
28+
spi-max-frequency = <500000>;
29+
};
30+
fast@0 {
31+
compatible = "test-spi-loopback-fast";
32+
reg = <0>;
33+
spi-max-frequency = <16000000>;
34+
};
35+
};
36+
37+
&spi2 {
38+
#address-cells = <1>;
39+
#size-cells = <0>;
40+
dma-enabled;
41+
pinctrl-0 = <&spim2_loopback>;
42+
pinctrl-names = "default";
43+
status = "okay";
44+
45+
dmas = <&dma 0>, <&dma 1>;
46+
dma-names = "rx", "tx";
47+
};
48+
49+
&dma {
50+
status = "okay";
51+
};

0 commit comments

Comments
 (0)