-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: gpio_api_1pin: rpi_pico2: Support using external pulldowns
Extend gpio_api_1pin so that tests can require a test fixture to provide an external pulldown resistor to the board under test. Use the new test-gpio-external-pulldown device tree binding to define where that GPIO is, and, finally, add a device tree overlay for the Raspberry Pi Pico 2 board that defines where the pulldown provided by the fixture will be. Tested locally using `--fixture gpio_external_pull_down` when running Twister on the command line, or by creating and using a Hardware Map file, in combination with a modified Pico 2. Signed-off-by: Andrew Featherstone <[email protected]>
- Loading branch information
Showing
4 changed files
with
58 additions
and
10 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,13 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright (c) 2024 Andrew Featherstone <[email protected]> | ||
*/ | ||
|
||
/ { | ||
resources { | ||
compatible = "test-gpio-external-pulldown"; | ||
/* Choice of pin on the header is arbitrary. */ | ||
gpios = <&pico_header 15 GPIO_ACTIVE_HIGH>; | ||
}; | ||
}; |
18 changes: 18 additions & 0 deletions
18
tests/drivers/gpio/gpio_api_1pin/dts/bindings/test-gpio-external-pulldown.yaml
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) 2024 Andrew Featherstone <[email protected]> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
description: | | ||
This binding provides resources required to build and run the | ||
tests/drivers/gpio/gpio_api_1pin test in Zephyr on certain hardware. | ||
compatible: "test-gpio-external-pulldown" | ||
|
||
properties: | ||
gpios: | ||
type: phandle-array | ||
required: true | ||
description: | | ||
Identity of a GPIO that will be configured as both an output and input. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
common: | ||
tags: | ||
- drivers | ||
- gpio | ||
depends_on: gpio | ||
min_flash: 48 | ||
tests: | ||
drivers.gpio.1pin: | ||
tags: | ||
- drivers | ||
- gpio | ||
depends_on: gpio | ||
min_flash: 48 | ||
filter: > | ||
dt_enabled_alias_with_parent_compat("led0", "gpio-leds") | ||
and not dt_compat_enabled("test-gpio-external-pulldown") | ||
# Fix exclude when we can exclude just sim run | ||
platform_exclude: | ||
- mps2/an385 | ||
- mps2/an521/cpu0 | ||
- neorv32 | ||
filter: dt_enabled_alias_with_parent_compat("led0", "gpio-leds") | ||
drivers.gpio.1pin.external_pull_down: | ||
# For testing boards that require a test fixture that provides a pulldown | ||
# resistor on the GPIO used for the test. | ||
filter: dt_compat_enabled("test-gpio-external-pulldown") | ||
harness_config: | ||
fixture: gpio_external_pull_down |