diff options
Diffstat (limited to 'embassy-nrf/src/ppi/dppi.rs')
| -rw-r--r-- | embassy-nrf/src/ppi/dppi.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/embassy-nrf/src/ppi/dppi.rs b/embassy-nrf/src/ppi/dppi.rs index 078d2fd1c..d43a25c4e 100644 --- a/embassy-nrf/src/ppi/dppi.rs +++ b/embassy-nrf/src/ppi/dppi.rs | |||
| @@ -1,11 +1,12 @@ | |||
| 1 | use super::{Channel, ConfigurableChannel, Event, Ppi, Task}; | 1 | use super::{Channel, ConfigurableChannel, Event, Ppi, Task}; |
| 2 | use crate::{pac, Peri}; | 2 | use crate::Peri; |
| 3 | 3 | ||
| 4 | const DPPI_ENABLE_BIT: u32 = 0x8000_0000; | 4 | const DPPI_ENABLE_BIT: u32 = 0x8000_0000; |
| 5 | const DPPI_CHANNEL_MASK: u32 = 0x0000_00FF; | 5 | const DPPI_CHANNEL_MASK: u32 = 0x0000_00FF; |
| 6 | 6 | ||
| 7 | pub(crate) fn regs() -> pac::dppic::Dppic { | 7 | #[cfg(not(feature = "_nrf54l"))] |
| 8 | pac::DPPIC | 8 | pub(crate) fn regs() -> crate::pac::dppic::Dppic { |
| 9 | crate::pac::DPPIC | ||
| 9 | } | 10 | } |
| 10 | 11 | ||
| 11 | impl<'d, C: ConfigurableChannel> Ppi<'d, C, 1, 1> { | 12 | impl<'d, C: ConfigurableChannel> Ppi<'d, C, 1, 1> { |
| @@ -49,13 +50,13 @@ impl<'d, C: Channel, const EVENT_COUNT: usize, const TASK_COUNT: usize> Ppi<'d, | |||
| 49 | /// Enables the channel. | 50 | /// Enables the channel. |
| 50 | pub fn enable(&mut self) { | 51 | pub fn enable(&mut self) { |
| 51 | let n = self.ch.number(); | 52 | let n = self.ch.number(); |
| 52 | regs().chenset().write(|w| w.0 = 1 << n); | 53 | self.ch.regs().chenset().write(|w| w.0 = 1 << n); |
| 53 | } | 54 | } |
| 54 | 55 | ||
| 55 | /// Disables the channel. | 56 | /// Disables the channel. |
| 56 | pub fn disable(&mut self) { | 57 | pub fn disable(&mut self) { |
| 57 | let n = self.ch.number(); | 58 | let n = self.ch.number(); |
| 58 | regs().chenclr().write(|w| w.0 = 1 << n); | 59 | self.ch.regs().chenclr().write(|w| w.0 = 1 << n); |
| 59 | } | 60 | } |
| 60 | } | 61 | } |
| 61 | 62 | ||
