1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-28 23:49:47 +01:00
Commit Graph

4425 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
Marian Buschsieweke
c700aa92d4
Merge pull request #21031 from benpicco/net_fixes-misc
drivers/at86rf215: return ENETDOWN when interface is down
2024-11-23 16:30:32 +00:00
Benjamin Valentin
a379658fa1 drivers/at86rf215: tx_frame_len is already set by at86rf215_tx_load() 2024-11-22 19:50:12 +01:00
Benjamin Valentin
ef639df76f drivers/at86rf215: return ENETDOWN when interface is down 2024-11-22 19:44:12 +01:00
Marian Buschsieweke
a841fc39b9
Merge pull request #21020 from benpicco/drivers/atwinc15x0-netdev_new
drivers/atwinc15x0: port to `netdev_new_api`
2024-11-21 22:15:04 +00:00
Marian Buschsieweke
db331188b9
Merge pull request #21025 from benpicco/drivers/wdt-early_init
drivers/periph_init: initialize watchdog first
2024-11-21 22:14:48 +00:00
Benjamin Valentin
220d1008a0 drivers/periph_init: initialize watchdog first
We want to initialize the watchdog early so it can detect a hang in
later init functions.
2024-11-21 16:28:28 +01:00
Benjamin Valentin
7c93da905f drivers/atwinc15x0: port to netdev_new_api 2024-11-21 13:59:58 +01:00
benpicco
27073eeab6
Merge pull request #21016 from benpicco/driver/ethos-netdev_new_api
drivers/ethos: port to netdev_new_api
2024-11-21 10:25:14 +00:00
Marian Buschsieweke
8179312d06
Merge pull request #20978 from benpicco/drivers/slipdev-netdev_new
drivers/slipdev: port to netdev_new_api
2024-11-21 09:55:19 +00:00
Marian Buschsieweke
7832253f39
Merge pull request #20991 from benpicco/rivers/dose-new_api
drivers/dose: port to netdev_new_api
2024-11-21 05:49:32 +00:00
Benjamin Valentin
fc72c76054 drivers/ethos: port to netdev_new_api 2024-11-21 00:14:16 +01:00
Benjamin Valentin
8e4bdca325 drivers/dose: port to netdev_new_api 2024-11-21 00:10:57 +01:00
Benjamin Valentin
82e5b19b86 drivers/slipdev: port to netdev_new_api 2024-11-21 00:06:25 +01:00
benpicco
2bce94a7c7
Merge pull request #21012 from benpicco/netdev_new_api-relax
netdev_new_api: allow `.send()` to return > 0 to signal synchronos send
2024-11-20 22:28:26 +00:00
Benjamin Valentin
a86411b81e drivers/netdev: allow .send() to return > 0 to signal synchronos send 2024-11-20 16:40:36 +01:00
Marian Buschsieweke
04f1597792
drivers/periph_timer: fix timer_query_freqs() doc
The code examples in the doc contained an obvious bug that this commit
fixes.
2024-11-18 21:27:41 +01:00
Marian Buschsieweke
51f969d655
Merge pull request #20993 from benpicco/netdev_new_api-enhance
gnrc_netif: netdev_new_api implies TX end irq, no need to check it
2024-11-17 08:45:19 +00:00
Marian Buschsieweke
dedc8f950f
Merge pull request #20995 from benpicco/confirm_send-retval
drivers/netdev: revise return values of `.confirm_send()`
2024-11-15 22:46:58 +00:00
Benjamin Valentin
dbd52079e1 drivers/netdev: revise return values of .confirm_send() 2024-11-15 14:18:58 +01:00
Benjamin Valentin
140c3afbcc drivers/at86rf215: don't use netdev events internally 2024-11-15 14:08:44 +01:00
Benjamin Valentin
62eb2935c8 drivers/at86rf215 drop get for NETOPT_TX_END_IRQ
This is always true with netdev_new_api
2024-11-14 17:39:23 +01:00
Benjamin Valentin
fbd1ffe2f1 drivers/netdev: hide legacy events behind netdev_legacy_api 2024-11-14 17:11:28 +01:00
Benjamin Valentin
1629a6aa41 drivers/at86rf215: properly implement netdev_new 2024-11-14 11:57:58 +01:00
Benjamin Valentin
122758143a drivers/slipdev: implement NETDEV_EVENT_TX_COMPLETE event 2024-11-11 19:17:24 +01:00
Marian Buschsieweke
2b6f65a08a
build_system/xfa: change API to fix alignment
This changes the API of xfa from

    XFA(array_name, prio) type element_name = INITIALIZER;

