diff options
| author | Dion Dokter <[email protected]> | 2021-10-26 09:45:29 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-10-26 14:47:34 +0200 |
| commit | c63d74720980fcf9acbf5b1d8adbb9dc2031d391 (patch) | |
| tree | a90b0824d649025ce8e44177e542ec0e3610afe7 | |
| parent | 4d3341dbb980131762d714cb5b5d8dfb11060119 (diff) | |
Fewer channel traits, more cfg to make the system work
| -rw-r--r-- | embassy-nrf/src/buffered_uarte.rs | 20 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52805.rs | 44 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52810.rs | 64 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52811.rs | 64 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52820.rs | 64 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52832.rs | 64 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52833.rs | 64 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52840.rs | 64 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf9160.rs | 32 | ||||
| -rw-r--r-- | embassy-nrf/src/ppi/mod.rs | 135 | ||||
| -rw-r--r-- | embassy-nrf/src/ppi/ppi.rs | 12 | ||||
| -rw-r--r-- | embassy-nrf/src/uarte.rs | 20 |
12 files changed, 335 insertions, 312 deletions
diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs index 1dc04f4f6..717ada78d 100644 --- a/embassy-nrf/src/buffered_uarte.rs +++ b/embassy-nrf/src/buffered_uarte.rs | |||
| @@ -15,7 +15,7 @@ use embassy_hal_common::{low_power_wait_until, unborrow}; | |||
| 15 | use crate::gpio::sealed::Pin as _; | 15 | use crate::gpio::sealed::Pin as _; |
| 16 | use crate::gpio::{OptionalPin as GpioOptionalPin, Pin as GpioPin}; | 16 | use crate::gpio::{OptionalPin as GpioOptionalPin, Pin as GpioPin}; |
| 17 | use crate::pac; | 17 | use crate::pac; |
| 18 | use crate::ppi::{AnyChannel, Event, OneToOneChannel, OneToTwoChannel, Ppi, Task}; | 18 | use crate::ppi::{AnyConfigurableChannel, ConfigurableChannel, Event, Ppi, Task}; |
| 19 | use crate::timer::Instance as TimerInstance; | 19 | use crate::timer::Instance as TimerInstance; |
| 20 | use crate::timer::{Frequency, Timer}; | 20 | use crate::timer::{Frequency, Timer}; |
| 21 | use crate::uarte::{Config, Instance as UarteInstance}; | 21 | use crate::uarte::{Config, Instance as UarteInstance}; |
| @@ -45,8 +45,8 @@ impl<'d, U: UarteInstance, T: TimerInstance> State<'d, U, T> { | |||
| 45 | struct StateInner<'d, U: UarteInstance, T: TimerInstance> { | 45 | struct StateInner<'d, U: UarteInstance, T: TimerInstance> { |
| 46 | phantom: PhantomData<&'d mut U>, | 46 | phantom: PhantomData<&'d mut U>, |
| 47 | timer: Timer<'d, T>, | 47 | timer: Timer<'d, T>, |
| 48 | _ppi_ch1: Ppi<'d, AnyChannel, 1, 2>, | 48 | _ppi_ch1: Ppi<'d, AnyConfigurableChannel, 1, 2>, |
| 49 | _ppi_ch2: Ppi<'d, AnyChannel, 1, 1>, | 49 | _ppi_ch2: Ppi<'d, AnyConfigurableChannel, 1, 1>, |
| 50 | 50 | ||
| 51 | rx: RingBuffer<'d>, | 51 | rx: RingBuffer<'d>, |
| 52 | rx_state: RxState, | 52 | rx_state: RxState, |
| @@ -70,8 +70,8 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> { | |||
| 70 | state: &'d mut State<'d, U, T>, | 70 | state: &'d mut State<'d, U, T>, |
| 71 | _uarte: impl Unborrow<Target = U> + 'd, | 71 | _uarte: impl Unborrow<Target = U> + 'd, |
| 72 | timer: impl Unborrow<Target = T> + 'd, | 72 | timer: impl Unborrow<Target = T> + 'd, |
| 73 | ppi_ch1: impl Unborrow<Target = impl OneToTwoChannel + 'd> + 'd, | 73 | ppi_ch1: impl Unborrow<Target = impl ConfigurableChannel + 'd> + 'd, |
| 74 | ppi_ch2: impl Unborrow<Target = impl OneToOneChannel + 'd> + 'd, | 74 | ppi_ch2: impl Unborrow<Target = impl ConfigurableChannel + 'd> + 'd, |
| 75 | irq: impl Unborrow<Target = U::Interrupt> + 'd, | 75 | irq: impl Unborrow<Target = U::Interrupt> + 'd, |
| 76 | rxd: impl Unborrow<Target = impl GpioPin> + 'd, | 76 | rxd: impl Unborrow<Target = impl GpioPin> + 'd, |
| 77 | txd: impl Unborrow<Target = impl GpioPin> + 'd, | 77 | txd: impl Unborrow<Target = impl GpioPin> + 'd, |
| @@ -145,20 +145,18 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> { | |||
| 145 | timer.cc(0).short_compare_stop(); | 145 | timer.cc(0).short_compare_stop(); |
| 146 | 146 | ||
| 147 | let mut ppi_ch1 = Ppi::new_one_to_two( | 147 | let mut ppi_ch1 = Ppi::new_one_to_two( |
| 148 | ppi_ch1, | 148 | ppi_ch1.degrade(), |
| 149 | Event::from_reg(&r.events_rxdrdy), | 149 | Event::from_reg(&r.events_rxdrdy), |
| 150 | timer.task_clear(), | 150 | timer.task_clear(), |
| 151 | timer.task_start(), | 151 | timer.task_start(), |
| 152 | ) | 152 | ); |
| 153 | .degrade(); | ||
| 154 | ppi_ch1.enable(); | 153 | ppi_ch1.enable(); |
| 155 | 154 | ||
| 156 | let mut ppi_ch2 = Ppi::new_one_to_one( | 155 | let mut ppi_ch2 = Ppi::new_one_to_one( |
| 157 | ppi_ch2, | 156 | ppi_ch2.degrade(), |
| 158 | timer.cc(0).event_compare(), | 157 | timer.cc(0).event_compare(), |
| 159 | Task::from_reg(&r.tasks_stoprx), | 158 | Task::from_reg(&r.tasks_stoprx), |
| 160 | ) | 159 | ); |
| 161 | .degrade(); | ||
| 162 | ppi_ch2.enable(); | 160 | ppi_ch2.enable(); |
| 163 | 161 | ||
| 164 | Self { | 162 | Self { |
diff --git a/embassy-nrf/src/chips/nrf52805.rs b/embassy-nrf/src/chips/nrf52805.rs index 326f4a8be..689896485 100644 --- a/embassy-nrf/src/chips/nrf52805.rs +++ b/embassy-nrf/src/chips/nrf52805.rs | |||
| @@ -167,28 +167,28 @@ impl_pin!(P0_29, 0, 29); | |||
| 167 | impl_pin!(P0_30, 0, 30); | 167 | impl_pin!(P0_30, 0, 30); |
| 168 | impl_pin!(P0_31, 0, 31); | 168 | impl_pin!(P0_31, 0, 31); |
| 169 | 169 | ||
| 170 | impl_ppi_channel!(PPI_CH0, 0, true, 1, 2); | 170 | impl_ppi_channel!(PPI_CH0, 0 => configurable); |
| 171 | impl_ppi_channel!(PPI_CH1, 1, true, 1, 2); | 171 | impl_ppi_channel!(PPI_CH1, 1 => configurable); |
| 172 | impl_ppi_channel!(PPI_CH2, 2, true, 1, 2); | 172 | impl_ppi_channel!(PPI_CH2, 2 => configurable); |
| 173 | impl_ppi_channel!(PPI_CH3, 3, true, 1, 2); | 173 | impl_ppi_channel!(PPI_CH3, 3 => configurable); |
| 174 | impl_ppi_channel!(PPI_CH4, 4, true, 1, 2); | 174 | impl_ppi_channel!(PPI_CH4, 4 => configurable); |
| 175 | impl_ppi_channel!(PPI_CH5, 5, true, 1, 2); | 175 | impl_ppi_channel!(PPI_CH5, 5 => configurable); |
| 176 | impl_ppi_channel!(PPI_CH6, 6, true, 1, 2); | 176 | impl_ppi_channel!(PPI_CH6, 6 => configurable); |
| 177 | impl_ppi_channel!(PPI_CH7, 7, true, 1, 2); | 177 | impl_ppi_channel!(PPI_CH7, 7 => configurable); |
| 178 | impl_ppi_channel!(PPI_CH8, 8, true, 1, 2); | 178 | impl_ppi_channel!(PPI_CH8, 8 => configurable); |
| 179 | impl_ppi_channel!(PPI_CH9, 9, true, 1, 2); | 179 | impl_ppi_channel!(PPI_CH9, 9 => configurable); |
| 180 | impl_ppi_channel!(PPI_CH20, 20, false, 0, 1); | 180 | impl_ppi_channel!(PPI_CH20, 20 => static); |
| 181 | impl_ppi_channel!(PPI_CH21, 21, false, 0, 1); | 181 | impl_ppi_channel!(PPI_CH21, 21 => static); |
| 182 | impl_ppi_channel!(PPI_CH22, 22, false, 0, 1); | 182 | impl_ppi_channel!(PPI_CH22, 22 => static); |
| 183 | impl_ppi_channel!(PPI_CH23, 23, false, 0, 1); | 183 | impl_ppi_channel!(PPI_CH23, 23 => static); |
| 184 | impl_ppi_channel!(PPI_CH24, 24, false, 0, 1); | 184 | impl_ppi_channel!(PPI_CH24, 24 => static); |
| 185 | impl_ppi_channel!(PPI_CH25, 25, false, 0, 1); | 185 | impl_ppi_channel!(PPI_CH25, 25 => static); |
| 186 | impl_ppi_channel!(PPI_CH26, 26, false, 0, 1); | 186 | impl_ppi_channel!(PPI_CH26, 26 => static); |
| 187 | impl_ppi_channel!(PPI_CH27, 27, false, 0, 1); | 187 | impl_ppi_channel!(PPI_CH27, 27 => static); |
| 188 | impl_ppi_channel!(PPI_CH28, 28, false, 0, 1); | 188 | impl_ppi_channel!(PPI_CH28, 28 => static); |
| 189 | impl_ppi_channel!(PPI_CH29, 29, false, 0, 1); | 189 | impl_ppi_channel!(PPI_CH29, 29 => static); |
| 190 | impl_ppi_channel!(PPI_CH30, 30, false, 0, 1); | 190 | impl_ppi_channel!(PPI_CH30, 30 => static); |
| 191 | impl_ppi_channel!(PPI_CH31, 31, false, 0, 1); | 191 | impl_ppi_channel!(PPI_CH31, 31 => static); |
| 192 | 192 | ||
| 193 | impl_saadc_input!(P0_04, ANALOGINPUT2); | 193 | impl_saadc_input!(P0_04, ANALOGINPUT2); |
| 194 | impl_saadc_input!(P0_05, ANALOGINPUT3); | 194 | impl_saadc_input!(P0_05, ANALOGINPUT3); |
diff --git a/embassy-nrf/src/chips/nrf52810.rs b/embassy-nrf/src/chips/nrf52810.rs index 4c16d51a7..b3b3593bb 100644 --- a/embassy-nrf/src/chips/nrf52810.rs +++ b/embassy-nrf/src/chips/nrf52810.rs | |||
| @@ -172,38 +172,38 @@ impl_pin!(P0_29, 0, 29); | |||
| 172 | impl_pin!(P0_30, 0, 30); | 172 | impl_pin!(P0_30, 0, 30); |
| 173 | impl_pin!(P0_31, 0, 31); | 173 | impl_pin!(P0_31, 0, 31); |
| 174 | 174 | ||
| 175 | impl_ppi_channel!(PPI_CH0, 0, true, 1, 2); | 175 | impl_ppi_channel!(PPI_CH0, 0 => configurable); |
| 176 | impl_ppi_channel!(PPI_CH1, 1, true, 1, 2); | 176 | impl_ppi_channel!(PPI_CH1, 1 => configurable); |
| 177 | impl_ppi_channel!(PPI_CH2, 2, true, 1, 2); | 177 | impl_ppi_channel!(PPI_CH2, 2 => configurable); |
| 178 | impl_ppi_channel!(PPI_CH3, 3, true, 1, 2); | 178 | impl_ppi_channel!(PPI_CH3, 3 => configurable); |
| 179 | impl_ppi_channel!(PPI_CH4, 4, true, 1, 2); | 179 | impl_ppi_channel!(PPI_CH4, 4 => configurable); |
| 180 | impl_ppi_channel!(PPI_CH5, 5, true, 1, 2); | 180 | impl_ppi_channel!(PPI_CH5, 5 => configurable); |
| 181 | impl_ppi_channel!(PPI_CH6, 6, true, 1, 2); | 181 | impl_ppi_channel!(PPI_CH6, 6 => configurable); |
| 182 | impl_ppi_channel!(PPI_CH7, 7, true, 1, 2); | 182 | impl_ppi_channel!(PPI_CH7, 7 => configurable); |
| 183 | impl_ppi_channel!(PPI_CH8, 8, true, 1, 2); | 183 | impl_ppi_channel!(PPI_CH8, 8 => configurable); |
| 184 | impl_ppi_channel!(PPI_CH9, 9, true, 1, 2); | 184 | impl_ppi_channel!(PPI_CH9, 9 => configurable); |
| 185 | impl_ppi_channel!(PPI_CH10, 10, true, 1, 2); | 185 | impl_ppi_channel!(PPI_CH10, 10 => configurable); |
| 186 | impl_ppi_channel!(PPI_CH11, 11, true, 1, 2); | 186 | impl_ppi_channel!(PPI_CH11, 11 => configurable); |
| 187 | impl_ppi_channel!(PPI_CH12, 12, true, 1, 2); | 187 | impl_ppi_channel!(PPI_CH12, 12 => configurable); |
| 188 | impl_ppi_channel!(PPI_CH13, 13, true, 1, 2); | 188 | impl_ppi_channel!(PPI_CH13, 13 => configurable); |
| 189 | impl_ppi_channel!(PPI_CH14, 14, true, 1, 2); | 189 | impl_ppi_channel!(PPI_CH14, 14 => configurable); |
| 190 | impl_ppi_channel!(PPI_CH15, 15, true, 1, 2); | 190 | impl_ppi_channel!(PPI_CH15, 15 => configurable); |
| 191 | impl_ppi_channel!(PPI_CH16, 16, true, 1, 2); | 191 | impl_ppi_channel!(PPI_CH16, 16 => configurable); |
| 192 | impl_ppi_channel!(PPI_CH17, 17, true, 1, 2); | 192 | impl_ppi_channel!(PPI_CH17, 17 => configurable); |
| 193 | impl_ppi_channel!(PPI_CH18, 18, true, 1, 2); | 193 | impl_ppi_channel!(PPI_CH18, 18 => configurable); |
| 194 | impl_ppi_channel!(PPI_CH19, 19, true, 1, 2); | 194 | impl_ppi_channel!(PPI_CH19, 19 => configurable); |
| 195 | impl_ppi_channel!(PPI_CH20, 20, false, 0, 1); | 195 | impl_ppi_channel!(PPI_CH20, 20 => static); |
| 196 | impl_ppi_channel!(PPI_CH21, 21, false, 0, 1); | 196 | impl_ppi_channel!(PPI_CH21, 21 => static); |
| 197 | impl_ppi_channel!(PPI_CH22, 22, false, 0, 1); | 197 | impl_ppi_channel!(PPI_CH22, 22 => static); |
| 198 | impl_ppi_channel!(PPI_CH23, 23, false, 0, 1); | 198 | impl_ppi_channel!(PPI_CH23, 23 => static); |
| 199 | impl_ppi_channel!(PPI_CH24, 24, false, 0, 1); | 199 | impl_ppi_channel!(PPI_CH24, 24 => static); |
| 200 | impl_ppi_channel!(PPI_CH25, 25, false, 0, 1); | 200 | impl_ppi_channel!(PPI_CH25, 25 => static); |
| 201 | impl_ppi_channel!(PPI_CH26, 26, false, 0, 1); | 201 | impl_ppi_channel!(PPI_CH26, 26 => static); |
| 202 | impl_ppi_channel!(PPI_CH27, 27, false, 0, 1); | 202 | impl_ppi_channel!(PPI_CH27, 27 => static); |
| 203 | impl_ppi_channel!(PPI_CH28, 28, false, 0, 1); | 203 | impl_ppi_channel!(PPI_CH28, 28 => static); |
| 204 | impl_ppi_channel!(PPI_CH29, 29, false, 0, 1); | 204 | impl_ppi_channel!(PPI_CH29, 29 => static); |
| 205 | impl_ppi_channel!(PPI_CH30, 30, false, 0, 1); | 205 | impl_ppi_channel!(PPI_CH30, 30 => static); |
| 206 | impl_ppi_channel!(PPI_CH31, 31, false, 0, 1); | 206 | impl_ppi_channel!(PPI_CH31, 31 => static); |
| 207 | 207 | ||
| 208 | impl_saadc_input!(P0_02, ANALOGINPUT0); | 208 | impl_saadc_input!(P0_02, ANALOGINPUT0); |
| 209 | impl_saadc_input!(P0_03, ANALOGINPUT1); | 209 | impl_saadc_input!(P0_03, ANALOGINPUT1); |
diff --git a/embassy-nrf/src/chips/nrf52811.rs b/embassy-nrf/src/chips/nrf52811.rs index 0c54d9b9e..7551492c3 100644 --- a/embassy-nrf/src/chips/nrf52811.rs +++ b/embassy-nrf/src/chips/nrf52811.rs | |||
| @@ -173,38 +173,38 @@ impl_pin!(P0_29, 0, 29); | |||
| 173 | impl_pin!(P0_30, 0, 30); | 173 | impl_pin!(P0_30, 0, 30); |
| 174 | impl_pin!(P0_31, 0, 31); | 174 | impl_pin!(P0_31, 0, 31); |
| 175 | 175 | ||
| 176 | impl_ppi_channel!(PPI_CH0, 0, true, 1, 2); | 176 | impl_ppi_channel!(PPI_CH0, 0 => configurable); |
| 177 | impl_ppi_channel!(PPI_CH1, 1, true, 1, 2); | 177 | impl_ppi_channel!(PPI_CH1, 1 => configurable); |
| 178 | impl_ppi_channel!(PPI_CH2, 2, true, 1, 2); | 178 | impl_ppi_channel!(PPI_CH2, 2 => configurable); |
| 179 | impl_ppi_channel!(PPI_CH3, 3, true, 1, 2); | 179 | impl_ppi_channel!(PPI_CH3, 3 => configurable); |
| 180 | impl_ppi_channel!(PPI_CH4, 4, true, 1, 2); | 180 | impl_ppi_channel!(PPI_CH4, 4 => configurable); |
| 181 | impl_ppi_channel!(PPI_CH5, 5, true, 1, 2); | 181 | impl_ppi_channel!(PPI_CH5, 5 => configurable); |
| 182 | impl_ppi_channel!(PPI_CH6, 6, true, 1, 2); | 182 | impl_ppi_channel!(PPI_CH6, 6 => configurable); |
| 183 | impl_ppi_channel!(PPI_CH7, 7, true, 1, 2); | 183 | impl_ppi_channel!(PPI_CH7, 7 => configurable); |
| 184 | impl_ppi_channel!(PPI_CH8, 8, true, 1, 2); | 184 | impl_ppi_channel!(PPI_CH8, 8 => configurable); |
| 185 | impl_ppi_channel!(PPI_CH9, 9, true, 1, 2); | 185 | impl_ppi_channel!(PPI_CH9, 9 => configurable); |
| 186 | impl_ppi_channel!(PPI_CH10, 10, true, 1, 2); | 186 | impl_ppi_channel!(PPI_CH10, 10 => configurable); |
| 187 | impl_ppi_channel!(PPI_CH11, 11, true, 1, 2); | 187 | impl_ppi_channel!(PPI_CH11, 11 => configurable); |
| 188 | impl_ppi_channel!(PPI_CH12, 12, true, 1, 2); | 188 | impl_ppi_channel!(PPI_CH12, 12 => configurable); |
| 189 | impl_ppi_channel!(PPI_CH13, 13, true, 1, 2); | 189 | impl_ppi_channel!(PPI_CH13, 13 => configurable); |
| 190 | impl_ppi_channel!(PPI_CH14, 14, true, 1, 2); | 190 | impl_ppi_channel!(PPI_CH14, 14 => configurable); |
| 191 | impl_ppi_channel!(PPI_CH15, 15, true, 1, 2); | 191 | impl_ppi_channel!(PPI_CH15, 15 => configurable); |
| 192 | impl_ppi_channel!(PPI_CH16, 16, true, 1, 2); | 192 | impl_ppi_channel!(PPI_CH16, 16 => configurable); |
| 193 | impl_ppi_channel!(PPI_CH17, 17, true, 1, 2); | 193 | impl_ppi_channel!(PPI_CH17, 17 => configurable); |
| 194 | impl_ppi_channel!(PPI_CH18, 18, true, 1, 2); | 194 | impl_ppi_channel!(PPI_CH18, 18 => configurable); |
| 195 | impl_ppi_channel!(PPI_CH19, 19, true, 1, 2); | 195 | impl_ppi_channel!(PPI_CH19, 19 => configurable); |
| 196 | impl_ppi_channel!(PPI_CH20, 20, false, 0, 1); | 196 | impl_ppi_channel!(PPI_CH20, 20 => static); |
| 197 | impl_ppi_channel!(PPI_CH21, 21, false, 0, 1); | 197 | impl_ppi_channel!(PPI_CH21, 21 => static); |
| 198 | impl_ppi_channel!(PPI_CH22, 22, false, 0, 1); | 198 | impl_ppi_channel!(PPI_CH22, 22 => static); |
| 199 | impl_ppi_channel!(PPI_CH23, 23, false, 0, 1); | 199 | impl_ppi_channel!(PPI_CH23, 23 => static); |
| 200 | impl_ppi_channel!(PPI_CH24, 24, false, 0, 1); | 200 | impl_ppi_channel!(PPI_CH24, 24 => static); |
| 201 | impl_ppi_channel!(PPI_CH25, 25, false, 0, 1); | 201 | impl_ppi_channel!(PPI_CH25, 25 => static); |
| 202 | impl_ppi_channel!(PPI_CH26, 26, false, 0, 1); | 202 | impl_ppi_channel!(PPI_CH26, 26 => static); |
| 203 | impl_ppi_channel!(PPI_CH27, 27, false, 0, 1); | 203 | impl_ppi_channel!(PPI_CH27, 27 => static); |
| 204 | impl_ppi_channel!(PPI_CH28, 28, false, 0, 1); | 204 | impl_ppi_channel!(PPI_CH28, 28 => static); |
| 205 | impl_ppi_channel!(PPI_CH29, 29, false, 0, 1); | 205 | impl_ppi_channel!(PPI_CH29, 29 => static); |
| 206 | impl_ppi_channel!(PPI_CH30, 30, false, 0, 1); | 206 | impl_ppi_channel!(PPI_CH30, 30 => static); |
| 207 | impl_ppi_channel!(PPI_CH31, 31, false, 0, 1); | 207 | impl_ppi_channel!(PPI_CH31, 31 => static); |
| 208 | 208 | ||
| 209 | impl_saadc_input!(P0_02, ANALOGINPUT0); | 209 | impl_saadc_input!(P0_02, ANALOGINPUT0); |
| 210 | impl_saadc_input!(P0_03, ANALOGINPUT1); | 210 | impl_saadc_input!(P0_03, ANALOGINPUT1); |
diff --git a/embassy-nrf/src/chips/nrf52820.rs b/embassy-nrf/src/chips/nrf52820.rs index d52f2f98a..128e1503f 100644 --- a/embassy-nrf/src/chips/nrf52820.rs +++ b/embassy-nrf/src/chips/nrf52820.rs | |||
| @@ -168,38 +168,38 @@ impl_pin!(P0_29, 0, 29); | |||
| 168 | impl_pin!(P0_30, 0, 30); | 168 | impl_pin!(P0_30, 0, 30); |
| 169 | impl_pin!(P0_31, 0, 31); | 169 | impl_pin!(P0_31, 0, 31); |
| 170 | 170 | ||
| 171 | impl_ppi_channel!(PPI_CH0, 0, true, 1, 2); | 171 | impl_ppi_channel!(PPI_CH0, 0 => configurable); |
| 172 | impl_ppi_channel!(PPI_CH1, 1, true, 1, 2); | 172 | impl_ppi_channel!(PPI_CH1, 1 => configurable); |
| 173 | impl_ppi_channel!(PPI_CH2, 2, true, 1, 2); | 173 | impl_ppi_channel!(PPI_CH2, 2 => configurable); |
| 174 | impl_ppi_channel!(PPI_CH3, 3, true, 1, 2); | 174 | impl_ppi_channel!(PPI_CH3, 3 => configurable); |
| 175 | impl_ppi_channel!(PPI_CH4, 4, true, 1, 2); | 175 | impl_ppi_channel!(PPI_CH4, 4 => configurable); |
| 176 | impl_ppi_channel!(PPI_CH5, 5, true, 1, 2); | 176 | impl_ppi_channel!(PPI_CH5, 5 => configurable); |
| 177 | impl_ppi_channel!(PPI_CH6, 6, true, 1, 2); | 177 | impl_ppi_channel!(PPI_CH6, 6 => configurable); |
| 178 | impl_ppi_channel!(PPI_CH7, 7, true, 1, 2); | 178 | impl_ppi_channel!(PPI_CH7, 7 => configurable); |
| 179 | impl_ppi_channel!(PPI_CH8, 8, true, 1, 2); | 179 | impl_ppi_channel!(PPI_CH8, 8 => configurable); |
| 180 | impl_ppi_channel!(PPI_CH9, 9, true, 1, 2); | 180 | impl_ppi_channel!(PPI_CH9, 9 => configurable); |
| 181 | impl_ppi_channel!(PPI_CH10, 10, true, 1, 2); | 181 | impl_ppi_channel!(PPI_CH10, 10 => configurable); |
| 182 | impl_ppi_channel!(PPI_CH11, 11, true, 1, 2); | 182 | impl_ppi_channel!(PPI_CH11, 11 => configurable); |
| 183 | impl_ppi_channel!(PPI_CH12, 12, true, 1, 2); | 183 | impl_ppi_channel!(PPI_CH12, 12 => configurable); |
| 184 | impl_ppi_channel!(PPI_CH13, 13, true, 1, 2); | 184 | impl_ppi_channel!(PPI_CH13, 13 => configurable); |
| 185 | impl_ppi_channel!(PPI_CH14, 14, true, 1, 2); | 185 | impl_ppi_channel!(PPI_CH14, 14 => configurable); |
| 186 | impl_ppi_channel!(PPI_CH15, 15, true, 1, 2); | 186 | impl_ppi_channel!(PPI_CH15, 15 => configurable); |
| 187 | impl_ppi_channel!(PPI_CH16, 16, true, 1, 2); | 187 | impl_ppi_channel!(PPI_CH16, 16 => configurable); |
| 188 | impl_ppi_channel!(PPI_CH17, 17, true, 1, 2); | 188 | impl_ppi_channel!(PPI_CH17, 17 => configurable); |
| 189 | impl_ppi_channel!(PPI_CH18, 18, true, 1, 2); | 189 | impl_ppi_channel!(PPI_CH18, 18 => configurable); |
| 190 | impl_ppi_channel!(PPI_CH19, 19, true, 1, 2); | 190 | impl_ppi_channel!(PPI_CH19, 19 => configurable); |
| 191 | impl_ppi_channel!(PPI_CH20, 20, false, 0, 1); | 191 | impl_ppi_channel!(PPI_CH20, 20 => static); |
| 192 | impl_ppi_channel!(PPI_CH21, 21, false, 0, 1); | 192 | impl_ppi_channel!(PPI_CH21, 21 => static); |
| 193 | impl_ppi_channel!(PPI_CH22, 22, false, 0, 1); | 193 | impl_ppi_channel!(PPI_CH22, 22 => static); |
| 194 | impl_ppi_channel!(PPI_CH23, 23, false, 0, 1); | 194 | impl_ppi_channel!(PPI_CH23, 23 => static); |
| 195 | impl_ppi_channel!(PPI_CH24, 24, false, 0, 1); | 195 | impl_ppi_channel!(PPI_CH24, 24 => static); |
| 196 | impl_ppi_channel!(PPI_CH25, 25, false, 0, 1); | 196 | impl_ppi_channel!(PPI_CH25, 25 => static); |
| 197 | impl_ppi_channel!(PPI_CH26, 26, false, 0, 1); | 197 | impl_ppi_channel!(PPI_CH26, 26 => static); |
| 198 | impl_ppi_channel!(PPI_CH27, 27, false, 0, 1); | 198 | impl_ppi_channel!(PPI_CH27, 27 => static); |
| 199 | impl_ppi_channel!(PPI_CH28, 28, false, 0, 1); | 199 | impl_ppi_channel!(PPI_CH28, 28 => static); |
| 200 | impl_ppi_channel!(PPI_CH29, 29, false, 0, 1); | 200 | impl_ppi_channel!(PPI_CH29, 29 => static); |
| 201 | impl_ppi_channel!(PPI_CH30, 30, false, 0, 1); | 201 | impl_ppi_channel!(PPI_CH30, 30 => static); |
| 202 | impl_ppi_channel!(PPI_CH31, 31, false, 0, 1); | 202 | impl_ppi_channel!(PPI_CH31, 31 => static); |
| 203 | 203 | ||
| 204 | pub mod irqs { | 204 | pub mod irqs { |
| 205 | use crate::pac::Interrupt as InterruptEnum; | 205 | use crate::pac::Interrupt as InterruptEnum; |
diff --git a/embassy-nrf/src/chips/nrf52832.rs b/embassy-nrf/src/chips/nrf52832.rs index d97a65350..432af143c 100644 --- a/embassy-nrf/src/chips/nrf52832.rs +++ b/embassy-nrf/src/chips/nrf52832.rs | |||
| @@ -190,38 +190,38 @@ impl_pin!(P0_29, 0, 29); | |||
| 190 | impl_pin!(P0_30, 0, 30); | 190 | impl_pin!(P0_30, 0, 30); |
| 191 | impl_pin!(P0_31, 0, 31); | 191 | impl_pin!(P0_31, 0, 31); |
| 192 | 192 | ||
| 193 | impl_ppi_channel!(PPI_CH0, 0, true, 1, 2); | 193 | impl_ppi_channel!(PPI_CH0, 0 => configurable); |
| 194 | impl_ppi_channel!(PPI_CH1, 1, true, 1, 2); | 194 | impl_ppi_channel!(PPI_CH1, 1 => configurable); |
| 195 | impl_ppi_channel!(PPI_CH2, 2, true, 1, 2); | 195 | impl_ppi_channel!(PPI_CH2, 2 => configurable); |
| 196 | impl_ppi_channel!(PPI_CH3, 3, true, 1, 2); | 196 | impl_ppi_channel!(PPI_CH3, 3 => configurable); |
| 197 | impl_ppi_channel!(PPI_CH4, 4, true, 1, 2); | 197 | impl_ppi_channel!(PPI_CH4, 4 => configurable); |
| 198 | impl_ppi_channel!(PPI_CH5, 5, true, 1, 2); | 198 | impl_ppi_channel!(PPI_CH5, 5 => configurable); |
| 199 | impl_ppi_channel!(PPI_CH6, 6, true, 1, 2); | 199 | impl_ppi_channel!(PPI_CH6, 6 => configurable); |
| 200 | impl_ppi_channel!(PPI_CH7, 7, true, 1, 2); | 200 | impl_ppi_channel!(PPI_CH7, 7 => configurable); |
| 201 | impl_ppi_channel!(PPI_CH8, 8, true, 1, 2); | 201 | impl_ppi_channel!(PPI_CH8, 8 => configurable); |
| 202 | impl_ppi_channel!(PPI_CH9, 9, true, 1, 2); | 202 | impl_ppi_channel!(PPI_CH9, 9 => configurable); |
| 203 | impl_ppi_channel!(PPI_CH10, 10, true, 1, 2); | 203 | impl_ppi_channel!(PPI_CH10, 10 => configurable); |
| 204 | impl_ppi_channel!(PPI_CH11, 11, true, 1, 2); | 204 | impl_ppi_channel!(PPI_CH11, 11 => configurable); |
| 205 | impl_ppi_channel!(PPI_CH12, 12, true, 1, 2); | 205 | impl_ppi_channel!(PPI_CH12, 12 => configurable); |
| 206 | impl_ppi_channel!(PPI_CH13, 13, true, 1, 2); | 206 | impl_ppi_channel!(PPI_CH13, 13 => configurable); |
| 207 | impl_ppi_channel!(PPI_CH14, 14, true, 1, 2); | 207 | impl_ppi_channel!(PPI_CH14, 14 => configurable); |
| 208 | impl_ppi_channel!(PPI_CH15, 15, true, 1, 2); | 208 | impl_ppi_channel!(PPI_CH15, 15 => configurable); |
| 209 | impl_ppi_channel!(PPI_CH16, 16, true, 1, 2); | 209 | impl_ppi_channel!(PPI_CH16, 16 => configurable); |
| 210 | impl_ppi_channel!(PPI_CH17, 17, true, 1, 2); | 210 | impl_ppi_channel!(PPI_CH17, 17 => configurable); |
| 211 | impl_ppi_channel!(PPI_CH18, 18, true, 1, 2); | 211 | impl_ppi_channel!(PPI_CH18, 18 => configurable); |
| 212 | impl_ppi_channel!(PPI_CH19, 19, true, 1, 2); | 212 | impl_ppi_channel!(PPI_CH19, 19 => configurable); |
| 213 | impl_ppi_channel!(PPI_CH20, 20, false, 0, 1); | 213 | impl_ppi_channel!(PPI_CH20, 20 => static); |
| 214 | impl_ppi_channel!(PPI_CH21, 21, false, 0, 1); | 214 | impl_ppi_channel!(PPI_CH21, 21 => static); |
| 215 | impl_ppi_channel!(PPI_CH22, 22, false, 0, 1); | 215 | impl_ppi_channel!(PPI_CH22, 22 => static); |
| 216 | impl_ppi_channel!(PPI_CH23, 23, false, 0, 1); | 216 | impl_ppi_channel!(PPI_CH23, 23 => static); |
| 217 | impl_ppi_channel!(PPI_CH24, 24, false, 0, 1); | 217 | impl_ppi_channel!(PPI_CH24, 24 => static); |
| 218 | impl_ppi_channel!(PPI_CH25, 25, false, 0, 1); | 218 | impl_ppi_channel!(PPI_CH25, 25 => static); |
| 219 | impl_ppi_channel!(PPI_CH26, 26, false, 0, 1); | 219 | impl_ppi_channel!(PPI_CH26, 26 => static); |
| 220 | impl_ppi_channel!(PPI_CH27, 27, false, 0, 1); | 220 | impl_ppi_channel!(PPI_CH27, 27 => static); |
| 221 | impl_ppi_channel!(PPI_CH28, 28, false, 0, 1); | 221 | impl_ppi_channel!(PPI_CH28, 28 => static); |
| 222 | impl_ppi_channel!(PPI_CH29, 29, false, 0, 1); | 222 | impl_ppi_channel!(PPI_CH29, 29 => static); |
| 223 | impl_ppi_channel!(PPI_CH30, 30, false, 0, 1); | 223 | impl_ppi_channel!(PPI_CH30, 30 => static); |
| 224 | impl_ppi_channel!(PPI_CH31, 31, false, 0, 1); | 224 | impl_ppi_channel!(PPI_CH31, 31 => static); |
| 225 | 225 | ||
| 226 | impl_saadc_input!(P0_02, ANALOGINPUT0); | 226 | impl_saadc_input!(P0_02, ANALOGINPUT0); |
| 227 | impl_saadc_input!(P0_03, ANALOGINPUT1); | 227 | impl_saadc_input!(P0_03, ANALOGINPUT1); |
diff --git a/embassy-nrf/src/chips/nrf52833.rs b/embassy-nrf/src/chips/nrf52833.rs index 9bf370c4b..7c7198dfd 100644 --- a/embassy-nrf/src/chips/nrf52833.rs +++ b/embassy-nrf/src/chips/nrf52833.rs | |||
| @@ -226,38 +226,38 @@ impl_pin!(P1_13, 1, 13); | |||
| 226 | impl_pin!(P1_14, 1, 14); | 226 | impl_pin!(P1_14, 1, 14); |
| 227 | impl_pin!(P1_15, 1, 15); | 227 | impl_pin!(P1_15, 1, 15); |
| 228 | 228 | ||
| 229 | impl_ppi_channel!(PPI_CH0, 0, true, 1, 2); | 229 | impl_ppi_channel!(PPI_CH0, 0 => configurable); |
| 230 | impl_ppi_channel!(PPI_CH1, 1, true, 1, 2); | 230 | impl_ppi_channel!(PPI_CH1, 1 => configurable); |
| 231 | impl_ppi_channel!(PPI_CH2, 2, true, 1, 2); | 231 | impl_ppi_channel!(PPI_CH2, 2 => configurable); |
| 232 | impl_ppi_channel!(PPI_CH3, 3, true, 1, 2); | 232 | impl_ppi_channel!(PPI_CH3, 3 => configurable); |
| 233 | impl_ppi_channel!(PPI_CH4, 4, true, 1, 2); | 233 | impl_ppi_channel!(PPI_CH4, 4 => configurable); |
| 234 | impl_ppi_channel!(PPI_CH5, 5, true, 1, 2); | 234 | impl_ppi_channel!(PPI_CH5, 5 => configurable); |
| 235 | impl_ppi_channel!(PPI_CH6, 6, true, 1, 2); | 235 | impl_ppi_channel!(PPI_CH6, 6 => configurable); |
| 236 | impl_ppi_channel!(PPI_CH7, 7, true, 1, 2); | 236 | impl_ppi_channel!(PPI_CH7, 7 => configurable); |
| 237 | impl_ppi_channel!(PPI_CH8, 8, true, 1, 2); | 237 | impl_ppi_channel!(PPI_CH8, 8 => configurable); |
| 238 | impl_ppi_channel!(PPI_CH9, 9, true, 1, 2); | 238 | impl_ppi_channel!(PPI_CH9, 9 => configurable); |
| 239 | impl_ppi_channel!(PPI_CH10, 10, true, 1, 2); | 239 | impl_ppi_channel!(PPI_CH10, 10 => configurable); |
| 240 | impl_ppi_channel!(PPI_CH11, 11, true, 1, 2); | 240 | impl_ppi_channel!(PPI_CH11, 11 => configurable); |
| 241 | impl_ppi_channel!(PPI_CH12, 12, true, 1, 2); | 241 | impl_ppi_channel!(PPI_CH12, 12 => configurable); |
| 242 | impl_ppi_channel!(PPI_CH13, 13, true, 1, 2); | 242 | impl_ppi_channel!(PPI_CH13, 13 => configurable); |
| 243 | impl_ppi_channel!(PPI_CH14, 14, true, 1, 2); | 243 | impl_ppi_channel!(PPI_CH14, 14 => configurable); |
| 244 | impl_ppi_channel!(PPI_CH15, 15, true, 1, 2); | 244 | impl_ppi_channel!(PPI_CH15, 15 => configurable); |
| 245 | impl_ppi_channel!(PPI_CH16, 16, true, 1, 2); | 245 | impl_ppi_channel!(PPI_CH16, 16 => configurable); |
| 246 | impl_ppi_channel!(PPI_CH17, 17, true, 1, 2); | 246 | impl_ppi_channel!(PPI_CH17, 17 => configurable); |
| 247 | impl_ppi_channel!(PPI_CH18, 18, true, 1, 2); | 247 | impl_ppi_channel!(PPI_CH18, 18 => configurable); |
| 248 | impl_ppi_channel!(PPI_CH19, 19, true, 1, 2); | 248 | impl_ppi_channel!(PPI_CH19, 19 => configurable); |
| 249 | impl_ppi_channel!(PPI_CH20, 20, false, 0, 1); | 249 | impl_ppi_channel!(PPI_CH20, 20 => static); |
| 250 | impl_ppi_channel!(PPI_CH21, 21, false, 0, 1); | 250 | impl_ppi_channel!(PPI_CH21, 21 => static); |
| 251 | impl_ppi_channel!(PPI_CH22, 22, false, 0, 1); | 251 | impl_ppi_channel!(PPI_CH22, 22 => static); |
| 252 | impl_ppi_channel!(PPI_CH23, 23, false, 0, 1); | 252 | impl_ppi_channel!(PPI_CH23, 23 => static); |
| 253 | impl_ppi_channel!(PPI_CH24, 24, false, 0, 1); | 253 | impl_ppi_channel!(PPI_CH24, 24 => static); |
| 254 | impl_ppi_channel!(PPI_CH25, 25, false, 0, 1); | 254 | impl_ppi_channel!(PPI_CH25, 25 => static); |
| 255 | impl_ppi_channel!(PPI_CH26, 26, false, 0, 1); | 255 | impl_ppi_channel!(PPI_CH26, 26 => static); |
| 256 | impl_ppi_channel!(PPI_CH27, 27, false, 0, 1); | 256 | impl_ppi_channel!(PPI_CH27, 27 => static); |
| 257 | impl_ppi_channel!(PPI_CH28, 28, false, 0, 1); | 257 | impl_ppi_channel!(PPI_CH28, 28 => static); |
| 258 | impl_ppi_channel!(PPI_CH29, 29, false, 0, 1); | 258 | impl_ppi_channel!(PPI_CH29, 29 => static); |
| 259 | impl_ppi_channel!(PPI_CH30, 30, false, 0, 1); | 259 | impl_ppi_channel!(PPI_CH30, 30 => static); |
| 260 | impl_ppi_channel!(PPI_CH31, 31, false, 0, 1); | 260 | impl_ppi_channel!(PPI_CH31, 31 => static); |
| 261 | 261 | ||
| 262 | impl_saadc_input!(P0_02, ANALOGINPUT0); | 262 | impl_saadc_input!(P0_02, ANALOGINPUT0); |
| 263 | impl_saadc_input!(P0_03, ANALOGINPUT1); | 263 | impl_saadc_input!(P0_03, ANALOGINPUT1); |
diff --git a/embassy-nrf/src/chips/nrf52840.rs b/embassy-nrf/src/chips/nrf52840.rs index 266328d58..f5b90cd5a 100644 --- a/embassy-nrf/src/chips/nrf52840.rs +++ b/embassy-nrf/src/chips/nrf52840.rs | |||
| @@ -231,38 +231,38 @@ impl_pin!(P1_13, 1, 13); | |||
| 231 | impl_pin!(P1_14, 1, 14); | 231 | impl_pin!(P1_14, 1, 14); |
| 232 | impl_pin!(P1_15, 1, 15); | 232 | impl_pin!(P1_15, 1, 15); |
| 233 | 233 | ||
| 234 | impl_ppi_channel!(PPI_CH0, 0, true, 1, 2); | 234 | impl_ppi_channel!(PPI_CH0, 0 => configurable); |
| 235 | impl_ppi_channel!(PPI_CH1, 1, true, 1, 2); | 235 | impl_ppi_channel!(PPI_CH1, 1 => configurable); |
| 236 | impl_ppi_channel!(PPI_CH2, 2, true, 1, 2); | 236 | impl_ppi_channel!(PPI_CH2, 2 => configurable); |
| 237 | impl_ppi_channel!(PPI_CH3, 3, true, 1, 2); | 237 | impl_ppi_channel!(PPI_CH3, 3 => configurable); |
| 238 | impl_ppi_channel!(PPI_CH4, 4, true, 1, 2); | 238 | impl_ppi_channel!(PPI_CH4, 4 => configurable); |
| 239 | impl_ppi_channel!(PPI_CH5, 5, true, 1, 2); | 239 | impl_ppi_channel!(PPI_CH5, 5 => configurable); |
| 240 | impl_ppi_channel!(PPI_CH6, 6, true, 1, 2); | 240 | impl_ppi_channel!(PPI_CH6, 6 => configurable); |
| 241 | impl_ppi_channel!(PPI_CH7, 7, true, 1, 2); | 241 | impl_ppi_channel!(PPI_CH7, 7 => configurable); |
| 242 | impl_ppi_channel!(PPI_CH8, 8, true, 1, 2); | 242 | impl_ppi_channel!(PPI_CH8, 8 => configurable); |
| 243 | impl_ppi_channel!(PPI_CH9, 9, true, 1, 2); | 243 | impl_ppi_channel!(PPI_CH9, 9 => configurable); |
| 244 | impl_ppi_channel!(PPI_CH10, 10, true, 1, 2); | 244 | impl_ppi_channel!(PPI_CH10, 10 => configurable); |
| 245 | impl_ppi_channel!(PPI_CH11, 11, true, 1, 2); | 245 | impl_ppi_channel!(PPI_CH11, 11 => configurable); |
| 246 | impl_ppi_channel!(PPI_CH12, 12, true, 1, 2); | 246 | impl_ppi_channel!(PPI_CH12, 12 => configurable); |
| 247 | impl_ppi_channel!(PPI_CH13, 13, true, 1, 2); | 247 | impl_ppi_channel!(PPI_CH13, 13 => configurable); |
| 248 | impl_ppi_channel!(PPI_CH14, 14, true, 1, 2); | 248 | impl_ppi_channel!(PPI_CH14, 14 => configurable); |
| 249 | impl_ppi_channel!(PPI_CH15, 15, true, 1, 2); | 249 | impl_ppi_channel!(PPI_CH15, 15 => configurable); |
| 250 | impl_ppi_channel!(PPI_CH16, 16, true, 1, 2); | 250 | impl_ppi_channel!(PPI_CH16, 16 => configurable); |
| 251 | impl_ppi_channel!(PPI_CH17, 17, true, 1, 2); | 251 | impl_ppi_channel!(PPI_CH17, 17 => configurable); |
| 252 | impl_ppi_channel!(PPI_CH18, 18, true, 1, 2); | 252 | impl_ppi_channel!(PPI_CH18, 18 => configurable); |
| 253 | impl_ppi_channel!(PPI_CH19, 19, true, 1, 2); | 253 | impl_ppi_channel!(PPI_CH19, 19 => configurable); |
| 254 | impl_ppi_channel!(PPI_CH20, 20, false, 0, 1); | 254 | impl_ppi_channel!(PPI_CH20, 20 => static); |
| 255 | impl_ppi_channel!(PPI_CH21, 21, false, 0, 1); | 255 | impl_ppi_channel!(PPI_CH21, 21 => static); |
| 256 | impl_ppi_channel!(PPI_CH22, 22, false, 0, 1); | 256 | impl_ppi_channel!(PPI_CH22, 22 => static); |
| 257 | impl_ppi_channel!(PPI_CH23, 23, false, 0, 1); | 257 | impl_ppi_channel!(PPI_CH23, 23 => static); |
| 258 | impl_ppi_channel!(PPI_CH24, 24, false, 0, 1); | 258 | impl_ppi_channel!(PPI_CH24, 24 => static); |
| 259 | impl_ppi_channel!(PPI_CH25, 25, false, 0, 1); | 259 | impl_ppi_channel!(PPI_CH25, 25 => static); |
| 260 | impl_ppi_channel!(PPI_CH26, 26, false, 0, 1); | 260 | impl_ppi_channel!(PPI_CH26, 26 => static); |
| 261 | impl_ppi_channel!(PPI_CH27, 27, false, 0, 1); | 261 | impl_ppi_channel!(PPI_CH27, 27 => static); |
| 262 | impl_ppi_channel!(PPI_CH28, 28, false, 0, 1); | 262 | impl_ppi_channel!(PPI_CH28, 28 => static); |
| 263 | impl_ppi_channel!(PPI_CH29, 29, false, 0, 1); | 263 | impl_ppi_channel!(PPI_CH29, 29 => static); |
| 264 | impl_ppi_channel!(PPI_CH30, 30, false, 0, 1); | 264 | impl_ppi_channel!(PPI_CH30, 30 => static); |
| 265 | impl_ppi_channel!(PPI_CH31, 31, false, 0, 1); | 265 | impl_ppi_channel!(PPI_CH31, 31 => static); |
| 266 | 266 | ||
| 267 | impl_saadc_input!(P0_02, ANALOGINPUT0); | 267 | impl_saadc_input!(P0_02, ANALOGINPUT0); |
| 268 | impl_saadc_input!(P0_03, ANALOGINPUT1); | 268 | impl_saadc_input!(P0_03, ANALOGINPUT1); |
diff --git a/embassy-nrf/src/chips/nrf9160.rs b/embassy-nrf/src/chips/nrf9160.rs index 7357e9e22..6ca918104 100644 --- a/embassy-nrf/src/chips/nrf9160.rs +++ b/embassy-nrf/src/chips/nrf9160.rs | |||
| @@ -184,22 +184,22 @@ impl_pin!(P0_29, 0, 29); | |||
| 184 | impl_pin!(P0_30, 0, 30); | 184 | impl_pin!(P0_30, 0, 30); |
| 185 | impl_pin!(P0_31, 0, 31); | 185 | impl_pin!(P0_31, 0, 31); |
| 186 | 186 | ||
| 187 | impl_ppi_channel!(PPI_CH0, 0, true, many, many); | 187 | impl_ppi_channel!(PPI_CH0, 0 => configurable); |
| 188 | impl_ppi_channel!(PPI_CH1, 1, true, many, many); | 188 | impl_ppi_channel!(PPI_CH1, 1 => configurable); |
| 189 | impl_ppi_channel!(PPI_CH2, 2, true, many, many); | 189 | impl_ppi_channel!(PPI_CH2, 2 => configurable); |
| 190 | impl_ppi_channel!(PPI_CH3, 3, true, many, many); | 190 | impl_ppi_channel!(PPI_CH3, 3 => configurable); |
| 191 | impl_ppi_channel!(PPI_CH4, 4, true, many, many); | 191 | impl_ppi_channel!(PPI_CH4, 4 => configurable); |
| 192 | impl_ppi_channel!(PPI_CH5, 5, true, many, many); | 192 | impl_ppi_channel!(PPI_CH5, 5 => configurable); |
| 193 | impl_ppi_channel!(PPI_CH6, 6, true, many, many); | 193 | impl_ppi_channel!(PPI_CH6, 6 => configurable); |
| 194 | impl_ppi_channel!(PPI_CH7, 7, true, many, many); | 194 | impl_ppi_channel!(PPI_CH7, 7 => configurable); |
| 195 | impl_ppi_channel!(PPI_CH8, 8, true, many, many); | 195 | impl_ppi_channel!(PPI_CH8, 8 => configurable); |
| 196 | impl_ppi_channel!(PPI_CH9, 9, true, many, many); | 196 | impl_ppi_channel!(PPI_CH9, 9 => configurable); |
| 197 | impl_ppi_channel!(PPI_CH10, 10, true, many, many); | 197 | impl_ppi_channel!(PPI_CH10, 10 => configurable); |
| 198 | impl_ppi_channel!(PPI_CH11, 11, true, many, many); | 198 | impl_ppi_channel!(PPI_CH11, 11 => configurable); |
| 199 | impl_ppi_channel!(PPI_CH12, 12, true, many, many); | 199 | impl_ppi_channel!(PPI_CH12, 12 => configurable); |
| 200 | impl_ppi_channel!(PPI_CH13, 13, true, many, many); | 200 | impl_ppi_channel!(PPI_CH13, 13 => configurable); |
| 201 | impl_ppi_channel!(PPI_CH14, 14, true, many, many); | 201 | impl_ppi_channel!(PPI_CH14, 14 => configurable); |
| 202 | impl_ppi_channel!(PPI_CH15, 15, true, many, many); | 202 | impl_ppi_channel!(PPI_CH15, 15 => configurable); |
| 203 | 203 | ||
| 204 | impl_saadc_input!(P0_13, ANALOGINPUT0); | 204 | impl_saadc_input!(P0_13, ANALOGINPUT0); |
| 205 | impl_saadc_input!(P0_14, ANALOGINPUT1); | 205 | impl_saadc_input!(P0_14, ANALOGINPUT1); |
diff --git a/embassy-nrf/src/ppi/mod.rs b/embassy-nrf/src/ppi/mod.rs index bfbc69b79..cea8a0e68 100644 --- a/embassy-nrf/src/ppi/mod.rs +++ b/embassy-nrf/src/ppi/mod.rs | |||
| @@ -38,21 +38,6 @@ pub struct Ppi<'d, C: Channel, const EVENT_COUNT: usize, const TASK_COUNT: usize | |||
| 38 | impl<'d, C: Channel + 'd, const EVENT_COUNT: usize, const TASK_COUNT: usize> | 38 | impl<'d, C: Channel + 'd, const EVENT_COUNT: usize, const TASK_COUNT: usize> |
| 39 | Ppi<'d, C, EVENT_COUNT, TASK_COUNT> | 39 | Ppi<'d, C, EVENT_COUNT, TASK_COUNT> |
| 40 | { | 40 | { |
| 41 | pub fn degrade(self) -> Ppi<'d, AnyChannel, EVENT_COUNT, TASK_COUNT> { | ||
| 42 | Ppi { | ||
| 43 | ch: AnyChannel { | ||
| 44 | number: self.ch.number() as u8, | ||
| 45 | #[cfg(feature = "_ppi")] | ||
| 46 | has_configurable_task: self.ch.is_task_configurable(), | ||
| 47 | }, | ||
| 48 | #[cfg(feature = "_dppi")] | ||
| 49 | events: self.events, | ||
| 50 | #[cfg(feature = "_dppi")] | ||
| 51 | tasks: self.tasks, | ||
| 52 | phantom: PhantomData, | ||
| 53 | } | ||
| 54 | } | ||
| 55 | |||
| 56 | /// Enables the channel. | 41 | /// Enables the channel. |
| 57 | pub fn enable(&mut self) { | 42 | pub fn enable(&mut self) { |
| 58 | let r = unsafe { &*pac::PPI::ptr() }; | 43 | let r = unsafe { &*pac::PPI::ptr() }; |
| @@ -77,7 +62,8 @@ impl<'d, C: Channel, const EVENT_COUNT: usize, const TASK_COUNT: usize> Drop | |||
| 77 | } | 62 | } |
| 78 | } | 63 | } |
| 79 | 64 | ||
| 80 | impl<'d, C: ZeroToOneChannel> Ppi<'d, C, 0, 1> { | 65 | #[cfg(not(feature = "nrf51"))] // Not for nrf51 because of the fork task |
| 66 | impl<'d, C: StaticChannel> Ppi<'d, C, 0, 1> { | ||
| 81 | pub fn new_zero_to_one(ch: impl Unborrow<Target = C> + 'd, task: Task) -> Self { | 67 | pub fn new_zero_to_one(ch: impl Unborrow<Target = C> + 'd, task: Task) -> Self { |
| 82 | unborrow!(ch); | 68 | unborrow!(ch); |
| 83 | 69 | ||
| @@ -97,7 +83,7 @@ impl<'d, C: ZeroToOneChannel> Ppi<'d, C, 0, 1> { | |||
| 97 | } | 83 | } |
| 98 | } | 84 | } |
| 99 | 85 | ||
| 100 | impl<'d, C: OneToOneChannel> Ppi<'d, C, 1, 1> { | 86 | impl<'d, C: ConfigurableChannel> Ppi<'d, C, 1, 1> { |
| 101 | pub fn new_one_to_one(ch: impl Unborrow<Target = C> + 'd, event: Event, task: Task) -> Self { | 87 | pub fn new_one_to_one(ch: impl Unborrow<Target = C> + 'd, event: Event, task: Task) -> Self { |
| 102 | unborrow!(ch); | 88 | unborrow!(ch); |
| 103 | 89 | ||
| @@ -117,7 +103,8 @@ impl<'d, C: OneToOneChannel> Ppi<'d, C, 1, 1> { | |||
| 117 | } | 103 | } |
| 118 | } | 104 | } |
| 119 | 105 | ||
| 120 | impl<'d, C: OneToTwoChannel> Ppi<'d, C, 1, 2> { | 106 | #[cfg(not(feature = "nrf51"))] // Not for nrf51 because of the fork task |
| 107 | impl<'d, C: ConfigurableChannel> Ppi<'d, C, 1, 2> { | ||
| 121 | pub fn new_one_to_two( | 108 | pub fn new_one_to_two( |
| 122 | ch: impl Unborrow<Target = C> + 'd, | 109 | ch: impl Unborrow<Target = C> + 'd, |
| 123 | event: Event, | 110 | event: Event, |
| @@ -142,7 +129,8 @@ impl<'d, C: OneToTwoChannel> Ppi<'d, C, 1, 2> { | |||
| 142 | } | 129 | } |
| 143 | } | 130 | } |
| 144 | 131 | ||
| 145 | impl<'d, C: ManyToManyChannel, const EVENT_COUNT: usize, const TASK_COUNT: usize> | 132 | #[cfg(feature = "_dppi")] |
| 133 | impl<'d, C: ConfigurableChannel, const EVENT_COUNT: usize, const TASK_COUNT: usize> | ||
| 146 | Ppi<'d, C, EVENT_COUNT, TASK_COUNT> | 134 | Ppi<'d, C, EVENT_COUNT, TASK_COUNT> |
| 147 | { | 135 | { |
| 148 | pub fn new_many_to_many( | 136 | pub fn new_many_to_many( |
| @@ -221,72 +209,107 @@ pub(crate) mod sealed { | |||
| 221 | pub trait Channel: sealed::Channel + Unborrow<Target = Self> + Sized { | 209 | pub trait Channel: sealed::Channel + Unborrow<Target = Self> + Sized { |
| 222 | /// Returns the number of the channel | 210 | /// Returns the number of the channel |
| 223 | fn number(&self) -> usize; | 211 | fn number(&self) -> usize; |
| 224 | #[cfg(feature = "_ppi")] | 212 | fn configurable() -> bool; |
| 225 | fn is_task_configurable(&self) -> bool; | 213 | } |
| 214 | |||
| 215 | pub trait ConfigurableChannel: Channel { | ||
| 216 | fn degrade(self) -> AnyConfigurableChannel; | ||
| 226 | } | 217 | } |
| 227 | 218 | ||
| 228 | pub trait ZeroToOneChannel: Channel {} | 219 | pub trait StaticChannel: Channel { |
| 229 | pub trait OneToOneChannel: ZeroToOneChannel {} | 220 | fn degrade(self) -> AnyStaticChannel; |
| 230 | pub trait OneToTwoChannel: OneToOneChannel {} | 221 | } |
| 231 | pub trait ManyToManyChannel: OneToTwoChannel {} | ||
| 232 | 222 | ||
| 233 | pub trait Group: sealed::Group + Sized { | 223 | pub trait Group: sealed::Group + Sized { |
| 234 | fn number(&self) -> usize; | 224 | fn number(&self) -> usize; |
| 225 | fn degrade(self) -> AnyGroup { | ||
| 226 | AnyGroup { | ||
| 227 | number: self.number() as u8, | ||
| 228 | } | ||
| 229 | } | ||
| 235 | } | 230 | } |
| 236 | 231 | ||
| 237 | // ====================== | 232 | // ====================== |
| 238 | // channels | 233 | // channels |
| 239 | 234 | ||
| 240 | pub struct AnyChannel { | 235 | /// The any channel can represent any static channel at runtime. |
| 241 | number: u8, | 236 | /// This can be used to have fewer generic parameters in some places. |
| 242 | #[cfg(feature = "_ppi")] | 237 | pub struct AnyStaticChannel { |
| 243 | has_configurable_task: bool, | 238 | pub(crate) number: u8, |
| 239 | } | ||
| 240 | unsafe_impl_unborrow!(AnyStaticChannel); | ||
| 241 | impl sealed::Channel for AnyStaticChannel {} | ||
| 242 | impl Channel for AnyStaticChannel { | ||
| 243 | fn number(&self) -> usize { | ||
| 244 | self.number as usize | ||
| 245 | } | ||
| 246 | |||
| 247 | fn configurable() -> bool { | ||
| 248 | false | ||
| 249 | } | ||
| 250 | } | ||
| 251 | impl StaticChannel for AnyStaticChannel { | ||
| 252 | fn degrade(self) -> AnyStaticChannel { | ||
| 253 | self | ||
| 254 | } | ||
| 255 | } | ||
| 256 | |||
| 257 | /// The any configurable channel can represent any configurable channel at runtime. | ||
| 258 | /// This can be used to have fewer generic parameters in some places. | ||
| 259 | pub struct AnyConfigurableChannel { | ||
| 260 | pub(crate) number: u8, | ||
| 244 | } | 261 | } |
| 245 | unsafe_impl_unborrow!(AnyChannel); | 262 | unsafe_impl_unborrow!(AnyConfigurableChannel); |
| 246 | impl sealed::Channel for AnyChannel {} | 263 | impl sealed::Channel for AnyConfigurableChannel {} |
| 247 | impl Channel for AnyChannel { | 264 | impl Channel for AnyConfigurableChannel { |
| 248 | fn number(&self) -> usize { | 265 | fn number(&self) -> usize { |
| 249 | self.number as usize | 266 | self.number as usize |
| 250 | } | 267 | } |
| 251 | 268 | ||
| 252 | #[cfg(feature = "_ppi")] | 269 | fn configurable() -> bool { |
| 253 | fn is_task_configurable(&self) -> bool { | 270 | true |
| 254 | self.has_configurable_task | 271 | } |
| 272 | } | ||
| 273 | impl ConfigurableChannel for AnyConfigurableChannel { | ||
| 274 | fn degrade(self) -> AnyConfigurableChannel { | ||
| 275 | self | ||
| 255 | } | 276 | } |
| 256 | } | 277 | } |
| 257 | 278 | ||
| 258 | macro_rules! impl_ppi_channel { | 279 | macro_rules! impl_ppi_channel { |
| 259 | ($type:ident, $number:expr, $has_configurable_task:expr) => { | 280 | ($type:ident, $number:expr, $configurability:expr) => { |
| 260 | impl crate::ppi::sealed::Channel for peripherals::$type {} | 281 | impl crate::ppi::sealed::Channel for peripherals::$type {} |
| 261 | impl crate::ppi::Channel for peripherals::$type { | 282 | impl crate::ppi::Channel for peripherals::$type { |
| 262 | fn number(&self) -> usize { | 283 | fn number(&self) -> usize { |
| 263 | $number | 284 | $number |
| 264 | } | 285 | } |
| 265 | 286 | ||
| 266 | #[cfg(feature = "_ppi")] | 287 | fn configurable() -> bool { |
| 267 | fn is_task_configurable(&self) -> bool { | 288 | $configurability |
| 268 | $has_configurable_task | ||
| 269 | } | 289 | } |
| 270 | } | 290 | } |
| 271 | }; | 291 | }; |
| 272 | ($type:ident, $number:expr, $has_configurable_task:expr, 0, 0) => { | 292 | ($type:ident, $number:expr => static) => { |
| 273 | impl_ppi_channel!($type, $number, $has_configurable_task); | 293 | impl_ppi_channel!($type, $number, false); |
| 274 | }; | 294 | impl crate::ppi::StaticChannel for peripherals::$type { |
| 275 | ($type:ident, $number:expr, $has_configurable_task:expr, 0, 1) => { | 295 | fn degrade(self) -> crate::ppi::AnyStaticChannel { |
| 276 | impl_ppi_channel!($type, $number, $has_configurable_task, 0, 0); | 296 | use crate::ppi::Channel; |
| 277 | impl crate::ppi::ZeroToOneChannel for peripherals::$type {} | 297 | crate::ppi::AnyStaticChannel { |
| 278 | }; | 298 | number: self.number() as u8, |
| 279 | ($type:ident, $number:expr, $has_configurable_task:expr, 1, 1) => { | 299 | } |
| 280 | impl_ppi_channel!($type, $number, $has_configurable_task, 0, 1); | 300 | } |
| 281 | impl crate::ppi::OneToOneChannel for peripherals::$type {} | 301 | } |
| 282 | }; | ||
| 283 | ($type:ident, $number:expr, $has_configurable_task:expr, 1, 2) => { | ||
| 284 | impl_ppi_channel!($type, $number, $has_configurable_task, 1, 1); | ||
| 285 | impl crate::ppi::OneToTwoChannel for peripherals::$type {} | ||
| 286 | }; | 302 | }; |
| 287 | ($type:ident, $number:expr, $has_configurable_task:expr, many, many) => { | 303 | ($type:ident, $number:expr => configurable) => { |
| 288 | impl_ppi_channel!($type, $number, $has_configurable_task, 1, 2); | 304 | impl_ppi_channel!($type, $number, true); |
| 289 | impl crate::ppi::ManyToManyChannel for peripherals::$type {} | 305 | impl crate::ppi::ConfigurableChannel for peripherals::$type { |
| 306 | fn degrade(self) -> crate::ppi::AnyConfigurableChannel { | ||
| 307 | use crate::ppi::Channel; | ||
| 308 | crate::ppi::AnyConfigurableChannel { | ||
| 309 | number: self.number() as u8, | ||
| 310 | } | ||
| 311 | } | ||
| 312 | } | ||
| 290 | }; | 313 | }; |
| 291 | } | 314 | } |
| 292 | 315 | ||
diff --git a/embassy-nrf/src/ppi/ppi.rs b/embassy-nrf/src/ppi/ppi.rs index 67d2086c3..0bcb3a791 100644 --- a/embassy-nrf/src/ppi/ppi.rs +++ b/embassy-nrf/src/ppi/ppi.rs | |||
| @@ -15,6 +15,7 @@ impl<'d, C: Channel + 'd, const EVENT_COUNT: usize, const TASK_COUNT: usize> | |||
| 15 | } | 15 | } |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #[cfg(not(feature = "nrf51"))] | ||
| 18 | fn set_fork_task(task: Option<&Task>, channel: usize) { | 19 | fn set_fork_task(task: Option<&Task>, channel: usize) { |
| 19 | let r = unsafe { &*pac::PPI::ptr() }; | 20 | let r = unsafe { &*pac::PPI::ptr() }; |
| 20 | if let Some(task) = task { | 21 | if let Some(task) = task { |
| @@ -40,16 +41,18 @@ impl<'d, C: Channel + 'd, const EVENT_COUNT: usize, const TASK_COUNT: usize> | |||
| 40 | /// Enables all tasks and events | 41 | /// Enables all tasks and events |
| 41 | pub(super) fn enable_all(tasks: &[Task], events: &[Event], channel: &C) { | 42 | pub(super) fn enable_all(tasks: &[Task], events: &[Event], channel: &C) { |
| 42 | // One configurable task, no fork | 43 | // One configurable task, no fork |
| 43 | if channel.is_task_configurable() && TASK_COUNT == 1 { | 44 | if C::configurable() && TASK_COUNT == 1 { |
| 44 | Self::set_main_task(Some(&tasks[0]), channel.number()); | 45 | Self::set_main_task(Some(&tasks[0]), channel.number()); |
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | // One configurable task, as fork | 48 | // One configurable task, as fork |
| 48 | if !channel.is_task_configurable() && TASK_COUNT == 1 { | 49 | #[cfg(not(feature = "nrf51"))] |
| 50 | if !C::configurable() && TASK_COUNT == 1 { | ||
| 49 | Self::set_fork_task(Some(&tasks[0]), channel.number()); | 51 | Self::set_fork_task(Some(&tasks[0]), channel.number()); |
| 50 | } | 52 | } |
| 51 | 53 | ||
| 52 | // Two configurable tasks (main + fork) | 54 | // Two configurable tasks (main + fork) |
| 55 | #[cfg(not(feature = "nrf51"))] | ||
| 53 | if TASK_COUNT == 2 { | 56 | if TASK_COUNT == 2 { |
| 54 | Self::set_main_task(Some(&tasks[0]), channel.number()); | 57 | Self::set_main_task(Some(&tasks[0]), channel.number()); |
| 55 | Self::set_fork_task(Some(&tasks[1]), channel.number()); | 58 | Self::set_fork_task(Some(&tasks[1]), channel.number()); |
| @@ -62,11 +65,12 @@ impl<'d, C: Channel + 'd, const EVENT_COUNT: usize, const TASK_COUNT: usize> | |||
| 62 | 65 | ||
| 63 | /// Disable all tasks and events | 66 | /// Disable all tasks and events |
| 64 | pub(super) fn disable_all(&self) { | 67 | pub(super) fn disable_all(&self) { |
| 65 | if self.ch.is_task_configurable() { | 68 | if C::configurable() { |
| 66 | Self::set_main_task(None, self.ch.number()); | 69 | Self::set_main_task(None, self.ch.number()); |
| 67 | } | 70 | } |
| 68 | 71 | ||
| 69 | if TASK_COUNT == 1 && !self.ch.is_task_configurable() || TASK_COUNT == 2 { | 72 | #[cfg(not(feature = "nrf51"))] |
| 73 | if TASK_COUNT == 1 && !C::configurable() || TASK_COUNT == 2 { | ||
| 70 | Self::set_fork_task(None, self.ch.number()); | 74 | Self::set_fork_task(None, self.ch.number()); |
| 71 | } | 75 | } |
| 72 | 76 | ||
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs index 36cf65d89..4bbdec63f 100644 --- a/embassy-nrf/src/uarte.rs +++ b/embassy-nrf/src/uarte.rs | |||
| @@ -18,7 +18,7 @@ use crate::gpio::sealed::Pin as _; | |||
| 18 | use crate::gpio::{self, OptionalPin as GpioOptionalPin, Pin as GpioPin}; | 18 | use crate::gpio::{self, OptionalPin as GpioOptionalPin, Pin as GpioPin}; |
| 19 | use crate::interrupt::Interrupt; | 19 | use crate::interrupt::Interrupt; |
| 20 | use crate::pac; | 20 | use crate::pac; |
| 21 | use crate::ppi::{AnyChannel, Event, OneToOneChannel, OneToTwoChannel, Ppi, Task}; | 21 | use crate::ppi::{AnyConfigurableChannel, ConfigurableChannel, Event, Ppi, Task}; |
| 22 | use crate::timer::Instance as TimerInstance; | 22 | use crate::timer::Instance as TimerInstance; |
| 23 | use crate::timer::{Frequency, Timer}; | 23 | use crate::timer::{Frequency, Timer}; |
| 24 | 24 | ||
| @@ -331,8 +331,8 @@ impl<'d, T: Instance> Write for Uarte<'d, T> { | |||
| 331 | pub struct UarteWithIdle<'d, U: Instance, T: TimerInstance> { | 331 | pub struct UarteWithIdle<'d, U: Instance, T: TimerInstance> { |
| 332 | uarte: Uarte<'d, U>, | 332 | uarte: Uarte<'d, U>, |
| 333 | timer: Timer<'d, T>, | 333 | timer: Timer<'d, T>, |
| 334 | ppi_ch1: Ppi<'d, AnyChannel, 1, 2>, | 334 | ppi_ch1: Ppi<'d, AnyConfigurableChannel, 1, 2>, |
| 335 | _ppi_ch2: Ppi<'d, AnyChannel, 1, 1>, | 335 | _ppi_ch2: Ppi<'d, AnyConfigurableChannel, 1, 1>, |
| 336 | } | 336 | } |
| 337 | 337 | ||
| 338 | impl<'d, U: Instance, T: TimerInstance> UarteWithIdle<'d, U, T> { | 338 | impl<'d, U: Instance, T: TimerInstance> UarteWithIdle<'d, U, T> { |
| @@ -348,8 +348,8 @@ impl<'d, U: Instance, T: TimerInstance> UarteWithIdle<'d, U, T> { | |||
| 348 | pub unsafe fn new( | 348 | pub unsafe fn new( |
| 349 | uarte: impl Unborrow<Target = U> + 'd, | 349 | uarte: impl Unborrow<Target = U> + 'd, |
| 350 | timer: impl Unborrow<Target = T> + 'd, | 350 | timer: impl Unborrow<Target = T> + 'd, |
| 351 | ppi_ch1: impl Unborrow<Target = impl OneToTwoChannel + 'd> + 'd, | 351 | ppi_ch1: impl Unborrow<Target = impl ConfigurableChannel + 'd> + 'd, |
| 352 | ppi_ch2: impl Unborrow<Target = impl OneToOneChannel + 'd> + 'd, | 352 | ppi_ch2: impl Unborrow<Target = impl ConfigurableChannel + 'd> + 'd, |
| 353 | irq: impl Unborrow<Target = U::Interrupt> + 'd, | 353 | irq: impl Unborrow<Target = U::Interrupt> + 'd, |
| 354 | rxd: impl Unborrow<Target = impl GpioPin> + 'd, | 354 | rxd: impl Unborrow<Target = impl GpioPin> + 'd, |
| 355 | txd: impl Unborrow<Target = impl GpioPin> + 'd, | 355 | txd: impl Unborrow<Target = impl GpioPin> + 'd, |
| @@ -379,20 +379,18 @@ impl<'d, U: Instance, T: TimerInstance> UarteWithIdle<'d, U, T> { | |||
| 379 | timer.cc(0).short_compare_stop(); | 379 | timer.cc(0).short_compare_stop(); |
| 380 | 380 | ||
| 381 | let mut ppi_ch1 = Ppi::new_one_to_two( | 381 | let mut ppi_ch1 = Ppi::new_one_to_two( |
| 382 | ppi_ch1, | 382 | ppi_ch1.degrade(), |
| 383 | Event::from_reg(&r.events_rxdrdy), | 383 | Event::from_reg(&r.events_rxdrdy), |
| 384 | timer.task_clear(), | 384 | timer.task_clear(), |
| 385 | timer.task_start(), | 385 | timer.task_start(), |
| 386 | ) | 386 | ); |
| 387 | .degrade(); | ||
| 388 | ppi_ch1.enable(); | 387 | ppi_ch1.enable(); |
| 389 | 388 | ||
| 390 | let mut ppi_ch2 = Ppi::new_one_to_one( | 389 | let mut ppi_ch2 = Ppi::new_one_to_one( |
| 391 | ppi_ch2, | 390 | ppi_ch2.degrade(), |
| 392 | timer.cc(0).event_compare(), | 391 | timer.cc(0).event_compare(), |
| 393 | Task::from_reg(&r.tasks_stoprx), | 392 | Task::from_reg(&r.tasks_stoprx), |
| 394 | ) | 393 | ); |
| 395 | .degrade(); | ||
| 396 | ppi_ch2.enable(); | 394 | ppi_ch2.enable(); |
| 397 | 395 | ||
| 398 | Self { | 396 | Self { |
