-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP tests/drivers/gpio: generalize gpio specification solution
Provide board-specific overlays that specify which pins to use for the test, rather than use aliases in the board device tree. This uses a binding that's specifically documented for use in GPIO applications. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
- Loading branch information
Showing
7 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# | ||
# Copyright (c) 2019 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
title: GPIO pin definitions for tests | ||
|
||
description: > | ||
Identify accessible board pins that can be used for GPIO signals. | ||
Most development boards expose several GPIO pins on a header. These | ||
may be used as signals to a logic analyzer, or to simulate an | ||
external device. This binding provides a board-independent | ||
description of pins that can be made available for this purpose. | ||
compatible: "test,scope-pins" | ||
|
||
properties: | ||
gpios: | ||
type: compound | ||
required: true | ||
description: > | ||
Accessible pins used for GPIO-based instrumentation and | ||
testing. | ||
Any number of pins may be provided, on multiple GPIO devices. | ||
However at least two entries must be present, and the first | ||
two must be on the same GPIO device. |
12 changes: 12 additions & 0 deletions
12
tests/drivers/gpio/gpio_basic_api/efr32mg_sltb004a.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright (c) 2019 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/ { | ||
scope-pins { | ||
compatible = "test,scope-pins"; | ||
gpios = <&gpiof 6 0>, <&gpiof 5 0>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) 2019 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/ { | ||
scope-pins { | ||
compatible = "test,scope-pins"; | ||
gpios = | ||
<&gpioc 16 0>, <&gpioc 17 0>, | ||
<&gpioc 2 0>, <&gpioc 3 0>, | ||
<&gpioc 1 0>, <&gpioc 8 0>, | ||
<&gpioc 9 0>, <&gpioc 0 0>, | ||
<&gpioc 7 0>, <&gpioc 5 0>; | ||
|
||
}; | ||
}; |
17 changes: 17 additions & 0 deletions
17
tests/drivers/gpio/gpio_basic_api/nrf52840_pca10056.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright (c) 2019 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/ { | ||
scope-pins { | ||
compatible = "test,scope-pins"; | ||
/* Use pins on P3 (Arduino D0) header. */ | ||
gpios = | ||
<&gpio1 1 0>, <&gpio1 2 0>, | ||
<&gpio1 3 0>, <&gpio1 4 0>, | ||
<&gpio1 5 0>, <&gpio1 6 0>, | ||
<&gpio1 7 0>, <&gpio1 8 0>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ CONFIG_GPIO=y | |
CONFIG_ZTEST=y | ||
CONFIG_ENTROPY_GENERATOR=y | ||
CONFIG_TEST_RANDOM_GENERATOR=y | ||
#CONFIG_TEST_USERSPACE=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters