capsules_extra::bus

Struct 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>,

Source§

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>,

Source§

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.