[][src]Struct buspirate::BusPirate

pub struct BusPirate<TX: Write<u8>, RX: Read<u8>> { /* fields omitted */ }

BusPirate represents a Bus Pirate device in its normal terminal mode, not yet initialized into any binary mode.

The primary method on BusPirate is to_bitbang, which transitions the device into "binary bit-bang" mode. That mode then also allows transitions into the other binary modes.

let bb = bp.to_bitbang()?;

Methods

impl<TX, RX, TXErr, RXErr> BusPirate<TX, RX> where
    TX: Write<u8, Error = TXErr>,
    RX: Read<u8, Error = RXErr>, 
[src]

pub fn new(tx: TX, rx: RX) -> Self[src]

BusPirate::new associates some serial channels with a new BusPirate object.

The transmit and receive objects are consumed. If the caller needs to access them again, it must call release to discard the BusPirate object and recover the original objects.

pub fn to_bitbang(self) -> Result<BitBang<TX, RX>, Error<TXErr, RXErr>>[src]

to_bitbang directs the Bus Pirate to move into "binary bit-bang" mode.

The Bus Pirate requires several steps to properly switch from terminal mode into binary bitbang mode, so this method can potentially be slow due to sending and receiving several characters.

to_bitbang consumes the BusPirate object and returns a BitBang object in its place. To recover the BusPirate object, call close on the BitBang object to reset the Bus Pirate back into terminal mode.

pub fn release(self) -> (TX, RX)[src]

release returns the serial transmit and receive objects wrapped by the BusPirate object.

This consumes the BusPirate object.

Trait Implementations

impl<TX: Debug + Write<u8>, RX: Debug + Read<u8>> Debug for BusPirate<TX, RX>[src]

impl<TX: Clone + Write<u8>, RX: Clone + Read<u8>> Clone for BusPirate<TX, RX>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<TX, RX> Send for BusPirate<TX, RX> where
    RX: Send,
    TX: Send

impl<TX, RX> Sync for BusPirate<TX, RX> where
    RX: Sync,
    TX: Sync

impl<TX, RX> Unpin for BusPirate<TX, RX> where
    RX: Unpin,
    TX: Unpin

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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

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.

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

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

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