Cleanup examples
This commit is contained in:
parent
71c130488b
commit
9ff5c50774
4 changed files with 8 additions and 8 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::spi::{Blocking, Spi};
|
||||
use embassy_rp::spi::Spi;
|
||||
use embassy_rp::{gpio, spi};
|
||||
use gpio::{Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
@ -24,7 +24,7 @@ async fn main(_spawner: Spawner) {
|
|||
// create SPI
|
||||
let mut config = spi::Config::default();
|
||||
config.frequency = 2_000_000;
|
||||
let mut spi: Spi<'_, _, Blocking> = Spi::new_blocking(p.SPI1, clk, mosi, miso, config);
|
||||
let mut spi = Spi::new_blocking(p.SPI1, clk, mosi, miso, config);
|
||||
|
||||
// Configure CS
|
||||
let mut cs = Output::new(touch_cs, Level::Low);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::spi::{Async, Config, Spi};
|
||||
use embassy_rp::spi::{Config, Spi};
|
||||
use embassy_time::{Duration, Timer};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
|
@ -17,7 +17,7 @@ async fn main(_spawner: Spawner) {
|
|||
let mosi = p.PIN_11;
|
||||
let clk = p.PIN_10;
|
||||
|
||||
let mut spi: Spi<'_, _, Async> = Spi::new(p.SPI1, clk, mosi, miso, p.DMA_CH0, p.DMA_CH1, Config::default());
|
||||
let mut spi = Spi::new(p.SPI1, clk, mosi, miso, p.DMA_CH0, p.DMA_CH1, Config::default());
|
||||
|
||||
loop {
|
||||
let tx_buf = [1_u8, 2, 3, 4, 5, 6];
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
use defmt::{assert_eq, *};
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::spi::{Blocking, Config, Spi};
|
||||
use embassy_rp::spi::{Config, Spi};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[embassy_executor::main]
|
||||
|
@ -16,7 +16,7 @@ async fn main(_spawner: Spawner) {
|
|||
let mosi = p.PIN_3;
|
||||
let miso = p.PIN_4;
|
||||
|
||||
let mut spi: Spi<'_, _, Blocking> = Spi::new_blocking(p.SPI0, clk, mosi, miso, Config::default());
|
||||
let mut spi = Spi::new_blocking(p.SPI0, clk, mosi, miso, Config::default());
|
||||
|
||||
let tx_buf = [1_u8, 2, 3, 4, 5, 6];
|
||||
let mut rx_buf = [0_u8; 6];
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
use defmt::{assert_eq, *};
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::spi::{Async, Config, Spi};
|
||||
use embassy_rp::spi::{Config, Spi};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[embassy_executor::main]
|
||||
|
@ -16,7 +16,7 @@ async fn main(_spawner: Spawner) {
|
|||
let mosi = p.PIN_3;
|
||||
let miso = p.PIN_4;
|
||||
|
||||
let mut spi: Spi<'_, _, Async> = Spi::new(p.SPI0, clk, mosi, miso, p.DMA_CH0, p.DMA_CH1, Config::default());
|
||||
let mut spi = Spi::new(p.SPI0, clk, mosi, miso, p.DMA_CH0, p.DMA_CH1, Config::default());
|
||||
|
||||
let tx_buf = [1_u8, 2, 3, 4, 5, 6];
|
||||
let mut rx_buf = [0_u8; 6];
|
||||
|
|
Loading…
Reference in a new issue