[][src]Struct usbd_blaster::Blaster

pub struct Blaster<'a, B: UsbBus, E, TDI: OutputPin<Error = E>, TCK: OutputPin<Error = E>, TMS: OutputPin<Error = E>, TDO: InputPin<Error = E>> { /* fields omitted */ }

Blaster device class

Methods

impl<'a, B: UsbBus, E, TDI: OutputPin<Error = E>, TCK: OutputPin<Error = E>, TMS: OutputPin<Error = E>, TDO: InputPin<Error = E>> Blaster<'a, B, E, TDI, TCK, TMS, TDO>[src]

pub fn new(
    alloc: &'a UsbBusAllocator<B>,
    tdi: TDI,
    tck: TCK,
    tms: TMS,
    tdo: TDO
) -> Blaster<'a, B, E, TDI, TCK, TMS, TDO>
[src]

Allocate a Blaster on the USB bus. Takes control of the four JTAG pins. The JTAG pins can be any pins you want, just make sure you assign them correctly.

pub fn read(&mut self) -> Result<usize>[src]

Read data from the host output endpoint into the Blaster's internal read buffer.

pub fn write(&mut self, heartbeat: bool) -> Result<usize>[src]

Write data to the host input endpoint from the Blaster's internal write buffer. The heartbeat parameter must be true at least once every 10 milliseconds, so that the blaster can output the modem status. See libftdi ftdi.c for more on this. Otherwise, a BSOD could occur on Windows A safe default for the heartbeat seems to be true all the time. This will output the modem status whenever the host reads the device.

pub fn handle(&mut self) -> Result<(), E>[src]

Runs all pending operations from the internal read buffer until either no operations are left or the internal write buffer is full. If a GPIO error occurs, the JTAG state machine will enter an undefined state requiring a forced USB bus reset.

Trait Implementations

impl<'_, B, E, TDI: OutputPin<Error = E>, TCK: OutputPin<Error = E>, TMS: OutputPin<Error = E>, TDO: InputPin<Error = E>> UsbClass<B> for Blaster<'_, B, E, TDI, TCK, TMS, TDO> where
    B: UsbBus,
    E: Debug
[src]

Auto Trait Implementations

impl<'a, B, E, TDI, TCK, TMS, TDO> Send for Blaster<'a, B, E, TDI, TCK, TMS, TDO> where
    TCK: Send,
    TDI: Send,
    TDO: Send,
    TMS: Send

impl<'a, B, E, TDI, TCK, TMS, TDO> Sync for Blaster<'a, B, E, TDI, TCK, TMS, TDO> where
    TCK: Sync,
    TDI: Sync,
    TDO: Sync,
    TMS: Sync

impl<'a, B, E, TDI, TCK, TMS, TDO> Unpin for Blaster<'a, B, E, TDI, TCK, TMS, TDO> where
    TCK: Unpin,
    TDI: Unpin,
    TDO: Unpin,
    TMS: Unpin

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, 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.