aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-nrf/src')
-rw-r--r--embassy-nrf/src/chips/nrf52805.rs23
-rw-r--r--embassy-nrf/src/chips/nrf52810.rs33
-rw-r--r--embassy-nrf/src/chips/nrf52811.rs33
-rw-r--r--embassy-nrf/src/chips/nrf52820.rs33
-rw-r--r--embassy-nrf/src/chips/nrf52832.rs33
-rw-r--r--embassy-nrf/src/chips/nrf52833.rs33
-rw-r--r--embassy-nrf/src/chips/nrf52840.rs33
-rw-r--r--embassy-nrf/src/ppi.rs53
8 files changed, 230 insertions, 44 deletions
diff --git a/embassy-nrf/src/chips/nrf52805.rs b/embassy-nrf/src/chips/nrf52805.rs
index f214d927b..3bf87e3d9 100644
--- a/embassy-nrf/src/chips/nrf52805.rs
+++ b/embassy-nrf/src/chips/nrf52805.rs
@@ -159,6 +159,29 @@ impl_pin!(P0_29, 0, 29);
159impl_pin!(P0_30, 0, 30); 159impl_pin!(P0_30, 0, 30);
160impl_pin!(P0_31, 0, 31); 160impl_pin!(P0_31, 0, 31);
161 161
162impl_ppi_channel!(PPI_CH0, 0, configurable);
163impl_ppi_channel!(PPI_CH1, 1, configurable);
164impl_ppi_channel!(PPI_CH2, 2, configurable);
165impl_ppi_channel!(PPI_CH3, 3, configurable);
166impl_ppi_channel!(PPI_CH4, 4, configurable);
167impl_ppi_channel!(PPI_CH5, 5, configurable);
168impl_ppi_channel!(PPI_CH6, 6, configurable);
169impl_ppi_channel!(PPI_CH7, 7, configurable);
170impl_ppi_channel!(PPI_CH8, 8, configurable);
171impl_ppi_channel!(PPI_CH9, 9, configurable);
172impl_ppi_channel!(PPI_CH20, 20);
173impl_ppi_channel!(PPI_CH21, 21);
174impl_ppi_channel!(PPI_CH22, 22);
175impl_ppi_channel!(PPI_CH23, 23);
176impl_ppi_channel!(PPI_CH24, 24);
177impl_ppi_channel!(PPI_CH25, 25);
178impl_ppi_channel!(PPI_CH26, 26);
179impl_ppi_channel!(PPI_CH27, 27);
180impl_ppi_channel!(PPI_CH28, 28);
181impl_ppi_channel!(PPI_CH29, 29);
182impl_ppi_channel!(PPI_CH30, 30);
183impl_ppi_channel!(PPI_CH31, 31);
184
162pub mod irqs { 185pub mod irqs {
163 use crate::pac::Interrupt as InterruptEnum; 186 use crate::pac::Interrupt as InterruptEnum;
164 use embassy_macros::interrupt_declare as declare; 187 use embassy_macros::interrupt_declare as declare;
diff --git a/embassy-nrf/src/chips/nrf52810.rs b/embassy-nrf/src/chips/nrf52810.rs
index caef3e7e7..d3241364b 100644
--- a/embassy-nrf/src/chips/nrf52810.rs
+++ b/embassy-nrf/src/chips/nrf52810.rs
@@ -164,6 +164,39 @@ impl_pin!(P0_29, 0, 29);
164impl_pin!(P0_30, 0, 30); 164impl_pin!(P0_30, 0, 30);
165impl_pin!(P0_31, 0, 31); 165impl_pin!(P0_31, 0, 31);
166 166
167impl_ppi_channel!(PPI_CH0, 0, configurable);
168impl_ppi_channel!(PPI_CH1, 1, configurable);
169impl_ppi_channel!(PPI_CH2, 2, configurable);
170impl_ppi_channel!(PPI_CH3, 3, configurable);
171impl_ppi_channel!(PPI_CH4, 4, configurable);
172impl_ppi_channel!(PPI_CH5, 5, configurable);
173impl_ppi_channel!(PPI_CH6, 6, configurable);
174impl_ppi_channel!(PPI_CH7, 7, configurable);
175impl_ppi_channel!(PPI_CH8, 8, configurable);
176impl_ppi_channel!(PPI_CH9, 9, configurable);
177impl_ppi_channel!(PPI_CH10, 10, configurable);
178impl_ppi_channel!(PPI_CH11, 11, configurable);
179impl_ppi_channel!(PPI_CH12, 12, configurable);
180impl_ppi_channel!(PPI_CH13, 13, configurable);
181impl_ppi_channel!(PPI_CH14, 14, configurable);
182impl_ppi_channel!(PPI_CH15, 15, configurable);
183impl_ppi_channel!(PPI_CH16, 16, configurable);
184impl_ppi_channel!(PPI_CH17, 17, configurable);
185impl_ppi_channel!(PPI_CH18, 18, configurable);
186impl_ppi_channel!(PPI_CH19, 19, configurable);
187impl_ppi_channel!(PPI_CH20, 20);
188impl_ppi_channel!(PPI_CH21, 21);
189impl_ppi_channel!(PPI_CH22, 22);
190impl_ppi_channel!(PPI_CH23, 23);
191impl_ppi_channel!(PPI_CH24, 24);
192impl_ppi_channel!(PPI_CH25, 25);
193impl_ppi_channel!(PPI_CH26, 26);
194impl_ppi_channel!(PPI_CH27, 27);
195impl_ppi_channel!(PPI_CH28, 28);
196impl_ppi_channel!(PPI_CH29, 29);
197impl_ppi_channel!(PPI_CH30, 30);
198impl_ppi_channel!(PPI_CH31, 31);
199
167pub mod irqs { 200pub mod irqs {
168 use crate::pac::Interrupt as InterruptEnum; 201 use crate::pac::Interrupt as InterruptEnum;
169 use embassy_macros::interrupt_declare as declare; 202 use embassy_macros::interrupt_declare as declare;
diff --git a/embassy-nrf/src/chips/nrf52811.rs b/embassy-nrf/src/chips/nrf52811.rs
index cbf14df2a..1231ae62b 100644
--- a/embassy-nrf/src/chips/nrf52811.rs
+++ b/embassy-nrf/src/chips/nrf52811.rs
@@ -165,6 +165,39 @@ impl_pin!(P0_29, 0, 29);
165impl_pin!(P0_30, 0, 30); 165impl_pin!(P0_30, 0, 30);
166impl_pin!(P0_31, 0, 31); 166impl_pin!(P0_31, 0, 31);
167 167
168impl_ppi_channel!(PPI_CH0, 0, configurable);
169impl_ppi_channel!(PPI_CH1, 1, configurable);
170impl_ppi_channel!(PPI_CH2, 2, configurable);
171impl_ppi_channel!(PPI_CH3, 3, configurable);
172impl_ppi_channel!(PPI_CH4, 4, configurable);
173impl_ppi_channel!(PPI_CH5, 5, configurable);
174impl_ppi_channel!(PPI_CH6, 6, configurable);
175impl_ppi_channel!(PPI_CH7, 7, configurable);
176impl_ppi_channel!(PPI_CH8, 8, configurable);
177impl_ppi_channel!(PPI_CH9, 9, configurable);
178impl_ppi_channel!(PPI_CH10, 10, configurable);
179impl_ppi_channel!(PPI_CH11, 11, configurable);
180impl_ppi_channel!(PPI_CH12, 12, configurable);
181impl_ppi_channel!(PPI_CH13, 13, configurable);
182impl_ppi_channel!(PPI_CH14, 14, configurable);
183impl_ppi_channel!(PPI_CH15, 15, configurable);
184impl_ppi_channel!(PPI_CH16, 16, configurable);
185impl_ppi_channel!(PPI_CH17, 17, configurable);
186impl_ppi_channel!(PPI_CH18, 18, configurable);
187impl_ppi_channel!(PPI_CH19, 19, configurable);
188impl_ppi_channel!(PPI_CH20, 20);
189impl_ppi_channel!(PPI_CH21, 21);
190impl_ppi_channel!(PPI_CH22, 22);
191impl_ppi_channel!(PPI_CH23, 23);
192impl_ppi_channel!(PPI_CH24, 24);
193impl_ppi_channel!(PPI_CH25, 25);
194impl_ppi_channel!(PPI_CH26, 26);
195impl_ppi_channel!(PPI_CH27, 27);
196impl_ppi_channel!(PPI_CH28, 28);
197impl_ppi_channel!(PPI_CH29, 29);
198impl_ppi_channel!(PPI_CH30, 30);
199impl_ppi_channel!(PPI_CH31, 31);
200
168pub mod irqs { 201pub mod irqs {
169 use crate::pac::Interrupt as InterruptEnum; 202 use crate::pac::Interrupt as InterruptEnum;
170 use embassy_macros::interrupt_declare as declare; 203 use embassy_macros::interrupt_declare as declare;
diff --git a/embassy-nrf/src/chips/nrf52820.rs b/embassy-nrf/src/chips/nrf52820.rs
index e434c0096..fc7a367ef 100644
--- a/embassy-nrf/src/chips/nrf52820.rs
+++ b/embassy-nrf/src/chips/nrf52820.rs
@@ -160,6 +160,39 @@ impl_pin!(P0_29, 0, 29);
160impl_pin!(P0_30, 0, 30); 160impl_pin!(P0_30, 0, 30);
161impl_pin!(P0_31, 0, 31); 161impl_pin!(P0_31, 0, 31);
162 162
163impl_ppi_channel!(PPI_CH0, 0, configurable);
164impl_ppi_channel!(PPI_CH1, 1, configurable);
165impl_ppi_channel!(PPI_CH2, 2, configurable);
166impl_ppi_channel!(PPI_CH3, 3, configurable);
167impl_ppi_channel!(PPI_CH4, 4, configurable);
168impl_ppi_channel!(PPI_CH5, 5, configurable);
169impl_ppi_channel!(PPI_CH6, 6, configurable);
170impl_ppi_channel!(PPI_CH7, 7, configurable);
171impl_ppi_channel!(PPI_CH8, 8, configurable);
172impl_ppi_channel!(PPI_CH9, 9, configurable);
173impl_ppi_channel!(PPI_CH10, 10, configurable);
174impl_ppi_channel!(PPI_CH11, 11, configurable);
175impl_ppi_channel!(PPI_CH12, 12, configurable);
176impl_ppi_channel!(PPI_CH13, 13, configurable);
177impl_ppi_channel!(PPI_CH14, 14, configurable);
178impl_ppi_channel!(PPI_CH15, 15, configurable);
179impl_ppi_channel!(PPI_CH16, 16, configurable);
180impl_ppi_channel!(PPI_CH17, 17, configurable);
181impl_ppi_channel!(PPI_CH18, 18, configurable);
182impl_ppi_channel!(PPI_CH19, 19, configurable);
183impl_ppi_channel!(PPI_CH20, 20);
184impl_ppi_channel!(PPI_CH21, 21);
185impl_ppi_channel!(PPI_CH22, 22);
186impl_ppi_channel!(PPI_CH23, 23);
187impl_ppi_channel!(PPI_CH24, 24);
188impl_ppi_channel!(PPI_CH25, 25);
189impl_ppi_channel!(PPI_CH26, 26);
190impl_ppi_channel!(PPI_CH27, 27);
191impl_ppi_channel!(PPI_CH28, 28);
192impl_ppi_channel!(PPI_CH29, 29);
193impl_ppi_channel!(PPI_CH30, 30);
194impl_ppi_channel!(PPI_CH31, 31);
195
163pub mod irqs { 196pub mod irqs {
164 use crate::pac::Interrupt as InterruptEnum; 197 use crate::pac::Interrupt as InterruptEnum;
165 use embassy_macros::interrupt_declare as declare; 198 use embassy_macros::interrupt_declare as declare;
diff --git a/embassy-nrf/src/chips/nrf52832.rs b/embassy-nrf/src/chips/nrf52832.rs
index b95aa604b..9bbef5438 100644
--- a/embassy-nrf/src/chips/nrf52832.rs
+++ b/embassy-nrf/src/chips/nrf52832.rs
@@ -178,6 +178,39 @@ impl_pin!(P0_29, 0, 29);
178impl_pin!(P0_30, 0, 30); 178impl_pin!(P0_30, 0, 30);
179impl_pin!(P0_31, 0, 31); 179impl_pin!(P0_31, 0, 31);
180 180
181impl_ppi_channel!(PPI_CH0, 0, configurable);
182impl_ppi_channel!(PPI_CH1, 1, configurable);
183impl_ppi_channel!(PPI_CH2, 2, configurable);
184impl_ppi_channel!(PPI_CH3, 3, configurable);
185impl_ppi_channel!(PPI_CH4, 4, configurable);
186impl_ppi_channel!(PPI_CH5, 5, configurable);
187impl_ppi_channel!(PPI_CH6, 6, configurable);
188impl_ppi_channel!(PPI_CH7, 7, configurable);
189impl_ppi_channel!(PPI_CH8, 8, configurable);
190impl_ppi_channel!(PPI_CH9, 9, configurable);
191impl_ppi_channel!(PPI_CH10, 10, configurable);
192impl_ppi_channel!(PPI_CH11, 11, configurable);
193impl_ppi_channel!(PPI_CH12, 12, configurable);
194impl_ppi_channel!(PPI_CH13, 13, configurable);
195impl_ppi_channel!(PPI_CH14, 14, configurable);
196impl_ppi_channel!(PPI_CH15, 15, configurable);
197impl_ppi_channel!(PPI_CH16, 16, configurable);
198impl_ppi_channel!(PPI_CH17, 17, configurable);
199impl_ppi_channel!(PPI_CH18, 18, configurable);
200impl_ppi_channel!(PPI_CH19, 19, configurable);
201impl_ppi_channel!(PPI_CH20, 20);
202impl_ppi_channel!(PPI_CH21, 21);
203impl_ppi_channel!(PPI_CH22, 22);
204impl_ppi_channel!(PPI_CH23, 23);
205impl_ppi_channel!(PPI_CH24, 24);
206impl_ppi_channel!(PPI_CH25, 25);
207impl_ppi_channel!(PPI_CH26, 26);
208impl_ppi_channel!(PPI_CH27, 27);
209impl_ppi_channel!(PPI_CH28, 28);
210impl_ppi_channel!(PPI_CH29, 29);
211impl_ppi_channel!(PPI_CH30, 30);
212impl_ppi_channel!(PPI_CH31, 31);
213
181pub mod irqs { 214pub mod irqs {
182 use crate::pac::Interrupt as InterruptEnum; 215 use crate::pac::Interrupt as InterruptEnum;
183 use embassy_macros::interrupt_declare as declare; 216 use embassy_macros::interrupt_declare as declare;
diff --git a/embassy-nrf/src/chips/nrf52833.rs b/embassy-nrf/src/chips/nrf52833.rs
index 570e4b103..d9495dd94 100644
--- a/embassy-nrf/src/chips/nrf52833.rs
+++ b/embassy-nrf/src/chips/nrf52833.rs
@@ -218,6 +218,39 @@ impl_pin!(P1_13, 1, 13);
218impl_pin!(P1_14, 1, 14); 218impl_pin!(P1_14, 1, 14);
219impl_pin!(P1_15, 1, 15); 219impl_pin!(P1_15, 1, 15);
220 220
221impl_ppi_channel!(PPI_CH0, 0, configurable);
222impl_ppi_channel!(PPI_CH1, 1, configurable);
223impl_ppi_channel!(PPI_CH2, 2, configurable);
224impl_ppi_channel!(PPI_CH3, 3, configurable);
225impl_ppi_channel!(PPI_CH4, 4, configurable);
226impl_ppi_channel!(PPI_CH5, 5, configurable);
227impl_ppi_channel!(PPI_CH6, 6, configurable);
228impl_ppi_channel!(PPI_CH7, 7, configurable);
229impl_ppi_channel!(PPI_CH8, 8, configurable);
230impl_ppi_channel!(PPI_CH9, 9, configurable);
231impl_ppi_channel!(PPI_CH10, 10, configurable);
232impl_ppi_channel!(PPI_CH11, 11, configurable);
233impl_ppi_channel!(PPI_CH12, 12, configurable);
234impl_ppi_channel!(PPI_CH13, 13, configurable);
235impl_ppi_channel!(PPI_CH14, 14, configurable);
236impl_ppi_channel!(PPI_CH15, 15, configurable);
237impl_ppi_channel!(PPI_CH16, 16, configurable);
238impl_ppi_channel!(PPI_CH17, 17, configurable);
239impl_ppi_channel!(PPI_CH18, 18, configurable);
240impl_ppi_channel!(PPI_CH19, 19, configurable);
241impl_ppi_channel!(PPI_CH20, 20);
242impl_ppi_channel!(PPI_CH21, 21);
243impl_ppi_channel!(PPI_CH22, 22);
244impl_ppi_channel!(PPI_CH23, 23);
245impl_ppi_channel!(PPI_CH24, 24);
246impl_ppi_channel!(PPI_CH25, 25);
247impl_ppi_channel!(PPI_CH26, 26);
248impl_ppi_channel!(PPI_CH27, 27);
249impl_ppi_channel!(PPI_CH28, 28);
250impl_ppi_channel!(PPI_CH29, 29);
251impl_ppi_channel!(PPI_CH30, 30);
252impl_ppi_channel!(PPI_CH31, 31);
253
221pub mod irqs { 254pub mod irqs {
222 use crate::pac::Interrupt as InterruptEnum; 255 use crate::pac::Interrupt as InterruptEnum;
223 use embassy_macros::interrupt_declare as declare; 256 use embassy_macros::interrupt_declare as declare;
diff --git a/embassy-nrf/src/chips/nrf52840.rs b/embassy-nrf/src/chips/nrf52840.rs
index 1221f23b3..ad89afbca 100644
--- a/embassy-nrf/src/chips/nrf52840.rs
+++ b/embassy-nrf/src/chips/nrf52840.rs
@@ -223,6 +223,39 @@ impl_pin!(P1_13, 1, 13);
223impl_pin!(P1_14, 1, 14); 223impl_pin!(P1_14, 1, 14);
224impl_pin!(P1_15, 1, 15); 224impl_pin!(P1_15, 1, 15);
225 225
226impl_ppi_channel!(PPI_CH0, 0, configurable);
227impl_ppi_channel!(PPI_CH1, 1, configurable);
228impl_ppi_channel!(PPI_CH2, 2, configurable);
229impl_ppi_channel!(PPI_CH3, 3, configurable);
230impl_ppi_channel!(PPI_CH4, 4, configurable);
231impl_ppi_channel!(PPI_CH5, 5, configurable);
232impl_ppi_channel!(PPI_CH6, 6, configurable);
233impl_ppi_channel!(PPI_CH7, 7, configurable);
234impl_ppi_channel!(PPI_CH8, 8, configurable);
235impl_ppi_channel!(PPI_CH9, 9, configurable);
236impl_ppi_channel!(PPI_CH10, 10, configurable);
237impl_ppi_channel!(PPI_CH11, 11, configurable);
238impl_ppi_channel!(PPI_CH12, 12, configurable);
239impl_ppi_channel!(PPI_CH13, 13, configurable);
240impl_ppi_channel!(PPI_CH14, 14, configurable);
241impl_ppi_channel!(PPI_CH15, 15, configurable);
242impl_ppi_channel!(PPI_CH16, 16, configurable);
243impl_ppi_channel!(PPI_CH17, 17, configurable);
244impl_ppi_channel!(PPI_CH18, 18, configurable);
245impl_ppi_channel!(PPI_CH19, 19, configurable);
246impl_ppi_channel!(PPI_CH20, 20);
247impl_ppi_channel!(PPI_CH21, 21);
248impl_ppi_channel!(PPI_CH22, 22);
249impl_ppi_channel!(PPI_CH23, 23);
250impl_ppi_channel!(PPI_CH24, 24);
251impl_ppi_channel!(PPI_CH25, 25);
252impl_ppi_channel!(PPI_CH26, 26);
253impl_ppi_channel!(PPI_CH27, 27);
254impl_ppi_channel!(PPI_CH28, 28);
255impl_ppi_channel!(PPI_CH29, 29);
256impl_ppi_channel!(PPI_CH30, 30);
257impl_ppi_channel!(PPI_CH31, 31);
258
226pub mod irqs { 259pub mod irqs {
227 use crate::pac::Interrupt as InterruptEnum; 260 use crate::pac::Interrupt as InterruptEnum;
228 use embassy_macros::interrupt_declare as declare; 261 use embassy_macros::interrupt_declare as declare;
diff --git a/embassy-nrf/src/ppi.rs b/embassy-nrf/src/ppi.rs
index a18dec12c..1b12b1e95 100644
--- a/embassy-nrf/src/ppi.rs
+++ b/embassy-nrf/src/ppi.rs
@@ -1,3 +1,5 @@
1#![macro_use]
2
1//! HAL interface for the PPI peripheral. 3//! HAL interface for the PPI peripheral.
2//! 4//!
3//! The Programmable Peripheral Interconnect interface allows for an autonomous interoperability 5//! The Programmable Peripheral Interconnect interface allows for an autonomous interoperability
@@ -109,7 +111,7 @@ impl Event {
109 } 111 }
110} 112}
111 113
112mod sealed { 114pub(crate) mod sealed {
113 pub trait ConfigurableChannel {} 115 pub trait ConfigurableChannel {}
114 pub trait Channel {} 116 pub trait Channel {}
115 pub trait Group {} 117 pub trait Group {}
@@ -167,15 +169,15 @@ impl Channel for AnyConfigurableChannel {
167 } 169 }
168} 170}
169 171
170macro_rules! impl_channel { 172macro_rules! impl_ppi_channel {
171 ($type:ident, $number:expr, configurable) => { 173 ($type:ident, $number:expr, configurable) => {
172 impl_channel!($type, $number); 174 impl_ppi_channel!($type, $number);
173 impl sealed::ConfigurableChannel for peripherals::$type {} 175 impl crate::ppi::sealed::ConfigurableChannel for peripherals::$type {}
174 impl ConfigurableChannel for peripherals::$type {} 176 impl crate::ppi::ConfigurableChannel for peripherals::$type {}
175 }; 177 };
176 ($type:ident, $number:expr) => { 178 ($type:ident, $number:expr) => {
177 impl sealed::Channel for peripherals::$type {} 179 impl crate::ppi::sealed::Channel for peripherals::$type {}
178 impl Channel for peripherals::$type { 180 impl crate::ppi::Channel for peripherals::$type {
179 fn number(&self) -> usize { 181 fn number(&self) -> usize {
180 $number 182 $number
181 } 183 }
@@ -183,43 +185,6 @@ macro_rules! impl_channel {
183 }; 185 };
184} 186}
185 187
186impl_channel!(PPI_CH0, 0, configurable);
187impl_channel!(PPI_CH1, 1, configurable);
188impl_channel!(PPI_CH2, 2, configurable);
189impl_channel!(PPI_CH3, 3, configurable);
190impl_channel!(PPI_CH4, 4, configurable);
191impl_channel!(PPI_CH5, 5, configurable);
192impl_channel!(PPI_CH6, 6, configurable);
193impl_channel!(PPI_CH7, 7, configurable);
194impl_channel!(PPI_CH8, 8, configurable);
195impl_channel!(PPI_CH9, 9, configurable);
196impl_channel!(PPI_CH10, 10, configurable);
197impl_channel!(PPI_CH11, 11, configurable);
198impl_channel!(PPI_CH12, 12, configurable);
199impl_channel!(PPI_CH13, 13, configurable);
200impl_channel!(PPI_CH14, 14, configurable);
201impl_channel!(PPI_CH15, 15, configurable);
202#[cfg(not(feature = "nrf51"))]
203impl_channel!(PPI_CH16, 16, configurable);
204#[cfg(not(feature = "nrf51"))]
205impl_channel!(PPI_CH17, 17, configurable);
206#[cfg(not(feature = "nrf51"))]
207impl_channel!(PPI_CH18, 18, configurable);
208#[cfg(not(feature = "nrf51"))]
209impl_channel!(PPI_CH19, 19, configurable);
210impl_channel!(PPI_CH20, 20);
211impl_channel!(PPI_CH21, 21);
212impl_channel!(PPI_CH22, 22);
213impl_channel!(PPI_CH23, 23);
214impl_channel!(PPI_CH24, 24);
215impl_channel!(PPI_CH25, 25);
216impl_channel!(PPI_CH26, 26);
217impl_channel!(PPI_CH27, 27);
218impl_channel!(PPI_CH28, 28);
219impl_channel!(PPI_CH29, 29);
220impl_channel!(PPI_CH30, 30);
221impl_channel!(PPI_CH31, 31);
222
223// ====================== 188// ======================
224// groups 189// groups
225 190