mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 16:23:10 +00:00
rp: add gpio::Pin::io() for access to io banks
This commit is contained in:
parent
e6d4043279
commit
2c6fcdbd3f
@ -643,12 +643,15 @@ pub(crate) mod sealed {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gpio(&self) -> pac::io::Gpio {
|
fn io(&self) -> pac::io::Io {
|
||||||
let block = match self._bank() {
|
match self._bank() {
|
||||||
Bank::Bank0 => crate::pac::IO_BANK0,
|
Bank::Bank0 => crate::pac::IO_BANK0,
|
||||||
Bank::Qspi => crate::pac::IO_QSPI,
|
Bank::Qspi => crate::pac::IO_QSPI,
|
||||||
};
|
}
|
||||||
block.gpio(self._pin() as _)
|
}
|
||||||
|
|
||||||
|
fn gpio(&self) -> pac::io::Gpio {
|
||||||
|
self.io().gpio(self._pin() as _)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pad_ctrl(&self) -> Reg<pac::pads::regs::GpioCtrl, RW> {
|
fn pad_ctrl(&self) -> Reg<pac::pads::regs::GpioCtrl, RW> {
|
||||||
@ -672,12 +675,8 @@ pub(crate) mod sealed {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn int_proc(&self) -> pac::io::Int {
|
fn int_proc(&self) -> pac::io::Int {
|
||||||
let io_block = match self._bank() {
|
|
||||||
Bank::Bank0 => crate::pac::IO_BANK0,
|
|
||||||
Bank::Qspi => crate::pac::IO_QSPI,
|
|
||||||
};
|
|
||||||
let proc = SIO.cpuid().read();
|
let proc = SIO.cpuid().read();
|
||||||
io_block.int_proc(proc as _)
|
self.io().int_proc(proc as _)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user