![]() |
NUC472_NUC442_BSP V3.03.004
The Board Support Package for NUC472/NUC442
|
Functions | |
void | USBH_HidInit (void) |
Init USB Host HID driver. More... | |
HID_DEV_T * | USBH_HidGetDeviceList (void) |
Get a list of currently connected USB Hid devices. More... | |
int32_t | HID_HidGetReportDescriptor (HID_DEV_T *hdev, uint8_t *desc_buf, int buf_max_len) |
Get report descriptor request. More... | |
int32_t | HID_HidGetReport (HID_DEV_T *hdev, int rtp_typ, int rtp_id, uint8_t *data, int len) |
HID class standard request Get_Report request. The Get_Report request allows the host to receive a report via the Control pipe. More... | |
int32_t | HID_HidSetReport (HID_DEV_T *hdev, int rtp_typ, int rtp_id, uint8_t *data, int len) |
HID class standard request Set_Report request. The Set_Report request allows the host to send a report to the device, possibly setting the state of input, output, or feature controls. More... | |
int32_t | HID_HidGetIdle (HID_DEV_T *hdev, int rtp_id, uint8_t *idle_rate) |
HID class standard request Get_Idle request. The Get_Idle request reads the current idle rate for a particular Input report. More... | |
int32_t | HID_HidSetIdle (HID_DEV_T *hdev, int rtp_id, uint8_t idle_rate) |
HID class standard request Set_Idle request. The Set_Idle request silences a particular report on the Interrupt In pipe until a new event occurs or the specified amount of time passes. More... | |
int32_t | HID_HidGetProtocol (HID_DEV_T *hdev, uint8_t *protocol) |
HID class standard request Get_Protocol request. The Get_Protocol request reads which protocol is currently active (either the boot protocol or the report protocol.) More... | |
int32_t | HID_HidSetProtocol (HID_DEV_T *hdev, uint8_t protocol) |
HID class standard request Set_Protocol request. The Set_Protocol switches between the boot protocol and the report protocol (or vice versa). More... | |
int32_t | USBH_HidStartIntReadPipe (HID_DEV_T *hdev, HID_IR_FUNC *func) |
Start purge the USB interrupt in transfer. More... | |
int32_t | USBH_HidStartIntWritePipe (HID_DEV_T *hdev, HID_IW_FUNC *func) |
Start purge the USB interrupt out transfer. More... | |
Variables | |
USB_DEV_T * | usbhid_dev::udev |
int | usbhid_dev::ifnum |
uint8_t | usbhid_dev::bSubClassCode |
uint8_t | usbhid_dev::bProtocolCode |
URB_T * | usbhid_dev::urbin |
URB_T * | usbhid_dev::urbout |
uint8_t | usbhid_dev::inbuf [HID_MAX_BUFFER_SIZE] |
HID_IR_FUNC * | usbhid_dev::read_func |
HID_IW_FUNC * | usbhid_dev::write_func |
struct usbhid_dev * | usbhid_dev::next |
uint8_t | usbhid_dev::client [HID_CLIENT_SIZE] |
HID device structure
int32_t HID_HidGetIdle | ( | HID_DEV_T * | hdev, |
int | rtp_id, | ||
uint8_t * | idle_rate | ||
) |
HID class standard request Get_Idle request. The Get_Idle request reads the current idle rate for a particular Input report.
[in] | hdev | HID device |
[in] | rtp_id | Report ID |
[out] | idle_rate | An one byte buffer holds the reported idle rate. |
0 | Success |
Otherwise | Failed |
Definition at line 204 of file hid_core.c.
int32_t HID_HidGetProtocol | ( | HID_DEV_T * | hdev, |
uint8_t * | protocol | ||
) |
HID class standard request Get_Protocol request. The Get_Protocol request reads which protocol is currently active (either the boot protocol or the report protocol.)
[in] | hdev | HID device |
[out] | protocol | An one byte buffer holds the protocol code. |
0 | Success |
Otherwise | Failed |
Definition at line 268 of file hid_core.c.
int32_t HID_HidGetReport | ( | HID_DEV_T * | hdev, |
int | rtp_typ, | ||
int | rtp_id, | ||
uint8_t * | data, | ||
int | len | ||
) |
HID class standard request Get_Report request. The Get_Report request allows the host to receive a report via the Control pipe.
[in] | hdev | HID device |
[in] | rtp_typ | Report type. Valid values are: |
[in] | rtp_id | Report ID |
[out] | data | Buffer to store data retrieved from this report ID. |
[in] | len | Report length. |
>=0 | The actual length of data obtained from this report ID. |
Otherwise | Failed |
Definition at line 138 of file hid_core.c.
int32_t HID_HidGetReportDescriptor | ( | HID_DEV_T * | hdev, |
uint8_t * | desc_buf, | ||
int | buf_max_len | ||
) |
Get report descriptor request.
[in] | hdev | HID device |
[out] | desc_buf | The data buffer to store report descriptor. |
[in] | buf_max_len | The maximum length of desc_buf. This function will read more data than buf_max_len. |
<0 | Failed |
Otherwise | Length of report descriptor read. |
Definition at line 76 of file hid_core.c.
int32_t HID_HidSetIdle | ( | HID_DEV_T * | hdev, |
int | rtp_id, | ||
uint8_t | idle_rate | ||
) |
HID class standard request Set_Idle request. The Set_Idle request silences a particular report on the Interrupt In pipe until a new event occurs or the specified amount of time passes.
[in] | hdev | HID device |
[in] | rtp_id | Report ID |
[out] | idle_rate | The idle rate to be set. |
0 | Success |
Otherwise | Failed |
Definition at line 236 of file hid_core.c.
int32_t HID_HidSetProtocol | ( | HID_DEV_T * | hdev, |
uint8_t | protocol | ||
) |
HID class standard request Set_Protocol request. The Set_Protocol switches between the boot protocol and the report protocol (or vice versa).
[in] | hdev | HID device |
[in] | protocol | The protocol to be set. |
0 | Success |
Otherwise | Failed |
Definition at line 299 of file hid_core.c.
int32_t HID_HidSetReport | ( | HID_DEV_T * | hdev, |
int | rtp_typ, | ||
int | rtp_id, | ||
uint8_t * | data, | ||
int | len | ||
) |
HID class standard request Set_Report request. The Set_Report request allows the host to send a report to the device, possibly setting the state of input, output, or feature controls.
[in] | hdev | HID device |
[in] | rtp_typ | Report type. Valid values are: |
[in] | rtp_id | Report ID |
[out] | data | Buffer store data to be send. |
[in] | len | Report length. |
>=0 | The actual length of data written to this report ID. |
Otherwise | Failed |
Definition at line 174 of file hid_core.c.
HID_DEV_T * USBH_HidGetDeviceList | ( | void | ) |
Get a list of currently connected USB Hid devices.
NULL | There's no HID device found. |
Otherwise | A list of connected HID devices. |
The HID devices are chained by the "next" member of HID_DEV_T.
Definition at line 262 of file hid_driver.c.
void USBH_HidInit | ( | void | ) |
Init USB Host HID driver.
Definition at line 246 of file hid_driver.c.
HIDDEN_SYMBOLS int32_t USBH_HidStartIntReadPipe | ( | HID_DEV_T * | hdev, |
HID_IR_FUNC * | func | ||
) |
Start purge the USB interrupt in transfer.
[in] | hdev | HID device |
[in] | func | The interrupt in data receiver callback function. |
0 | Success |
Otherwise | Failed |
Definition at line 378 of file hid_core.c.
int32_t USBH_HidStartIntWritePipe | ( | HID_DEV_T * | hdev, |
HID_IW_FUNC * | func | ||
) |
Start purge the USB interrupt out transfer.
[in] | hdev | HID device |
[in] | func | The interrupt in data transfer callback function. |
0 | Success |
Otherwise | Failed |
Definition at line 439 of file hid_core.c.
uint8_t usbhid_dev::bProtocolCode |
Interface protocol code
Definition at line 96 of file usbh_hid.h.
uint8_t usbhid_dev::bSubClassCode |
Interface subclass code
Definition at line 95 of file usbh_hid.h.
uint8_t usbhid_dev::client[HID_CLIENT_SIZE] |
HID device client data area
Definition at line 103 of file usbh_hid.h.
int usbhid_dev::ifnum |
Interface numder
Definition at line 94 of file usbh_hid.h.
uint8_t usbhid_dev::inbuf[HID_MAX_BUFFER_SIZE] |
Input buffer
Definition at line 99 of file usbh_hid.h.
struct usbhid_dev* usbhid_dev::next |
Point to the next HID device
Definition at line 102 of file usbh_hid.h.
HID_IR_FUNC* usbhid_dev::read_func |
Interrupt-in callback function
Definition at line 100 of file usbh_hid.h.
USB_DEV_T* usbhid_dev::udev |
USB device pointer of HID_DEV_T
Definition at line 93 of file usbh_hid.h.
URB_T* usbhid_dev::urbin |
Input URB
Definition at line 97 of file usbh_hid.h.
URB_T* usbhid_dev::urbout |
Output URB
Definition at line 98 of file usbh_hid.h.
HID_IW_FUNC* usbhid_dev::write_func |
Interrupt-out callback function
Definition at line 101 of file usbh_hid.h.