1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

50 Commits

Author SHA1 Message Date
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
Gunar Schorcht
3499b822ee cpu/efm32: add DAC support for EFM32 Series1 (VDAC) 2023-08-30 16:47:52 +02:00
Gunar Schorcht
817bb48843 cpu/efm32: fix DAC reference voltage configuration
The EFM32 MCU allows the reference voltage to be configured per DAC device, not per DAC channel. Also, the DAC reference voltage was defined in the configuration but not used anywhere.
2023-08-15 13:58:39 +02:00
Gunar Schorcht
9f894bc1ac cpu/efm32: clarify units in USB FIFO size definitions
Since the USB OTG FIFO sizes are partly defined in 32-bit words and partly in bytes, the documentation of the of the USB OTG FIFO size definitions is extended by the respective unit.
2023-04-16 22:59:11 +02:00
Gunar Schorcht
9528733a99 cpu/efm32: remove USB OTG HS definitions in vendor definitions
EFM32 MCUs do not support USB OTG HS mode. The according definitions are therefore removed from vendor definitions.
2023-04-16 22:59:11 +02:00
Gunar Schorcht
a235442b2b cpu/efm32: add number of EPs provided by USB OTG peripheral 2023-03-12 13:15:44 +01:00
Gunar Schorcht
dd6c46e289 cpu/efm32: fix PM configuration
`cpu/cortexm_common/include/cpu.h` has to be included in `cpu/efm32/periph_cpu.h` so that `PROVIDES_PM_SET_LOWEST` is defined if only `periph_cpu.h` is included. Otherwise `pm_set_lowest` is defined multiple times if the `pm_layered` module is not used. `PROVIDES_PM_OFF` has to be defined in case `pm_layered` is not used, e.g. in riotboot.
2022-12-07 16:38:51 +01:00
Gunar Schorcht
6146a3ea91 cpu/efm32: add support for Synopsys USB OTG FS IP core 2022-12-07 16:34:34 +01:00
Juergen Fitschen
a6ff838a4b
Merge pull request #18933 from jue89/feature/cpu_efm32_series_2_adc
cpu/efm32: add periph_adc support for Gecko Series 2
2022-11-24 11:32:56 +01:00
Juergen Fitschen
18e9167c73 cpu/efm32/adc: add support for Gecko Series 2
Series 2 features IADCs instead of ADCs.
2022-11-22 14:44:56 +01:00
Jue
80b491d7dd cpu/efm32/uart: add modecfg support for Gecko Series 2 2022-11-21 23:17:52 +01:00
Jue
2ce1df5cd6 cpu/efm32/wdt: add series 2 support 2022-10-24 23:16:39 +02:00
Jue
53e444ebc7 cpu/efm32/i2c: add series 2 support 2022-10-24 23:16:39 +02:00
Jue
2c2790dde2 cpu/efm32/spi: add series 2 support 2022-10-24 23:16:39 +02:00
Jue
568448f68c cpu/efm32/timer: add series 2 periph driver 2022-10-24 23:16:39 +02:00
Jue
42c9a3c9f1 cpu/efm32/uart: add series 2 periph driver 2022-10-24 23:16:38 +02:00
Jue
775861510c cpu/efm32: allow series 2 boards to setup clock trees flexibly 2022-10-24 23:16:38 +02:00
Jue
bc51071d44 cpu/efm32: define EFM power modes for pm_layered 2022-10-18 17:34:27 +02:00
Jue
b3989bc11f cpu/efm32: remove ADC defintion for CPUs without ADC
Gecko Series 2 is shipped with a new IADC peripheral which is backed by its own emlib driver.
2022-10-18 16:39:18 +02:00
Gunar Schorcht
550a599da9 cpu/efm32: fix RTT_MAX_VALUE selection
EFM32GG12 have both a RTC and a RTCC. `_RTC_CNT_MAX` is used as `RTT_MAX_VALUE` in this case.
2022-10-17 08:19:08 +02:00
chrysn
e9a577c384 cpu/efm32: Document what is and is not implemented
Collapsing strengths as they'll stay unused for the time being.
2022-05-03 19:32:08 +02:00
chrysn
3264a1d51d cpu/efm32: Minimal support for gpio_ll 2022-05-03 19:32:08 +02:00
Benjamin Valentin
0340ac6129 cpu: include IDLE in PM_NUM_MODES 2022-04-06 12:29:25 +02:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Karl Fessel
fb50acd3f9 cpu/efm32: define rtt attributes 2021-04-20 11:12:45 +02:00
a1ca06d6f4 cpu/efm32: coretemp.h: add missing stdint.h include 2020-11-25 17:52:34 +01:00
1d5e2e9cd9 all: remove traces of kernel_types.h
Automatically removed using:

    $ git grep -l kernel_types | xargs sed -i '/^#include .kernel_types/d'
