pub struct SpiChannel {
pub cs: Option<u32>,
pub vid: Option<u32>,
pub pid: Option<u32>,
pub did: Option<u32>,
pub cs_polarity_high: Option<bool>,
pub word_length_bits: Option<u8>,
pub is_bus_controller: Option<bool>,
pub clock_polarity_high: Option<bool>,
pub clock_phase: Option<SpiClockPhase>,
pub max_frequency_hz: Option<u32>,
/* private fields */
}Expand description
Represents a single device on a SPI bus.
Fields§
§cs: Option<u32>Chip select number for the device.
vid: Option<u32>Vendor ID. Used when binding via platform bus device IDs.
pid: Option<u32>Product ID. Used when binding via platform bus device IDs.
did: Option<u32>Device ID. Used when binding via platform bus device IDs.
cs_polarity_high: Option<bool>Chip select polarity: true == high, false == low.
word_length_bits: Option<u8>Size in bits of a single word on the SPI bus.
is_bus_controller: Option<bool>Are we in charge of the bus?
clock_polarity_high: Option<bool>Clock polarity. true == high, false == low.
clock_phase: Option<SpiClockPhase>Clock phase.
max_frequency_hz: Option<u32>Maximum bus frequency in Hz.
Trait Implementations§
Source§impl Clone for SpiChannel
impl Clone for SpiChannel
Source§fn clone(&self) -> SpiChannel
fn clone(&self) -> SpiChannel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpiChannel
impl Debug for SpiChannel
Source§impl<D> Decode<SpiChannel, D> for SpiChannelwhere
D: ResourceDialect,
impl<D> Decode<SpiChannel, D> for SpiChannelwhere
D: ResourceDialect,
Source§fn new_empty() -> SpiChannel
fn new_empty() -> SpiChannel
Creates a valid instance of
Self. The specific value does not matter,
since it will be overwritten by decode.Source§impl Default for SpiChannel
impl Default for SpiChannel
Source§fn default() -> SpiChannel
fn default() -> SpiChannel
Returns the “default value” for a type. Read more
Source§impl<D> Encode<SpiChannel, D> for &SpiChannelwhere
D: ResourceDialect,
impl<D> Encode<SpiChannel, D> for &SpiChannelwhere
D: ResourceDialect,
Source§impl PartialEq for SpiChannel
impl PartialEq for SpiChannel
Source§fn eq(&self, other: &SpiChannel) -> bool
fn eq(&self, other: &SpiChannel) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl TypeMarker for SpiChannel
impl TypeMarker for SpiChannel
Source§type Owned = SpiChannel
type Owned = SpiChannel
The owned Rust type which this FIDL type decodes into.
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Returns the minimum required alignment of the inline portion of the
encoded object. It must be a (nonzero) power of two.
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
Returns the size of the inline portion of the encoded object, including
padding for alignment. Must be a multiple of
inline_align.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned to a single memcpy.Source§impl ValueTypeMarker for SpiChannel
impl ValueTypeMarker for SpiChannel
Source§type Borrowed<'a> = &'a SpiChannel
type Borrowed<'a> = &'a SpiChannel
The Rust type to use for encoding. This is a particular
Encode<Self>
type cheaply obtainable from &Self::Owned. There are three cases: Read moreSource§fn borrow(
value: &<SpiChannel as TypeMarker>::Owned,
) -> <SpiChannel as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<SpiChannel as TypeMarker>::Owned, ) -> <SpiChannel as ValueTypeMarker>::Borrowed<'_>
Cheaply converts from
&Self::Owned to Self::Borrowed.impl Persistable for SpiChannel
impl StructuralPartialEq for SpiChannel
Auto Trait Implementations§
impl Freeze for SpiChannel
impl RefUnwindSafe for SpiChannel
impl Send for SpiChannel
impl Sync for SpiChannel
impl Unpin for SpiChannel
impl UnsafeUnpin for SpiChannel
impl UnwindSafe for SpiChannel
Blanket Implementations§
Source§impl<T> Body for Twhere
T: Persistable,
impl<T> Body for Twhere
T: Persistable,
Source§type MarkerAtTopLevel = T
type MarkerAtTopLevel = T
The marker type to use when the body is at the top-level.
Source§type MarkerInResultUnion = T
type MarkerInResultUnion = T
The marker type to use when the body is nested in a result union.
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