update embedded-hal crates.

This commit is contained in:
Dario Nieuwenhuis
2023-07-04 19:53:06 +02:00
parent b2f843a4ce
commit a101d9078d
35 changed files with 184 additions and 393 deletions

View File

@ -41,8 +41,8 @@ byte-slice-cast = { version = "1.2.0", default-features = false }
smart-leds = "0.3.0"
heapless = "0.7.15"
embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.10" }
embedded-hal-async = "0.2.0-alpha.1"
embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.11" }
embedded-hal-async = "0.2.0-alpha.2"
embedded-io = { version = "0.4.0", features = ["async", "defmt"] }
embedded-storage = { version = "0.3" }
static_cell = { version = "1.1", features = ["nightly"]}
@ -53,3 +53,6 @@ rand = { version = "0.8.5", default-features = false }
[profile.release]
debug = true
[patch.crates-io]
lora-phy = { git = "https://github.com/embassy-rs/lora-phy", rev = "ad289428fd44b02788e2fa2116445cc8f640a265" }

View File

@ -15,7 +15,7 @@ use embassy_rp::clocks::RoscRng;
use embassy_rp::gpio::{Input, Level, Output, Pull};
use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0};
use embassy_rp::spi::{Async, Config as SpiConfig, Spi};
use embassy_time::Duration;
use embassy_time::{Delay, Duration};
use embedded_hal_async::spi::ExclusiveDevice;
use embedded_io::asynch::Write;
use rand::RngCore;
@ -26,7 +26,7 @@ use {defmt_rtt as _, panic_probe as _};
async fn ethernet_task(
runner: Runner<
'static,
ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>>,
ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>,
Input<'static, PIN_21>,
Output<'static, PIN_20>,
>,
@ -54,8 +54,14 @@ async fn main(spawner: Spawner) {
let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00];
let state = make_static!(State::<8, 8>::new());
let (device, runner) =
embassy_net_w5500::new(mac_addr, state, ExclusiveDevice::new(spi, cs), w5500_int, w5500_reset).await;
let (device, runner) = embassy_net_w5500::new(
mac_addr,
state,
ExclusiveDevice::new(spi, cs, Delay),
w5500_int,
w5500_reset,
)
.await;
unwrap!(spawner.spawn(ethernet_task(runner)));
// Generate random seed

View File

@ -17,7 +17,7 @@ use embassy_rp::clocks::RoscRng;
use embassy_rp::gpio::{Input, Level, Output, Pull};
use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0};
use embassy_rp::spi::{Async, Config as SpiConfig, Spi};
use embassy_time::{Duration, Timer};
use embassy_time::{Delay, Duration, Timer};
use embedded_hal_async::spi::ExclusiveDevice;
use embedded_io::asynch::Write;
use rand::RngCore;
@ -28,7 +28,7 @@ use {defmt_rtt as _, panic_probe as _};
async fn ethernet_task(
runner: Runner<
'static,
ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>>,
ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>,
Input<'static, PIN_21>,
Output<'static, PIN_20>,
>,
@ -57,8 +57,14 @@ async fn main(spawner: Spawner) {
let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00];
let state = make_static!(State::<8, 8>::new());
let (device, runner) =
embassy_net_w5500::new(mac_addr, state, ExclusiveDevice::new(spi, cs), w5500_int, w5500_reset).await;
let (device, runner) = embassy_net_w5500::new(
mac_addr,
state,
ExclusiveDevice::new(spi, cs, Delay),
w5500_int,
w5500_reset,
)
.await;
unwrap!(spawner.spawn(ethernet_task(runner)));
// Generate random seed

View File

@ -16,7 +16,7 @@ use embassy_rp::clocks::RoscRng;
use embassy_rp::gpio::{Input, Level, Output, Pull};
use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0};
use embassy_rp::spi::{Async, Config as SpiConfig, Spi};
use embassy_time::Duration;
use embassy_time::{Delay, Duration};
use embedded_hal_async::spi::ExclusiveDevice;
use embedded_io::asynch::Write;
use rand::RngCore;
@ -26,7 +26,7 @@ use {defmt_rtt as _, panic_probe as _};
async fn ethernet_task(
runner: Runner<
'static,
ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>>,
ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>,
Input<'static, PIN_21>,
Output<'static, PIN_20>,
>,
@ -55,8 +55,14 @@ async fn main(spawner: Spawner) {
let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00];
let state = make_static!(State::<8, 8>::new());
let (device, runner) =
embassy_net_w5500::new(mac_addr, state, ExclusiveDevice::new(spi, cs), w5500_int, w5500_reset).await;
let (device, runner) = embassy_net_w5500::new(
mac_addr,
state,
ExclusiveDevice::new(spi, cs, Delay),
w5500_int,
w5500_reset,
)
.await;
unwrap!(spawner.spawn(ethernet_task(runner)));
// Generate random seed

View File

@ -16,6 +16,7 @@ use embassy_rp::clocks::RoscRng;
use embassy_rp::gpio::{Input, Level, Output, Pull};
use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0};
use embassy_rp::spi::{Async, Config as SpiConfig, Spi};
use embassy_time::Delay;
use embedded_hal_async::spi::ExclusiveDevice;
use rand::RngCore;
use static_cell::make_static;
@ -24,7 +25,7 @@ use {defmt_rtt as _, panic_probe as _};
async fn ethernet_task(
runner: Runner<
'static,
ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>>,
ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>,
Input<'static, PIN_21>,
Output<'static, PIN_20>,
>,
@ -52,8 +53,14 @@ async fn main(spawner: Spawner) {
let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00];
let state = make_static!(State::<8, 8>::new());
let (device, runner) =
embassy_net_w5500::new(mac_addr, state, ExclusiveDevice::new(spi, cs), w5500_int, w5500_reset).await;
let (device, runner) = embassy_net_w5500::new(
mac_addr,
state,
ExclusiveDevice::new(spi, cs, Delay),
w5500_int,
w5500_reset,
)
.await;
unwrap!(spawner.spawn(ethernet_task(runner)));
// Generate random seed

View File

@ -175,7 +175,7 @@ mod touch {
mod my_display_interface {
use display_interface::{DataFormat, DisplayError, WriteOnlyDataCommand};
use embedded_hal_1::digital::OutputPin;
use embedded_hal_1::spi::SpiDeviceWrite;
use embedded_hal_1::spi::SpiDevice;
/// SPI display interface.
///
@ -187,7 +187,7 @@ mod my_display_interface {
impl<SPI, DC> SPIDeviceInterface<SPI, DC>
where
SPI: SpiDeviceWrite,
SPI: SpiDevice,
DC: OutputPin,
{
/// Create new SPI interface for communciation with a display driver
@ -198,7 +198,7 @@ mod my_display_interface {
impl<SPI, DC> WriteOnlyDataCommand for SPIDeviceInterface<SPI, DC>
where
SPI: SpiDeviceWrite,
SPI: SpiDevice,
DC: OutputPin,
{
fn send_commands(&mut self, cmds: DataFormat<'_>) -> Result<(), DisplayError> {
@ -218,7 +218,7 @@ mod my_display_interface {
}
}
fn send_u8<T: SpiDeviceWrite>(spi: &mut T, words: DataFormat<'_>) -> Result<(), T::Error> {
fn send_u8<T: SpiDevice>(spi: &mut T, words: DataFormat<'_>) -> Result<(), T::Error> {
match words {
DataFormat::U8(slice) => spi.write(slice),
DataFormat::U16(slice) => {