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

8504 Commits

Author SHA1 Message Date
chrysn
52a976e147 cpu/nrf52 i2c: Add shortcut when data is in RAM
See-Also: https://github.com/RIOT-OS/RIOT/pull/20298#discussion_r1466508505
2024-01-25 16:33:25 +01:00
chrysn
b80d1e622f cpu/nrf52 i2c: Always buffer writes
The underlying peripheral can only read from RAM. This uses the
existing infrastructure (already needed to work around the lack of a
hardware support for I2C_NOSTART) to unconditionally copy any to-be-sent
data into RAM.
2024-01-25 15:24:57 +01:00
Marian Buschsieweke
0a06b0c1d8
Merge pull request #20282 from chrysn-pull-requests/nrf52-i2c-nostop
cpu/nrf5x i2c: Set up correct interrupts after NOSTOP transmissions
2024-01-23 09:05:35 +00:00
chrysn
fce82dec6e cpu/nrf5x i2c: Forbid receive NOSTOP, document rationale 2024-01-22 23:29:24 +01:00
Marian Buschsieweke
63ec7fc7b5
Merge pull request #19835 from maribu/msp430
cpu/msp430: rework MSP430 x1xx periph drivers
2024-01-22 18:41:23 +00:00
Marian Buschsieweke
675dcc381c
cpu/msp430: rework MSP430 x1xx periph drivers
- Move common code for USART (shared SPI / UART peripheral) to its
  own file and allow sharing the USART peripheral to provide both
  UART and SPI in round-robin fashion.
- Configure both UART and SPI bus via a `struct` in the board's
  `periph_conf.h`
    - this allows allocating the two UARTs as needed by the use case
    - since both USARTs signals have a fixed connection to a single
      GPIO, most configuration is moved to the CPU
    - the board now only needs to decide which bus is provided by
      which USART

Note: Sharing an USART used as UART requires cooperation from the app:
- If the UART is used in TX-only mode (no RX callback), the driver
  will release the USART while not sending
- If the UART is used to also receive, the application needs to power
  the UART down while not expecting something to send. An
  `spi_acquire()` will be blocked while the UART is powered up.
2024-01-22 16:59:23 +01:00
Marian Buschsieweke
1484d305bf
cpu/sam0_common: implement periph_gpio_ll_irq
Co-authored-by: benpicco <benpicco@googlemail.com>
2024-01-22 16:28:30 +01:00
Marian Buschsieweke
855756524f
cpu/sam0_common: Implement periph_gpio_ll
Co-authored-by: benpicco <benpicco@googlemail.com>
2024-01-22 16:28:16 +01:00
chrysn
b91161dfce cpu/nrf5x i2c: Set up correct interrupts after NOSTOP transmissions 2024-01-22 02:03:46 +01:00
Marian Buschsieweke
922276296e
drivers/periph/gpio_ll: pass gpio_conf_t by value
Now that `gpio_conf_t` is on all implemented platforms no larger than
a register, we can more efficiently pass it by value rather than via
pointer.
2024-01-21 09:19:08 +01:00
Marian Buschsieweke
2a00ec13e5
drivers/periph/gpio_ll: shrink gpio_conf_t
This commit optimizes the `gpio_conf_t` type in the following
regards:

- The "base" `gpio_conf_t` is stripped from members that only some
  platforms support, e.g. drive strength, slew rate, and disabling of
  the Schmitt Trigger are no longer universally available but
  platform-specific extensions
- The `gpio_conf_t` is now crammed into a bit-field that is 8 bit or
  16 bit wide. This allows for storing lots of them e.g. in
  `driver_foo_params_t` or `uart_conf_t` etc.
- A `union` of the `struct` with bit-field members and a `bits` is used
  to allow accessing all bits in a simple C statement and to ensure
  alignment for efficient handling of the type

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2024-01-21 08:38:40 +01:00
Marian Buschsieweke
504c169346
Merge pull request #20270 from maribu/boards/gd32vf103c-start
boards/gd32vf103c-start: new board
2024-01-20 16:11:31 +00:00
Marian Buschsieweke
8b1c43afb0
cpu/gd32v: Allow configuration of SWJ_CFG
Expose the compile time configuration knob `CONFIG_AFIO_PCF0_SWJ_CFG`
to allow freeing some/all JTAG pins and use them as GPIOs.

As default, PB4 is remapped from NJTRST to be usable as regular GPIO.
This still allows using the JTAG interface for debugging/flashing,
but makes an GPIO exposed by some boards available.
2024-01-19 23:17:35 +01:00
benpicco
d5f1fda70d
Merge pull request #20230 from benpicco/CONFIG_UART_DMA_THRESHOLD_BYTES
cpu/stm32: uart: don't do DMA for small transfers
2024-01-18 12:26:30 +00:00
Marian Buschsieweke
3b5ed6d390
cpu/gd32v: Fix periph_pwm
The API doc clearly states that arbitrary high PWM frequencies can
be requested and the driver should reduce the frequency while keeping
the resolution, when required. So change the code to just do that
rather than blowing assertions.
2024-01-17 21:58:56 +01:00
Benjamin Valentin
9d70fbf2e1 cpu/sam0_common: SDHC: make use of busy_wait() 2024-01-15 14:30:56 +01:00
Benjamin Valentin
7add6c2fcc cpu/avr8_common: make pm_layered a DEFAULT_MODULE
This lets us disable it.
2024-01-11 21:14:43 +01:00
benpicco
714958ad3c
Merge pull request #20241 from benpicco/busy_wait
sys/busy_wait: add busy wait helper
2024-01-11 12:19:31 +00:00
Benjamin Valentin
fff9ff14da cpu/esp32: add busy loop cycles for all sub-arches 2024-01-10 22:43:31 +01:00
Benjamin Valentin
8bcfe7b7b6 cpu/esp8266: ESP8266 needs 5 cycles per busy loop 2024-01-10 22:43:31 +01:00
Benjamin Valentin
5dc43bd62d cpu/avr8_common: AVR-8 needs 7 cycles per busy loop 2024-01-10 22:43:31 +01:00
benpicco
2e3037c3aa
Merge pull request #20240 from benpicco/cpu/atmega-no_thread
cpu/avr8_common: fix build with !core_thread
2024-01-09 22:13:30 +00:00
Benjamin Valentin
cb76cc17e9 cpu/native: fix build with !core_thread 2024-01-09 23:02:01 +01:00
Benjamin Valentin
79b51efc15 cpu/cortexm_common: Cortex M0/M23 needs 4 cycles/busy loop 2024-01-09 19:03:15 +01:00
Benjamin Valentin
bfd29f0fa7 sys/busy_wait: add busy wait helper 2024-01-09 19:03:15 +01:00
Benjamin Valentin
112e378fcc cpu/avr8_common: fix build with !core_thread 2024-01-09 19:00:22 +01:00
Gunar Schorcht
92657f5fd2 cpu/esp32: add SDMMC support 2024-01-05 07:22:27 +01:00
Kevin "Tristate Tom" Weiss
7fef2e4b6f
Merge pull request #20214 from benpicco/CONFIG_SPI_DMA_THRESHOLD_BYTES
cpu/stm32/periph_spi: only perform DMA transfer above threshold
2024-01-04 17:32:02 +00:00
Benjamin Valentin
ca9bf1a29a cpu/stm32: uart: don't do DMA for small transfers 2024-01-04 17:34:18 +01:00
Marian Buschsieweke
616b48d354
Merge pull request #20228 from benpicco/cc2538_get_eui64_primary
cpu/cc2538: fix EUI provider
2024-01-04 14:30:19 +00:00
Benjamin Valentin
94ad4d7ba3 cpu/cc2538: update function signature of EUI provider 2024-01-04 13:15:47 +01:00
Marian Buschsieweke
f860d96a25
Merge pull request #19891 from chrysn-pull-requests/ws2181x_timer
drivers/ws281x: Add gpio_ll and timer based driver
2024-01-03 09:22:26 +00:00
krzysztof-cabaj
29502b2dc4 cpu/stm32/periph: fix typo - or RAM 2024-01-01 13:26:24 +01:00
Benjamin Valentin
753fae6936 cpu/stm32/periph_spi: only perform DMA transfer above threshold 2023-12-23 17:36:30 +01:00
Benjamin Valentin
fbeb1f9a26 drivers/periph/spi: move DMA threshold to common code 2023-12-23 17:35:29 +01:00
Gunar Schorcht
337a63ecb5 cpu/stm32/periph: add SDMMC support for F2/F4/F7/L4 2023-12-21 18:37:43 +01:00
Gunar Schorcht
d91f438589 cpu/stm32/periph/dma: dma_setup_ext for extended configuration
The function configures additional features of the DMA stream for F2/F4/F7.
`dma_setup_ext` added to configure F2/F4/F7 specific additional features like `MBURST`, `PBURST`, `FIFO` and Peripheral flow controller. It is supposed to be used after `dma_setup` and `dma_prepare`.
2023-12-20 09:14:28 +01:00
MrKevinWeiss
7b80348f31
drivers/ws281x: Fix Kconfig
Patch from https://github.com/RIOT-OS/RIOT/pull/19891#pullrequestreview-1753651538
2023-12-19 11:13:43 +01:00
chrysn
02285fd63a
drivers/periph: Add timer_poll feature and timer_poll_channel function 2023-12-19 11:13:41 +01:00
chrysn
abf95d14a6
cpu/nrf5x: Tolerate NULL callback in timers
timer_set has no documented restriction on this being not null, other
implementations explicitly tolerate it (rpx0xx checks inside the ISR,
but doing it at init time keeps the ISR slim).

