750 Commits

Author SHA1 Message Date
Łukasz Dobrowolski
26fe907930 Add watchdog stop 2025-12-29 15:52:14 +01:00
Łukasz Dobrowolski
e2c34cacc4 Change watchdog interface
Add duration argument to watchdog.feed function.
watchdog.start function's delay keeps duration argument but it's meaning
changes to initial watchdog feeding.

This change makes the watchdog more flexible. It allows one to set
different initial timeout duration then during normal operation. This
allows to tighten the timeouts rather than having to use biggest one.

It would also allow one to set a long timeout before running some long
blocking operation.
2025-12-29 14:32:25 +01:00
ivan770
28ed00127f
rp: allow sourcing gpout clock from LPOSC 2025-12-26 14:31:13 +00:00
Dario Nieuwenhuis
8484b3bfaf
Merge pull request #5061 from ericseppanen/pio_divider
embassy_rp: improve calculate_pio_clock_divider
2025-12-19 18:35:26 +00:00
Dario Nieuwenhuis
62ed44f99a Update to embedded-io 0.7 2025-12-19 12:29:50 +01:00
Eric Seppanen
7227c7bde2 clock_divider: use core::assert in const fn
defmt::assert gives a compile error in const context.
2025-12-13 15:18:39 -08:00
Eric Seppanen
a47f745c25 improve pio clock divider math
Ensure that the fractional part of the clock divider is accurately
calculated. This does additional u32 division/mod operations, which I
think is better than using u64 for its extra precision.

Also:
- Add additional asserts to catch out-of-bounds results.
- Make the version that accepts the system clock as a parameter
const and public, so if anyone wants to hardcode the system
frequency they can avoid any runtime computation.
- Remove the `inline` attributes because the function has grown quite a
bit.
2025-12-13 14:40:40 -08:00
Eric Seppanen
215804facc add unit test for calculate_pio_clock_divider
The test will fail, because the current implementation doesn't calculate
the fractional part.
2025-12-13 14:40:40 -08:00
Bjorn Beishline
edd8878f8c Use two AtomicU32 instead 2025-11-25 12:05:52 -07:00
Bjorn Beishline
5792daf3af Remove atomic-polyfill 2025-11-25 11:37:47 -07:00
Alex Strandberg
883a998b8d embassy-rp: add support for TX-only, no SCK SPI 2025-11-24 20:21:24 -05:00
Valentin Trophime
d4e2caab31 Add docs for embassy-rp::pio::get_x assumption about autopush. 2025-11-12 13:38:00 +01:00
Robert Williams
4177e44e90 fix formatting 2025-11-03 21:37:09 +00:00
Robert Williams
52d514652b docs: color order methods traits missing docs 2025-11-03 21:37:09 +00:00
Robert Williams
aa6b6e08dc split into multiple methods 2025-11-03 21:37:09 +00:00
Robert Williams
07f45bd12a fix: split traits to avoid inference problems 2025-11-03 21:37:09 +00:00
Robert Williams
2546d26cf2 embassy-rp: add color order to ws2812 pio program 2025-11-03 21:37:09 +00:00
Michael Turner
d838c2b84b Disable PIO SM before setting Y register 2025-11-02 10:24:52 -08:00
Rob Wells
7ef9a6453a
embassy-rp: doc comment spelling pass
All changes but one are to documentation comments, and one to an
ordinary comment.
2025-10-27 15:30:21 +00:00
Nicolas Mattia
724edcaf70 rp: fix typo in Input interrupt comment 2025-10-26 11:43:05 +01:00
Dario Nieuwenhuis
8730a013c3 Rustfmt for edition 2024. 2025-10-06 23:19:53 +02:00
Dario Nieuwenhuis
abc8e450f9 Edition 2024. 2025-10-06 23:19:53 +02:00
Bjorn Beishline
1d494594e8 Add reset_to_usb_boot to rp235x 2025-09-23 14:28:10 -07:00
9names
9bb77f36f9 rp: Use msplim for rp235x core1 stack guard 2025-09-21 19:12:31 +10:00
1-rafael-1
dd10e372d2 Fix race condition in RTC alarm by using AtomicBool flag 2025-09-15 21:57:41 +02:00
1-rafael-1
ac32f43c3d alarm handling to poll hardware status directly; add ci test 2025-09-15 21:10:22 +02:00
1-rafael-1
6bb3d2c072 Merge branch 'main' into rp2040-rtc-alarm 2025-09-15 20:07:18 +02:00
Matt Johnston
8f10e3638d rp/pio: Add onewire strong pullups, parasite power
DS18B20 sensors require a strong pullup to be applied for the duration
of the temperature conversion, within 10us of the command. The rp2xxx
pins have sufficient drive strength to use as the pullup (no external
mosfet needed).

