pub struct DeviceSynchronousProxy { /* private fields */ }
Implementations§
Source§impl DeviceSynchronousProxy
impl DeviceSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<DeviceEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<DeviceEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn transfer(
&self,
transactions: &[Transaction],
___deadline: MonotonicInstant,
) -> Result<DeviceTransferResult, Error>
pub fn transfer( &self, transactions: &[Transaction], ___deadline: MonotonicInstant, ) -> Result<DeviceTransferResult, Error>
Issue one or more transactions to a particular I2C device.
Each Transaction
is performed in the order in which it appears in transactions
. Data for
read transfers (if there are any) is returned through read_data
, which has one entry for
each read transfer in transactions
. Transaction processing continues until all transfers
have been completed, an error occurs, or the target issues a NACK in response to a write
transfer.
The possible error values are:
ZX_ERR_INVALID_ARGS: transactions
has zero elements, data_transfer
was not specified
for a Transaction
, or there was a zero-length DataTransfer
.
ZX_ERR_OUT_OF_RANGE: A DataTransfer
was too large to be handled by this I2C controller.
ZX_ERR_IO_NOT_PRESENT: The device did not respond to its I2C address.
ZX_ERR_IO_REFUSED: The device issued a NACK before the end of a write transfer.
Sourcepub fn get_name(
&self,
___deadline: MonotonicInstant,
) -> Result<DeviceGetNameResult, Error>
pub fn get_name( &self, ___deadline: MonotonicInstant, ) -> Result<DeviceGetNameResult, Error>
Get the name of this I2C Device. Returns ZX_ERR_NOT_SUPPORTED if the name is unspecified or the empty string.
Trait Implementations§
Source§impl Debug for DeviceSynchronousProxy
impl Debug for DeviceSynchronousProxy
Source§impl SynchronousProxy for DeviceSynchronousProxy
impl SynchronousProxy for DeviceSynchronousProxy
Source§type Proxy = DeviceProxy
type Proxy = DeviceProxy
Source§type Protocol = DeviceMarker
type Protocol = DeviceMarker
Proxy
controls.