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: MemoryAccess;
// 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: MemoryAccess
const EP_MEMORY_ACCESS: MemoryAccess
Endpoint memory access scheme
See MemoryAccess
enum for more details. Check Reference Manual to determine the correct access scheme to use.
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.