Skip to main content

SpiImplServerHandler

Trait SpiImplServerHandler 

Source
pub trait SpiImplServerHandler<___T: Transport = DriverChannel> {
    // Required methods
    fn get_chip_select_count(
        &mut self,
        responder: Responder<GetChipSelectCount, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn transmit_vector(
        &mut self,
        request: Request<TransmitVector, ___T>,
        responder: Responder<TransmitVector, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn receive_vector(
        &mut self,
        request: Request<ReceiveVector, ___T>,
        responder: Responder<ReceiveVector, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn exchange_vector(
        &mut self,
        request: Request<ExchangeVector, ___T>,
        responder: Responder<ExchangeVector, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn lock_bus(
        &mut self,
        request: Request<LockBus, ___T>,
        responder: Responder<LockBus, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn unlock_bus(
        &mut self,
        request: Request<UnlockBus, ___T>,
        responder: Responder<UnlockBus, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn register_vmo(
        &mut self,
        request: Request<RegisterVmo, ___T>,
        responder: Responder<RegisterVmo, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn unregister_vmo(
        &mut self,
        request: Request<UnregisterVmo, ___T>,
        responder: Responder<UnregisterVmo, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn release_registered_vmos(
        &mut self,
        request: Request<ReleaseRegisteredVmos, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn transmit_vmo(
        &mut self,
        request: Request<TransmitVmo, ___T>,
        responder: Responder<TransmitVmo, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn receive_vmo(
        &mut self,
        request: Request<ReceiveVmo, ___T>,
        responder: Responder<ReceiveVmo, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn exchange_vmo(
        &mut self,
        request: Request<ExchangeVmo, ___T>,
        responder: Responder<ExchangeVmo, ___T>,
    ) -> impl Future<Output = ()> + Send;
}
Expand description

A server handler for the SpiImpl protocol.

See SpiImpl for more details.

Required Methods§

Source

fn get_chip_select_count( &mut self, responder: Responder<GetChipSelectCount, ___T>, ) -> impl Future<Output = ()> + Send

Returns the number of chip select lines available or provided by the driver instance. To be used as a limit on the acceptable values for the `chip_select’ field in the Exchange() and ExchangeVmo() methods.

Source

fn transmit_vector( &mut self, request: Request<TransmitVector, ___T>, responder: Responder<TransmitVector, ___T>, ) -> impl Future<Output = ()> + Send

Half-duplex transmit data to a SPI device; always transmits the entire buffer on success.

Source

fn receive_vector( &mut self, request: Request<ReceiveVector, ___T>, responder: Responder<ReceiveVector, ___T>, ) -> impl Future<Output = ()> + Send

Half-duplex receive data from a SPI device; always reads the full size requested.

Source

fn exchange_vector( &mut self, request: Request<ExchangeVector, ___T>, responder: Responder<ExchangeVector, ___T>, ) -> impl Future<Output = ()> + Send

Full-duplex SPI transaction. Received data will exactly equal the length of the transmit buffer.

Source

fn lock_bus( &mut self, request: Request<LockBus, ___T>, responder: Responder<LockBus, ___T>, ) -> impl Future<Output = ()> + Send

Lock the bus.

Source

fn unlock_bus( &mut self, request: Request<UnlockBus, ___T>, responder: Responder<UnlockBus, ___T>, ) -> impl Future<Output = ()> + Send

Unlock the bus.

Source

fn register_vmo( &mut self, request: Request<RegisterVmo, ___T>, responder: Responder<RegisterVmo, ___T>, ) -> impl Future<Output = ()> + Send

rights is a bit field containing SpiVmoRight values, and determines the read/write permissions used by the implementation when pinning or mapping the VMO.

Source

fn unregister_vmo( &mut self, request: Request<UnregisterVmo, ___T>, responder: Responder<UnregisterVmo, ___T>, ) -> impl Future<Output = ()> + Send

Source

fn release_registered_vmos( &mut self, request: Request<ReleaseRegisteredVmos, ___T>, ) -> impl Future<Output = ()> + Send

Release all VMOs registered to this chip_select. Called by the core driver after the client has disconnected and the VMOs are no longer needed.

Source

fn transmit_vmo( &mut self, request: Request<TransmitVmo, ___T>, responder: Responder<TransmitVmo, ___T>, ) -> impl Future<Output = ()> + Send

Source

fn receive_vmo( &mut self, request: Request<ReceiveVmo, ___T>, responder: Responder<ReceiveVmo, ___T>, ) -> impl Future<Output = ()> + Send

Source

fn exchange_vmo( &mut self, request: Request<ExchangeVmo, ___T>, responder: Responder<ExchangeVmo, ___T>, ) -> impl Future<Output = ()> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§