Struct evegfx_hal::EVEHALSPIInterface [−][src]
EVEHALSPIInterface
is an implementation of evegfx.Interface
that
commincates over SPI using the embedded-hal
SPI and GPIO (for
"chip select") traits.
Implementations
impl<SPI, CS> EVEHALSPIInterface<SPI, CS> where
SPI: Transfer<u8> + Write<u8>,
CS: OutputPin,
[src]
SPI: Transfer<u8> + Write<u8>,
CS: OutputPin,
pub fn new(spi: SPI, cs: CS) -> Self
[src]
Create a new EVE interface in terms of the given SPI bus and CS signal implementations.
The given CS implementation must be a digital output pin which will be set to low to assert chip select, or high to unassert it, reflecting the physical characteristics of the CS pin on EVE IC packages.
Trait Implementations
impl<SPI, CS> Interface for EVEHALSPIInterface<SPI, CS> where
SPI: Transfer<u8> + Write<u8>,
CS: OutputPin,
[src]
SPI: Transfer<u8> + Write<u8>,
CS: OutputPin,
type Error = EVEHALSPIError<<SPI as Write<u8>>::Error, <SPI as Transfer<u8>>::Error, CS::Error>
fn begin_write(&mut self, addr: u32) -> Result<(), Self::Error>
[src]
fn continue_write(&mut self, v: &[u8]) -> Result<(), Self::Error>
[src]
fn end_write(&mut self) -> Result<(), Self::Error>
[src]
fn begin_read(&mut self, addr: u32) -> Result<(), Self::Error>
[src]
fn continue_read(&mut self, into: &mut [u8]) -> Result<(), Self::Error>
[src]
fn end_read(&mut self) -> Result<(), Self::Error>
[src]
fn host_cmd(&mut self, cmd: u8, a0: u8, a1: u8) -> Result<(), Self::Error>
[src]
pub fn reset(&mut self) -> Result<(), Self::Error>
[src]
pub fn write(&mut self, addr: u32, v: &[u8]) -> Result<(), Self::Error>
[src]
pub fn read(&mut self, addr: u32, into: &mut [u8]) -> Result<(), Self::Error>
[src]
pub fn build_write_header(&self, addr: u32, into: &mut [u8; 3])
[src]
pub fn build_read_header(&self, addr: u32, into: &mut [u8; 4])
[src]
pub fn build_host_cmd_msg(&self, cmd: u8, a0: u8, a1: u8, into: &mut [u8; 3])
[src]
Auto Trait Implementations
impl<SPI, CS> Send for EVEHALSPIInterface<SPI, CS> where
CS: Send,
SPI: Send,
[src]
CS: Send,
SPI: Send,
impl<SPI, CS> Sync for EVEHALSPIInterface<SPI, CS> where
CS: Sync,
SPI: Sync,
[src]
CS: Sync,
SPI: Sync,
impl<SPI, CS> Unpin for EVEHALSPIInterface<SPI, CS> where
CS: Unpin,
SPI: Unpin,
[src]
CS: Unpin,
SPI: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,