pub struct SpiConfig { /* private fields */ }
Expand description
Represents the SPI (Serial Peripheral Interface) configuration.
Example:
// Create a new SPI configuration instance.
let spi_config = SpiConfig {
io_mode: SpiIOMode::Quad_IO,
io_speed: SpiSpeed::_50MHz,
};
// Convert the SPI config into a 32-bit integer.
let packed_value: u32 = spi_config.into();
// Convert the 32-bit integer back into an SPI config.
let unpacked_value = SpiConfig::from(packed_value);
// Print the values from the unpacked config.
println!("SPI IO Mode: {:?}", unpacked_value.io_mode);
println!("SPI IO Speed: {:?}", unpacked_value.io_speed);
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SpiConfig
impl<'de> Deserialize<'de> for SpiConfig
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 SpiConfig
Auto Trait Implementations§
impl Freeze for SpiConfig
impl RefUnwindSafe for SpiConfig
impl Send for SpiConfig
impl Sync for SpiConfig
impl Unpin for SpiConfig
impl UnwindSafe for SpiConfig
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