samples: sensor: qdec: Add overlays for Nordic Semiconductor boards
Add overlay for nrf52840dk_nrf52840 and nrf5340dk_nrf5340_cpuapp Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
This commit is contained in:
parent
09fa46ee4e
commit
b96f6fd618
3 changed files with 100 additions and 8 deletions
42
samples/sensor/qdec/boards/nrf52840dk_nrf52840.overlay
Normal file
42
samples/sensor/qdec/boards/nrf52840dk_nrf52840.overlay
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright 2023 Nordic Semiconductor ASA
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
qdec0 = &qdec0;
|
||||
qenca = &phase_a;
|
||||
qencb = &phase_b;
|
||||
};
|
||||
|
||||
encoder-emulate {
|
||||
compatible = "gpio-leds";
|
||||
phase_a: phase_a {
|
||||
/* Arduino A0 */
|
||||
gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
phase_b: phase_b {
|
||||
/* Arduino A1 */
|
||||
gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
qdec_pinctrl: qdec_pinctrl {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(QDEC_A, 0, 31)>, /* Ardiuno A5 */
|
||||
<NRF_PSEL(QDEC_B, 0, 30)>; /* Arduino A4 */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&qdec0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&qdec_pinctrl>;
|
||||
pinctrl-names = "default";
|
||||
steps = < 120 >;
|
||||
led-pre = < 500 >;
|
||||
};
|
41
samples/sensor/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay
Normal file
41
samples/sensor/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright 2023 Nordic Semiconductor ASA
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
qdec0 = &qdec1;
|
||||
qenca = &phase_a;
|
||||
qencb = &phase_b;
|
||||
};
|
||||
|
||||
encoder-emulate {
|
||||
compatible = "gpio-leds";
|
||||
phase_a: phase_a {
|
||||
/* Arduino A0 */
|
||||
gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
phase_b: phase_b {
|
||||
/* Arduino A1 */
|
||||
gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
qdec_pinctrl: qdec_pinctrl {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(QDEC_A, 0, 26)>, /* Ardiuno A5 */
|
||||
<NRF_PSEL(QDEC_B, 0, 25)>; /* Arduino A4 */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&qdec1 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&qdec_pinctrl>;
|
||||
pinctrl-names = "default";
|
||||
steps = < 120 >;
|
||||
led-pre = < 500 >;
|
||||
};
|
|
@ -1,16 +1,25 @@
|
|||
sample:
|
||||
description: Usage quadrature decoder sensor
|
||||
name: qdec_sensor
|
||||
common:
|
||||
tags: sensors
|
||||
timeout: 5
|
||||
harness: console
|
||||
harness_config:
|
||||
type: multi_line
|
||||
ordered: true
|
||||
regex:
|
||||
- "Quadrature decoder sensor test"
|
||||
- "Position = (.*) degrees"
|
||||
tests:
|
||||
sample.sensor.qdec_sensor:
|
||||
tags: sensors
|
||||
platform_allow: nucleo_f401re
|
||||
timeout: 5
|
||||
harness: console
|
||||
harness_config:
|
||||
type: multi_line
|
||||
ordered: true
|
||||
regex:
|
||||
- "Quadrature decoder sensor test"
|
||||
- "Position = (.*) degrees"
|
||||
fixture: fixture_mech_encoder
|
||||
sample.sensor.nrf_qdec_sensor:
|
||||
platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp
|
||||
integration_platforms:
|
||||
- nrf52840dk_nrf52840
|
||||
- nrf5340dk_nrf5340_cpuapp
|
||||
harness_config:
|
||||
fixture: gpio_loopback
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue