Struct max7301::interface::spi::SpiInterface [−][src]
A configured ExpanderInterface
for controlling a MAX7301 via SPI.
Implementations
impl<SPI, CS> SpiInterface<SPI, CS> where
SPI: Write<u8> + Transfer<u8>,
CS: OutputPin,
[src]
SPI: Write<u8> + Transfer<u8>,
CS: OutputPin,
pub fn new(spi: SPI, cs: CS) -> Self
[src]
Create a new SPI interface to communicate with the port expander. spi
is the SPI
master device, and cs
is the GPIO output pin connected to the CS pin of the MAX7301.
Trait Implementations
impl<SPI, CS> ExpanderInterface for SpiInterface<SPI, CS> where
SPI: Write<u8> + Transfer<u8>,
CS: OutputPin,
[src]
SPI: Write<u8> + Transfer<u8>,
CS: OutputPin,
fn write_register(&mut self, addr: RegisterAddress, value: u8) -> Result<(), ()>
[src]
fn read_register(&mut self, addr: RegisterAddress) -> Result<u8, ()>
[src]
Auto Trait Implementations
impl<SPI, CS> RefUnwindSafe for SpiInterface<SPI, CS> where
CS: RefUnwindSafe,
SPI: RefUnwindSafe,
CS: RefUnwindSafe,
SPI: RefUnwindSafe,
impl<SPI, CS> Send for SpiInterface<SPI, CS> where
CS: Send,
SPI: Send,
CS: Send,
SPI: Send,
impl<SPI, CS> Sync for SpiInterface<SPI, CS> where
CS: Sync,
SPI: Sync,
CS: Sync,
SPI: Sync,
impl<SPI, CS> Unpin for SpiInterface<SPI, CS> where
CS: Unpin,
SPI: Unpin,
CS: Unpin,
SPI: Unpin,
impl<SPI, CS> UnwindSafe for SpiInterface<SPI, CS> where
CS: UnwindSafe,
SPI: UnwindSafe,
CS: UnwindSafe,
SPI: UnwindSafe,
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>,