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>
impl<'a, S: SpiMasterDevice<'a>> SpiMasterBus<'a, S>
pub fn new(spi: &'a S, addr_buffer: &'static mut [u8]) -> SpiMasterBus<'a, S>
pub fn set_read_write_buffer(&self, buffer: &'static mut [u8])
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>
impl<'a, A: BusAddr, S: SpiMasterDevice<'a>> Bus<'a, A> for SpiMasterBus<'a, S>
source§fn write(
&self,
data_width: DataWidth,
buffer: &'static mut [u8],
len: usize,
) -> Result<(), (ErrorCode, &'static mut [u8])>
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])>
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
fn set_client(&self, client: &'a dyn Client)
source§impl<'a, S: SpiMasterDevice<'a>> SpiMasterClient for SpiMasterBus<'a, S>
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>,
)
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more