pub struct DeviceProxy { /* private fields */ }Implementations§
Source§impl DeviceProxy
impl DeviceProxy
Sourcepub fn take_event_stream(&self) -> DeviceEventStream
pub fn take_event_stream(&self) -> DeviceEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn transmit(
&self,
buffer: &SharedVmoBuffer,
) -> QueryResponseFut<SharedVmoIoTransmitResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn transmit( &self, buffer: &SharedVmoBuffer, ) -> QueryResponseFut<SharedVmoIoTransmitResult, DefaultFuchsiaResourceDialect> ⓘ
Sends the data in buffer to the device.
Sourcepub fn receive(
&self,
buffer: &SharedVmoBuffer,
) -> QueryResponseFut<SharedVmoIoReceiveResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn receive( &self, buffer: &SharedVmoBuffer, ) -> QueryResponseFut<SharedVmoIoReceiveResult, DefaultFuchsiaResourceDialect> ⓘ
Receives data from the device into buffer.
Sourcepub fn exchange(
&self,
tx_buffer: &SharedVmoBuffer,
rx_buffer: &SharedVmoBuffer,
) -> QueryResponseFut<SharedVmoIoExchangeResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn exchange( &self, tx_buffer: &SharedVmoBuffer, rx_buffer: &SharedVmoBuffer, ) -> QueryResponseFut<SharedVmoIoExchangeResult, DefaultFuchsiaResourceDialect> ⓘ
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,
) -> QueryResponseFut<SharedVmoRegisterRegisterVmoResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn register_vmo( &self, vmo_id: u32, vmo: Range, rights: SharedVmoRight, ) -> QueryResponseFut<SharedVmoRegisterRegisterVmoResult, DefaultFuchsiaResourceDialect> ⓘ
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,
) -> QueryResponseFut<SharedVmoRegisterUnregisterVmoResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn unregister_vmo( &self, vmo_id: u32, ) -> QueryResponseFut<SharedVmoRegisterUnregisterVmoResult, DefaultFuchsiaResourceDialect> ⓘ
Unmaps and/or unpins the VMO and returns the handle to the caller.
Sourcepub fn transmit_vector(
&self,
data: &[u8],
) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect> ⓘ
pub fn transmit_vector( &self, data: &[u8], ) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect> ⓘ
Half-duplex transmit data to a SPI device; always transmits the entire buffer on success.
Sourcepub fn receive_vector(
&self,
size: u32,
) -> QueryResponseFut<(i32, Vec<u8>), DefaultFuchsiaResourceDialect> ⓘ
pub fn receive_vector( &self, size: u32, ) -> QueryResponseFut<(i32, Vec<u8>), DefaultFuchsiaResourceDialect> ⓘ
Half-duplex receive data from a SPI device; always reads the full size requested.
Sourcepub fn exchange_vector(
&self,
txdata: &[u8],
) -> QueryResponseFut<(i32, Vec<u8>), DefaultFuchsiaResourceDialect> ⓘ
pub fn exchange_vector( &self, txdata: &[u8], ) -> QueryResponseFut<(i32, Vec<u8>), DefaultFuchsiaResourceDialect> ⓘ
Full-duplex SPI transaction. Received data will exactly equal the length of the transmit buffer.
Sourcepub fn can_assert_cs(
&self,
) -> QueryResponseFut<bool, DefaultFuchsiaResourceDialect> ⓘ
pub fn can_assert_cs( &self, ) -> QueryResponseFut<bool, DefaultFuchsiaResourceDialect> ⓘ
Returns true if the device can call |AssertCs()| and |DeassertCs()|.
Sourcepub fn assert_cs(&self) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect> ⓘ
pub fn assert_cs(&self) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect> ⓘ
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,
) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect> ⓘ
pub fn deassert_cs( &self, ) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect> ⓘ
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 Clone for DeviceProxy
impl Clone for DeviceProxy
Source§impl Debug for DeviceProxy
impl Debug for DeviceProxy
Source§impl DeviceProxyInterface for DeviceProxy
impl DeviceProxyInterface for DeviceProxy
type TransmitResponseFut = QueryResponseFut<Result<(), i32>>
type ReceiveResponseFut = QueryResponseFut<Result<(), i32>>
type ExchangeResponseFut = QueryResponseFut<Result<(), i32>>
type RegisterVmoResponseFut = QueryResponseFut<Result<(), i32>>
type UnregisterVmoResponseFut = QueryResponseFut<Result<Vmo, i32>>
type TransmitVectorResponseFut = QueryResponseFut<i32>
type ReceiveVectorResponseFut = QueryResponseFut<(i32, Vec<u8>)>
type ExchangeVectorResponseFut = QueryResponseFut<(i32, Vec<u8>)>
type CanAssertCsResponseFut = QueryResponseFut<bool>
type AssertCsResponseFut = QueryResponseFut<i32>
type DeassertCsResponseFut = QueryResponseFut<i32>
fn transmit(&self, buffer: &SharedVmoBuffer) -> Self::TransmitResponseFut
fn receive(&self, buffer: &SharedVmoBuffer) -> Self::ReceiveResponseFut
fn exchange( &self, tx_buffer: &SharedVmoBuffer, rx_buffer: &SharedVmoBuffer, ) -> Self::ExchangeResponseFut
fn register_vmo( &self, vmo_id: u32, vmo: Range, rights: SharedVmoRight, ) -> Self::RegisterVmoResponseFut
fn unregister_vmo(&self, vmo_id: u32) -> Self::UnregisterVmoResponseFut
fn transmit_vector(&self, data: &[u8]) -> Self::TransmitVectorResponseFut
fn receive_vector(&self, size: u32) -> Self::ReceiveVectorResponseFut
fn exchange_vector(&self, txdata: &[u8]) -> Self::ExchangeVectorResponseFut
fn can_assert_cs(&self) -> Self::CanAssertCsResponseFut
fn assert_cs(&self) -> Self::AssertCsResponseFut
fn deassert_cs(&self) -> Self::DeassertCsResponseFut
Source§impl Proxy for DeviceProxy
impl Proxy for DeviceProxy
Source§type Protocol = DeviceMarker
type Protocol = DeviceMarker
Proxy controls.