Struct stm32_hal2::usb::UsbBus[][src]

pub struct UsbBus<USB> { /* fields omitted */ }

USB peripheral driver for STM32 microcontrollers.

Implementations

impl<USB> UsbBus<USB> where
    USB: UsbPeripheral
[src]

pub fn new(peripheral: USB) -> UsbBusAllocator<UsbBus<USB>>[src]

Constructs a new USB peripheral driver.

pub fn free(self) -> USB[src]

pub fn force_reenumeration<F>(&self, disconnect: F) where
    F: FnOnce(), 
[src]

Simulates a disconnect from the USB bus, causing the host to reset and re-enumerate the device.

Mostly used for development. By calling this at the start of your program ensures that the host re-enumerates your device after a new program has been flashed.

disconnect parameter is used to provide a custom disconnect function. This function will be called with USB peripheral powered down and interrupts disabled. It should perform disconnect in a platform-specific way.

Trait Implementations

impl<USB> UsbBus for UsbBus<USB> where
    USB: UsbPeripheral
[src]

Auto Trait Implementations

impl<USB> Send for UsbBus<USB> where
    USB: Send

impl<USB> Sync for UsbBus<USB> where
    USB: Send + Sync

impl<USB> Unpin for UsbBus<USB> where
    USB: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.