aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/ppi/dppi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-nrf/src/ppi/dppi.rs')
-rw-r--r--embassy-nrf/src/ppi/dppi.rs11
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 @@
1use super::{Channel, ConfigurableChannel, Event, Ppi, Task}; 1use super::{Channel, ConfigurableChannel, Event, Ppi, Task};
2use crate::{pac, Peri}; 2use crate::Peri;
3 3
4const DPPI_ENABLE_BIT: u32 = 0x8000_0000; 4const DPPI_ENABLE_BIT: u32 = 0x8000_0000;
5const DPPI_CHANNEL_MASK: u32 = 0x0000_00FF; 5const DPPI_CHANNEL_MASK: u32 = 0x0000_00FF;
6 6
7pub(crate) fn regs() -> pac::dppic::Dppic { 7#[cfg(not(feature = "_nrf54l"))]
8 pac::DPPIC 8pub(crate) fn regs() -> crate::pac::dppic::Dppic {
9 crate::pac::DPPIC
9} 10}
10 11
11impl<'d, C: ConfigurableChannel> Ppi<'d, C, 1, 1> { 12impl<'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