[][src]Struct wishbone_bridge::SpiBridge

pub struct SpiBridge { /* fields omitted */ }

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

impl Clone for SpiBridge[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.