Struct capsules_extra::bus::SpiMasterBus

source ·
pub struct SpiMasterBus<'a, S: SpiMasterDevice<'a>> { /* private fields */ }

Implementations§

source§

impl<'a, S: SpiMasterDevice<'a>> SpiMasterBus<'a, S>

source

pub fn new(spi: &'a S, addr_buffer: &'static mut [u8]) -> SpiMasterBus<'a, S>

source

pub fn set_read_write_buffer(&self, buffer: &'static mut [u8])

source

pub fn configure( &self, cpol: ClockPolarity, cpal: ClockPhase, rate: u32, ) -> Result<(), ErrorCode>

Trait Implementations§

source§

impl<'a, A: BusAddr, S: SpiMasterDevice<'a>> Bus<'a, A> for SpiMasterBus<'a, S>

source§

fn set_addr(&self, addr: A) -> Result<(), ErrorCode>

Set the address to write to Read more
source§

fn write( &self, data_width: DataWidth, buffer: &'static mut [u8], len: usize, ) -> Result<(), (ErrorCode, &'static mut [u8])>

Write data items to the previously set address Read more
source§

fn read( &self, data_width: DataWidth, buffer: &'static mut [u8], len: usize, ) -> Result<(), (ErrorCode, &'static mut [u8])>

Read data items from the previously set address Read more
source§

fn set_client(&self, client: &'a dyn Client)

source§

impl<'a, S: SpiMasterDevice<'a>> SpiMasterClient for SpiMasterBus<'a, S>

source§

fn read_write_done( &self, write_buffer: SubSliceMut<'static, u8>, read_buffer: Option<SubSliceMut<'static, u8>>, status: Result<usize, ErrorCode>, )

Callback issued when a read/write operation finishes. Read more

Auto Trait Implementations§

§

impl<'a, S> !Freeze for SpiMasterBus<'a, S>

§

impl<'a, S> !RefUnwindSafe for SpiMasterBus<'a, S>

§

impl<'a, S> !Send for SpiMasterBus<'a, S>

§

impl<'a, S> !Sync for SpiMasterBus<'a, S>

§

impl<'a, S> Unpin for SpiMasterBus<'a, S>

§

impl<'a, S> !UnwindSafe for SpiMasterBus<'a, S>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.