Add a new write_bytes_pullup() that will apply the pullup after
bytes are written. Existing read_bytes()/write_bytes() has no change to
onewire timing.

A pio_onewire_parasite example reads multiple sensors individually,
applying the strong pullup.
2025-09-14 16:54:14 +08:00
Dario Nieuwenhuis
46bf0c71cc
Merge pull request #4210 from mcaveniathor/pio_i2s_rx
Add PioI2sIn, PioI2sInProgram, and example binary
2025-09-05 19:08:06 +00:00
Thor McAvenia
241129c569 Add PioI2sIn, PioI2sInProgram, and example binary 2025-09-05 21:01:37 +02:00
Adrian Wowk
815ba8aa75 rp: read pio gpiobase in set_pins and set_pin_dirs 2025-09-05 20:41:07 +02:00
Adrian Wowk
5137306575 rp: move pio pin configs after set_config
This is needed for the program to work correctly on rp235xb when using
the higher pin numbers.
2025-09-05 20:35:48 +02:00
Adrian Wowk
62ff0194f4 rp: add pio spi runtime reconfiguration 2025-09-05 20:35:48 +02:00
Adrian Wowk
83b42e0db6 style: cleanup with rustfmt 2025-09-05 20:35:48 +02:00
Adrian Wowk
4cac3ac1d2 rp: add new pio spi program
This commit adds a new PIO program which implements SPI. This allows
you to drive more than 2 SPI buses by using PIO state machines as
additional duplex SPI interfaces.

The driver supports both blocking and async modes of operation and
exclusively uses the DMA for async IO.
2025-09-05 20:35:48 +02:00
Adrian Wowk
676f9da583 rp: add new pio dma apis
This commit adds StateMachineRx::dma_pull_repeated and
StateMachineTx::dma_push_repeated which allow you to discard reads or
send dummy writes to the state machine using the DMA hardware
2025-09-05 20:35:48 +02:00
Dario Nieuwenhuis
581594d1f5
Merge pull request #4496 from variegated-coffee/psram
feat(embassy-rp): RP2350 - Add support for QMI CS1, and for APS6404L PSRAM
2025-09-05 13:45:00 +00:00
Dario Nieuwenhuis
8aec341f28 executor: return error when creating the spawntoken, not when spawning. 2025-08-29 13:23:21 +02:00
erwin
badcdcc24c change default internal pullup state to be active to make this change nonbreaking 2025-08-19 12:14:48 +02:00
erwin
bbc3e49c58 Add configurable internal pullups for rp i2c
- Example updated to demonstrate enabling internal pullups
- Add `sda_pullup` and `scl_pullup` fields to I2C Config
2025-08-18 14:39:18 +02:00
Magnus Nordlander
88934c42d3 Gate ARM-specific assembly using cfg 2025-08-05 12:52:20 +02:00
Magnus Nordlander
1e91833118 Apply rustfmt 2025-08-05 09:58:33 +02:00
Magnus Nordlander
8965a13da4 Interface changes and added example 2025-08-05 09:56:09 +02:00
Magnus Nordlander
6d38e8b306 Remove regs since it doesn’t really make sense to return the QMI peripheral from QMI CS1. 2025-08-05 09:34:09 +02:00
Phirks
65bab430a6 removed the rp2040 flag from the dormant function 2025-08-03 08:37:58 -04:00
Magnus Nordlander
af6b74ad5a Apply rustfmt 2025-08-02 18:45:56 +02:00
Magnus Nordlander
d4f469576f Added support for QMI CS1, and for APS6404L PSRAM on the RP2350 2025-08-02 18:36:42 +02:00
Elliot Sayes
1652d9269e Add IRQ StatusSource for _rp235x 2025-08-02 17:26:42 +04:00
Dario Nieuwenhuis
5b8340bdc4
Merge pull request #4296 from adamNewell/fix-rp2350-stack-guard-rlar
Embassy RP: RP235x Fix MPU region enablement in stack guard installation
2025-07-24 21:53:32 +00:00
Dario Nieuwenhuis
c361c82c41
Merge pull request #4449 from rursprung/add-debug-and-defmt-for-rp-gpio
add missing `Debug` and `defmt::Format` derives for `embassy_rp::gpio`
2025-07-23 15:12:11 +00:00