From b3ca672f70c71194da40a7670549a8264c13d971 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 12 Jan 2024 20:24:51 +0100 Subject: Update to `embedded-hal` 1.0. --- src/interface.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/interface.rs') diff --git a/src/interface.rs b/src/interface.rs index 960c7ef..0e665a3 100644 --- a/src/interface.rs +++ b/src/interface.rs @@ -1,7 +1,6 @@ //! I2C interface use crate::{private, Error}; -use embedded_hal::blocking; /// I2C interface #[derive(Debug, Default)] @@ -14,13 +13,14 @@ pub struct I2cInterface { pub trait WriteData: private::Sealed { /// Error type type Error; + /// Write to an u16 register fn write_register(&mut self, register: u8, data: u16) -> Result<(), Error>; } impl WriteData for I2cInterface where - I2C: blocking::i2c::Write, + I2C: embedded_hal::i2c::I2c, { type Error = E; fn write_register(&mut self, register: u8, data: u16) -> Result<(), Error> { @@ -33,13 +33,14 @@ where pub trait ReadData: private::Sealed { /// Error type type Error; + /// Read an u16 register fn read_register(&mut self, register: u8) -> Result>; } impl ReadData for I2cInterface where - I2C: blocking::i2c::WriteRead, + I2C: embedded_hal::i2c::I2c, { type Error = E; fn read_register(&mut self, register: u8) -> Result> { -- cgit v1.2.3-54-g00ecf