Skip to content

Commit fd3cc9b

Browse files
Raffael Rostagnokartben
authored andcommitted
samples: boards: esp32c6_devkitc: Add QDEC sample for PCNT
Add QDEC sample for PCNT driver testing. Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
1 parent fb2b48f commit fd3cc9b

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd.
5+
*/
6+
7+
/ {
8+
aliases {
9+
qdec0 = &pcnt;
10+
};
11+
};
12+
13+
&pinctrl {
14+
pcnt_default: pcnt_default {
15+
group1 {
16+
pinmux = <PCNT0_CH0SIG_GPIO2>,
17+
<PCNT0_CH0CTRL_GPIO3>;
18+
bias-pull-up;
19+
};
20+
};
21+
};
22+
23+
&pcnt {
24+
pinctrl-0 = <&pcnt_default>;
25+
pinctrl-names = "default";
26+
status = "okay";
27+
#address-cells = <1>;
28+
#size-cells = <0>;
29+
unit0@0 {
30+
reg = <0>;
31+
#address-cells = <1>;
32+
#size-cells = <0>;
33+
filter = <100>;
34+
channelA@0 {
35+
reg = <0>;
36+
sig-pos-mode = <2>;
37+
sig-neg-mode = <1>;
38+
ctrl-h-mode = <0>;
39+
ctrl-l-mode = <1>;
40+
};
41+
};
42+
};

0 commit comments

Comments
 (0)