pub struct UsbSerialJtag<'d, T> { /* private fields */ }

Implementations§

source§

impl<'d, T> UsbSerialJtag<'d, T>where T: Instance,

source

pub fn new(usb_serial: impl Peripheral<P = T> + 'd) -> UsbSerialJtag<'d, T>

Create a new USB serial/JTAG instance with defaults

source

pub fn write_bytes(&mut self, data: &[u8]) -> Result<(), Infallible>

Write data to the serial output in chunks of up to 64 bytes

source

pub fn write_byte_nb(&mut self, word: u8) -> Result<(), Error<Infallible>>

Write data to the serial output in a non-blocking manner Requires manual flushing (automatically flushed every 64 bytes)

source

pub fn flush_tx(&mut self) -> Result<(), Infallible>

Flush the output FIFO and block until it has been sent

source

pub fn flush_tx_nb(&mut self) -> Result<(), Error<Infallible>>

Flush the output FIFO but don’t block if it isn’t ready immediately

source

pub fn read_byte(&mut self) -> Result<u8, Error<Infallible>>

source

pub fn listen_rx_packet_recv_interrupt(&mut self)

Listen for RX-PACKET-RECV interrupts

source

pub fn unlisten_rx_packet_recv_interrupt(&mut self)

Stop listening for RX-PACKET-RECV interrupts

source

pub fn rx_packet_recv_interrupt_set(&mut self) -> bool

Checks if RX-PACKET-RECV interrupt is set

source

pub fn reset_rx_packet_recv_interrupt(&mut self)

Reset RX-PACKET-RECV interrupt

Trait Implementations§

source§

impl<T> Read<u8> for UsbSerialJtag<'_, T>where T: Instance,

§

type Error = Infallible

Read error
source§

fn read( &mut self ) -> Result<u8, Error<<UsbSerialJtag<'_, T> as Read<u8>>::Error>>

Reads a single word from the serial interface
source§

impl<T> Write<u8> for UsbSerialJtag<'_, T>where T: Instance,

§

type Error = Infallible

Write error
source§

fn write( &mut self, word: u8 ) -> Result<(), Error<<UsbSerialJtag<'_, T> as Write<u8>>::Error>>

Writes a single word to the serial interface
source§

fn flush( &mut self ) -> Result<(), Error<<UsbSerialJtag<'_, T> as Write<u8>>::Error>>

Ensures that none of the previously written words are still buffered
source§

impl<T> Write for UsbSerialJtag<'_, T>where T: Instance,

source§

fn write_str(&mut self, s: &str) -> Result<(), Error>

Writes a string slice into this writer, returning whether the write succeeded. Read more
1.1.0 · source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a char into this writer, returning whether the write succeeded. Read more
1.0.0 · source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the write! macro with implementors of this trait. Read more

Auto Trait Implementations§

§

impl<'d, T> RefUnwindSafe for UsbSerialJtag<'d, T>where T: RefUnwindSafe,

§

impl<'d, T> Send for UsbSerialJtag<'d, T>where T: Send,

§

impl<'d, T> Sync for UsbSerialJtag<'d, T>where T: Sync,

§

impl<'d, T> Unpin for UsbSerialJtag<'d, T>where T: Unpin,

§

impl<'d, T> !UnwindSafe for UsbSerialJtag<'d, T>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.