pub enum DeviceRequest {
Transmit {
buffer: SharedVmoBuffer,
responder: DeviceTransmitResponder,
},
Receive {
buffer: SharedVmoBuffer,
responder: DeviceReceiveResponder,
},
Exchange {
tx_buffer: SharedVmoBuffer,
rx_buffer: SharedVmoBuffer,
responder: DeviceExchangeResponder,
},
RegisterVmo {
vmo_id: u32,
vmo: Range,
rights: SharedVmoRight,
responder: DeviceRegisterVmoResponder,
},
UnregisterVmo {
vmo_id: u32,
responder: DeviceUnregisterVmoResponder,
},
TransmitVector {
data: Vec<u8>,
responder: DeviceTransmitVectorResponder,
},
ReceiveVector {
size: u32,
responder: DeviceReceiveVectorResponder,
},
ExchangeVector {
txdata: Vec<u8>,
responder: DeviceExchangeVectorResponder,
},
CanAssertCs {
responder: DeviceCanAssertCsResponder,
},
AssertCs {
responder: DeviceAssertCsResponder,
},
DeassertCs {
responder: DeviceDeassertCsResponder,
},
}Variants§
Transmit
Sends the data in buffer to the device.
Receive
Receives data from the device into buffer.
Exchange
Simultaneously transmits and receives data. The size fields of tx_buffer and rx_buffer must be the same.
RegisterVmo
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.
UnregisterVmo
Unmaps and/or unpins the VMO and returns the handle to the caller.
TransmitVector
Half-duplex transmit data to a SPI device; always transmits the entire buffer on success.
ReceiveVector
Half-duplex receive data from a SPI device; always reads the full size requested.
ExchangeVector
Full-duplex SPI transaction. Received data will exactly equal the length of the transmit buffer.
CanAssertCs
Returns true if the device can call |AssertCs()| and |DeassertCs()|.
Fields
responder: DeviceCanAssertCsResponderAssertCs
Assert CS for this device. Returns ZX_ERR_NOT_SUPPORTED if there is more than one device on the bus.
Fields
responder: DeviceAssertCsResponderDeassertCs
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.
Fields
responder: DeviceDeassertCsResponderImplementations§
Source§impl DeviceRequest
impl DeviceRequest
pub fn into_transmit(self) -> Option<(SharedVmoBuffer, DeviceTransmitResponder)>
pub fn into_receive(self) -> Option<(SharedVmoBuffer, DeviceReceiveResponder)>
pub fn into_exchange( self, ) -> Option<(SharedVmoBuffer, SharedVmoBuffer, DeviceExchangeResponder)>
pub fn into_register_vmo( self, ) -> Option<(u32, Range, SharedVmoRight, DeviceRegisterVmoResponder)>
pub fn into_unregister_vmo(self) -> Option<(u32, DeviceUnregisterVmoResponder)>
pub fn into_transmit_vector( self, ) -> Option<(Vec<u8>, DeviceTransmitVectorResponder)>
pub fn into_receive_vector(self) -> Option<(u32, DeviceReceiveVectorResponder)>
pub fn into_exchange_vector( self, ) -> Option<(Vec<u8>, DeviceExchangeVectorResponder)>
pub fn into_can_assert_cs(self) -> Option<DeviceCanAssertCsResponder>
pub fn into_assert_cs(self) -> Option<DeviceAssertCsResponder>
pub fn into_deassert_cs(self) -> Option<DeviceDeassertCsResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL