[−][src]Struct wishbone_bridge::SpiBridge
Describes a connection to a SPI bus. Note that not all platforms support SPI connections.
Implementations
impl SpiBridge
[src]
A builder to create a connection to a target via SPI. These connections are currently only supported on Raspberry Pi through the use of bit-banging. There are interesting opportunities to add support for SPI connections to other platforms.
use wishbone_bridge::SpiBridge; let bridge = SpiBridge::new("2,3,4,18").unwrap().create().unwrap();
pub fn new(pinspec: &str) -> Result<Self, String>
[src]
Create a new SpiBridge struct with the provided pinspec
.
This spec is a comma-delimited list of pins to use for the SPI connection.
The number of pins provided indicates the type of connection to use:
2: Use two-wire communication (no chip select, shared I/O line)
3: Use three-wire communication (chip select, shared I/O line)
4: Use four-wire communication (chip select, output, and input lines)
This function returns an error if the spec cannot be parsed.
pub fn create(&self) -> Result<Bridge, BridgeError>
[src]
Create a Bridge
struct based on the current configuration.
This will return an error on platforms that do not support SPI.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SpiBridge
impl Send for SpiBridge
impl Sync for SpiBridge
impl Unpin for SpiBridge
impl UnwindSafe for SpiBridge
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,