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
653 of 1269
NXP Semiconductors
UM10503
Chapter 25: LPC43xx USB API
RegisterEpHandler
ErrorCode_t(*ErrorCode_t USBD_CORE_API::RegisterEpHandler)(USBD_HANDLE_T hUsb, uint32_t ep_index,
USB_EP_HANDLER_T pfn, void *data)
Function to register interrupt/event handler for the requested endpoint with USB device stack.
The application layer uses this function to register the custom class's EP0 handler. The stack calls
all the registered class handlers on any EP0 event before going through default handling of the
event. This gives the class handlers to implement class specific request handlers and also to
override the default stack handling for a particular event targeted to the interface. Check
USB_EP_HANDLER_T for more details on how the callback function should be implemented.
Parameters:
1. hUsb = Handle to the USB device stack.
2. ep_index = Class specific EP0 handler function.
3. pfn = Class specific EP0 handler function.
4. data = Pointer to the data which will be passed when callback function is called by the stack.
Returns:
Returns ErrorCode_t type to indicate success or error condition.
Return values:
1. LPC_OK = On success
2. ERR_USBD_TOO_MANY_CLASS_HDLR(0x0004000c) = Too many endpoint handlers.
SetupStage
void(*void USBD_CORE_API::SetupStage)(USBD_HANDLE_T hUsb)
Function to set EP0 state machine in setup state.
This function is called by USB stack and the application layer to set the EP0 state machine in setup
state. This function will read the setup packet received from USB host into stack's buffer.
Remark:
This interface is provided to users to invoke this function in other scenarios which are not
handle by current stack. In most user applications this function is not called directly.Also this
function can be used by users who are selectively modifying the USB device stack's standard
handlers through callback interface exposed by the stack.
Parameters:
1. hUsb = Handle to the USB device stack.
Returns:
Nothing.
DataInStage
void(*void USBD_CORE_API::DataInStage)(USBD_HANDLE_T hUsb)
Function to set EP0 state machine in data_in state.
This function is called by USB stack and the application layer to set the EP0 state machine in
data_in state. This function will write the data present in EP0Data buffer to EP0 FIFO for
transmission to host.
Remark:
This interface is provided to users to invoke this function in other scenarios which are not
handle by current stack. In most user applications this function is not called directly.Also this
function can be used by users who are selectively modifying the USB device stack's standard
handlers through callback interface exposed by the stack.
Parameters:
1. hUsb = Handle to the USB device stack.
Returns:
Nothing.
Table 521. USBD_CORE_API class structure
Member
Description