2020//! );
2121//!
2222//! // Scan for devices on the bus by attempting to read from them
23- //! use embedded_hal_0_2::prelude::_embedded_hal_blocking_i2c_Read;
2423//! for i in 0..=127 {
2524//! let mut readbuf: [u8; 1] = [0; 1];
2625//! let result = i2c.read(i, &mut readbuf);
3130//! }
3231//!
3332//! // Write some data to a device at 0x2c
34- //! use embedded_hal_0_2::prelude::_embedded_hal_blocking_i2c_Write;
3533//! i2c.write(0x2c, &[1, 2, 3]).unwrap();
3634//!
3735//! // Write and then read from a device at 0x3a
38- //! use embedded_hal_0_2::prelude::_embedded_hal_blocking_i2c_WriteRead;
3936//! let mut readbuf: [u8; 1] = [0; 1];
4037//! i2c.write_read(0x2c, &[1, 2, 3], &mut readbuf).unwrap();
4138//! ```
@@ -70,26 +67,26 @@ impl I2cDevice for pac::I2C1 {
7067 const ID : usize = 1 ;
7168}
7269
73- /// I2C error
70+ /// I²C Error
7471#[ non_exhaustive]
7572pub enum Error {
76- /// I2C abort with error
73+ /// I²C abort with error
7774 Abort ( u32 ) ,
7875 /// User passed in a read buffer that was 0 length
7976 ///
80- /// This is a limitation of the RP2040 I2C peripheral.
81- /// If the slave ACKs its address, the I2C peripheral must read
77+ /// This is a limitation of the RP2040 I²C peripheral.
78+ /// If the slave ACKs its address, the I²C peripheral must read
8279 /// at least one byte before sending the STOP condition.
8380 InvalidReadBufferLength ,
8481 /// User passed in a write buffer that was 0 length
8582 ///
86- /// This is a limitation of the RP2040 I2C peripheral.
87- /// If the slave ACKs its address, the I2C peripheral must write
83+ /// This is a limitation of the RP2040 I²C peripheral.
84+ /// If the slave ACKs its address, the I²C peripheral must write
8885 /// at least one byte before sending the STOP condition.
8986 InvalidWriteBufferLength ,
90- /// Target i2c address is out of range
87+ /// Target I²C address is out of range
9188 AddressOutOfRange ( u16 ) ,
92- /// Target i2c address is reserved
89+ /// Target I²C address is reserved
9390 AddressReserved ( u16 ) ,
9491}
9592
@@ -99,8 +96,8 @@ impl core::fmt::Debug for Error {
9996 match self {
10097 Error :: InvalidReadBufferLength => write ! ( fmt, "InvalidReadBufferLength" ) ,
10198 Error :: InvalidWriteBufferLength => write ! ( fmt, "InvalidWriteBufferLength" ) ,
102- Error :: AddressOutOfRange ( addr) => write ! ( fmt, "AddressOutOfRange({:x })" , addr) ,
103- Error :: AddressReserved ( addr) => write ! ( fmt, "AddressReserved({:x })" , addr) ,
99+ Error :: AddressOutOfRange ( addr) => write ! ( fmt, "AddressOutOfRange({:? })" , addr) ,
100+ Error :: AddressReserved ( addr) => write ! ( fmt, "AddressReserved({:? })" , addr) ,
104101 Error :: Abort ( _) => {
105102 write ! ( fmt, "{:?}" , self . kind( ) )
106103 }
0 commit comments