![]() |
LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
|
USB descriptors data structure. More...
#include "usbd_dfuuser.h"
Data Fields | |
uint32_t | mem_base |
uint32_t | mem_size |
uint16_t | wTransferSize |
uint8_t * | intf_desc |
uint8_t(* | DFU_Write )(uint32_t block_num, uint8_t **src, uint32_t length, uint8_t *bwPollTimeout) |
uint32_t(* | DFU_Read )(uint32_t block_num, uint8_t **dst, uint32_t length) |
void(* | DFU_Done )(void) |
void(* | DFU_Detach )(USBD_HANDLE_T hUsb) |
ErrorCode_t(* | DFU_Ep0_Hdlr )(USBD_HANDLE_T hUsb, void *data, uint32_t event) |
USB descriptors data structure.
This module exposes functions which interact directly with USB device stack's core layer. The application layer uses this component when it has to implement custom class function driver or standard class function driver which is not part of the current USB device stack. The functions exposed by this interface are to register class specific EP0 handlers and corresponding utility functions to manipulate EP0 state machine of the stack. This interface also exposes function to register custom endpoint interrupt handler.
Definition at line 62 of file usbd_dfuuser.h.
void(* DFU_Detach)(USBD_HANDLE_T hUsb) |
DFU detach callback function.
This function is provided by the application software. This function gets called after USB_REQ_DFU_DETACH is recieved. Applications which set USB_DFU_WILL_DETACH bit in DFU descriptor should define this function. As part of this function application can call Connect() routine to disconnect and then connect back with host. For application which rely on WinUSB based host application should use this feature since USB reset can be invoked only by kernel drivers on Windows host. By implementing this feature host doen't have to issue reset instead the device has to do it automatically by disconnect and connect procedure.
hUsb | Handle DFU control structure. |
Definition at line 151 of file usbd_dfuuser.h.
void(* DFU_Done)(void) |
DFU done callback function.
This function is provided by the application software. This function gets called after download is finished.
Definition at line 133 of file usbd_dfuuser.h.
ErrorCode_t(* DFU_Ep0_Hdlr)(USBD_HANDLE_T hUsb, void *data, uint32_t event) |
Optional user overridable function to replace the default DFU class handler.
The application software could override the default EP0 class handler with their own by providing the handler function address as this data member of the parameter structure. Application which like the default handler should set this data member to zero before calling the USBD_DFU_API::Init().
hUsb | Handle to the USB device stack. |
data | Pointer to the data which will be passed when callback function is called by the stack. |
event | Type of endpoint event. See USBD_EVENT_T for more details. |
LPC_OK | On success. |
ERR_USBD_UNHANDLED | Event is not handled hence pass the event to next in line. |
ERR_USBD_xxx | For other error conditions. |
Definition at line 172 of file usbd_dfuuser.h.
DFU Read callback function.
This function is provided by the application software. This function gets called when host sends a read command.
block_num | Destination start address. |
dst | Pointer to a pointer to the source of data. Pointer-to-pointer is used to implement zero-copy buffers. See USBD_ZeroCopy for more details on zero-copy concept. |
length | Amount of data copied to destination buffer. |
Definition at line 122 of file usbd_dfuuser.h.
DFU Write callback function.
This function is provided by the application software. This function gets called when host sends a write command. For application using zero-copy buffer scheme this function is called for the first time with length parameter set to 0. The application code should update the buffer pointer.
block_num | Destination start address. |
src | Pointer to a pointer to the source of data. Pointer-to-pointer is used to implement zero-copy buffers. See USBD_ZeroCopy for more details on zero-copy concept. |
bwPollTimeout | Pointer to a 3 byte buffer which the callback implementer should fill with the amount of minimum time, in milliseconds, that the host should wait before sending a subsequent DFU_GETSTATUS request. |
length | Number of bytes to be written. |
Definition at line 106 of file usbd_dfuuser.h.
uint8_t* intf_desc |
Pointer to the DFU interface descriptor within the descriptor array (high_speed_desc) passed to Init() through USB_CORE_DESCS_T structure.
Definition at line 84 of file usbd_dfuuser.h.
uint32_t mem_base |
Base memory location from where the stack can allocate data and buffers.
Definition at line 65 of file usbd_dfuuser.h.
uint32_t mem_size |
The size of memory buffer which stack can use.
Definition at line 70 of file usbd_dfuuser.h.
uint16_t wTransferSize |
DFU transfer block size in number of bytes. This value should match the value set in DFU descriptor provided as part of the descriptor array (high_speed_desc) passed to Init() through USB_CORE_DESCS_T structure.
Definition at line 74 of file usbd_dfuuser.h.