Trait UsbPeripheral

Source
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§

Source

const REGISTERS: *const ()

Pointer to the register block

Source

const DP_PULL_UP_FEATURE: bool

Embedded pull-up resistor on USB_DP line

Source

const EP_MEMORY: *const ()

Pointer to the endpoint memory

Source

const EP_MEMORY_SIZE: usize

Endpoint memory size in bytes

Source

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§

Source

fn enable()

Enables USB device on its peripheral bus

Source

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.

Implementors§