Trait i2c::Smbus
[−]
[src]
pub trait Smbus: Master { fn smbus_write_quick(&mut self, value: bool) -> Result<(), Self::Error>; fn smbus_read_byte(&mut self) -> Result<u8, Self::Error>; fn smbus_write_byte(&mut self, value: u8) -> Result<(), Self::Error>; fn smbus_read_byte_data(&mut self, command: u8) -> Result<u8, Self::Error>; fn smbus_write_byte_data(
&mut self,
command: u8,
value: u8
) -> Result<(), Self::Error>; fn smbus_read_word_data(&mut self, command: u8) -> Result<u16, Self::Error>; fn smbus_write_word_data(
&mut self,
command: u8,
value: u16
) -> Result<(), Self::Error>; fn smbus_process_call(
&mut self,
command: u8,
value: u16
) -> Result<u16, Self::Error>; fn smbus_read_block_data(
&mut self,
command: u8,
value: &mut [u8]
) -> Result<usize, Self::Error>; fn smbus_write_block_data(
&mut self,
command: u8,
value: &[u8]
) -> Result<(), Self::Error>; }
SMBus operations
Required Methods
fn smbus_write_quick(&mut self, value: bool) -> Result<(), Self::Error>
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>
Reads a single byte from a device without specifying a register.
fn smbus_write_byte(&mut self, value: u8) -> Result<(), Self::Error>
Sends a single byte to the device
fn smbus_read_byte_data(&mut self, command: u8) -> Result<u8, Self::Error>
Reads a byte from the designated register.
fn smbus_write_byte_data(
&mut self,
command: u8,
value: u8
) -> Result<(), Self::Error>
&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>
Reads a 16-bit word from the designated register.
fn smbus_write_word_data(
&mut self,
command: u8,
value: u16
) -> Result<(), Self::Error>
&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>
&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.
fn smbus_read_block_data(
&mut self,
command: u8,
value: &mut [u8]
) -> Result<usize, Self::Error>
&mut self,
command: u8,
value: &mut [u8]
) -> Result<usize, Self::Error>
Reads up to 32 bytes from the designated device register.
Returns the number of bytes read, which may be larger than value.len()
if the read was truncated.
fn smbus_write_block_data(
&mut self,
command: u8,
value: &[u8]
) -> Result<(), Self::Error>
&mut self,
command: u8,
value: &[u8]
) -> Result<(), Self::Error>
Writes up to 32 bytes to the designated device register.
Implementors
impl<I: ReadWrite> Smbus for SmbusReadWrite<I>