From e5897ca7a456457c63dbe9fe5ab59cb106e540c4 Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Fri, 24 Jun 2022 00:24:27 +0200 Subject: [PATCH] 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() --- rp2040-hal/src/pio.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rp2040-hal/src/pio.rs b/rp2040-hal/src/pio.rs index 3901ab7..2153c13 100644 --- a/rp2040-hal/src/pio.rs +++ b/rp2040-hal/src/pio.rs @@ -1138,10 +1138,15 @@ impl Rx { .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.