1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/esp32
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
..
bin cpu/esp32: compile bootloader from ESP-IDF v4.4 source 2022-06-01 13:31:00 +02:00
bootloader *Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
esp-ble-nimble *Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
esp-eth *Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
esp-idf *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
esp-idf-api *Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
esp-lcd *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
freertos cpu/esp*: move freertos/task to cpu/esp_common 2020-02-21 09:09:34 +01:00
include drivers/periph_gpio_ll: change API to access GPIO ports 2024-08-02 09:55:24 +02:00
ld Merge #19760 #19946 #19956 #19957 2023-09-29 08:36:50 +00:00
periph drivers/periph_gpio_ll: change API to access GPIO ports 2024-08-02 09:55:24 +02:00
stdio_usb_serial_jtag *Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
vendor/include cpu/esp32: add vendor header file for periph_usbdev 2022-09-27 01:00:57 +02:00
doc_esp32.txt cpu/esp32: add SDMMC support 2024-01-05 07:22:27 +01:00
doc_esp32c3.txt cpu/esp32: documentation fix 2023-07-07 11:12:01 +02:00
doc_esp32s2.txt cpu/esp32: documentation fix 2023-07-07 11:12:01 +02:00
doc_esp32s3.txt cpu/esp32: add SDMMC support 2024-01-05 07:22:27 +01:00
doc.txt cpu/esp32: add SDMMC support 2024-01-05 07:22:27 +01:00
esp_ztimer.c cpu/esp32: platform-independent formatting in DEBUG 2022-07-18 13:51:33 +02:00
irq_arch.c cpu/esp32: add SDMMC support 2024-01-05 07:22:27 +01:00
Kconfig *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Kconfig.common *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Kconfig.esp32 *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Kconfig.esp32c3 *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Kconfig.esp32s2 *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Kconfig.esp32s3 *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Kconfig.esp32x *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Makefile cpu/esp32: add LCD low-level parallel interface suppport 2023-11-13 13:01:57 +01:00
Makefile.default cpu: make pm_layered a DEFAULT_MODULE 2021-01-27 13:21:20 +01:00
Makefile.dep features.yaml: s/esp_eth/periph_eth/ 2024-05-28 20:59:29 +02:00
Makefile.features *Makefile.features: Remove TEST_KCONFIG includes 2024-03-26 14:53:39 +01:00
Makefile.include cpu/esp32: add LCD low-level parallel interface suppport 2023-11-13 13:01:57 +01:00
startup.c cpu/esp32: fix compilation with gcc 12.2 2023-04-17 07:32:48 +02:00
syscalls.c cpu/esp32: fix compilation with gcc 12.2 2023-04-17 07:32:48 +02:00
usb_reset.c cpu/esp32: add esp-bootloader-reset 2023-02-02 10:56:40 +01:00