diff options
author | Tomasz Kramkowski <tomasz@kramkow.ski> | 2024-12-08 19:19:44 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tomasz@kramkow.ski> | 2024-12-08 19:19:44 +0000 |
commit | deaf0dc5ed4643f228265d197cd72f7d3a7b0e4a (patch) | |
tree | 3d8cbc87442227958c6c2e72e043ea2b0b342ef4 | |
parent | 9bf7e6fc3b5f75575955791be1025b09b2150c35 (diff) | |
download | max31855-async-deaf0dc5ed4643f228265d197cd72f7d3a7b0e4a.tar.gz max31855-async-deaf0dc5ed4643f228265d197cd72f7d3a7b0e4a.tar.xz max31855-async-deaf0dc5ed4643f228265d197cd72f7d3a7b0e4a.zip |
Update embedded-hal to 1.0.0
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/lib.rs | 8 |
2 files changed, 5 insertions, 5 deletions
@@ -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" @@ -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>> { |