1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/esp32/include
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
..
esp_ble_nimble/syscfg cpu/esp32/esp-ble-nimble: fix too many empty lines in syscfg.h 2022-08-27 17:27:23 +02:00
esp_idf_api cpu/esp32: remove ESP-IDF periph_ctrl interface API 2023-03-27 03:10:56 +02:00
freertos cpu/esp_common/freertos: missing functions/definitions for ESP-IDF v4.4 2022-06-01 13:21:29 +02:00
sys cpu/esp32: update sys/lock.h for retargetable locking 2022-05-18 07:27:23 +02:00
adc_arch_private.h cpu/esp32: port periph/adc to ESP-IDF interface API 2022-07-17 17:16:49 +02:00
adc_arch.h cpu/esp32: remove ESP-IDF adc interface API 2023-03-27 03:10:56 +02:00
c11_atomics_compat_cpu.hpp cpu: Platform specific C11 atomics compat headers 2019-10-24 23:08:36 +02:00
can_esp.h cpu/esp32: port periph/can to ESP-IDF twai HAL 2022-07-14 15:51:47 +02:00
can_params.h cpu/esp*: fix doxygen grouping warnings 2021-09-11 12:45:15 +02:00
cpu_conf_esp32.h cpu/esp32: split cpu_conf.h into ESP32x and ESP32 parts 2022-07-18 16:48:56 +02:00
cpu_conf_esp32c3.h cpu/esp32: add ESP32-C3 specific configuration header files 2022-08-05 22:26:22 +02:00
cpu_conf_esp32s2.h cpu/esp32: add ESP32-S2 specific configuration header files 2022-08-29 17:19:39 +02:00
cpu_conf_esp32s3.h cpu/esp32: add ESP32-S3 specific configuration header files 2022-08-17 02:04:07 +02:00
cpu_conf.h cpu/esp32: add flashpage definitions in CPU config 2023-01-07 10:38:52 +01:00
gpio_arch.h cpu/esp32: implement periph/gpio_ll 2022-09-02 15:03:45 +02:00
gpio_ll_arch.h drivers/periph_gpio_ll: change API to access GPIO ports 2024-08-02 09:55:24 +02:00
irq_arch.h cpu/esp32: add SDMMC support 2024-01-05 07:22:27 +01:00
newlib.h cpu/esp32: enable _NANO_FORMATTED_IO for Espressif's GCC 8.4.0 2022-03-08 09:31:42 +01:00
periph_cpu_esp32.h Merge pull request #20241 from benpicco/busy_wait 2024-01-11 12:19:31 +00:00
periph_cpu_esp32c3.h cpu/esp32: add busy loop cycles for all sub-arches 2024-01-10 22:43:31 +01:00
periph_cpu_esp32s2.h cpu/esp32: add busy loop cycles for all sub-arches 2024-01-10 22:43:31 +01:00
periph_cpu_esp32s3.h cpu/esp32: add busy loop cycles for all sub-arches 2024-01-10 22:43:31 +01:00
periph_cpu.h drivers/periph_gpio_ll: change API to access GPIO ports 2024-08-02 09:55:24 +02:00
rtt_arch.h cpu/esp32: add RTT counter implementation 2020-04-07 09:12:44 +02:00
sdkconfig_esp32.h cpu/esp32: define RAM_START_ADDR and RAM_LEN 2023-06-25 17:33:06 +02:00
sdkconfig_esp32c3.h cpu/esp32: fix SDK configuration for USB PHY 2023-01-06 12:30:11 +01:00
sdkconfig_esp32s2.h cpu/esp32: drop CONFIG_ESP_PHY_ENABLE_USB for ESP32S2 2023-02-02 10:56:40 +01:00
sdkconfig_esp32s3.h cpu/esp32: fix SDK configuration for USB PHY 2023-01-06 12:30:11 +01:00
sdkconfig.h cpu/esp32: add LCD low-level parallel interface suppport 2023-11-13 13:01:57 +01:00
syscalls.h cpu/esp32: fix compilation errors 2022-01-25 00:36:51 +01:00