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:
Lucas Tamborrino 2023-02-23 10:57:36 -03:00 committed by Maureen Helm
parent 2c1da15e35
commit 6a0b5346ef

View 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>;
};
};
};