pub struct Mode {
pub dummy_cycles: u8,
pub switch: Switch,
pub width: DataWidth,
pub double_transfer_rate: bool,
}
Fields§
§dummy_cycles: u8
The number of no-operation clock cycles between address and data phases.
switch: Switch
Declarations of if and when to switch from single-lane SPI to a faster mode as declared by
width
and double_transfer_rate
.
width: DataWidth
How many lanes to use after the switch (1, 2, 4, or 8).
double_transfer_rate: bool
Whether to shift data on both rising and falling clock edges after the switch.
Implementations§
Source§impl Mode
impl Mode
Sourcepub fn cmd_addr(&self, opcode: u8, addr: u32, addr_mode: AddressMode) -> Cmd
pub fn cmd_addr(&self, opcode: u8, addr: u32, addr_mode: AddressMode) -> Cmd
One-byte opcode, with address
Sourcepub fn cmd2_addr(
&self,
opcode1: u8,
opcode2: u8,
addr: u32,
addr_mode: AddressMode,
) -> Cmd
pub fn cmd2_addr( &self, opcode1: u8, opcode2: u8, addr: u32, addr_mode: AddressMode, ) -> Cmd
Two-byte opcode, with address
pub fn dummy_cycles(&self, dummy_cycles: u8) -> Mode
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Mode
impl<'de> Deserialize<'de> for Mode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Mode
Auto Trait Implementations§
impl Freeze for Mode
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnwindSafe for Mode
Blanket Implementations§
§impl<T> Annotate for T
impl<T> Annotate for T
default fn format( &self, _variant: Option<&str>, _field: &MemberId<'_>, ) -> Option<Format>
default fn comment( &self, _variant: Option<&str>, _field: &MemberId<'_>, ) -> Option<String>
default fn as_annotate(&self) -> Option<&dyn Annotate>
default fn thunk_serialize( &self, serializer: &mut AnnotatedSerializer<'_>, ) -> Result<Document, Error>
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