This adds two functions:
void gpio_ll_switch_dir_output(gpio_port_t port, uword_t outputs);
void gpio_ll_switch_dir_input(gpio_port_t port, uword_t inputs);
The first configures GPIO pins specified by a bitmask as output, the
second configures the specified pins as input.
The main use case is to allow bit-banging bidirectional protocols using
more basic GPIO peripherals that do not implement open drain mode, such
as found e.g. on MSP430, ATmega, or SAM0.
It is not intended to implement this feature on modern MCUs with
sophisticated GPIO peripherals.
Use analog mode for GPIO_DISCONNECT, as this is said to have the lowest
current leakage due to disabling the Schmitt trigger and correctly
detect this in `gpio_ll_query_conf()`.
Also drop the `schmitt_trigger_disabled` member in `gpio_conf_t`, as
the Schmitt trigger is only ever disabled in Analog mode anyway and
cannot be freely configured.
The separate Schmitt trigger bit in the configuration is dropped, as
the Schmitt trigger is only every disabled when in `GPIO_DISCONNECT`
mode. So no need to encode the same information twice.
The `gpio_state_t` is improved to be a bitmask that holds the
MODER register value and a flag indicating whether open-drain mode
should be enabled.
Finally, `GPIO_DISCONNECT` is implemented. This is done by placing the
GPIO in analog mode, which by disabling the Schmitt trigger reduces
power consumption.
This changes the implementation to be solely build upon `endian.h`
and `unaligned.h`.
This turns `byteorder.h` basically in syntactic sugar on top of the
`<endian.h>` API, reducing the complexity of the implementation and,
hence, the maintenance effort.
Note that yields a small ROM reduction as well *yeah!*
```
make BOARD=nrf52840dk RIOT_CI_BUILD=1 BUILD_IN_DOCKER=1 -C tests/unittests
```
Yields before this commit:
```
text data bss dec hex filename
417788 2200 28640 448628 6d874 /data/riotbuild/riotbase/tests/unittests/bin/nrf52840dk/tests_unittests.elf
```
And with this commit:
```
text data bss dec hex filename
417756 2200 28640 448596 6d854 /data/riotbuild/riotbase/tests/unittests/bin/nrf52840dk/tests_unittests.elf
```
This pulls in embedded-nal 0.7 implementations, and (on both crates)
alterations that decouple riot-wrappers from riot-sys and simplify build
system integration, and do away with the need for passing
RIOT_USEMODULE.
This will use the make test-input-hash-changed feature to save
the test hashes with the results and optionally skip running
the test if nothing has changed.
Murdock already has this feature but it is not easily accessible.
This should prevent unneeded flash cycles as well as speeding up
constant rerunning of tests for boards.
This target allows one to check if a test-input-hash is there and if it differs from
a new one, adding basic support to skip tests if nothing needs to be run.
RIOT_TEST_HASH_DIR represents the dir to generate the test-input-hash.sha1 file for
checking if a test has changed, uses BINDIR by default.
Since it defaults to BINDIR it should have no effect on running systems.
This allows a bit more fine grain control, especially when using
the compile_and_test_for_board.py script.
The checks would print their prominently colored warnings and confuse
users, and the comments are more geared to those editing the Makefiles
than to those watching which commands get executed.