Fix PIO rx fifo status (#367)

* Implement embedded-hal 1.0.0-alpha.8 traits

* Add comment about missing SPI traits

* Fix doc of rx.is_empty() and add rx.is_full()
This commit is contained in:
Jan Niehusmann 2022-06-24 00:24:27 +02:00 committed by GitHub
parent 99dfeaf6f2
commit e5897ca7a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1138,10 +1138,15 @@ impl<SM: ValidStateMachine> Rx<SM> {
.modify(|_, w| w.autopush().bit(enable))
}
/// Indicate if the tx FIFO is full
/// Indicate if the rx FIFO is empty
pub fn is_empty(&self) -> bool {
self.register_block().fstat.read().rxempty().bits() & (1 << SM::id()) != 0
}
/// Indicate if the rx FIFO is full
pub fn is_full(&self) -> bool {
self.register_block().fstat.read().rxfull().bits() & (1 << SM::id()) != 0
}
}
/// PIO TX FIFO handle.