USBD_HID_Add
Description
Adds a new instance of the HID class.
Files
usbd_hid.h/usbd_hid.c
Prototype
void USBD_HID_Add (CPU_INT08U subclass, CPU_INT08U protocol, USBD_HID_COUNTRY_CODE country_code, CPU_INT08U *p_report_desc, CPU_INT16U report_desc_len, CPU_INT08U *p_phy_desc, CPU_INT16U phy_desc_len, CPU_INT16U interval_in, CPU_INT16U interval_out, CPU_BOOLEAN ctrl_rd_en, USBD_HID_CALLBACK *p_hid_callback, USBD_ERR *p_err);
Arguments
subclass
Subclass code.
protocol
Protocol code.
country_code
Country code ID.
p_report_desc
Pointer to report descriptor structure.
report_desc_len
Report descriptor length.
p_phy_desc
Pointer to physical descriptor structure.
phy_desc_len
Physical descriptor length.
interval_in
Polling interval for input transfers, in milliseconds. It must be a power of 2.
interval_out
Polling interval for output transfers, in milliseconds. It must be a power of 2. Used only when read operations are not through control transfers.
ctrl_rd_en
Enable read operations through control transfers.
p_hid_callback
Pointer to HID descriptor and request callback structure. Can be null.
p_err
Pointer to variable that will receive the return error code from this function.
USBD_ERR_NONE
USBD_ERR_ALLOC
USBD_ERR_NULL_PTR
USBD_ERR_INVALID_ARG
USBD_ERR_FAIL
Returned Value
Class interface number, if NO error(s).
USBD_CLASS_NBR_NONE
, otherwise.
Callers
Application.
Notes / Warnings
None.