654 Commits

Author SHA1 Message Date
1-rafael-1
45b7127d61 fmt 2025-04-26 21:55:16 +02:00
1-rafael-1
713d6291d5 Scale clock dividers in HD44780, rotary encoder, and stepper driver based on system clock frequency 2025-04-26 21:54:48 +02:00
1-rafael-1
4ce3bdb370 Add core voltage scaling options and PLL parameter finder for RP2040 2025-04-26 21:54:40 +02:00
Marc
5d8b0e0327 Some small improvements 2025-04-25 01:14:54 +02:00
Marc
2a4b380cb7 Search can use the normal write/read instructions 2025-04-25 01:14:38 +02:00
Marc
29bcddaa10 Refactor Onewire PIO implementation 2025-04-25 01:14:13 +02:00
Dario Nieuwenhuis
c955320e5d
Merge pull request #4093 from 1-rafael-1/rp235x-input-pwm-fix
Enable input mode for PWM pins on RP235x and disable it on drop
2025-04-15 19:14:19 +02:00
Wez Furlong
a606a1a45a
embassy-rp: impl rand_core::CryptoRng for Trng
Per discussion in https://github.com/embassy-rs/embassy/pull/3338/files#r2040704590
the Trng implementation satisfies the requirements for CryptoRng,
so it is reasonable to implement this marker trait.
2025-04-14 19:22:33 -07:00
1-rafael-1
dbd7ce4d38 Enable input mode for PWM pins on RP235x and disable it on drop 2025-04-14 22:41:28 +02:00
Dario Nieuwenhuis
a23e971d31
Merge pull request #4017 from shilga/SpinlockMutex
embassy-rp: Spinlock mutex implementation
2025-04-07 23:13:35 +00:00
Sebastian Quilitz
05a6f7a795 embassy-rp: Implementation of a SpinlockMutex 2025-04-07 21:59:36 +02:00
David Brown
c6e16c9e4e embassy-rp: uart: Increase RX FIFO watermark
Change the UART RX FIFO depth from 1/8 to 7/8.  This should allow for
buffered receipt of uart data with a lower IRQ load.

The PL011 fifo is pretty smart about the fifo, it has an automatic
timeout (which triggers an interrupt) of about 4 characters worth of
time, so setting this threshold doesn't affect the behavior of receipt
of a partially filled fifo.

This should not have any affect on the DMA mode, as the DMA will
generally drain the fifo as data becomes available.

The constraint for the fifo threshold should be determined by expected
interrupt latency.  The IRQ needs to be able to drain the fifo before it
fills.  As such, the proper threshold depends on system design and data
rate.  At full speed (7.8 Mbaud), the remaining 8 characters will come
in in about 10us, which is probably insufficient. But, the time is quite
adequate at lower speeds.
2025-04-07 00:56:24 +02:00
Ulf Lilleengen
b1179c5090
Merge pull request #3983 from mgomez0/topic/buffered-uart-take-pins-before-interrupts
BufferedUart initialization
2025-04-05 05:36:27 +00:00
Michael Gomez
f1feedf190 BufferedUart initialization
This change modifies UART initialization throughout Embassy to take pins
before interrupts.

Related to #1304.
2025-04-04 21:54:36 -07:00
James Munns
72832c1550 embassy-rp: defensive change to ensure wakers are registered
This change ensures that wakers are registered PRIOR to checking status
in i2c `wait_on` helpers.
2025-04-03 19:01:00 +02:00
Caleb Jamison
49badcff1a
RP235x watchdog doesn't have the double count bug 2025-03-28 17:45:41 -04:00
Sebastian Quilitz
d17d43735f embassy-rp: Move Spinlock implementation out of critical_section_impl 2025-03-27 20:10:34 +01:00
Dario Nieuwenhuis
502c188cf4
Merge pull request #3999 from embassy-rs/peripehral-v2
Remove Peripheral trait, rename PeripheralRef->Peri.
2025-03-27 15:30:40 +01:00
Dario Nieuwenhuis
d41eeeae79 Remove Peripheral trait, rename PeripheralRef->Peri. 2025-03-27 15:18:06 +01:00
Dario Nieuwenhuis
d097ccc68c
Merge pull request #4012 from adom-inc/rp2350-adc-fix
rp/adc: fix potential race condition
2025-03-27 13:36:46 +00:00
Adrian Wowk
5777284304 rp: rename BOOTROM_BASE to BOOTRAM_BASE
Previously the constant pointing at the base of the bootram was
incorrectly called BOOTROM_BASE. According to the datasheet, the bootrom
is a 32K region starting at 0x00000000 while the bootram is a 1K region
of SRAM starting at 0x400e0000.
2025-03-26 19:05:27 -05:00
Adrian Wowk
1b6e563260 rp/adc: fix potential race condition
This commit rearranges the Adc::wait_for_ready function to make sure
that wakers are registered before the interrupt is enabled, and keeps
enabling the interrupt until the ADC is ready
2025-03-26 17:11:27 -05:00
JuliDi
436f940d5a
make rustfmt happy 2025-03-19 10:42:34 +01:00
JuliDi
f15c587887
fix wrong funcsel on rp2350 gpout/gpin 2025-03-19 10:32:16 +01:00
eden barby
24941212e8 Added access to the byte swap flag for RP2*** chips for the PIO state machine DMA calls. 2025-03-01 17:23:04 +10:00
Ronald Weber
7a2f038800 doc: Fix "the the" 2025-02-19 17:29:21 +01:00
Dario Nieuwenhuis
52dfefb632 rp/pio: update pio-rs crate, reexport it so users don't get version mismatches. 2025-02-18 18:14:57 +01:00
Dario Nieuwenhuis
e3edd671b6 rp/pio: move instructions to methods of the SM. 2025-02-18 18:14:35 +01:00
9names
4cc5ab9474 Add rp235x imagedef features (based on rp2040 boot2 features)
rp235x firmwares need an Image Definition if they want to be called
from the rp235x bootrom.

