1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00
RIOT/tests/periph/gpio_ll/README.md
Marian Buschsieweke 00cb9668ae
drivers/periph_gpio_ll: Improve documentation
The documentation on the state `GPIO_DISCONNECT` was a bit vague. The
API doc said it should disconnect the GPIO from all peripherals, the
test also tested them for being electrically disconnected.

The documentation in both the test and the API is extended to point out
that a GPIO indeed SHOULD be in high impedance state, but that user
MUST NOT expect that this requested is honored by every implementation
and for every GPIO pin.

In the test it is also pointed out that failing the test for a GPIO
in the `GPIO_DISCONNECT` state being electrically disconnected is for
some pins expected, and that the test should be just run again with
different GPIOs. The test intentionally tests for a feature not provided
by every GPIO pin rather than warning on a failure: The effort to just
flash and run the test again with different GPIOs is relatively low, but
it does confirm correct behavior of the API.
2024-01-22 10:28:35 +01:00

1.5 KiB

Test for periph/gpio_ll

This application will use two output and two input GPIOs, which have to be connected via a jumper wire. The test will change the value of the two pins output pins and use the input pins to read the value back in. If the value read doesn't match the expected result, the test aborts and fails.

If IRQ support is provided, the test will additionally walk through every IRQ configuration for the first GPIO pin given and iterate over any trigger condition possible. It will check that edge trigger and (if supported) level trigger IRQs trigger exactly on the configured triggers.

Configuration

Configure in the Makefile or set via environment variables the number of the output GPIO port to use via the PORT_OUT variable. The PIN_OUT_0 and PIN_OUT_1 variables select the pins to use within that GPIO port. The input GPIO port is set via PORT_IN. Both PORT_IN == PORT_OUT and PORT_IN != PORT_OUT is valid. The input pin number within PORT_IN are set via PIN_IN_0 and PIN_IN_1. PIN_IN_0 has to be wired to PIN_OUT_0, and PIN_IN_1 to PIN_OUT_1.

Expected Failures

Implementations are allowed to not electrically disconnect GPIO pins in state GPIO_DISCONNECT. The test will however test for pins to be electrically disconnected. For every MCU supported by GPIO LL so far at least some pins can be electrically disconnected. You might need to change the GPIO pins tested if the test for disconnected GPIOs being also electrically disconnected.