Struct CmsisDapV2Class
pub struct CmsisDapV2Class<'d, D>where
D: Driver<'d>,{ /* private fields */ }Expand description
USB device class for CMSIS-DAP v2 probes.
Implementations§
§impl<'d, D> CmsisDapV2Class<'d, D>where
D: Driver<'d>,
impl<'d, D> CmsisDapV2Class<'d, D>where
D: Driver<'d>,
pub fn new(
builder: &mut Builder<'d, D>,
state: &'d mut State,
max_packet_size: u16,
trace: bool,
) -> CmsisDapV2Class<'d, D>
pub fn new( builder: &mut Builder<'d, D>, state: &'d mut State, max_packet_size: u16, trace: bool, ) -> CmsisDapV2Class<'d, D>
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.
pub async fn wait_connection(&mut self)
pub async fn wait_connection(&mut self)
Waits for the USB host to enable this interface
pub 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.
pub 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.
pub 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> UnsafeUnpin 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