pub enum SpiMode {
Mode0,
Mode1,
Mode2,
Mode3,
}Expand description
SPI communication modes, defined by clock polarity (CPOL) and clock phase (CPHA).
These modes control the clock signal’s idle state and when data is sampled and shifted.
Variants§
Mode0
Mode 0 (CPOL = 0, CPHA = 0): Clock is low when idle, data is captured on the rising edge and propagated on the falling edge.
Mode1
Mode 1 (CPOL = 0, CPHA = 1): Clock is low when idle, data is captured on the falling edge and propagated on the rising edge.
Mode2
Mode 2 (CPOL = 1, CPHA = 0): Clock is high when idle, data is captured on the falling edge and propagated on the rising edge.
Mode3
Mode 3 (CPOL = 1, CPHA = 1): Clock is high when idle, data is captured on the rising edge and propagated on the falling edge.
Trait Implementations§
impl Copy for SpiMode
impl StructuralPartialEq for SpiMode
Auto Trait Implementations§
impl Freeze for SpiMode
impl RefUnwindSafe for SpiMode
impl Send for SpiMode
impl Sync for SpiMode
impl Unpin for SpiMode
impl UnwindSafe for SpiMode
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