This is useful when using a timer just to read, without any action when
it triggers (the action is taken depending on read values, eg. in a
thread context).
2023-12-19 11:13:40 +01:00
benpicco
208790a5f1
Merge pull request #20108 from benpicco/drivers/dose-uart_ondemand_tx
drivers/periph/uart: add periph_uart_tx_ondemand feature
2023-12-14 20:42:55 +00:00
Benjamin Valentin
60f8468191 cpu/sam0_common: implement uart_tx_ondemand 2023-12-14 18:30:38 +01:00
Gunar Schorcht
d089c122c1 cpu/sam0_common: improve doc consistency for MTDs 2023-12-14 17:26:29 +01:00
benpicco
6eac1e1761
Merge pull request #15380 from benpicco/mtd_drop_write
mtd/*: drop .write() if .write_page() is implemented
2023-12-13 20:35:53 +00:00
Benjamin Valentin
c6646125f7 native/mtd: drop .write()
The old .write() function is only used as a fall-back if .write_page()
is not implemented.
We can drop it.
2023-12-13 16:50:41 +01:00
Benjamin Valentin
2235dc2464 cpu/esp_common: flash: drop .write()
The old .write() function is only used as a fall-back if .write_page()
is not implemented.
We can drop it.
2023-12-13 16:50:41 +01:00
Benjamin Valentin
6b86e274d9 cpu/sam0/uart: implement uart_pin_cts()/uart_pin_rts() 2023-12-12 20:26:17 +01:00
Marian Buschsieweke
3002f1efa3
cpu/stm32: fix periph_i2c for F1, F2, L1 and F4 families
- boot the I2C after init in low power mode
    - otherwise I2C will consume more power until the first time it is
      used, which is surprising
- STM32 F1 only: reconfigure SCL and SDA as GPIOs while the I2C
  peripheral is powered down
    - When the I2C peripheral is not clocked, it drives SCL and SDA
      down. This will dissipate power across the pull up resistor.
2023-12-12 09:55:47 +01:00
Marian Buschsieweke
13f0a5062d
cpu/stm32/periph_i2c: improve DEBUG output 2023-12-12 09:55:47 +01:00
Marian Buschsieweke
bb07bb6613
Merge pull request #20160 from maribu/cpu/msp430/timer
cpu/msp430: improve periph_timer
2023-12-10 13:02:30 +00:00