From deaf0dc5ed4643f228265d197cd72f7d3a7b0e4a Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Sun, 8 Dec 2024 19:19:44 +0000 Subject: Update embedded-hal to 1.0.0 --- Cargo.toml | 2 +- src/lib.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ed1847b..fc22f5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,5 +13,5 @@ documentation = "https://docs.rs/max31855" homepage = "https://github.com/cs2dsb/max31855.rs" [dependencies] -embedded-hal = version = "0.2.3" +embedded-hal = "1.0.0" bit_field = "0.10.0" diff --git a/src/lib.rs b/src/lib.rs index 2663345..f2198fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,7 +45,7 @@ use bit_field::BitField; use core::ops::RangeInclusive; -use embedded_hal::{blocking::spi::Transfer, digital::v2::OutputPin}; +use embedded_hal::{spi::SpiDevice, digital::OutputPin}; /// The bits that represent the thermocouple value when reading the first u16 from the sensor const THERMOCOUPLE_BITS: RangeInclusive = 2..=15; @@ -143,11 +143,11 @@ fn transfer( ) -> Result<(), Error> where CS: OutputPin, - SPI: Transfer, + SPI: SpiDevice, { set_cs(chip_select, Low)?; - spi.transfer(buffer).map_err(|e| Error::SpiError(e))?; + spi.transfer_in_place(buffer).map_err(|e| Error::SpiError(e))?; set_cs(chip_select, High) } @@ -218,7 +218,7 @@ pub trait Max31855 { impl Max31855 for SPI where CS: OutputPin, - SPI: Transfer, + SPI: SpiDevice, { /// Reads the thermocouple temperature and leave it as a raw ADC count. Checks if there is a fault but doesn't detect what kind of fault it is fn read_thermocouple_raw(&mut self, chip_select: &mut CS) -> Result> { -- cgit v1.2.3-54-g00ecf