pub struct UsbSerialJtag<'d, Dm: DriverMode> { /* private fields */ }unstable only.Expand description
USB Serial/JTAG (Full-duplex)
Implementations§
Source§impl<'d> UsbSerialJtag<'d, Blocking>
impl<'d> UsbSerialJtag<'d, Blocking>
Sourcepub fn new(usb_device: impl Peripheral<P = USB_DEVICE> + 'd) -> Self
pub fn new(usb_device: impl Peripheral<P = USB_DEVICE> + 'd) -> Self
Create a new USB serial/JTAG instance with defaults
Sourcepub fn into_async(self) -> UsbSerialJtag<'d, Async>
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,
impl<'d, Dm> UsbSerialJtag<'d, Dm>where
Dm: DriverMode,
Sourcepub fn split(self) -> (UsbSerialJtagRx<'d, Dm>, UsbSerialJtagTx<'d, Dm>)
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.
Sourcepub fn write(&mut self, data: &[u8]) -> Result<(), Infallible>
pub fn write(&mut self, data: &[u8]) -> Result<(), Infallible>
Write data to the serial output in chunks of up to 64 bytes
Sourcepub fn write_byte_nb(&mut self, word: u8) -> Result<(), Infallible>
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)
Sourcepub fn flush_tx(&mut self) -> Result<(), Infallible>
pub fn flush_tx(&mut self) -> Result<(), Infallible>
Flush the output FIFO and block until it has been sent
Sourcepub fn flush_tx_nb(&mut self) -> Result<(), Infallible>
pub fn flush_tx_nb(&mut self) -> Result<(), Infallible>
Flush the output FIFO but don’t block if it isn’t ready immediately
Sourcepub fn read_byte(&mut self) -> Result<u8, Infallible>
pub fn read_byte(&mut self) -> Result<u8, Infallible>
Read a single byte but don’t block if it isn’t ready immediately
Sourcepub fn listen_rx_packet_recv_interrupt(&mut self)
pub fn listen_rx_packet_recv_interrupt(&mut self)
Listen for RX-PACKET-RECV interrupts
Sourcepub fn unlisten_rx_packet_recv_interrupt(&mut self)
pub fn unlisten_rx_packet_recv_interrupt(&mut self)
Stop listening for RX-PACKET-RECV interrupts
Sourcepub fn rx_packet_recv_interrupt_set(&mut self) -> bool
pub fn rx_packet_recv_interrupt_set(&mut self) -> bool
Checks if RX-PACKET-RECV interrupt is set
Sourcepub fn reset_rx_packet_recv_interrupt(&mut self)
pub fn reset_rx_packet_recv_interrupt(&mut self)
Reset RX-PACKET-RECV interrupt
Sourcepub fn set_interrupt_handler(&mut self, handler: InterruptHandler)
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>
impl<'d> UsbSerialJtag<'d, Async>
Sourcepub fn into_blocking(self) -> UsbSerialJtag<'d, Blocking>
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.
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§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.
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)
fn set_interrupt_handler(&mut self, handler: InterruptHandler)
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.
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>
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Source§async fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf. Read moreSource§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.
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>
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Source§fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf. Read moreSource§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.
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>
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Source§impl<Dm> Write for UsbSerialJtag<'_, Dm>where
Dm: DriverMode,
impl<Dm> Write for UsbSerialJtag<'_, Dm>where
Dm: DriverMode,
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.
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>
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Source§fn flush(&mut self) -> Result<(), Self::Error>
fn flush(&mut self) -> Result<(), Self::Error>
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.
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§fn write_str(&mut self, s: &str) -> Result<(), Self::Error>
fn write_str(&mut self, s: &str) -> Result<(), Self::Error>
Source§fn write_char(&mut self, ch: char) -> Result<(), Self::Error>
fn write_char(&mut self, ch: char) -> Result<(), Self::Error>
char] into this writer, returning whether the write succeeded. Read more