summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tomasz@kramkow.ski>2024-12-08 19:19:44 +0000
committerTomasz Kramkowski <tomasz@kramkow.ski>2024-12-08 19:19:44 +0000
commitdeaf0dc5ed4643f228265d197cd72f7d3a7b0e4a (patch)
tree3d8cbc87442227958c6c2e72e043ea2b0b342ef4
parent9bf7e6fc3b5f75575955791be1025b09b2150c35 (diff)
downloadmax31855-async-deaf0dc5ed4643f228265d197cd72f7d3a7b0e4a.tar.gz
max31855-async-deaf0dc5ed4643f228265d197cd72f7d3a7b0e4a.tar.xz
max31855-async-deaf0dc5ed4643f228265d197cd72f7d3a7b0e4a.zip
Update embedded-hal to 1.0.0
-rw-r--r--Cargo.toml2
-rw-r--r--src/lib.rs8
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<usize> = 2..=15;
@@ -143,11 +143,11 @@ fn transfer<CS, SPI, SpiE, CsE>(
) -> Result<(), Error<SpiE, CsE>>
where
CS: OutputPin<Error = CsE>,
- SPI: Transfer<u8, Error = SpiE>,
+ SPI: SpiDevice<u8, Error = SpiE>,
{
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<SpiE, CsE, CS> {
impl<CS, SPI, SpiE, CsE> Max31855<SpiE, CsE, CS> for SPI
where
CS: OutputPin<Error = CsE>,
- SPI: Transfer<u8, Error = SpiE>,
+ SPI: SpiDevice<u8, Error = SpiE>,
{
/// 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<i16, Error<SpiE, CsE>> {