pub unsafe trait UsbPeripheral: Send + Sync {
const REGISTERS: *const ();
const DP_PULL_UP_FEATURE: bool;
const EP_MEMORY: *const ();
const EP_MEMORY_SIZE: usize;
const EP_MEMORY_ACCESS_2X16: bool;
// Required methods
fn enable();
fn startup_delay();
}
Expand description
A trait for device-specific USB peripherals. Implement this to add support for a new hardware platform. Peripherals that have this trait must have the same register block as STM32 USBFS peripherals.
Required Associated Constants§
Sourceconst DP_PULL_UP_FEATURE: bool
const DP_PULL_UP_FEATURE: bool
Embedded pull-up resistor on USB_DP line
Sourceconst EP_MEMORY_SIZE: usize
const EP_MEMORY_SIZE: usize
Endpoint memory size in bytes
Sourceconst EP_MEMORY_ACCESS_2X16: bool
const EP_MEMORY_ACCESS_2X16: bool
Endpoint memory access scheme
Check Reference Manual for details.
Set to true
if “2x16 bits/word” access scheme is used, otherwise set to false
.
Required Methods§
Sourcefn startup_delay()
fn startup_delay()
Performs a chip specific startup delay
This function is called in UsbBus::enable()
after deasserting the pdwn
bit and before
peripheral initialization.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.