AN050
GD32 USBFS&USBHS Firmware Library User Guide
19
#ifdef USB_FS_CORE
#define RX_FIFO_FS_SIZE 128
#define TX0_FIFO_FS_SIZE 64
#define TX1_FIFO_FS_SIZE 128
#define TX2_FIFO_FS_SIZE 0
#define TX3_FIFO_FS_SIZE 0
#endif
/* USB_FS_CORE */
#define USB_SOF_OUTPUT 1
#define USB_LOW_POWER 1
//#define VBUS_SENSING_ENABLED
//#define USE_HOST_MODE
#define USE_DEVICE_MODE
//#define USE_OTG_MODE
Table 5-2
. usb_conf.h configuration description
Configuration name
Functional description
RX_FIFO_FS_SIZE
RX FIFO size configuration
TX_FIFO_FS_SIZE
TX FIFO size configuration
USB_SOF_OUTPUT
enable SOF output
USB_LOW_POWER
enable low power mode
VBUS_SENSING_ENABLED
enable VBUS SENSING
USE_HOST_MODE
host mode
USE_DEVICE_MODE
device mode
USE_OTG_MODE
OTG mode
Note:
1.
If user need to measure the SOF with an oscilloscope, it is necessary to configure the
PA8 pin as the output function.
2.
Only one of USE_HOST_MODE, USE_DEVICE_MODE and USE_OTG_MODE coule be
selected.
3.
GD32F105xx/107xx
and
GD32F205xx/F207xx
series
don`t
has
VBUS_SENSING_ENABLED function, if USB module is configured as device, user
should connect VBUS pin.
5.2.
Firmware library process
USBFS firmware library flow include clock configuration, interrupt enable, USB register
configuration, endpoint configuration, connect, enumeration and data transfer.As shown in