AN050
GD32 USBFS&USBHS Firmware Library User Guide
49
6.
USBFS Host Library
6.1.
Host Library Configuration
6.1.1.
usbh_conf.h
File configuration item is shown as below.
#define USBH_MAX_EP_NUM 2
#define USBH_MAX_INTERFACES_NUM 2
#define USBH_MAX_ALT_SETTING 2
#define USBH_MAX_SUPPORTED_CLASS 2
#define USBH_DATA_BUF_MAX_LEN 0x200
#define USBH_CFGSET_MAX_LEN 0x200
Each configuration is defined as
Table 6-1. usbh_conf.h Configuration description
Table 6-1
. usbh_conf.h Configuration description
Configuration name
Functional description
USBH_MAX_EP_NUM
Maximum number of endpoints
USBH_MAX_INTERFACES_NUM
Maximum number of interfaces
USBH_MAX_ALT_SETTING
Maximum number of alternate interfaces
USBH_MAX_SUPPORTED_CLASS
Maximum number of supported device classes
USBH_DATA_BUF_MAX_LEN
Maximum length of data buffer
USBH_CFGSET_MAX_LEN
Maximum length of configuration descriptor set
6.1.2.
usb_conf.h
#ifdef USB_FS_CORE
#define USB_RX_FIFO_FS_SIZE 128
#define USB_HTX_NPFIFO_FS_SIZE 96
#define USB_HTX_PFIFO_FS_SIZE 96
#endif
#ifdef USB_HS_CORE
#define USB_RX_FIFO_HS_SIZE 512
#define USB_HTX_NPFIFO_HS_SIZE 256
#define USB_HTX_PFIFO_HS_SIZE 256
#ifdef USE_ULPI_PHY
#define USB_ULPI_PHY_ENABLED
#endif