pub struct CmsisDapV2Class<'d, D: Driver<'d>> { /* private fields */ }
Expand description
USB device class for CMSIS-DAP v2 probes.
Implementations§
Source§impl<'d, D: Driver<'d>> CmsisDapV2Class<'d, D>
impl<'d, D: Driver<'d>> CmsisDapV2Class<'d, D>
Sourcepub fn new(
builder: &mut Builder<'d, D>,
state: &'d mut State,
max_packet_size: u16,
trace: bool,
) -> Self
pub fn new( builder: &mut Builder<'d, D>, state: &'d mut State, max_packet_size: u16, trace: bool, ) -> Self
Creates a new CmsisDapV2Class with the provided UsbBus and max_packet_size
in bytes. For
full-speed devices, max_packet_size
has to be 64.
The trace
parameter enables the trace output endpoint. This is optional and can be
disabled if the probe does not support trace output.
Sourcepub async fn wait_connection(&mut self)
pub async fn wait_connection(&mut self)
Waits for the USB host to enable this interface
Sourcepub async fn write_packet(&mut self, data: &[u8]) -> Result<(), EndpointError>
pub async fn write_packet(&mut self, data: &[u8]) -> Result<(), EndpointError>
Write data to the host.
Sourcepub async fn write_trace(&mut self, data: &[u8]) -> Result<(), EndpointError>
pub async fn write_trace(&mut self, data: &[u8]) -> Result<(), EndpointError>
Write data to the host via the trace output endpoint.
Returns EndpointError::Disabled
if the trace output endpoint is not enabled.
Sourcepub async fn read_packet(
&mut self,
data: &mut [u8],
) -> Result<usize, EndpointError>
pub async fn read_packet( &mut self, data: &mut [u8], ) -> Result<usize, EndpointError>
Read data from the host.
Auto Trait Implementations§
impl<'d, D> Freeze for CmsisDapV2Class<'d, D>
impl<'d, D> RefUnwindSafe for CmsisDapV2Class<'d, D>
impl<'d, D> Send for CmsisDapV2Class<'d, D>
impl<'d, D> Sync for CmsisDapV2Class<'d, D>
impl<'d, D> Unpin for CmsisDapV2Class<'d, D>
impl<'d, D> UnwindSafe for CmsisDapV2Class<'d, D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more