diff options
| author | Dion Dokter <[email protected]> | 2021-10-13 16:35:05 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-10-26 14:46:39 +0200 |
| commit | 65628e1f1538f003c114d97c98970631953e7d6e (patch) | |
| tree | 6717e0542e44af8758b058813e8289cd9fe3214c /examples | |
| parent | 01e5376b2531ccd97ee760ef1dd7c3ec5d82ccfb (diff) | |
- Added _ppi and _dppi to distinguish between the new and the old peripheral.
- Removed ConfigurableChannel and added capacity numbers to the channels
- Replaced the PPI api with a new one using the DPPI terminology (publish & subscribe)
- Updated all tasks and event registers for DPPI
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf/src/bin/ppi.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/nrf/src/bin/ppi.rs b/examples/nrf/src/bin/ppi.rs index 6ea03ebd0..550893968 100644 --- a/examples/nrf/src/bin/ppi.rs +++ b/examples/nrf/src/bin/ppi.rs | |||
| @@ -52,24 +52,24 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 52 | ); | 52 | ); |
| 53 | 53 | ||
| 54 | let mut ppi = Ppi::new(p.PPI_CH0); | 54 | let mut ppi = Ppi::new(p.PPI_CH0); |
| 55 | ppi.set_event(button1.event_in()); | 55 | ppi.publish(button1.event_in()).unwrap(); |
| 56 | ppi.set_task(led1.task_out()); | 56 | ppi.subscribe(led1.task_out()).unwrap(); |
| 57 | ppi.enable(); | 57 | ppi.enable(); |
| 58 | 58 | ||
| 59 | let mut ppi = Ppi::new(p.PPI_CH1); | 59 | let mut ppi = Ppi::new(p.PPI_CH1); |
| 60 | ppi.set_event(button2.event_in()); | 60 | ppi.publish(button2.event_in()).unwrap(); |
| 61 | ppi.set_task(led1.task_clr()); | 61 | ppi.subscribe(led1.task_clr()).unwrap(); |
| 62 | ppi.enable(); | 62 | ppi.enable(); |
| 63 | 63 | ||
| 64 | let mut ppi = Ppi::new(p.PPI_CH2); | 64 | let mut ppi = Ppi::new(p.PPI_CH2); |
| 65 | ppi.set_event(button3.event_in()); | 65 | ppi.publish(button3.event_in()).unwrap(); |
| 66 | ppi.set_task(led1.task_set()); | 66 | ppi.subscribe(led1.task_set()).unwrap(); |
| 67 | ppi.enable(); | 67 | ppi.enable(); |
| 68 | 68 | ||
| 69 | let mut ppi = Ppi::new(p.PPI_CH3); | 69 | let mut ppi = Ppi::new(p.PPI_CH3); |
| 70 | ppi.set_event(button4.event_in()); | 70 | ppi.publish(button4.event_in()).unwrap(); |
| 71 | ppi.set_task(led1.task_out()); | 71 | ppi.subscribe(led1.task_out()).unwrap(); |
| 72 | ppi.set_fork_task(led2.task_out()); | 72 | ppi.subscribe(led2.task_out()).unwrap(); |
| 73 | ppi.enable(); | 73 | ppi.enable(); |
| 74 | 74 | ||
| 75 | info!("PPI setup!"); | 75 | info!("PPI setup!"); |
