rp: clock setup

This commit is contained in:
Dario Nieuwenhuis
2021-06-25 03:38:03 +02:00
parent e1880a19df
commit 5a6384d199
11 changed files with 210 additions and 190 deletions

17
embassy-rp/src/reset.rs Normal file
View File

@ -0,0 +1,17 @@
use crate::pac;
pub use pac::resets::regs::Peripherals;
pub const ALL_PERIPHERALS: Peripherals = Peripherals(0x01ffffff);
pub unsafe fn reset(peris: Peripherals) {
pac::RESETS.reset().write_value(peris);
}
pub unsafe fn unreset_wait(peris: Peripherals) {
// TODO use the "atomic clear" register version
pac::RESETS
.reset()
.modify(|v| *v = Peripherals(v.0 & !peris.0));
while ((!pac::RESETS.reset_done().read().0) & peris.0) != 0 {}
}