![NXP Semiconductors LCP43 Series User Manual Download Page 661](http://html1.mh-extra.com/html/nxp-semiconductors/lcp43-series/lcp43-series_user-manual_1721817661.webp)
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
661 of 1269
NXP Semiconductors
UM10503
Chapter 25: LPC43xx USB API
HID_SetReport
ErrorCode_t(*ErrorCode_t(* USBD_HID_INIT_PARAM::HID_SetReport)(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 set report callback function.
This function is provided by the application software. This function gets called when host sends a
HID_REQUEST_SET_REPORT request. The setup packet data (
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.
HID_GetPhysDesc
ErrorCode_t(*ErrorCode_t(* USBD_HID_INIT_PARAM::HID_GetPhysDesc)(USBD_HANDLE_T hHid,
USB_SETUP_PACKET *pSetup, uint8_t **pBuf, uint16_t *length))(USBD_HANDLE_T hHid,
USB_SETUP_PACKET *pSetup, uint8_t **pBuf, uint16_t *length)
Optional callback function to handle HID_GetPhysDesc request.
The application software could provide this callback HID_GetPhysDesc handler to handle get
physical descriptor requests sent by the host. When host requests Physical Descriptor set 0,
application should return a special descriptor identifying the number of descriptor sets and their
sizes. A Get_Descriptor request with the Physical Index equal to 1 should return the first Physical
Descriptor set. A device could possibly have alternate uses for its items. These can be enumerated
by issuing subsequent Get_Descriptor requests while incrementing the Descriptor Index. A device
should return the last descriptor set to requests with an index greater than the last number defined in
the HID descriptor.
Remark:
Applications which don't have physical descriptor should set this data member to zero
before calling the USBD_HID_API::Init().
Parameters:
1. hHid = Handle to HID function driver.
2. pSetup = Pointer to setup packet received from host.
3. pBuf = Pointer to a pointer of data buffer containing physical descriptor data. If the physical
descriptor is in USB accessible memory area application could just update the pointer or else it
should copy the descriptor to the address pointed by this pointer.
4. length = Amount of data copied to destination buffer or descriptor length.
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.
Table 525. USBD_HID_INIT_PARAM class structure
Member
Description