Struct Config
#[non_exhaustive]pub struct Config {
pub vbus_detection: bool,
pub xcvrdly: bool,
}
Expand description
USB driver config.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.vbus_detection: bool
Enable VBUS detection.
The USB spec requires USB devices monitor for USB cable plug/unplug and react accordingly. This is done by checking whether there is 5V on the VBUS pin or not.
If your device is bus-powered (powers itself from the USB host via VBUS), then this is optional. (If there’s no power in VBUS your device would be off anyway, so it’s fine to always assume there’s power in VBUS, i.e. the USB cable is always plugged in.)
If your device is self-powered (i.e. it gets power from a source other than the USB cable, and therefore can stay powered through USB cable plug/unplug) then you MUST set this to true.
If you set this to true, you must connect VBUS to PA9 for FS, PB13 for HS, possibly with a voltage divider. See ST application note AN4879 and the reference manual for more details.
xcvrdly: bool
Enable transceiver delay.
Some ULPI PHYs like the Microchip USB334x series require a delay between the ULPI register write that initiates the HS Chirp and the subsequent transmit command, otherwise the HS Chirp does not get executed and the deivce enumerates in FS mode. Some USB Link IP like those in the STM32H7 series support adding this delay to work with the affected PHYs.
Trait Implementations§
impl Copy for Config
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)