[−][src]Struct stm32_usbd::bus::UsbBus
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 alloc_ep(
&mut self,
ep_dir: UsbDirection,
ep_addr: Option<EndpointAddress>,
ep_type: EndpointType,
max_packet_size: u16,
_interval: u8
) -> Result<EndpointAddress>
[src]
&mut self,
ep_dir: UsbDirection,
ep_addr: Option<EndpointAddress>,
ep_type: EndpointType,
max_packet_size: u16,
_interval: u8
) -> Result<EndpointAddress>
fn enable(&mut self)
[src]
fn reset(&self)
[src]
fn set_device_address(&self, addr: u8)
[src]
fn poll(&self) -> PollResult
[src]
fn write(&self, ep_addr: EndpointAddress, buf: &[u8]) -> Result<usize>
[src]
fn read(&self, ep_addr: EndpointAddress, buf: &mut [u8]) -> Result<usize>
[src]
fn set_stalled(&self, ep_addr: EndpointAddress, stalled: bool)
[src]
fn is_stalled(&self, ep_addr: EndpointAddress) -> bool
[src]
fn suspend(&self)
[src]
fn resume(&self)
[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,
PINS: Send,
impl<PINS> Sync for UsbBus<PINS> where
PINS: Sync,
PINS: Sync,
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self