-
Notifications
You must be signed in to change notification settings - Fork 282
Open
Description
The setters in PinGroup carefully select the correct bank to write to, e.g.:
pub fn set(&mut self, state: PinState) {
use super::pin::pin_sealed::PinIdOps;
let mask = self.0.write_mask();
let head_id = self.0.head.borrow().id();
if state == PinState::Low {
head_id.sio_out_clr().write(|w| unsafe { w.bits(mask) });
} else {
head_id.sio_out_set().write(|w| unsafe { w.bits(mask) });
}
}
However, read() always reads bank 0:
pub fn read(&self) -> u32 {
let mask = self.0.read_mask();
crate::sio::Sio::read_bank0() & mask
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels