diff options
Diffstat (limited to 'usb/device/dfu/dfu.h')
-rw-r--r-- | usb/device/dfu/dfu.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/usb/device/dfu/dfu.h b/usb/device/dfu/dfu.h index 00a0622..4d5aa5b 100644 --- a/usb/device/dfu/dfu.h +++ b/usb/device/dfu/dfu.h @@ -1,5 +1,5 @@ -#ifndef _USB_DFU_DESC_H -#define _USB_DFU_DESC_H +#ifndef _USB_DEV_DFU_H +#define _USB_DEV_DFU_H #include <stdint.h> #include <board.h> @@ -25,7 +25,15 @@ struct USBStringDescriptor { #ifdef BOARD_USB_DFU -#define DFU_NUM_IF 3 +/* USB DFU functional descriptor */ +#define DFU_FUNC_DESC { \ + .bLength = USB_DT_DFU_SIZE, \ + .bDescriptorType = USB_DT_DFU, \ + .bmAttributes = USB_DFU_CAN_UPLOAD | USB_DFU_CAN_DOWNLOAD, \ + .wDetachTimeOut = 0xff00, \ + .wTransferSize = BOARD_DFU_PAGE_SIZE, \ + .bcdDFUVersion = 0x0100, \ +} #define DFU_IF_DESCRIPTORS_STRUCT \ USBInterfaceDescriptor dfu_interface[DFU_NUM_IF]; @@ -100,10 +108,10 @@ extern struct dfu dfu; /* call-backs by the board/SOC */ extern int USBDFU_handle_dnload(uint16_t val, uint16_t len, int first); -static int USBDFU_handle_upload(uint16_t val, uint16_t len, int first); +extern int USBDFU_handle_upload(uint16_t val, uint16_t len, int first); -void USBDFU_Runtime_RequestHandler(USBDDriver *pDriver, const USBGenericRequest *request); -void USBDFU_DFU_RequestHandler(USBDDriver *pDriver, const USBGenericRequest *request); +void USBDFU_Runtime_RequestHandler(const USBGenericRequest *request); +void USBDFU_DFU_RequestHandler(const USBGenericRequest *request); void USBDFU_Initialize(const USBDDriverDescriptors *pDescriptors, unsigned char *pInterfaces); |