1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 06:53:52 +01:00

1963 Commits

Author SHA1 Message Date
David Picard
d2f8d4df22 drivers/abp2: driver for SPI sensors, prepare for I2C
Honeywell ABP2 pressure sensors series.
Implement all sensors features, only supporting the SPI version
of the sensor.
Prepare future support for the I2C interface by emphasizing where
to implement the code that will support the I2C bus version.
2025-05-04 10:28:58 +02:00
Marian Buschsieweke
4ce7ab2133
tree-wide: fix documentation issues
This should fix compilation with -Wdocumentation on LLVM.
2025-04-10 13:37:13 +02:00
Marian Buschsieweke
e5d2321fc2
Merge pull request #21392 from crasbe/pr/sen5x_fixup
driver/sen5x: Small Fixups
2025-04-08 18:20:16 +00:00
crasbe
832edbf11c drivers/sen5x: change header guard to #pragma once 2025-04-08 18:37:14 +02:00
mguetschow
3b470956aa
Merge pull request #21386 from mguetschow/deprecated-mtd-dev
drivers/mtd_default: remove deprecated `mtd_default_get_dev()`
2025-04-08 14:53:35 +00:00
crasbe
87352ee72d
Merge pull request #19955 from dprigoshij/sen5x
drivers/sen5x: Add device driver for SEN5x
2025-04-08 13:21:57 +00:00
Mikolai Gütschow
23d7f99f2b
drivers/mtd_default: remove deprecated mtd_default_get_dev()
use `mtd_dev_get()` instead

deprecated in https://github.com/RIOT-OS/RIOT/pull/20078
2025-04-08 15:05:34 +02:00
Daniel Prigoshij
0fd9959fbb tests/driver_sen5x: Added a test case for the SEN5X driver 2025-04-08 11:22:15 +02:00
Daniel Prigoshij
0eb1d9bca4 pkg/driver_sen5x: Implemented dedicated package for the sen5x driver 2025-04-08 11:22:06 +02:00
Marian Buschsieweke
db0be36345
tree-wide: mixed back of documentation fixes
This fixes a number of documentation issues that LLVM/clang would flag
with `-Wdocumentation`.
2025-04-07 15:59:13 +02:00
Daniel Prigoshij
3aa960ea01 drivers/sen5x: SAUL functionality imlemented 2025-04-07 13:21:30 +02:00
fabian18
d3d9afc9c5
Merge pull request #21365 from fabian18/pr/lis2dh12_int32_lis2dh12_wait_event
drivers/lis2dh12: int32_t lis2dh12_wait_event()
2025-04-06 12:22:12 +00:00
Fabian Hüßler
482750a67e drivers/lis2dh12: int32_t lis2dh12_wait_event() 2025-04-06 13:43:07 +02:00
Daniel Prigoshij
fadeafdf85 drivers/sen5x: added dedicated driver for the SEN5x 2025-04-04 13:27:04 +02:00
Marian Buschsieweke
1ff982a664
tree wide: various doc fixes
This fixes a batch of incorrect Doxygen comments that building with
LLVM/clang and `-Wdocumentation` uncovered.
2025-04-04 11:44:53 +02:00
Marian Buschsieweke
17d2516a54
Merge pull request #20581 from maribu/timer_get_closest_freq
drivers/periph_timer: add `timer_get_closest_freq()`
2025-04-02 14:45:14 +00:00
Marian Buschsieweke
5b600d3a8e
drivers/periph_timer: add timer_get_closest_freq
Add an API to search for the frequency supported by a timer that
is closest to the given target frequency.

This is in fact non-trivial to get right, as pre-scaler registers can
be 16 bit or even 32 bit in size, making a naive loop over all possible
pre-scalers too expensive (computationally).

Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
2025-04-02 16:21:07 +02:00
Marian Buschsieweke
48162bd0a6
Merge pull request #21325 from KSKNico/clang-format-header-fix
treewide: fixing order of doxygen tags and header guards
2025-03-28 16:45:02 +00:00
KSKNico
d357f5388b drivers/include: applied the script to the driver headers 2025-03-28 17:09:07 +01:00
mguetschow
d2fbe23e78
Merge pull request #21112 from KSKNico/tm1637
drivers/tm1637: add driver and tests for tm1637 7-segment display
2025-03-25 13:49:02 +00:00
KSKNico
cccce720e3 drivers/tm1637: driver for the tm1637 7-segment display 2025-03-18 16:53:36 +01:00
krzysztof-cabaj
a2dfd78b27 treewide: fix double the in doc and comments 2025-02-18 13:25:02 +01:00
benpicco
837bc0c5ed
Merge pull request #20428 from cogip/fdcan
can: add CAN FD support to STM32G4 and native architecture
2025-02-10 16:31:39 +00:00
Marian Buschsieweke
a82573558d
drivers/periph_{i2c,spi}: fix doc on initialization
Both SPI and I2C peripheral drivers *MUST NOT* be initialized by the
application code / (non-peripheral) device driver, as this is done
automatically be default. Some peripheral drivers have a non-idempotent
initialization and initializing them twice will break things.

