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