aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/spis.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-nrf/src/spis.rs')
-rw-r--r--embassy-nrf/src/spis.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/embassy-nrf/src/spis.rs b/embassy-nrf/src/spis.rs
index 96a9c0ae0..6f837c317 100644
--- a/embassy-nrf/src/spis.rs
+++ b/embassy-nrf/src/spis.rs
@@ -17,6 +17,7 @@ use crate::gpio::{self, AnyPin, OutputDrive, Pin as GpioPin, SealedPin as _, con
17use crate::interrupt::typelevel::Interrupt; 17use crate::interrupt::typelevel::Interrupt;
18use crate::pac::gpio::vals as gpiovals; 18use crate::pac::gpio::vals as gpiovals;
19use crate::pac::spis::vals; 19use crate::pac::spis::vals;
20use crate::ppi::Event;
20use crate::util::slice_in_ram_or; 21use crate::util::slice_in_ram_or;
21use crate::{interrupt, pac}; 22use crate::{interrupt, pac};
22 23
@@ -334,6 +335,20 @@ impl<'d> Spis<'d> {
334 Ok((n_rx, n_tx)) 335 Ok((n_rx, n_tx))
335 } 336 }
336 337
338 /// Returns the ACQUIRED event, for use with PPI.
339 ///
340 /// This event will fire when the semaphore is acquired.
341 pub fn event_acquired(&self) -> Event<'d> {
342 Event::from_reg(self.r.events_acquired())
343 }
344
345 /// Returns the END event, for use with PPI.
346 ///
347 /// This event will fire when the slave transaction is complete.
348 pub fn event_end(&self) -> Event<'d> {
349 Event::from_reg(self.r.events_end())
350 }
351
337 async fn async_inner(&mut self, rx: &mut [u8], tx: &[u8]) -> Result<(usize, usize), Error> { 352 async fn async_inner(&mut self, rx: &mut [u8], tx: &[u8]) -> Result<(usize, usize), Error> {
338 match self.async_inner_from_ram(rx, tx).await { 353 match self.async_inner_from_ram(rx, tx).await {
339 Ok(n) => Ok(n), 354 Ok(n) => Ok(n),