AN050
GD32 USBFS&USBHS Firmware Library User Guide
8
2.
Library architecture and file structure
2.1.
Library Architecture
USBFS module firmware structure of GD32 series is shown in
. The figure show USBFS host and device structure, user
application call the USBFS firmware library to realize the USB data commuction. The
underlying structure is hardware, that is MCU evaluation board. USBFS firmware library
consist of application layer and driver layer. User is able to modify application layer, while user
should not modify driver layer, which consist of host driver, device driver and USB underlying
layer. As a portion of application layer, USB application class file realize specific host or device
application class request. The library structure of USBFS and USBHS is similar.
Figure 2-1. GD32 USBFS firmware library framework
User application
main.c
USB_Class
GD32xxx_standard_peripheral
&
CMSIS
drv_usb_host.h/.c
drv_usbh_int.h/.c
usbh_core.h/.c
usbh_enum.h/.c
drv_usb_core.h/c
GD
32
U
S
B
F
S d
riv
er
A
p
p
lic
a
tio
n
la
yer
USBFS interface
(
GD32 MCU EVAL board
)
USB host
main.c
USB_Class
USB device
USB host
USB device
drv_usbd_int.h/.c
drv_usb_devcore.h/.c
usbd_core.h/.c
usbh_pipe.h/.c
drv_usb_regs.h
GD32xxxUSB firmware
usbh_usr.c
usbh_transc.h/.c
usbd_enum.h/.c
usbd_transc.h/.c
M
id
d
le
B
o
tt
o
m