Skip to content

Commit 26325f1

Browse files
committed
SPI: add is_busy() method to check for SR BSY flag
1 parent 9536aaf commit 26325f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/spi.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,10 @@ where
460460
pub fn is_overrun(&self) -> bool {
461461
self.spi.sr.read().ovr().bit_is_set()
462462
}
463+
464+
pub fn is_busy(&self) -> bool {
465+
self.spi.sr.read().bsy().bit_is_set()
466+
}
463467
}
464468

465469
impl<SPI, REMAP, PINS> Spi<SPI, REMAP, PINS, u8, Master>

0 commit comments

Comments
 (0)