samples: sensor: qdec: add esp32s3 overlay
Add esp32s3 overlay to qdec sample to ilustrate the use of PCNT in quadrature enconder mode. Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
This commit is contained in:
parent
2c1da15e35
commit
6a0b5346ef
44
samples/sensor/qdec/boards/esp32s3_devkitm.overlay
Normal file
44
samples/sensor/qdec/boards/esp32s3_devkitm.overlay
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
|
||||
*/
|
||||
|
||||
#include <dt-bindings/pinctrl/esp32s3-pinctrl.h>
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
qdec0 = &pcnt;
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
pcnt_default: pcnt_default {
|
||||
group1 {
|
||||
pinmux = <PCNT0_CH0SIG_GPIO35>,
|
||||
<PCNT0_CH0CTRL_GPIO36>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pcnt {
|
||||
pinctrl-0 = <&pcnt_default>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
unit0@0 {
|
||||
reg = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
filter = <100>;
|
||||
channelA@0 {
|
||||
reg = <0>;
|
||||
sig-pos-mode = <2>;
|
||||
sig-neg-mode = <1>;
|
||||
ctrl-h-mode = <0>;
|
||||
ctrl-l-mode = <1>;
|
||||
};
|
||||
};
|
||||
};
|
Loading…
Reference in a new issue