Trait synopsys_usb_otg::UsbPeripheral
source · [−]pub unsafe trait UsbPeripheral: Send + Sync {
const REGISTERS: *const ();
const HIGH_SPEED: bool;
const FIFO_DEPTH_WORDS: usize;
const ENDPOINT_COUNT: usize;
fn enable();
fn ahb_frequency_hz(&self) -> u32;
fn phy_type(&self) -> PhyType { ... }
fn setup_internal_hs_phy(&self) { ... }
}
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 USB OTG peripherals.
Required Associated Constants
sourceconst HIGH_SPEED: bool
const HIGH_SPEED: bool
true for High Speed variants of the peripheral, false for Full Speed
sourceconst FIFO_DEPTH_WORDS: usize
const FIFO_DEPTH_WORDS: usize
FIFO size in 32-bit words
sourceconst ENDPOINT_COUNT: usize
const ENDPOINT_COUNT: usize
Number of (bidirectional) endpoints
Required Methods
sourcefn ahb_frequency_hz(&self) -> u32
fn ahb_frequency_hz(&self) -> u32
AHB frequency in hertz
Provided Methods
sourcefn setup_internal_hs_phy(&self)
fn setup_internal_hs_phy(&self)
Performs initial setup of the internal high-speed PHY
This function should turn on LDO and PLL and wait for PHY clock to become stable.