[−][src]Trait embedded_spi::Transactional
Transaction trait provides higher level, transaction-based, SPI constructs These are executed in a single SPI transaction (without de-asserting CS).
Associated Types
type Error
Required methods
fn spi_read(
&mut self,
prefix: &[u8],
data: &mut [u8]
) -> Result<(), Self::Error>
&mut self,
prefix: &[u8],
data: &mut [u8]
) -> Result<(), Self::Error>
Read writes the prefix buffer then reads into the input buffer Note that the values of the input buffer will also be output, because, SPI...
fn spi_write(&mut self, prefix: &[u8], data: &[u8]) -> Result<(), Self::Error>
Write writes the prefix buffer then writes the output buffer
fn spi_exec(
&mut self,
transactions: &mut [Transaction]
) -> Result<(), Self::Error>
&mut self,
transactions: &mut [Transaction]
) -> Result<(), Self::Error>
Transfer writes the outgoing buffer while reading into the incoming buffer note that outgoing and incoming must have the same length Exec allows 'Transaction' objects to be chained together into a single transaction
fn spi_busy(&mut self) -> Result<PinState, Self::Error>
Busy returns the value of the busy input signal if available
Implementors
impl Transactional for Spi
[src]
type Error = Error<(), ()>
fn spi_read(
&mut self,
prefix: &[u8],
data: &mut [u8]
) -> Result<(), Self::Error>
[src]
&mut self,
prefix: &[u8],
data: &mut [u8]
) -> Result<(), Self::Error>
Read data from a specified address This consumes the provided input data array and returns a reference to this on success
fn spi_write(&mut self, prefix: &[u8], data: &[u8]) -> Result<(), Self::Error>
[src]
Write data to a specified register address
fn spi_exec(
&mut self,
transactions: &mut [Transaction]
) -> Result<(), Self::Error>
[src]
&mut self,
transactions: &mut [Transaction]
) -> Result<(), Self::Error>
Execute the provided transactions
fn spi_busy(&mut self) -> Result<PinState, Self::Error>
[src]
Check peripheral busy status
impl<Spi, SpiError, Output, Input, PinError> Transactional for Wrapper<Spi, SpiError, Output, Input, PinError> where
Spi: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>,
Output: OutputPin<Error = PinError>,
Input: InputPin<Error = PinError>,
[src]
Spi: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>,
Output: OutputPin<Error = PinError>,
Input: InputPin<Error = PinError>,
type Error = Error<SpiError, PinError>
fn spi_read<'a>(
&mut self,
prefix: &[u8],
data: &'a mut [u8]
) -> Result<(), Self::Error>
[src]
&mut self,
prefix: &[u8],
data: &'a mut [u8]
) -> Result<(), Self::Error>
Read data from a specified address This consumes the provided input data array and returns a reference to this on success
fn spi_write(&mut self, prefix: &[u8], data: &[u8]) -> Result<(), Self::Error>
[src]
Write data to a specified register address
fn spi_exec(
&mut self,
transactions: &mut [Transaction]
) -> Result<(), Self::Error>
[src]
&mut self,
transactions: &mut [Transaction]
) -> Result<(), Self::Error>
Execute the provided transactions
fn spi_busy(&mut self) -> Result<PinState, Self::Error>
[src]
Check if the peripheral is currently busy This will panic if not busy pin is bound