72 Commits

Author SHA1 Message Date
Dario Nieuwenhuis
e4fc487644 Add rand-core v0.9 support.
Co-Authored-By: Aurélien Jacobs <aurel@gnuage.org>
2025-05-18 20:35:36 +02:00
1-rafael-1
981ef20f83 removed one line too many 2025-05-13 10:59:11 +02:00
1-rafael-1
1314808b3a Changes after review: copypasted doc comment fixed and no cfg gates to panic on failing pll config in init() 2025-05-13 10:49:23 +02:00
1-rafael-1
be1b679d48 Refactor CoreVoltage enum, separate for rp2040 and rp235x 2025-05-12 21:42:03 +02:00
1-rafael-1
79e452922a Add ClockError enum and update system_freq to return Result for error handling 2025-05-12 21:33:47 +02:00
1-rafael-1
133500167c limit CoreVoltage eum to values up to 1.30V, because we do not support unlocking higher voltages 2025-05-12 09:45:05 +02:00
1-rafael-1
4567beda7b rp235x overclocking 2025-05-11 17:26:36 +02:00
1-rafael-1
4621c8aa7a Clarify comment for CoreVoltage enum regarding V1_20 2025-05-07 22:16:29 +02:00
1-rafael-1
a254daf4ff Changes after review 2025-05-07 21:19:09 +02:00
1-rafael-1
0d03aa0bec rework init() 2025-05-05 22:55:09 +02:00
1-rafael-1
3441e80507 first batch of changes after review 2025-05-02 23:51:28 +02:00
1-rafael-1
c01776a3d7 - two more doc examples test ignored
- added tests for the new calculations and fixed an overflow issue these tests surfaced.
- Activate brownout detection.
2025-05-01 17:07:48 +02:00
1-rafael-1
22b5f73811 add manual overclock example, finalize API, cleanup 2025-05-01 00:11:56 +02:00
1-rafael-1
77e8bc9b28 refactoring to have higher and lower level api 2025-04-29 22:49:05 +02:00
1-rafael-1
3a6dc910ff first working draft 2025-04-28 22:54:15 +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
Dario Nieuwenhuis
d41eeeae79 Remove Peripheral trait, rename PeripheralRef->Peri. 2025-03-27 15:18:06 +01: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
Adrian Wowk
617f6e7855 fix: enable RP2350 watchdog tick generator 2025-01-15 14:52:49 -06:00
Sebastian Quilitz
b73b3f2da0 rp: Run RP235x at 150 MHz instead of 125 2024-10-05 12:18:33 +02:00
Caleb Jamison
2855e65cc6 Disable pad isolation on clock in/out pins 2024-09-16 13:26:24 -04:00
Ugljesa Jovanovic
8c1024b2a5
Set up timer0 tick when initializing clocks 2024-08-24 12:19:12 +02:00
Caleb Jamison
752fbc662a Fix docs, ci 2024-08-12 05:06:59 -04:00
Caleb Jamison
778241fd71 Fix CI, rename private feature, address comments from dirbaio. 2024-08-12 04:32:31 -04:00
Caleb Jamison
b185e02a42 Initial rp235x support
Examples have been run, but there is not yet a test suite.
2024-08-08 21:35:21 -04:00
QWS
c3db435011 Fix: typo 2024-05-14 15:48:00 +08:00
QWS
75cf17994f In the start_xosc function, the frequency range is set twice. Remove the redundant one. 2024-05-13 19:48:23 +08:00
Dario Nieuwenhuis
a84b33995e rp: remove mod sealed. 2024-04-05 00:48:46 +02:00
Rafael Bachmann
e139a4e076 fix: CI 2024-03-25 15:09:41 +01:00
Rafael Bachmann
255ed29853 fix minor clippy lints in embassy_rp 2024-03-18 23:28:58 +01:00
Ulf Lilleengen
f4b77c967f docs: document all embassy-rp public apis
Enable missing doc warnings.
2023-12-19 14:19:46 +01:00
Ulf Lilleengen
e45e3e76b5 docs: embassy-rp rustdoc and refactoring 2023-12-19 10:56:22 +01:00
Michael van Niekerk
83a976cf4b RP2040: Fixes as per PR 2023-08-30 21:59:41 +02:00
Michael van Niekerk
a76ff53fb3 RP2040: Fixes as per PR 2023-08-30 21:58:36 +02:00
Michael van Niekerk
f69e8459c9 RP2040: Fixes as per PR 2023-08-30 21:52:03 +02:00
Michael van Niekerk
891f1758bc RP2040: XOSC delay multiplier 2023-08-30 21:43:57 +02:00
Michael van Niekerk
ae174fd0e0 RP2040: XOSC delay multiplier 2023-08-30 21:42:27 +02:00
pennae
3c5f011245 rp: add generic dormant-sleep functionality
this is "generic" in that it doesn't require the user to set up anything
specific to go to dormant sleep, unlike the C sdk which requires clock
sources to be configured explicitly and doesn't much care about PLLs. we
will instead take a snapshot of the current clock configuration, switch
to a known clock source (very slow rosc, in this case), go to sleep, and
on wakeup undo everything we've done (ensuring stability of PLLs and
such).

