AN050
GD32 USBFS&USBHS Firmware Library User Guide
27
uint8_t
(*
req_proc
)
(
usb_dev
*
udev
,
usb_req
*
req
);
/*!< device
request handler */
uint8_t
(*
set_intf
)
(
usb_dev
*
udev
,
usb_req
*
req
);
/*!< device set
interface callback */
uint8_t
(*
ctlx_in
)
(
usb_dev
*
udev
);
/*!< device
contrl in callback */
uint8_t
(*
ctlx_out
)
(
usb_dev
*
udev
);
uint8_t
(*
data_in
)
(
usb_dev
*
udev
,
uint8_t
ep_num
);
/*!< device
data in handler */
uint8_t
(*
data_out
)
(
usb_dev
*
udev
,
uint8_t
ep_num
);
/*!< device
data out handler */
uint8_t
(*
SOF
)
(
usb_dev
*
udev
);
/*!< Start
of frame handler */
uint8_t
(*
incomplete_isoc_in
)
(
usb_dev
*
udev
);
/*!<
Incomplete synchronization IN transfer handler */
uint8_t
(*
incomplete_isoc_out
)
(
usb_dev
*
udev
);
/*!<
Incomplete synchronization OUT transfer handler */
}
usb_class_core
;
The initialization of structure is realized by corresponding device class, each device class file
is saved in corresponding folder of device/class folder path.
Figure 5-3. Device class file
For example, the initialization of a HID device is as follows: