[−][src]Type Definition embedded_hal_mock::spi::Mock
type Mock = Generic<Transaction>;
Mock SPI implementation
This supports the specification and checking of expectations to allow automated testing of SPI based drivers. Mismatches between expected and real SPI transactions will cause runtime assertions to assist with locating faults.
See the usage section in the module level docs for an example.
Trait Implementations
impl FullDuplex<u8> for Mock
[src]
type Error = MockError
An enumeration of SPI errors
fn send(&mut self, buffer: u8) -> Result<(), Self::Error>
[src]
spi::FullDuplex implementeation for Mock
This will call the nonblocking read/write primitives.
fn read(&mut self) -> Result<u8, Self::Error>
[src]
spi::FullDuplex implementeation for Mock
This will call the nonblocking read/write primitives.
impl Transfer<u8> for Mock
[src]
type Error = MockError
Error type
fn transfer<'w>(
&mut self,
buffer: &'w mut [u8]
) -> Result<&'w [u8], Self::Error>
[src]
&mut self,
buffer: &'w mut [u8]
) -> Result<&'w [u8], Self::Error>
spi::Transfer implementation for Mock
This writes the provided response to the buffer and will cause an assertion if the written data does not match the next expectation