Struct i2c::SmbusReadWrite
[−]
[src]
pub struct SmbusReadWrite<I>(pub I);
A wrapper around an i2c::ReadWrite
that attempts to impl Smbus
.
Repeated START is not supported, which may confuse some devices and probably makes this a non-conforming implementation.
Trait Implementations
impl<I: Master> Master for SmbusReadWrite<I>
[src]
impl<I: Address> Address for SmbusReadWrite<I>
[src]
fn set_slave_address(
&mut self,
addr: u16,
tenbit: bool
) -> Result<(), Self::Error>
[src]
&mut self,
addr: u16,
tenbit: bool
) -> Result<(), Self::Error>
Sets the current slave to address. Read more
impl<I: ReadWrite> ReadWrite for SmbusReadWrite<I>
[src]
fn i2c_read(&mut self, value: &mut [u8]) -> Result<usize, Self::Error>
[src]
Initiate an isolated read transfer on the I2C bus, followed by a STOP.
fn i2c_write(&mut self, value: &[u8]) -> Result<(), Self::Error>
[src]
Initiate an isolated write transfer on the I2C bus, followed by a STOP.
impl<I: ReadWrite> Smbus for SmbusReadWrite<I>
[src]
fn smbus_write_quick(&mut self, value: bool) -> Result<(), Self::Error>
[src]
Sends a single bit to the device, in the place of the rd/wr address bit.
fn smbus_read_byte(&mut self) -> Result<u8, Self::Error>
[src]
Reads a single byte from a device without specifying a register.
fn smbus_write_byte(&mut self, value: u8) -> Result<(), Self::Error>
[src]
Sends a single byte to the device
fn smbus_read_byte_data(&mut self, command: u8) -> Result<u8, Self::Error>
[src]
Reads a byte from the designated register.
fn smbus_write_byte_data(
&mut self,
command: u8,
value: u8
) -> Result<(), Self::Error>
[src]
&mut self,
command: u8,
value: u8
) -> Result<(), Self::Error>
Writes a byte to the designated register.
fn smbus_read_word_data(&mut self, command: u8) -> Result<u16, Self::Error>
[src]
Reads a 16-bit word from the designated register.
fn smbus_write_word_data(
&mut self,
command: u8,
value: u16
) -> Result<(), Self::Error>
[src]
&mut self,
command: u8,
value: u16
) -> Result<(), Self::Error>
Writes a 16-bit word to the designated register.
fn smbus_process_call(
&mut self,
command: u8,
value: u16
) -> Result<u16, Self::Error>
[src]
&mut self,
command: u8,
value: u16
) -> Result<u16, Self::Error>
Writes a 16-bit word to the specified register, then reads a 16-bit word in response. Read more
fn smbus_read_block_data(
&mut self,
command: u8,
value: &mut [u8]
) -> Result<usize, Self::Error>
[src]
&mut self,
command: u8,
value: &mut [u8]
) -> Result<usize, Self::Error>
Reads up to 32 bytes from the designated device register. Read more
fn smbus_write_block_data(
&mut self,
command: u8,
value: &[u8]
) -> Result<(), Self::Error>
[src]
&mut self,
command: u8,
value: &[u8]
) -> Result<(), Self::Error>
Writes up to 32 bytes to the designated device register.
impl<I: ReadWrite> BlockTransfer for SmbusReadWrite<I>
[src]
fn i2c_read_block_data(
&mut self,
command: u8,
value: &mut [u8]
) -> Result<usize, Self::Error>
[src]
&mut self,
command: u8,
value: &mut [u8]
) -> Result<usize, Self::Error>
Reads a block of bytes from the designated device register. Read more
fn i2c_write_block_data(
&mut self,
command: u8,
value: &[u8]
) -> Result<(), Self::Error>
[src]
&mut self,
command: u8,
value: &[u8]
) -> Result<(), Self::Error>
Writes a block of bytes to the designated device register. Read more