Sadly, the doc states the exact opposite.

This updates the documentation to match the implementation. In addition
the special case is pointed out of disabling the automatic
initialization during boot, in which case the app indeed has to do the
initialization.
2025-02-04 09:22:40 +01:00
Gilles DOFFE
f05fc0c70f can: introduce loop_delay
During the data phase of a FDCAN transmission only one node is
transmitting, all others are receivers. The length of the bus line has
no impact.
When transmitting via pin FDCAN_TX the protocol controller receives the
transmitted data from its local CAN transceiver via pin FDCAN_RX. The
received data is delayed by the CAN transceiver loop delay.
If this delay is greater than TSEG1 (time segment before sample point),
a bit error is detected. Without transceiver delay compensation, the bit
rate in the data phase of a FDCAN frame is limited by the transceiver's
loop delay.

Since this parameter is related to the transceiver used, there cannot be
a default value, and it must be explicitly defined with the
configuration variable CONFIG_FDCAN_DEVICE_TRANSCEIVER_LOOP_DELAY.

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:23 +01:00
Gilles DOFFE
3c026569f6 can: add CAN FD configuration
Add CAN FD specifities to CAN system library in RIOT:
* 64 bytes payload
* Bit rate switching
* Error State Indicator

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:23 +01:00
Gilles DOFFE
f6f6f6973c can: introduce typedef can_frame_t
Whole CAN code in RIOT is using 'struct can_frame' to represent a CAN
frame.
However incoming CAN FD support will bring 'struct canfd_frame' to
represent CAN FD frames.
Even if the 'struct canfd_frame' has additional flags and a bigger
payload, it is aligned on 'struct can_frame' and thus they can be
referenced by the same pointers in the code.

As it is impossible to predict which one will be used in RIOT, just
define a new type 'can_frame_t' which will map to the right struct
according to the MCU CAN supported format.

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:22 +01:00
Marian Buschsieweke
e1cfa0b2db
drivers/periph_uart: document acquire/release semantic
The UART API has not spelled out what happens when `uart_init()` is
called twice. This adds precise language that states that
acquire/release semantic is to be expected from the caller. Hence,
a caller needs to call `uart_poweroff()` before reconfiguring the UART
with a second call `uart_init()` for the same UART interface.

In practise, few apps will ever reconfigure the symbol rate. So the
impact is rather low.

However: This API now allows drivers to implement sharing of a serial
peripheral that can provide multiple interfaces (e.g. UART, SPI, I2C,
etc.). It would require some cooperation from the code that does use
the UART to actually release the UART again after each transaction;
something that will only work when RX data is only expected at
known points in time (e.g. in response to a request, or never in case
of TX only stdio). But still, this can mean the difference between
a use case becoming feasible on an MCU with a low number of serial
peripherals or not.
2025-01-24 16:46:24 +01:00
Martine S. Lenders
9ad6abb081
saul: initial import of saul_bat_voltage module 2024-11-22 18:42:04 +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
Benjamin Valentin
dbd52079e1 drivers/netdev: revise return values of .confirm_send() 2024-11-15 14:18:58 +01:00
Benjamin Valentin
fbd1ffe2f1 drivers/netdev: hide legacy events behind netdev_legacy_api 2024-11-14 17:11:28 +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
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
Mikolai Gütschow
f0e6776d40
treewide: apply codespell corrections 2024-10-09 13:03:52 +02:00
chrysn
f116a78de8 doc: Clarify that our CPU ID is not ARM's CPUID 2024-09-27 10:42:17 +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
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
Leandro Lanzieri
ebf64133d7
drivers: add max31855 2024-06-12 13:11:45 +02:00
Mihai Renea
5a7d553b8e drivers/at: expose some internal API 2024-05-28 12:20:54 +02:00
Stefan Schmidt
9d62ad4c5c driver/w5500: driver for the W5500 ethernet chip
- driver can be used with interrupt or in polling mode (default)
2024-05-02 22:07:17 +02:00
krzysztof-cabaj
a813e9728b drivers/led: add LEDX_IS_PRESENT defines 2024-04-29 16:25:32 +02:00