pub struct Master<F>{ /* private fields */ }Implementations§
Source§impl<F> Master<F>
impl<F> Master<F>
pub fn set_retries( self, retries: usize, ) -> impl Future<Item = Self, Error = Error> + Send + 'static
pub fn set_timeout( self, duration: Duration, ) -> impl Future<Item = Self, Error = Error> + Send + 'static
pub fn set_slave_address( self, address: u16, ) -> impl Future<Item = Self, Error = Error> + Send + 'static
pub const fn functionality(&self) -> Functionality
pub fn transfer_flags(&self) -> MessageFlags
Sourcepub fn transfer<A, M>(
self,
messages: SmallVec<M>,
) -> impl Future<Item = (SmallVec<M>, Self), Error = Error> + Send + 'static
pub fn transfer<A, M>( self, messages: SmallVec<M>, ) -> impl Future<Item = (SmallVec<M>, Self), Error = Error> + Send + 'static
§Panics
Panics for more messages than I2C_RDWR_IOCTL_MAX_MSGS.
Sourcepub fn transfers<A, M, T>(
self,
transfers: SmallVec<T>,
) -> impl Future<Item = (SmallVec<T>, Self), Error = Error> + Send + 'static
pub fn transfers<A, M, T>( self, transfers: SmallVec<T>, ) -> impl Future<Item = (SmallVec<T>, Self), Error = Error> + Send + 'static
§Panics
Panics for more total messages than I2C_RDWR_IOCTL_MAX_MSGS.
pub fn read_block_data<A>( self, command: u8, data: SmallVec<A>, exact: bool, ) -> impl Future<Item = (SmallVec<A>, Self), Error = Error> + Send + 'static
pub fn write_block_data<A>( self, command: u8, data: SmallVec<A>, ) -> impl Future<Item = Self, Error = Error> + Send + 'static
Source§impl<F> Master<F>
impl<F> Master<F>
Sourcepub fn smbus_set_pec(
self,
pec: bool,
) -> impl Future<Item = Self, Error = Error> + Send + 'static
pub fn smbus_set_pec( self, pec: bool, ) -> impl Future<Item = Self, Error = Error> + Send + 'static
Enables/Disables Packet Error Checking (PEC).
A Packet Error Code (PEC) is appended at the end of each message
transfer by the device that supplied the last data byte, that excludes
smbus_write_bit(). An invalid PEC byte will not be acknowledged and
result in an io::Error.
Available since version 1.1 of the SMBus specification.
Sourcepub fn smbus_write_bit(
self,
bit: bool,
) -> impl Future<Item = Self, Error = Error> + Send + 'static
pub fn smbus_write_bit( self, bit: bool, ) -> impl Future<Item = Self, Error = Error> + Send + 'static
Writes a command/data bit at the place of the direction bit.
No PEC byte will be appended, see smbus_set_pec().
S address bit [A] PSourcepub fn smbus_read_byte(
self,
) -> impl Future<Item = (u8, Self), Error = Error> + Send + 'static
pub fn smbus_read_byte( self, ) -> impl Future<Item = (u8, Self), Error = Error> + Send + 'static
Reads a command/data byte.
S address R [A] [byte] N PSourcepub fn smbus_write_byte(
self,
byte: u8,
) -> impl Future<Item = Self, Error = Error> + Send + 'static
pub fn smbus_write_byte( self, byte: u8, ) -> impl Future<Item = Self, Error = Error> + Send + 'static
Writes a command/data byte.
S address W [A] byte [A] PSourcepub fn smbus_read_byte_data<A>(
self,
command: u8,
) -> impl Future<Item = (u8, Self), Error = Error> + Send + 'static
pub fn smbus_read_byte_data<A>( self, command: u8, ) -> impl Future<Item = (u8, Self), Error = Error> + Send + 'static
Writes the command byte and reads a data byte.
S address W [A] command [A]
S address R [A] [data] N PSourcepub fn smbus_write_byte_data(
self,
command: u8,
data: u8,
) -> impl Future<Item = Self, Error = Error> + Send + 'static
pub fn smbus_write_byte_data( self, command: u8, data: u8, ) -> impl Future<Item = Self, Error = Error> + Send + 'static
Writes the command byte and the data byte.
S address W [A] command [A] [data] [A] PSourcepub fn smbus_read_word_data(
self,
command: u8,
) -> impl Future<Item = (u16, Self), Error = Error> + Send + 'static
pub fn smbus_read_word_data( self, command: u8, ) -> impl Future<Item = (u16, Self), Error = Error> + Send + 'static
Writes the command byte and reads a data word.
A data word comprises a low and a high data byte in the order mentioned.
S address W [A] command [A]
S address R [A] [data_low] A [data_high] N PSourcepub fn smbus_write_word_data(
self,
command: u8,
data: u16,
) -> impl Future<Item = Self, Error = Error> + Send + 'static
pub fn smbus_write_word_data( self, command: u8, data: u16, ) -> impl Future<Item = Self, Error = Error> + Send + 'static
Writes the command byte and the data word.
A data word comprises a low and a high data byte in the order mentioned.
S address W [A] command [A] data_low [A] data_high [A] PSourcepub fn smbus_process_call(
self,
command: u8,
data: u16,
) -> impl Future<Item = (u16, Self), Error = Error> + Send + 'static
pub fn smbus_process_call( self, command: u8, data: u16, ) -> impl Future<Item = (u16, Self), Error = Error> + Send + 'static
Writes the command byte and the data word and then reads a data word
in return.
A data word comprises a low and a high data byte in the order mentioned.
S address W [A] command [A] data_low [A] data_high [A]
S address R [A] [data_low] A [data_high] N PSourcepub fn smbus_read_block_data<A>(
self,
command: u8,
data: SmallVec<A>,
exact: bool,
) -> impl Future<Item = (SmallVec<A>, Self), Error = Error> + Send + 'static
pub fn smbus_read_block_data<A>( self, command: u8, data: SmallVec<A>, exact: bool, ) -> impl Future<Item = (SmallVec<A>, Self), Error = Error> + Send + 'static
Writes the command byte and reads a length byte followed by a data
block of that length.
The data block length ranges from 1 to 32 bytes.
S address W [A] command [A]
S address R [A] [length] A [data#1] A ... [data#length] N PSourcepub fn smbus_write_block_data<A>(
self,
command: u8,
data: SmallVec<A>,
) -> impl Future<Item = Self, Error = Error> + Send + 'static
pub fn smbus_write_block_data<A>( self, command: u8, data: SmallVec<A>, ) -> impl Future<Item = Self, Error = Error> + Send + 'static
Writes the command byte and a length byte followed by the data block
of that length.
The data block length ranges from 1 to 32 bytes.
S address W [A] command [A]
length [A] data#1 [A] ... data#length [A] PSourcepub fn smbus_block_process_call<A, B>(
self,
command: u8,
write_data: SmallVec<A>,
read_data: SmallVec<B>,
exact: bool,
) -> impl Future<Item = (SmallVec<B>, Self), Error = Error> + Send + 'static
pub fn smbus_block_process_call<A, B>( self, command: u8, write_data: SmallVec<A>, read_data: SmallVec<B>, exact: bool, ) -> impl Future<Item = (SmallVec<B>, Self), Error = Error> + Send + 'static
Writes the command byte and a length byte followed by the write_data
block of that length and then reads a length byte followed by a
read_data block of that length in return.
The data block length ranges from 1 to 32 bytes.
Available since version 2.0 of the SMBus specification.
S address W [A] command [A]
length [A] data#1 [A] ... data#length [A]
S address R [A] [length] A [data#1] A ... [data#length] N P