[][src]Struct stm32_usbd::bus::UsbBus

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

USB peripheral driver for STM32 microcontrollers.

Methods

impl<PINS: UsbPins + Sync> UsbBus<PINS>[src]

pub fn new(regs: USB, _pins: PINS) -> UsbBusAllocator<Self>[src]

Constructs a new USB peripheral driver.

pub fn force_reenumeration<F: FnOnce()>(&mut self, disconnect: F)[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<PINS: Send + Sync> UsbBus for UsbBus<PINS>[src]

fn force_reset(&self) -> Result<(), UsbError>[src]

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

Auto Trait Implementations

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

impl<PINS> Sync for UsbBus<PINS> where
    PINS: Sync

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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

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.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self