[−][src]Struct ht16k33::i2c_mock::I2cMock
The mock I2C state.
Example
use ht16k33::i2c_mock::I2cMock; // Create an I2cMock. let i2c_mock = I2cMock::new();
Fields
data_values: [u8; 16]
Display RAM state.
Methods
impl I2cMock
[src]
Trait Implementations
impl Write for I2cMock
[src]
type Error = I2cMockError
Error type
fn write(&mut self, _address: u8, bytes: &[u8]) -> Result<(), Self::Error>
[src]
write
implementation.
Arguments
_address
- The slave address. Ignored.bytes
- The command/address instructions to be written.
Examples
let mut i2c_mock = I2cMock::new(); // First value is the data address, remaining values are to be written // starting at the data address which auto-increments and then wraps. let write_buffer = [ht16k33::DisplayDataAddress::ROW_0.bits(), 0u8, 0u8]; i2c_mock.write(0, &write_buffer);
impl WriteRead for I2cMock
[src]
type Error = I2cMockError
Error type
fn write_read(
&mut self,
_address: u8,
bytes: &[u8],
buffer: &mut [u8]
) -> Result<(), Self::Error>
[src]
&mut self,
_address: u8,
bytes: &[u8],
buffer: &mut [u8]
) -> Result<(), Self::Error>
write_read
implementation.
Arguments
_address
- The slave address. Ignored.bytes
- The command/address instructions to be written.buffer
- The read results.
Examples
let mut i2c_mock = I2cMock::new(); let mut read_buffer = [0u8; 16]; i2c_mock.write_read(0, &[ht16k33::DisplayDataAddress::ROW_0.bits()], &mut read_buffer);
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,