tested locally, but adding tests to HIL seems infeasible. we'd need at
least another pico or extensive modifications to teleprobe since
dormant-sleep breaks SWD (except to rescue-dp), neither of which is
feasible at this point. if we *did* want to add tests we should check
for both rtc wakeups (with an external rtc clock source) and gpio wakeups.
2023-08-05 00:57:29 +02:00
pennae
e6d4043279 rp: rename gpio::Pin::io to gpio::Pin::gpio
we'll need access to the pin io bank registers for an upcoming fix, and
having both `io` and `io_bank` or similar can get confusing quickly.
rename `io` to `gpio` to avoid this, and also match the type while there.
2023-07-31 18:28:31 +02:00
Dario Nieuwenhuis
036e6ae30c
Rename embassy-hal-common to embassy-hal-internal, document it's for internal use only. (#1700) 2023-07-28 13:23:22 +02:00
Henrik Berg
6d402fe393 RP: Don't reset RTC in Clock::init. Updated example. 2023-07-12 15:16:56 +02:00
Dario Nieuwenhuis
ce889900d6 Update rp-pac. 2023-06-29 02:09:51 +02:00
Dario Nieuwenhuis
837ebe405f rp: update rp-pac. 2023-06-16 01:41:07 +02:00
pennae
fc746a88b5 rp/clocks: comment out all gpin handling for now
gpin clock sources aren't going to be very useful during cold boot and
thus require runtime clock reconfig. once we get there we can use this
for reference. or maybe we can't, only time will tell.
2023-05-17 23:25:49 +02:00
pennae
1e029a9e66 rp/clocks: remove superfluous clock actions
the rtc doesn't have to be disabled since it's always clocked from ref,
and the watchdog doesn't need to be configured twice.
2023-05-17 21:36:19 +02:00
pennae
053d5629ba rp/clocks: require GpinPin for gpin config
we'll take static ownership of an entire pin (not just a limited
reference), otherwise we cannot at all guarantee that the pin will not
be reused for something else while still in use. in theory we could
limit the liftime of this use, but that would require attaching
lifetimes to ClockConfig (and subsequently the main config), passing
those through init(), and returning an object that undoes the gpin
configuration on drop. that's a lot unnecessary support code while we
don't have runtime clock reconfig.
2023-05-17 21:36:19 +02:00
pennae
1b3d9a0aef rp/clocks: compactify pll setup
we don't need to preserve existing bits of the pll pwr register, so
let's only write and save a few instructions.
2023-05-17 21:36:19 +02:00
pennae
f79d8cb2d3 rp/clocks: store clock frequencies in ram
don't recalculate clock frequencies every time they are asked for. while
this is not very often in practice it does consume a bunch of flash
space that cannot be optimized away, and was pulled in unconditionally
previously. while we technically only need the configured rosc, xosc and
gpin frequencies it is easier to store all frequencies (and much cheaper
at runtime too).
2023-05-17 21:36:19 +02:00
pennae
0d4ab559a7 rp/clocks: fix comments and rosc defaults
if rosc really does run at 140MHz in high at div=1 then these values
were not correct and would've exceeded the chip spec. the HIL test
device seems to run fast (150MHz) so they're still not quite correct,
but rosc has high variance anyway so it's probably fine.
2023-05-17 21:36:19 +02:00