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 transmit(
&self,
buffer: &SharedVmoBuffer,
___deadline: MonotonicInstant,
) -> Result<SharedVmoIoTransmitResult, Error>
pub fn transmit( &self, buffer: &SharedVmoBuffer, ___deadline: MonotonicInstant, ) -> Result<SharedVmoIoTransmitResult, Error>
Sends the data in buffer to the device.
Sourcepub fn receive(
&self,
buffer: &SharedVmoBuffer,
___deadline: MonotonicInstant,
) -> Result<SharedVmoIoReceiveResult, Error>
pub fn receive( &self, buffer: &SharedVmoBuffer, ___deadline: MonotonicInstant, ) -> Result<SharedVmoIoReceiveResult, Error>
Receives data from the device into buffer.
Sourcepub fn exchange(
&self,
tx_buffer: &SharedVmoBuffer,
rx_buffer: &SharedVmoBuffer,
___deadline: MonotonicInstant,
) -> Result<SharedVmoIoExchangeResult, Error>
pub fn exchange( &self, tx_buffer: &SharedVmoBuffer, rx_buffer: &SharedVmoBuffer, ___deadline: MonotonicInstant, ) -> Result<SharedVmoIoExchangeResult, Error>
Simultaneously transmits and receives data. The size fields of tx_buffer and rx_buffer must be the same.
Sourcepub fn register_vmo(
&self,
vmo_id: u32,
vmo: Range,
rights: SharedVmoRight,
___deadline: MonotonicInstant,
) -> Result<SharedVmoRegisterRegisterVmoResult, Error>
pub fn register_vmo( &self, vmo_id: u32, vmo: Range, rights: SharedVmoRight, ___deadline: MonotonicInstant, ) -> Result<SharedVmoRegisterRegisterVmoResult, Error>
Registers a VMO and transfers ownership to the driver. vmo_id: The ID chosen by the client that will be used in operations on this VMO. vmo: The handle, offset, and size of this VMO. IO operations on this VMO will be relative to the offset and size specified here. rights: A bit field of SharedVmoRight values indicating how this VMO may be used. Callers should assume that the driver will map and/or pin the VMO using these rights.
Sourcepub fn unregister_vmo(
&self,
vmo_id: u32,
___deadline: MonotonicInstant,
) -> Result<SharedVmoRegisterUnregisterVmoResult, Error>
pub fn unregister_vmo( &self, vmo_id: u32, ___deadline: MonotonicInstant, ) -> Result<SharedVmoRegisterUnregisterVmoResult, Error>
Unmaps and/or unpins the VMO and returns the handle to the caller.
Sourcepub fn transmit_vector(
&self,
data: &[u8],
___deadline: MonotonicInstant,
) -> Result<i32, Error>
pub fn transmit_vector( &self, data: &[u8], ___deadline: MonotonicInstant, ) -> Result<i32, Error>
Half-duplex transmit data to a SPI device; always transmits the entire buffer on success.
Sourcepub fn receive_vector(
&self,
size: u32,
___deadline: MonotonicInstant,
) -> Result<(i32, Vec<u8>), Error>
pub fn receive_vector( &self, size: u32, ___deadline: MonotonicInstant, ) -> Result<(i32, Vec<u8>), Error>
Half-duplex receive data from a SPI device; always reads the full size requested.
Sourcepub fn exchange_vector(
&self,
txdata: &[u8],
___deadline: MonotonicInstant,
) -> Result<(i32, Vec<u8>), Error>
pub fn exchange_vector( &self, txdata: &[u8], ___deadline: MonotonicInstant, ) -> Result<(i32, Vec<u8>), Error>
Full-duplex SPI transaction. Received data will exactly equal the length of the transmit buffer.
Sourcepub fn can_assert_cs(
&self,
___deadline: MonotonicInstant,
) -> Result<bool, Error>
pub fn can_assert_cs( &self, ___deadline: MonotonicInstant, ) -> Result<bool, Error>
Returns true if the device can call |AssertCs()| and |DeassertCs()|.
Sourcepub fn assert_cs(&self, ___deadline: MonotonicInstant) -> Result<i32, Error>
pub fn assert_cs(&self, ___deadline: MonotonicInstant) -> Result<i32, Error>
Assert CS for this device. Returns ZX_ERR_NOT_SUPPORTED if there is more than one device on the bus.
Sourcepub fn deassert_cs(&self, ___deadline: MonotonicInstant) -> Result<i32, Error>
pub fn deassert_cs(&self, ___deadline: MonotonicInstant) -> Result<i32, Error>
Deassert CS for this device. Returns ZX_ERR_BAD_STATE if CS is already deasserted. Returns ZX_ERR_NOT_SUPPORTED if there is more than one device on the bus.
Trait Implementations§
Source§impl Debug for DeviceSynchronousProxy
impl Debug for DeviceSynchronousProxy
Source§impl From<Channel> for DeviceSynchronousProxy
Available on Fuchsia only.
impl From<Channel> for DeviceSynchronousProxy
Source§impl From<DeviceSynchronousProxy> for NullableHandle
Available on Fuchsia only.
impl From<DeviceSynchronousProxy> for NullableHandle
Source§fn from(value: DeviceSynchronousProxy) -> Self
fn from(value: DeviceSynchronousProxy) -> Self
Source§impl FromClient for DeviceSynchronousProxy
Available on Fuchsia only.
impl FromClient for DeviceSynchronousProxy
Source§type Protocol = DeviceMarker
type Protocol = DeviceMarker
Source§fn from_client(value: ClientEnd<DeviceMarker>) -> Self
fn from_client(value: ClientEnd<DeviceMarker>) -> Self
Source§impl SynchronousProxy for DeviceSynchronousProxy
Available on Fuchsia only.
impl SynchronousProxy for DeviceSynchronousProxy
Source§type Proxy = DeviceProxy
type Proxy = DeviceProxy
Source§type Protocol = DeviceMarker
type Protocol = DeviceMarker
Proxy controls.