Currently this Image Definition is manually added to each project/example,
but for most users it will always be the default (Secure Exe).

This commit adds crate features to allow users to configure this, with the
default of including a Secure Exe Image Definition in.
Just like the boot2-* features, this includes an opt-out (imagedef-none)
to allow the user to not make use of this included Image Definition.
2025-02-16 15:43:01 +11:00
Sebastian Scholz
787606b991
Expose the watchdog reset reason 2025-02-12 13:22:43 +01:00
Steve Work
3b74732f40 Rename readers with get_, per CBJamo review. Tweak use_program docstring.
The tweak arranges that "grep sideset" finds use_program() when grokking source - this spelling is used
elsewhere, as in PinConfig for example, and I managed to miss use_program.
2025-02-07 09:26:34 -08:00
Steve Work
9acbfc9c22 Add PIO functions.
Add some (I think) needed functions:
ConfigPins::set_sideset_pins (the other pin types are covered, why not this one?)
Several runtime StateMachine manipulations:
 - addr()
 - tx_threshold()
 - set_tx_threshold
 - rx_threshold()
 - set_rx_threshold()
 - set_thresholds() - both at once, same value
2025-02-06 17:46:04 -08:00
Dario Nieuwenhuis
556cc57c1f
Merge pull request #3851 from embassy-rs/rp23-atomics-fix
rp235x: fix atomics, fix SIO spinlock stuck bug, fix missing core1 reset.
2025-02-05 00:06:41 +00:00
Dario Nieuwenhuis
9da04cc38e rp: make atomics work properly between cores in rp235x. 2025-02-05 00:57:43 +01:00
Dario Nieuwenhuis
bb2d9ec7f8 rp: Workaround "SIO spinlock stuck bug", reset PROC1 at boot.
Just like RP2040. The bug was "working as intended" on rp2040, so it is on rp235x.
2025-02-05 00:57:15 +01:00
Dario Nieuwenhuis
fdb9795d6a
Merge pull request #3763 from robot-rover/fix_rp2040_time_driver
rp: Fix time driver hang
2025-02-04 23:56:43 +00:00
flippette
9d353d251c Correct ADC channels for RP2350XB 2025-01-30 00:16:36 +02:00
Tom Dohrmann
3e5514653f
remove checks for reserved I2c addresses
There are some non-compliant devices that respond to reserved I2c
addresses. rp2040 behaves sanely for these addresses, so let's just
allow using them.
2025-01-26 17:43:04 +01:00
Adrian Wowk
617f6e7855 fix: enable RP2350 watchdog tick generator 2025-01-15 14:52:49 -06:00
Pedro Ferreira
933e888ed0 RP235x: support new FIFO options, set IE, OD on PIO pins. 2025-01-15 01:56:37 +01:00
Samuel O'Brien
930af8efb7 run rustfmt 2025-01-12 20:56:08 -06:00
Samuel O'Brien
13b205ece2 rp: Fix time driver hang 2025-01-12 20:50:16 -06:00
Dario Nieuwenhuis
7dfb6f7113
Merge pull request #3729 from embassy-rs/update-nrf-rp
Prepare nrf and rp hals for release
2025-01-06 12:28:33 +00:00
Dario Nieuwenhuis
209183ebea Fixes for new PACs. 2025-01-06 13:22:44 +01:00
Georges Palauqui
3c87bb588b embassy-rp: add set_pullup() for OutputOpenDrain 2025-01-06 12:43:48 +01:00
Dániel Buga
44217aa092
Desugar some async fns 2024-12-30 12:13:13 +01:00
Dániel Buga
ab8ca3f126
Rename ETQD, bump date 2024-12-22 21:00:23 +01:00
Dario Nieuwenhuis
2c3bc75da6
Merge pull request #3593 from bugadani/refactor
Rework time-driver contract.
2024-12-16 12:30:30 +00:00
vinsynth
ffbef9316d i2s frequency relative to sysclk 2024-12-14 11:02:18 -05:00
vinsynth
854d1f3743 add sysclk frequency argument to PioI2Out::new 2024-12-14 00:32:47 -05:00