Struct UsbSerialJtag

Source
pub struct UsbSerialJtag<'d, Dm: DriverMode> { /* private fields */ }
Available on crate feature unstable only.
Expand description

USB Serial/JTAG (Full-duplex)

Implementations§

Source§

impl<'d> UsbSerialJtag<'d, Blocking>

Source

pub fn new(usb_device: impl Peripheral<P = USB_DEVICE> + 'd) -> Self

Create a new USB serial/JTAG instance with defaults

Source

pub fn into_async(self) -> UsbSerialJtag<'d, Async>

Reconfigure the USB Serial JTAG peripheral to operate in asynchronous mode.

Source§

impl<'d, Dm> UsbSerialJtag<'d, Dm>
where Dm: DriverMode,

Source

pub fn split(self) -> (UsbSerialJtagRx<'d, Dm>, UsbSerialJtagTx<'d, Dm>)

Split the USB Serial JTAG peripheral into a transmitter and receiver, which is particularly useful when having two tasks correlating to transmitting and receiving.

Source

pub fn write(&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<(), 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<(), Infallible>

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

Source

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

Read a single byte but don’t block if it isn’t ready immediately

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

Source

pub fn set_interrupt_handler(&mut self, handler: InterruptHandler)

Registers an interrupt handler for the USB Serial JTAG peripheral.

Note that this will replace any previously registered interrupt handlers.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

impl<'d> UsbSerialJtag<'d, Async>

Source

pub fn into_blocking(self) -> UsbSerialJtag<'d, Blocking>

Reconfigure the USB Serial JTAG peripheral to operate in blocking mode.

Trait Implementations§

Source§

impl<Dm> ErrorType for UsbSerialJtag<'_, Dm>
where Dm: DriverMode,

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

type Error = Infallible

Error type of all the IO operations on this type.
Source§

impl InterruptConfigurable for UsbSerialJtag<'_, Blocking>

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

fn set_interrupt_handler(&mut self, handler: InterruptHandler)

Registers an interrupt handler for the peripheral. Read more
Source§

impl Read for UsbSerialJtag<'_, Async>

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>

Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Source§

async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>

Read the exact number of bytes required to fill buf. Read more
Source§

impl<Dm> Read for UsbSerialJtag<'_, Dm>
where Dm: DriverMode,

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>

Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Source§

fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>

Read the exact number of bytes required to fill buf. Read more
Source§

impl Write for UsbSerialJtag<'_, Async>

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>

Write a buffer into this writer, returning how many bytes were written. Read more
Source§

async fn flush(&mut self) -> Result<(), Self::Error>

Flush this output stream, ensuring that all intermediately buffered contents reach their destination.
Source§

async fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error>

Write an entire buffer into this writer. Read more
Source§

impl<Dm> Write for UsbSerialJtag<'_, Dm>
where Dm: DriverMode,

Source§

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

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

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§

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

Glue for usage of the [write!] macro with implementors of this trait. Read more
Source§

impl<Dm> Write for UsbSerialJtag<'_, Dm>
where Dm: DriverMode,

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>

Write a buffer into this writer, returning how many bytes were written. Read more
Source§

fn flush(&mut self) -> Result<(), Self::Error>

Flush this output stream, blocking until all intermediately buffered contents reach their destination.
Source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error>

Write an entire buffer into this writer. Read more
Source§

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

Write a formatted string into this writer, returning any error encountered. Read more
Source§

impl<Dm> uWrite for UsbSerialJtag<'_, Dm>
where Dm: DriverMode,

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

type Error = Infallible

The error associated to this writer
Source§

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

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

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

Writes a [char] into this writer, returning whether the write succeeded. Read more

Auto Trait Implementations§

§

impl<'d, Dm> Freeze for UsbSerialJtag<'d, Dm>

§

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

§

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

§

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

§

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

§

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

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
§

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

Performs the conversion.
§

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

§

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

The type returned in the event of a conversion error.
§

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

Performs the conversion.