nrf/spim: expose all functionality as inherent methods.
This commit is contained in:
@ -9,7 +9,6 @@ use embassy::executor::Spawner;
|
||||
use embassy_nrf::gpio::{Level, Output, OutputDrive};
|
||||
use embassy_nrf::Peripherals;
|
||||
use embassy_nrf::{interrupt, spim};
|
||||
use embassy_traits::spi::FullDuplex;
|
||||
use example_common::*;
|
||||
|
||||
#[embassy::main]
|
||||
@ -31,7 +30,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
ncs.set_low();
|
||||
cortex_m::asm::delay(5);
|
||||
let tx = [0xFF];
|
||||
unwrap!(spim.read_write(&mut [], &tx).await);
|
||||
unwrap!(spim.transfer(&mut [], &tx).await);
|
||||
cortex_m::asm::delay(10);
|
||||
ncs.set_high();
|
||||
|
||||
@ -44,7 +43,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
ncs.set_low();
|
||||
cortex_m::asm::delay(5000);
|
||||
let tx = [0b000_11101, 0];
|
||||
unwrap!(spim.read_write(&mut rx, &tx).await);
|
||||
unwrap!(spim.transfer(&mut rx, &tx).await);
|
||||
cortex_m::asm::delay(5000);
|
||||
ncs.set_high();
|
||||
info!("estat: {=[?]}", rx);
|
||||
@ -54,7 +53,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
ncs.set_low();
|
||||
cortex_m::asm::delay(5);
|
||||
let tx = [0b100_11111, 0b11];
|
||||
unwrap!(spim.read_write(&mut rx, &tx).await);
|
||||
unwrap!(spim.transfer(&mut rx, &tx).await);
|
||||
cortex_m::asm::delay(10);
|
||||
ncs.set_high();
|
||||
|
||||
@ -63,7 +62,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
ncs.set_low();
|
||||
cortex_m::asm::delay(5);
|
||||
let tx = [0b000_10010, 0];
|
||||
unwrap!(spim.read_write(&mut rx, &tx).await);
|
||||
unwrap!(spim.transfer(&mut rx, &tx).await);
|
||||
cortex_m::asm::delay(10);
|
||||
ncs.set_high();
|
||||
|
||||
|
Reference in New Issue
Block a user