11use embedded_hal:: i2c:: { Error , ErrorKind , ErrorType , I2c } ;
22
3+ #[ cfg( feature = "defmt-03" ) ]
4+ use crate :: defmt;
35use crate :: util:: AtomicCell ;
46
57/// Atomics-based shared bus [`I2c`] implementation.
@@ -30,6 +32,8 @@ use crate::util::AtomicCell;
3032/// use embedded_hal_bus::i2c;
3133/// use embedded_hal_bus::util::AtomicCell;
3234/// # use embedded_hal::i2c::{self as hali2c, SevenBitAddress, TenBitAddress, I2c, Operation, ErrorKind};
35+ /// # #[cfg(feature = "defmt-03")]
36+ /// # use embedded_hal::defmt;
3337/// # pub struct Sensor<I2C> {
3438/// # i2c: I2C,
3539/// # address: u8,
@@ -42,6 +46,7 @@ use crate::util::AtomicCell;
4246/// # type PressureSensor<I2C> = Sensor<I2C>;
4347/// # type TemperatureSensor<I2C> = Sensor<I2C>;
4448/// # pub struct I2c0;
49+ /// # #[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
4550/// # #[derive(Debug, Copy, Clone, Eq, PartialEq)]
4651/// # pub enum Error { }
4752/// # impl hali2c::Error for Error {
@@ -80,6 +85,7 @@ pub struct AtomicDevice<'a, T> {
8085 bus : & ' a AtomicCell < T > ,
8186}
8287
88+ #[ cfg_attr( feature = "defmt-03" , derive( defmt:: Format ) ) ]
8389#[ derive( Debug , Copy , Clone ) ]
8490/// Wrapper type for errors originating from the atomically-checked I2C bus manager.
8591pub enum AtomicError < T : Error > {
0 commit comments