1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:52:44 +01:00
RIOT/boards/common
Marian Buschsieweke 36e8526046
drivers/periph_gpio_ll: change API to access GPIO ports
The API was based on the assumption that GPIO ports are mapped in memory
sanely, so that a `GPIO_PORT(num)` macro would work allow for constant
folding when `num` is known and still be efficient when it is not.

Some MCUs, however, will need a look up tables to efficiently translate
GPIO port numbers to the port's base address. This will prevent the use
of such a `GPIO_PORT(num)` macro in constant initializers.

As a result, we rather provide `GPIO_PORT_0`, `GPIO_PORT_1`, etc. macros
for each GPIO port present (regardless of MCU naming scheme), as well as
`GPIO_PORT_A`, `GPIO_PORT_B`, etc. macros if (and only if) the MCU port
naming scheme uses letters rather than numbers.

These can be defined as macros to the peripheral base address even when
those are randomly mapped into the address space. In addition, a C
function `gpio_port()` replaces the role of the `GPIO_PORT()` and
`gpio_port_num()` the `GPIO_PORT_NUM()` macro. Those functions will
still be implemented as efficient as possible and will allow constant
folding where it was formerly possible. Hence, there is no downside for
MCUs with sane peripheral memory mapping, but it is highly beneficial
for the crazy ones.

There are also two benefits for the non-crazy MCUs:
1. We can now test for valid port numbers with `#ifdef GPIO_PORT_<NUM>`
    - This directly benefits the test in `tests/periph/gpio_ll`, which
      can now provide a valid GPIO port for each and every board
    - Writing to invalid memory mapped I/O addresses was treated as
      triggering undefined behavior by the compiler and used as a
      optimization opportunity
2. We can now detect at compile time if the naming scheme of the MCU
   uses letters or numbers, and produce more user friendly output.
    - This is directly applied in the test app
2024-08-02 09:55:24 +02:00
..
arduino-atmega *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
arduino-due boards/*: include periph/gpio.h in board.h 2024-07-12 15:02:43 +02:00
arduino-mkr *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
arduino-zero boards/*: include periph/gpio.h in board.h 2024-07-12 15:02:43 +02:00
atmega *Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
atxmega *Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
blxxxpill *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
cc26xx_cc13xx boards/common/cc26xx_cc13xx: Fix flashing with upstream OpenOCD 2023-01-10 22:39:35 +01:00
cc2538 boards/cc2538: set cc2538-bsl as supported programmer 2021-02-24 13:28:53 +01:00
e104-bt50xxa-tb *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
esp32 *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
esp32c3 *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
esp32s2 *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
esp32s3 *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
esp32x boards/esp32*: move saul_gpio dep to board level 2024-05-22 13:38:33 +02:00
esp8266 *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
frdm boards/frdm: set openocd as only supported programmer 2021-02-24 13:29:16 +01:00
gd32v boards/common/gd32v: reorder members in initialization 2024-01-20 16:42:49 +01:00
init boards: drop empty custom board_init & empty board.c 2022-02-22 18:27:37 +01:00
iotlab build system: add netif_openwsn feature 2024-05-27 22:56:37 +02:00
kw41z tree-wide: Introduce netif feature and use it 2024-05-22 10:39:56 +02:00
makefiles boards/common/makefiles/stdio_cdc_acm.dep.mk: fix 2024-02-12 19:55:40 +01:00
microbit *Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
msb-430 *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
msba2 boards: set supported programmers 2021-02-24 13:30:34 +01:00
msp430 boards: clean up MSP430 board configuration 2023-12-10 09:11:24 +01:00
nrf51 *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
nrf52 tree-wide: Introduce netif feature and use it 2024-05-22 10:39:56 +02:00
nrf52xxxdk *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
nucleo *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
nucleo32 *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
nucleo64 *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
nucleo144 boards/common/nucleo144: revert waitespace changes 2024-04-23 11:13:48 -04:00
particle-mesh *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
qn908x *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
remote *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
samdx1-arduino-bootloader *Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
saml1x boards/*: include periph/gpio.h in board.h 2024-07-12 15:02:43 +02:00
silabs *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
slwstk6000b *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
sodaq *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
stm32 drivers/periph_gpio_ll: change API to access GPIO ports 2024-08-02 09:55:24 +02:00
weact-f4x1cx *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
doc.txt boards/stm32f103c8: add docu on flashing with DFU 2018-08-15 15:00:13 +02:00