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

521 Commits

Author SHA1 Message Date
Marian Buschsieweke
0dfd83938f
{cpu,drivers}/periph_gpio_ll: add missing include
For `gpio_ll_print_conf()` we need to include `<stdio.h>`, when not
using `fmt.h`.
2024-11-27 09:06:56 +01:00
Benjamin Valentin
4eb1c35fe3 cpu/sam0_eth: fix return values of sam0_eth_send() 2024-11-20 18:17:22 +01:00
Marian Buschsieweke
0222b8c54c
cpu/sam0_common/periph_gpio_ll: fix gpio_query_conf()
For the other MCUs, we take the input register state instead of the
output register state when the pin is configured as input. Let's do
the same here, as this is a lot more useful and intuitive.
2024-11-18 14:27:14 +01:00
Marian Buschsieweke
72d0b2b180
cpu/sam0_common/periph_gpio_ll: fix gpio_get_port()
It turns out that the legacy GPIO API and GPIO LL may disagree on what
the GPIO base address is: GPIO LL will use the IOBUS as base address
no matter what, the legacy GPIO API will use the APB as base address
unless `periph_gpio_fast_read` is used.

If the APIs disagree, we need to do impedance matching.
2024-11-18 12:50:25 +01:00
Marian Buschsieweke
f5f6b41bf8
Merge pull request #20994 from maribu/cpu/sam0_common/periph_adc/errata-2.1.6
cpu/sam0_common/periph_adc: add work around for errata 2.1.6
2024-11-17 13:55:12 +00:00
Benjamin Valentin
08fc52b53a cpu/sam0_common: eth: collision should return -EBUSY 2024-11-15 14:18:58 +01:00
Marian Buschsieweke
a89c924682
cpu/sam0_common/periph_adc: add work around for errata 2.1.6
This adds a delay between enabling the ADC and starting to sample
on the SAMD5x MCUs when the internal bandgap reference is used.

Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-11-14 22:44:23 +01:00
Dylan Laduranty
6401abbd92
Merge pull request #20850 from dylad/pr/cpu/saml21/compat_headers
cpu/saml21: add compatibily headers for vendor files migration
2024-11-08 08:14:28 +00:00
Dylan Laduranty
a9cb19dcc5 cpu/samr30: create compatibility headers for vendor files migration
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-11-07 21:25:03 +01:00
Dylan Laduranty
7d83c7a9d2 cpu/samr34: create compatibility headers for vendor files migration
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-11-07 21:22:23 +01:00
Marian Buschsieweke
c2c2cc8592
drivers/periph_gpio: let gpio_read() return bool
Since https://github.com/RIOT-OS/RIOT/pull/20935 gpio_write()
uses a `bool` instead of an `int`. This does the same treatment for
`gpio_read()`.

