diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-03-05 22:05:02 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-03-06 00:17:51 +0100 |
| commit | 9f5762d3654464011b5ddda771d4866c547106a0 (patch) | |
| tree | d9c9c047df8d67b4efd7915a24fe3dce5f7d9f9a /examples | |
| parent | a32e82029a8b6944ef3e9861b09095bae01b37a3 (diff) | |
nrf/spis: switch to new interrupt binding.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf52840/src/bin/spis.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/nrf52840/src/bin/spis.rs b/examples/nrf52840/src/bin/spis.rs index fe3b0c53d..77b6e8b64 100644 --- a/examples/nrf52840/src/bin/spis.rs +++ b/examples/nrf52840/src/bin/spis.rs | |||
| @@ -4,17 +4,20 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_nrf::interrupt; | ||
| 8 | use embassy_nrf::spis::{Config, Spis}; | 7 | use embassy_nrf::spis::{Config, Spis}; |
| 8 | use embassy_nrf::{bind_interrupts, peripherals, spis}; | ||
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | bind_interrupts!(struct Irqs { | ||
| 12 | SPIM2_SPIS2_SPI2 => spis::InterruptHandler<peripherals::SPI2>; | ||
| 13 | }); | ||
| 14 | |||
| 11 | #[embassy_executor::main] | 15 | #[embassy_executor::main] |
| 12 | async fn main(_spawner: Spawner) { | 16 | async fn main(_spawner: Spawner) { |
| 13 | let p = embassy_nrf::init(Default::default()); | 17 | let p = embassy_nrf::init(Default::default()); |
| 14 | info!("Running!"); | 18 | info!("Running!"); |
| 15 | 19 | ||
| 16 | let irq = interrupt::take!(SPIM2_SPIS2_SPI2); | 20 | let mut spis = Spis::new(p.SPI2, Irqs, p.P0_31, p.P0_29, p.P0_28, p.P0_30, Config::default()); |
| 17 | let mut spis = Spis::new(p.SPI2, irq, p.P0_31, p.P0_29, p.P0_28, p.P0_30, Config::default()); | ||
| 18 | 21 | ||
| 19 | loop { | 22 | loop { |
| 20 | let mut rx_buf = [0_u8; 64]; | 23 | let mut rx_buf = [0_u8; 64]; |
