53 #define USB_DFU_CONFIG_DESC_SIZ (18 + (9 * USBD_DFU_MAX_ITF_NUM)) 54 #define USB_DFU_DESC_SIZ 9 56 #define DFU_DESCRIPTOR_TYPE 0x21 62 #define APP_STATE_IDLE 0 63 #define APP_STATE_DETACH 1 64 #define DFU_STATE_IDLE 2 65 #define DFU_STATE_DNLOAD_SYNC 3 66 #define DFU_STATE_DNLOAD_BUSY 4 67 #define DFU_STATE_DNLOAD_IDLE 5 68 #define DFU_STATE_MANIFEST_SYNC 6 69 #define DFU_STATE_MANIFEST 7 70 #define DFU_STATE_MANIFEST_WAIT_RESET 8 71 #define DFU_STATE_UPLOAD_IDLE 9 72 #define DFU_STATE_ERROR 10 77 #define DFU_ERROR_NONE 0x00 78 #define DFU_ERROR_TARGET 0x01 79 #define DFU_ERROR_FILE 0x02 80 #define DFU_ERROR_WRITE 0x03 81 #define DFU_ERROR_ERASE 0x04 82 #define DFU_ERROR_CHECK_ERASED 0x05 83 #define DFU_ERROR_PROG 0x06 84 #define DFU_ERROR_VERIFY 0x07 85 #define DFU_ERROR_ADDRESS 0x08 86 #define DFU_ERROR_NOTDONE 0x09 87 #define DFU_ERROR_FIRMWARE 0x0A 88 #define DFU_ERROR_VENDOR 0x0B 89 #define DFU_ERROR_USB 0x0C 90 #define DFU_ERROR_POR 0x0D 91 #define DFU_ERROR_UNKNOWN 0x0E 92 #define DFU_ERROR_STALLEDPKT 0x0F 97 #define DFU_MANIFEST_COMPLETE 0x00 98 #define DFU_MANIFEST_IN_PROGRESS 0x01 104 #define DFU_CMD_GETCOMMANDS 0x00 105 #define DFU_CMD_SETADDRESSPOINTER 0x21 106 #define DFU_CMD_ERASE 0x41 108 #define DFU_MEDIA_ERASE 0x00 109 #define DFU_MEDIA_PROGRAM 0x01 115 #define DFU_DETACH_MASK (uint8_t)(1 << 4) 116 #define DFU_STATUS_DEPTH (6) 133 #define USBD_DFU_IF_DESC(n) 0x09, \ 134 USB_DESC_TYPE_INTERFACE, \ 141 USBD_IDX_INTERFACE_STR + (n) + 1 \ 143 #define TRANSFER_SIZE_BYTES(size) ((uint8_t)(size)), \ 144 ((uint8_t)(size >> 8)) 146 #define IS_PROTECTED_AREA(add) (uint8_t)(((add >= 0x08000000) && (add < (APP_DEFAULT_ADD)))? 1:0) 161 uint32_t d32[USBD_DFU_XFER_SIZE/4];
162 uint8_t d8[USBD_DFU_XFER_SIZE];
181 uint16_t (* Init) (void);
182 uint16_t (* DeInit) (void);
183 uint16_t (* Erase) (uint32_t Add);
184 uint16_t (* Write) (uint8_t *src, uint8_t *dest, uint32_t Len);
185 uint8_t* (* Read) (uint8_t *src, uint8_t *dest, uint32_t Len);
186 uint16_t (* GetStatus)(uint32_t Add, uint8_t cmd, uint8_t *buff);
208 #define USBD_DFU_CLASS &USBD_DFU
__IO uint32_t alt_setting
Header file for the usbd_ioreq.c file.
uint8_t USBD_DFU_RegisterMedia(USBD_HandleTypeDef *pdev, USBD_DFU_MediaTypeDef *fops)
USBD_DFU_GetUsrStringDesc Manages the transfer of memory interfaces string descriptors.
USBD_ClassTypeDef USBD_DFU