This does indeed add an instruction to `gpio_read()` implementations.
However, users caring about an instruction more are better served with
`gpio_ll_read()` anyway. And `gpio_read() == 1` is often seen in
newcomer's code, which would now work as expected.
2024-10-23 13:24:09 +02:00
Benjamin Valentin
4627f66caa drivers/periph/gpio: make gpio_write() take a bool 2024-10-22 16:39:48 +02:00
Marian Buschsieweke
702ad02b33
cpu/sam0_common/periph_dma: Fix API mismatch
Match the signature of the implementation of the dma_prepare() with the
declaration to fix:

    /home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/cpu/sam0_common/periph/dma.c:172:6: error: conflicting types for 'dma_prepare' due to enum/integer mismatch; have 'void(dma_t,  uint8_t,  const void *, void *, size_t,  uint8_t)' {aka 'void(unsigned int,  unsigned char,  const void *, void *, unsigned int,  unsigned char)'} [-Werror=enum-int-mismatch]
      172 | void dma_prepare(dma_t dma, uint8_t width, const void *src, void *dst,
          |      ^~~~~~~~~~~
    In file included from /home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/cpu/samd5x/include/periph_cpu.h:26,
                     from /home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/cpu/sam0_common/periph/dma.c:21:
    /home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/cpu/sam0_common/include/periph_cpu_common.h:1186:6: note: previous declaration of 'dma_prepare' with type void(dma_t,  uint8_t,  const void *, void *, size_t,  dma_incr_t)' {aka 'void(unsigned int,  unsigned char,  const void *, void *, unsigned int,  dma_incr_t)'}
     1186 | void dma_prepare(dma_t dma, uint8_t width, const void *src, void *dst,
          |      ^~~~~~~~~~~
2024-10-09 23:00:06 +02:00
Dylan Laduranty
fb8473a2ea cpu/saml21: create compatibility headers for vendor files migration
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-09-04 11:38:07 +02:00
mariemC
7df7886a69 cpu/sam0_common/periph: fix rtt reset after hibernation 2024-08-29 17:08:54 +02:00
Marian Buschsieweke
422042bd00
drivers/periph_gpio_ll_irq: make support for both edges optional
The assumption that every MCU has this feature turned out wrong. Hence,
add a feature to allow testing for support of edge triggered IRQs on
both flanks.
2024-08-02 13:41:36 +02:00
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
Dylan Laduranty
ccc155e351 cpu/sam0: remove bitfield usage in sdhc driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-25 16:13:17 +02:00
Dylan Laduranty
04e4770379 cpu/sam0: remove bitfield usage in headers
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-25 16:13:17 +02:00
Dylan Laduranty
25a04e6757 cpu/sam0/periph: remove bitfield usage in watchdog driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-25 16:13:17 +02:00
Dylan Laduranty
707fecbc38 cpu/sam0/periph: remove bitfield usage in usbdev driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-25 16:13:17 +02:00
Dylan Laduranty
f31ac8a978 cpu/sam0/periph: remove bitfield usage in UART driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-25 16:13:16 +02:00
Dylan Laduranty
6ccaca1e76 cpu/sam0/periph: remove bitfield usage in timer driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-25 16:13:16 +02:00
Dylan Laduranty
925e98b115 cpu/sam0/periph: remove bitfield usage in SPI driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-25 16:13:16 +02:00
Dylan Laduranty
7c1e66bdae cpu/sam0/periph: remove bitfield usage in RTC/RTT driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-25 16:13:16 +02:00
Dylan Laduranty
a66eebb8ac cpu/sam0/periph: remove bitfield usage in I2C driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-25 16:13:16 +02:00
Dylan Laduranty
37b03d8172 cpu/sam0/periph: remove bitfield usage in trng driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-25 16:13:16 +02:00
Dylan Laduranty
38c65b9531 cpu/sam0/periph: remove bitfield usage in PWM driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-25 16:13:16 +02:00
Dylan Laduranty
8af7b3b465 cpu/sam0/periph: remove bitfield usage in gpio_ll driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-21 09:42:46 +02:00
Dylan Laduranty
b2bbc4c6f1 cpu/sam0/periph: remove bitfield usage in gpio_ll_irq driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-21 09:42:46 +02:00
Dylan Laduranty
1e7167d9bf cpu/sam0/periph: remove bitfield usage in gpio driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-21 09:42:46 +02:00
Dylan Laduranty
ae7ed4612a cpu/sam0/periph: remove bitfield usage in flashpage driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-21 09:31:41 +02:00
Dylan Laduranty
1140241128 cpu/sam0/periph: remove bitfield usage in GMAC driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-21 09:31:41 +02:00
Dylan Laduranty
9d298137d6 cpu/sam0/periph: remove bitfield usage in DMAC driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-21 09:31:41 +02:00
Dylan Laduranty
292111a244 cpu/sam0/periph: remove bitfield usage in DAC driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-21 09:29:58 +02:00
Dylan Laduranty
3c64901b5e cpu/sam0/periph: remove bitfield usage in ADC driver
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-06-21 09:29:58 +02:00
Benjamin Valentin
d6d7d90a2a cpu/sam0_common: eth: reduce TX buffer count 2024-05-23 17:19:32 +02:00
Benjamin Valentin
4d1a5aa62c cpu/sam0_common: eth: port to new netdev API 2024-05-23 17:19:32 +02:00
Teufelchen
e2541c8528
Merge pull request #20525 from Teufelchen1/deprecate/muxpos
cpu/sam0: Remove deprecated muxpos
2024-05-07 14:15:04 +00:00
Teufelchen1
1cb2d7caed cpu/sam0: Remove deprecated muxpos 2024-04-03 11:59:48 +02:00
MrKevinWeiss
e0fdc3c16c
*Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
MrKevinWeiss
7a68fb0d5e
*Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
MrKevinWeiss
0a9c51fdf9
*.config: Modify all .config kconfig files 2024-03-26 14:53:40 +01:00
MrKevinWeiss
0f2b71c60e
*Makefile.features: Remove TEST_KCONFIG includes 2024-03-26 14:53:39 +01:00
Dylan Laduranty
92c36df77b cpu/sam0: don't enable TRFAIL interrupts
these interrupts were used to generate USBDEV_EVENT_TR_FAIL which is deprecated and will be removed

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-03-19 16:39:59 +01:00
Benjamin Valentin
6389b3c83b Revert "cpu/sam0_common: RTC: avoid negative month after POR"
This reverts commit 897a3ceda9.
2024-03-07 13:52:35 +01:00
Benjamin Valentin
8c4d0c53f2 cpu/sam0_common: RTC: avoid negative month after POR 2024-03-07 13:52:35 +01:00
Benjamin Valentin
897a3ceda9 cpu/sam0_common: RTC: avoid negative month after POR 2024-03-06 18:48:26 +01:00
Marian Buschsieweke
06a05370a2
cpu/sam0_common: Implement gpio_ll_switch_dir 2024-02-05 10:56:16 +01:00
Marian Buschsieweke
8bf61336a2
Merge pull request #20290 from maribu/drivers/periph/gpio_ll/features
drivers/periph_gpio_ll: Fix GPIO_DISCONNECT handling and add compile time feature checks
2024-02-05 07:30:54 +00:00