Cleanup examples

This commit is contained in:
Henrik Alsér 2022-08-31 22:28:47 +02:00 committed by Henrik Alsér
parent 71c130488b
commit 9ff5c50774
4 changed files with 8 additions and 8 deletions

View File

@ -4,7 +4,7 @@
use defmt::*; use defmt::*;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_rp::spi::{Blocking, Spi}; use embassy_rp::spi::Spi;
use embassy_rp::{gpio, spi}; use embassy_rp::{gpio, spi};
use gpio::{Level, Output}; use gpio::{Level, Output};
use {defmt_rtt as _, panic_probe as _}; use {defmt_rtt as _, panic_probe as _};
@ -24,7 +24,7 @@ async fn main(_spawner: Spawner) {
// create SPI // create SPI
let mut config = spi::Config::default(); let mut config = spi::Config::default();
config.frequency = 2_000_000; 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 // Configure CS
let mut cs = Output::new(touch_cs, Level::Low); let mut cs = Output::new(touch_cs, Level::Low);

View File

@ -4,7 +4,7 @@
use defmt::*; use defmt::*;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_rp::spi::{Async, Config, Spi}; use embassy_rp::spi::{Config, Spi};
use embassy_time::{Duration, Timer}; use embassy_time::{Duration, Timer};
use {defmt_rtt as _, panic_probe as _}; use {defmt_rtt as _, panic_probe as _};
@ -17,7 +17,7 @@ async fn main(_spawner: Spawner) {
let mosi = p.PIN_11; let mosi = p.PIN_11;
let clk = p.PIN_10; 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 { loop {
let tx_buf = [1_u8, 2, 3, 4, 5, 6]; let tx_buf = [1_u8, 2, 3, 4, 5, 6];

View File

@ -4,7 +4,7 @@
use defmt::{assert_eq, *}; use defmt::{assert_eq, *};
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_rp::spi::{Blocking, Config, Spi}; use embassy_rp::spi::{Config, Spi};
use {defmt_rtt as _, panic_probe as _}; use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::main] #[embassy_executor::main]
@ -16,7 +16,7 @@ async fn main(_spawner: Spawner) {
let mosi = p.PIN_3; let mosi = p.PIN_3;
let miso = p.PIN_4; 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 tx_buf = [1_u8, 2, 3, 4, 5, 6];
let mut rx_buf = [0_u8; 6]; let mut rx_buf = [0_u8; 6];

View File

@ -4,7 +4,7 @@
use defmt::{assert_eq, *}; use defmt::{assert_eq, *};
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_rp::spi::{Async, Config, Spi}; use embassy_rp::spi::{Config, Spi};
use {defmt_rtt as _, panic_probe as _}; use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::main] #[embassy_executor::main]
@ -16,7 +16,7 @@ async fn main(_spawner: Spawner) {
let mosi = p.PIN_3; let mosi = p.PIN_3;
let miso = p.PIN_4; 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 tx_buf = [1_u8, 2, 3, 4, 5, 6];
let mut rx_buf = [0_u8; 6]; let mut rx_buf = [0_u8; 6];