2020-11-25 17:52:34 +01:00
Bas Stottelaar
431e6efdf6 cpu/efm32: add coretemp driver 2020-11-18 12:28:45 +01:00
9a79124fba
efm32: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:39 +01:00
Bas Stottelaar
3e2303d30c
cpu/efm32: add watchdog peripheral 2020-10-07 09:01:41 +02:00
Benjamin Valentin
7d29d85ddd cpu/efm32: define CLOCK_CORECLOCK 2020-09-09 16:44:12 +02:00
Francisco Molina
cbf78fe3d4
cpu/efm32: allow running both LETIMER and regular timer 2020-08-31 09:38:31 +02:00
Francisco Molina
5c4db4a65b
cpu/efm32: use IS_ACTIVE for CONFIG_EFM32_USE_LETIMER 2020-08-31 09:38:30 +02:00
Marian Buschsieweke
234a720571
Merge pull request #14516 from benpicco/bitband_hw
cortexm_common: fix check for bitbanding feature
2020-08-08 14:26:49 +02:00
Benjamin Valentin
b716419462 cpu/efm32: set CPU_HAS_BITBAND 2020-07-16 14:44:28 +02:00
Thomas Stilwell
754d790b3f boards: efm32 boards: add support for LETIMER 2020-07-10 20:44:03 -05:00
Thomas Stilwell
651a3bf423 cpu/efm32/timer: add support for LETIMER 2020-07-10 20:44:03 -05:00
Bas Stottelaar
1105f60a23 cpu/efm32: make series defines explicit
The EFM32 uses the provided _SILICON_LABS_32B_SERIES_0 and
_SILICON_LABS_32B_SERIES_1 definitions to enable or disable certain
code. With the introduction of new MCUs, there is also the
_SILICON_LABS_32B_SERIES_2 definition.

This PR ensures that the defines are explicit, and that #else
statements don't target the wrong series.
2020-07-08 21:54:57 +02:00
Bas Stottelaar
2a5010f779 cpu/efm32: remove EFM32_UART_MODES 2019-10-16 22:05:08 +02:00
Bas Stottelaar
4e6b46ca20 cpu/efm32: implement uart_mode 2019-09-30 18:12:15 +02:00
Bas Stottelaar
b2769c0857 cpu: efm32: move LOW_POWER_ENABLED to efm32-features.mk 2019-09-30 00:03:15 +02:00
653c23ea31
Merge pull request #11963 from fjmolinas/pr_efm32_flashpage_raw
cpu/efm32: add flashpage_raw
2019-08-06 16:29:15 +02:00
fjmolinas
e1576c986c cpu/efm32: add flashpage_raw 2019-08-05 17:24:26 +02:00
570f308551
cpu/efm32: deduplicate cpu_efm32 group definition 2019-08-05 16:57:36 +02:00
Bas Stottelaar
e8a76acea5 cpu: efm32: adapt to new i2c interface. 2018-07-25 12:01:40 +02:00
Bas Stottelaar
0c47233f97 cpu: efm32: add support for non-standard UART modes. 2018-06-04 18:16:41 +02:00
Bas Stottelaar
41347328ce cpu: efm32: correct power modes 2018-04-04 21:29:20 +02:00
Joakim Nohlgård
d4e5bea0a3 efm32: Use different values for each unsupported ADC res 2018-02-23 09:36:57 +01:00
Bas Stottelaar
91b2627539 cpu: efm32: implement pwm modes. 2018-01-31 23:39:42 +01:00
Bas Stottelaar
8f12b9896f cpu: efm32_common + ef32mg1p: replace with generalized efm32 cpu 2017-12-19 20:04:37 +01:00