pub struct UsbDeviceEmulation<P: CheckedPermissions>(/* private fields */);Implementations§
Source§impl<P: CheckedPermissions> UsbDeviceEmulation<P>
impl<P: CheckedPermissions> UsbDeviceEmulation<P>
Sourcepub fn register_interface<const N: usize>(
&mut self,
config: UsbInterfaceConfig<'_, N>,
) -> Result<(UsbRegisteredInterface<P>, [UsbEmulatedEndpoint<P>; N]), UsbError>where
P: MessageAllowed<RegisterInterface>,
pub fn register_interface<const N: usize>(
&mut self,
config: UsbInterfaceConfig<'_, N>,
) -> Result<(UsbRegisteredInterface<P>, [UsbEmulatedEndpoint<P>; N]), UsbError>where
P: MessageAllowed<RegisterInterface>,
Register a disabled interface driver with explicit runtime visibility control.
Returns a stable interface handle and the allocated endpoints.
Call UsbRegisteredInterface::set_enabled after local setup is ready.
Sourcepub fn wait_for_connection(&self) -> Result<(), UsbError>where
P: MessageAllowed<WaitForConnection>,
pub fn wait_for_connection(&self) -> Result<(), UsbError>where
P: MessageAllowed<WaitForConnection>,
Wait until the device is configured by the host
pub fn is_enabled(&self) -> Result<bool, UsbError>where
P: MessageAllowed<IsDeviceEmulationEnabled>,
pub fn is_connected(&self) -> Result<bool, UsbError>where
P: MessageAllowed<IsDeviceEmulationConnected>,
Sourcepub fn is_cable_connected(&self) -> Result<bool, UsbError>where
P: MessageAllowed<IsCableConnected>,
pub fn is_cable_connected(&self) -> Result<bool, UsbError>where
P: MessageAllowed<IsCableConnected>,
Returns true if the USB cable is connected (VBUS has power)
Sourcepub fn is_device_mode(&self) -> Result<bool, UsbError>where
P: MessageAllowed<IsDeviceMode>,
pub fn is_device_mode(&self) -> Result<bool, UsbError>where
P: MessageAllowed<IsDeviceMode>,
Returns true if in USB device mode (not acting as USB host via OTG)
pub fn set_custom_vid_pid(&mut self, vid: Option<u16>, pid: Option<u16>)where
P: MessageAllowed<SetVidPid>,
pub fn reset_controller(&mut self)where
P: MessageAllowed<ResetController>,
Trait Implementations§
Source§impl<P: Default + CheckedPermissions> Default for UsbDeviceEmulation<P>
impl<P: Default + CheckedPermissions> Default for UsbDeviceEmulation<P>
Source§fn default() -> UsbDeviceEmulation<P>
fn default() -> UsbDeviceEmulation<P>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<P> Freeze for UsbDeviceEmulation<P>
impl<P> RefUnwindSafe for UsbDeviceEmulation<P>
impl<P> Send for UsbDeviceEmulation<P>
impl<P> Sync for UsbDeviceEmulation<P>
impl<P> Unpin for UsbDeviceEmulation<P>
impl<P> UnwindSafe for UsbDeviceEmulation<P>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.