diff options
Diffstat (limited to 'embassy-nrf')
| -rw-r--r-- | embassy-nrf/CHANGELOG.md | 1 | ||||
| -rw-r--r-- | embassy-nrf/src/spis.rs | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/embassy-nrf/CHANGELOG.md b/embassy-nrf/CHANGELOG.md index be79bde5d..cfb040ef5 100644 --- a/embassy-nrf/CHANGELOG.md +++ b/embassy-nrf/CHANGELOG.md | |||
| @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 28 | - changed: `gpiote::InputChannel::wait()` now ensures events are seen as soon as the function is called, even if the future is not polled | 28 | - changed: `gpiote::InputChannel::wait()` now ensures events are seen as soon as the function is called, even if the future is not polled |
| 29 | - bugfix: use correct flash size for nRF54l | 29 | - bugfix: use correct flash size for nRF54l |
| 30 | - changed: add workaround for anomaly 66 on nrf52 | 30 | - changed: add workaround for anomaly 66 on nrf52 |
| 31 | - added: expose PPI events available on SPIS peripheral | ||
| 31 | 32 | ||
| 32 | ## 0.8.0 - 2025-09-30 | 33 | ## 0.8.0 - 2025-09-30 |
| 33 | 34 | ||
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 | |||
| 17 | use crate::interrupt::typelevel::Interrupt; | 17 | use crate::interrupt::typelevel::Interrupt; |
| 18 | use crate::pac::gpio::vals as gpiovals; | 18 | use crate::pac::gpio::vals as gpiovals; |
| 19 | use crate::pac::spis::vals; | 19 | use crate::pac::spis::vals; |
| 20 | use crate::ppi::Event; | ||
| 20 | use crate::util::slice_in_ram_or; | 21 | use crate::util::slice_in_ram_or; |
| 21 | use crate::{interrupt, pac}; | 22 | use 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), |
