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_usb_otg_fshs_t
 stm32 USB OTG peripheral device context More...
 

Macros

#define STM32_USB_OTG_BUF_SPACE   USBDEV_EP_BUF_SPACE
 Buffer space available for endpoint TX/RX data.
 
#define STM32_USB_OTG_FS_RX_FIFO_SIZE   (128U)
 Number of endpoints available with the OTG FS peripheral including the control endpoint. More...
 
#define STM32_USB_OTG_HS_RX_FIFO_SIZE   (512U)
 USB OTG HS FIFO reception buffer space in 32-bit words. More...
 
#define STM32_USB_OTG_HS_USE_DMA   (1)
 Use the built-in DMA controller of the HS peripheral when possible.