to

    XFA(type, array_name, prio) element_name = INITIALIZER;

this allows forcing natural alignment of the type, fixing failing tests
on `native64`.
2024-11-07 16:30:01 +01:00
Marian Buschsieweke
ceeb787a6f
drivers: no need to convert gpio_read() to bool
We just changed the API so that it returns bool anyway.
2024-10-23 13:24:10 +02: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
Virgile Robles
7c68f00cd1 drivers/dht: test and doc 2024-10-21 15:13:23 +02:00
Virgile Robles
a2db594eb5 drivers/dht: fix null deref with saul 2024-10-20 07:53:52 +02:00
Mikolai Gütschow
f0e6776d40
treewide: apply codespell corrections 2024-10-09 13:03:52 +02:00
chrysn
13188e13f2
Merge pull request #20887 from chrysn-pull-requests/fmt
static_tests: Add test for Rust code formatting rules
2024-10-04 08:24:07 +00:00
chrysn
69a89b80ca treewide/rust: cargo fmt 2024-10-02 22:17:08 +02:00
Marian Buschsieweke
8c2f6ae9dc
drivers: Add shield_llcc68 module
This implements the `shield_llcc68` module that allows using the LLCC68
LoRa shield on Arduino UNO compatible boards (with Arduino IO mappings
provided by the board) by just selecting the module.
2024-10-02 09:48:29 +02:00
Marian Buschsieweke
7bc7b732d5
drivers/shield_w5100: pimp documentation
This adds a picture and a small fact table to the doc.
2024-10-02 09:48:29 +02:00
chrysn
f116a78de8 doc: Clarify that our CPU ID is not ARM's CPUID 2024-09-27 10:42:17 +02:00
chrysn
739e2697d6 drivers/leds: Make initialization conditional on presence, not pin
The LEDx_PIN may still be defined (eg. on the particle-mesh family
because it is used to configure the PWM pins); the IS_PRESENT macro
performs the stricter check ov testing for an _ON function.
2024-08-26 11:12:51 +02:00
chrysn
c0288f7d40 rust: Update to riot-wrappers 0.9 2024-08-22 17:33:40 +02:00
Jan Romann
947a5043c3 drivers/sx127x: fix link formatting in documentation 2024-08-20 14:19:27 +02:00
Marian Buschsieweke
a6b459eff3
drivers/periph/gpio_ll: change gpio_ll_switch_dir API
It turns out that the feature to switch the GPIO direction quickly
is not only a way to emulate open drain / open source mode for less
sophisticated GPIO peripherals that do not natively support it.
It also enables tri-state output (push-pull high, push-pull low,
high impedance), which is useful e.g. for driven charlieplexed LEDs
quickly.

This changes the API by introducing a `gpio_ll_prepare_switch_dir()`
function that prepares the value used to identify which pins should
be switched to input or to output mode. This is useful for GPIO
peripherals in which the GPIO mode register does not allocate one bit
per pin (so that only the direction is given there), such as the one
for STM32. This allows an STM32 implementation in which preparing the
bitmask needed to modify the direction of pins is not trivial.
2024-08-08 16:22:36 +02:00
Marian Buschsieweke
5db461c28b
drivers/periph_gpio_ll: always use hardware features
GPIO LL headers might be included even when not using GPIO LL. Some
functions may be provided by the common header or the platform specific
one, depending on the features used. Hence, the header can only be
safely included if the correct set of GPIO LL hardware features is used.
2024-08-02 13:41:37 +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
Mikolai Gütschow
b0b3b071d3
drivers/led: add LED_NUMOF and convenience inline functions 2024-07-11 14:48:16 +02:00
Joshua DeWeese
ad24c08c50 drivers/periph_wdt: fix auto starting of watchdog timer
When WDT_HAS_INIT is non-zero (which it is for all but two supported
CPUs). The watchdog timer was not automatically started on boot when the
periph_wdt_auto_start module was enabled. This patch fixes this.
2024-06-19 12:25:02 -04:00
Marian Buschsieweke
8821f1f301
Merge pull request #20730 from maribu/tree-wide/musl/fixes
tree wide: compilation fixes for `native64` on musl systems
2024-06-15 17:12:03 +00:00
Leandro Lanzieri
ebf64133d7
drivers: add max31855 2024-06-12 13:11:45 +02:00
Marian Buschsieweke
a62f10f7e3
Merge pull request #20731 from chrysn-pull-requests/ws281x-saul-write
drivers/ws281x: Fix SAUL writes
2024-06-05 21:04:51 +00:00
chrysn
ad2a031e6c drivers/ws281x: Return correct number of written elements 2024-06-05 22:41:40 +02:00