UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2012. All rights reserved.
User manual
Rev. 1.3 — 6 July 2012
660 of 1269
NXP Semiconductors
UM10503
Chapter 25: LPC43xx USB API
Table 525. USBD_HID_INIT_PARAM class structure
Member
Description
mem_base
uint32_tuint32_t USBD_HID_INIT_PARAM::mem_base
Base memory location from where the stack can allocate data and buffers.
Remark:
The memory address set in this field should be accessible by USB DMA controller. Also
this value should be aligned on 4 byte boundary.
mem_size
uint32_tuint32_t USBD_HID_INIT_PARAM::mem_size
The size of memory buffer which stack can use.
Remark:
The mem_size should be greater than the size returned by
USBD_HID_API::GetMemSize() routine.
max_reports
uint8_tuint8_t USBD_HID_INIT_PARAM::max_reports
Number of HID reports supported by this instance of HID class driver.
pad
uint8_tuint8_t USBD_HID_INIT_PARAM::pad[3][3]
intf_desc
uint8_t *uint8_t* USBD_HID_INIT_PARAM::intf_desc
Pointer to the HID interface descriptor within the descriptor array (
report_data
USB_HID_REPORT_T *USB_HID_REPORT_T* USBD_HID_INIT_PARAM::report_data
Pointer to an array of HID report descriptor data structure (
Remark:
This array should be of global scope.
HID_GetReport
ErrorCode_t(*ErrorCode_t(* USBD_HID_INIT_PARAM::HID_GetReport)(USBD_HANDLE_T hHid,
USB_SETUP_PACKET *pSetup, uint8_t **pBuffer, uint16_t *length))(USBD_HANDLE_T hHid,
USB_SETUP_PACKET *pSetup, uint8_t **pBuffer, uint16_t *length)
HID get report callback function.
This function is provided by the application software. This function gets called when host sends a
HID_REQUEST_GET_REPORT request. The setup packet data (
Remark:
HID reports are sent via interrupt IN endpoint also. This function is called only when report
request is received on control endpoint. Application should implement HID_EpIn_Hdlr to send
reports to host via interrupt IN endpoint.
Parameters:
1. hHid = Handle to HID function driver.
2. pSetup = Pointer to setup packet received from host.
3. pBuffer = Pointer to a pointer of data buffer containing report data. Pointer-to-pointer is used to
implement zero-copy buffers. See Zero-Copy Data Transfer model for more details on
zero-copy concept.
4. length = Amount of data copied to destination buffer.
Returns:
The call back should returns ErrorCode_t type to indicate success or error condition.
Return values:
1. LPC_OK = On success.
2. ERR_USBD_UNHANDLED = Event is not handled hence pass the event to next in line.
3. ERR_USBD_xxx = For other error conditions.