#usb-device #devices #usb #embedded-devices #peripheral #otg-hs #otg-fs

no-std esp-synopsys-usb-otg

'usb-device' implementation for Synopsys USB OTG IP cores

5 releases

0.4.2 Jul 5, 2024
0.4.1 Apr 16, 2024
0.4.0 Dec 11, 2023
0.3.2 Jul 14, 2023
0.3.1 Nov 2, 2022

#155 in Hardware support

Download history 3937/week @ 2024-08-17 4600/week @ 2024-08-24 5628/week @ 2024-08-31 3692/week @ 2024-09-07 4036/week @ 2024-09-14 4348/week @ 2024-09-21 3687/week @ 2024-09-28 4550/week @ 2024-10-05 4585/week @ 2024-10-12 5030/week @ 2024-10-19 4063/week @ 2024-10-26 4867/week @ 2024-11-02 3491/week @ 2024-11-09 4055/week @ 2024-11-16 3833/week @ 2024-11-23 3167/week @ 2024-11-30

15,410 downloads per month
Used in 2 crates

MIT license

420KB
8K SLoC

crates.io crates.io

This is a fork of synopsys-usb-otg with support for ESP32-Sx added - please use https://github.com/stm32-rs/synopsys-usb-otg when not targeting ESP32-Sx

synopsys-usb-otg

usb-device implementation for Synopsys USB OTG IP cores.

This project is a successor to the great work started by @mvirkkunen.

Supported microcontrollers

  • STM32F429xx (OTG_FS and OTG_HS in FS mode)
  • STM32F401xx
  • STM32F446xx (OTG_FS and OTG_HS in FS mode)
  • STM32F723xx (OTG_FS and OTG_HS with internal HS PHY)
  • STM32H7xxxx (OTG1_HS and OTG2_HS in FS mode, and OTG1_HS with external HS PHY)
  • And others...

Usage

This driver is intended for use through a device hal library. Such hal library should implement UsbPeripheral for the corresponding USB peripheral object. This trait declares all the peripheral properties that may vary from one device family to the other. Additionally, hal should pass fs of hs feature to the synopsys-usb-otg library to define a peripheral type:

  • fs - for FullSpeed peripherals
  • hs - for HighSpeed peripherals

Only one peripheral type can be selected at the moment.

ULPI Transciever 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. Enable the xcvrdly feature to add this delay.

Examples

See the usb-otg-workspace repo for different device-specific examples.

Dependencies

~2MB
~32K SLoC