mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2024-12-23 20:51:31 +11:00
Merge pull request #455 from papyDoctor/spi-isbusy
added SPI is_busy function
This commit is contained in:
commit
e7454087d1
|
@ -179,6 +179,11 @@ impl<D: SpiDevice, const DS: u8> Spi<Enabled, D, DS> {
|
||||||
self.device.sspsr.read().rne().bit_is_set()
|
self.device.sspsr.read().rne().bit_is_set()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Check if spi is busy transmitting and/or receiving
|
||||||
|
pub fn is_busy(&self) -> bool {
|
||||||
|
self.device.sspsr.read().bsy().bit_is_set()
|
||||||
|
}
|
||||||
|
|
||||||
/// Disable the spi to reset its configuration
|
/// Disable the spi to reset its configuration
|
||||||
pub fn disable(self) -> Spi<Disabled, D, DS> {
|
pub fn disable(self) -> Spi<Disabled, D, DS> {
|
||||||
self.device.sspcr1.modify(|_, w| w.sse().clear_bit());
|
self.device.sspcr1.modify(|_, w| w.sse().clear_bit());
|
||||||
|
|
Loading…
Reference in a new issue