Loading...
Searching...
No Matches
usbdev_stm32.h File Reference

USB interface functions for the stm32 OTG FS/HS class devices. More...

Detailed Description

USB interface functions for the stm32 OTG FS/HS class devices.

The stm32f2, stm32f4 and stm32f7 have a common USB OTG FS capable USB peripheral.

Two versions are currently known to exist with subtle differences in some registers. The CID register of the peripheral indicates this version, 0x00001200 for one version of the full speed peripheral and 0x00002000 for the other version of the full speed peripheral. The main difference is in the GCCFG register, where the 1.2 version has a NOVBUSSENS bit and the 2.0 version has a VBDEN bit. This difference is used to detect the IP version. The 2.0 version also has more advanced USB low power mode support.

For the end user, the main difference is the 1.2 version having 4 endpoints and the 2.0 version having 6 endpoints. The 2.0 version also supports a number of USB low power modes.

Author
Koen Zandberg koen@.nosp@m.berg.nosp@m.zand..nosp@m.net

Definition in file usbdev_stm32.h.

#include <stdint.h>
#include <stdlib.h>
#include "periph_cpu.h"
#include "periph/usbdev.h"
+ Include dependency graph for usbdev_stm32.h:

Go to the source code of this file.

Data Structures

struct  stm32_usbdev_fs_t
 stm32 USB Device FS only peripheral device context More...
 

Macros

#define DWC2_USB_OTG_FS_NUM_EP   STM32_USB_OTG_FS_NUM_EP
 Number of endpoints available with the OTG FS peripheral including the control endpoint.
 
#define DWC2_USB_OTG_HS_NUM_EP   STM32_USB_OTG_HS_NUM_EP
 Number of endpoints available with the OTG HS peripheral including the control endpoint.
 
#define DWC2_USB_OTG_FS_RX_FIFO_SIZE   (128U)
 USB OTG FS FIFO reception buffer space in 32-bit words.
 
#define DWC2_USB_OTG_HS_RX_FIFO_SIZE   (512U)
 USB OTG HS FIFO reception buffer space in 32-bit words.
 
#define USB_OTG_FS_TOTAL_FIFO_SIZE   (1280U)
 USB OTG FS FIFO total size in bytes.
 
#define USB_OTG_HS_TOTAL_FIFO_SIZE   (4096U)
 USB OTG FS FIFO total size in bytes.
 
#define DWC2_USB_OTG_FS_TOTAL_FIFO_SIZE   USB_OTG_FS_TOTAL_FIFO_SIZE
 USB OTG FS FIFO total size in bytes.
 
#define DWC2_USB_OTG_HS_TOTAL_FIFO_SIZE   USB_OTG_HS_TOTAL_FIFO_SIZE
 USB OTG HS FIFO total size in bytes.