130 #ifdef USB_OTG_HS_CORE 131 static uint8_t *USBD_DFU_GetOtherCfgDesc (uint8_t speed,
168 #ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED 169 #if defined ( __ICCARM__ ) 170 #pragma data_alignment=4 176 #ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED 177 #if defined ( __ICCARM__ ) 178 #pragma data_alignment=4 212 #ifdef USB_OTG_HS_CORE 213 USBD_DFU_GetOtherCfgDesc,
218 #ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED 219 #if defined ( __ICCARM__ ) 220 #pragma data_alignment=4 241 #if (USBD_ITF_MAX_NUM > 1) 246 #if (USBD_ITF_MAX_NUM > 2) 251 #if (USBD_ITF_MAX_NUM > 3) 256 #if (USBD_ITF_MAX_NUM > 4) 261 #if (USBD_ITF_MAX_NUM > 5) 266 #if (USBD_ITF_MAX_NUM > 6) 267 #error "ERROR: usbd_dfu_core.c: Modify the file to support more descriptors!" 284 TRANSFER_SIZE_BYTES(XFERSIZE),
291 #ifdef USE_USB_OTG_HS 292 #ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED 293 #if defined ( __ICCARM__ ) 294 #pragma data_alignment=4 315 #if (USBD_ITF_MAX_NUM > 1) 320 #if (USBD_ITF_MAX_NUM > 2) 325 #if (USBD_ITF_MAX_NUM > 3) 330 #if (USBD_ITF_MAX_NUM > 4) 335 #if (USBD_ITF_MAX_NUM > 5) 340 #if (USBD_ITF_MAX_NUM > 6) 341 #error "ERROR: usbd_dfu_core.c: Modify the file to support more descriptors!" 358 TRANSFER_SIZE_BYTES(XFERSIZE),
366 #ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED 367 #if defined ( __ICCARM__ ) 368 #pragma data_alignment=4 386 TRANSFER_SIZE_BYTES(XFERSIZE),
455 uint8_t *pbuf =
NULL;
504 #ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED 505 pbuf = usbd_dfu_Desc;
731 uint8_t *Phy_Addr =
NULL;
997 *length =
sizeof (usbd_dfu_CfgDesc);
998 return usbd_dfu_CfgDesc;
1001 #ifdef USB_OTG_HS_CORE 1009 static uint8_t *USBD_DFU_GetOtherCfgDesc (uint8_t speed, uint16_t *length)
1011 *length =
sizeof (usbd_dfu_OtherCfgDesc);
1012 return usbd_dfu_OtherCfgDesc;
void USBD_CtlError(USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req)
USBD_CtlError Handle USB low level Error.
#define USB_REQ_TYPE_STANDARD
Specific api's relative to the used hardware platform.
header file for the usbd_req.c file
static void DFU_Req_DNLOAD(void *pdev, USB_SETUP_REQ *req)
DFU_Req_DNLOAD Handles the DFU DNLOAD request.
static void DFU_Req_UPLOAD(void *pdev, USB_SETUP_REQ *req)
DFU_Req_UPLOAD Handles the DFU UPLOAD request.
uint16_t MAL_DeInit(void)
MAL_DeInit DeInitializes the Media on the STM32.
#define USBD_DFU_IF_DESC(n)
#define DFU_DESCRIPTOR_TYPE
void USBD_GetString(uint8_t *desc, uint8_t *unicode, uint16_t *len)
USBD_GetString Convert Ascii string into unicode one.
const uint8_t * usbd_dfu_StringDesc[]
#define STATE_dfuMANIFEST
#define USB_REQ_TYPE_CLASS
USBD_Status USBD_CtlSendData(USB_OTG_CORE_HANDLE *pdev, uint8_t *buf, uint16_t len)
USBD_CtlSendData send data on the ctl pipe.
#define STATE_dfuDNLOAD_SYNC
#define USB_REQ_SET_INTERFACE
#define USB_REQ_GET_INTERFACE
static void DFU_Req_GETSTATUS(void *pdev)
DFU_Req_GETSTATUS Handles the DFU GETSTATUS request.
header file for the usbd_dfu_core.c file.
static void DFU_Req_DETACH(void *pdev, USB_SETUP_REQ *req)
DFU_Req_DETACH Handles the DFU DETACH request.
void DCD_DevConnect(USB_OTG_CORE_HANDLE *pdev)
Connect device (enable internal pull-up)
#define STATE_dfuMANIFEST_SYNC
static void DFU_Req_GETSTATE(void *pdev)
DFU_Req_GETSTATE Handles the DFU GETSTATE request.
#define USB_CONFIGURATION_DESCRIPTOR_TYPE
uint16_t MAL_Write(uint32_t SectorAddress, uint32_t DataLength)
MAL_Write Write sectors of memory.
static uint32_t wBlockNum
__STATIC_INLINE void NVIC_SystemReset(void)
System Reset.
USBD_Status USBD_CtlPrepareRx(USB_OTG_CORE_HANDLE *pdev, uint8_t *pbuf, uint16_t len)
USBD_CtlPrepareRx receive data on the ctl pipe.
#define USB_DFU_CONFIG_DESC_SIZ
uint8_t USBD_StrDesc[USB_MAX_STR_DESC_SIZ]
uint16_t MAL_Init(void)
MAL_Init Initializes the Media on the STM32.
#define STATUS_ERRUNKNOWN
#define STATE_dfuMANIFEST_WAIT_RESET
void USB_OTG_BSP_mDelay(const uint32_t msec)
USB_OTG_BSP_mDelay This function provides delay time in milli sec.
#define USB_REQ_GET_DESCRIPTOR
#define Manifest_In_Progress
#define Manifest_complete
#define STATE_dfuUPLOAD_IDLE
static void DFU_LeaveDFUMode(void *pdev)
DFU_LeaveDFUMode Handles the sub-protocol DFU leave DFU mode request (leaves DFU mode and resets devi...
USBD_Class_cb_TypeDef DFU_cb
static uint8_t EP0_TxSent(void *pdev)
EP0_TxSent Handles the DFU control endpoint data IN stage.
static uint8_t * USBD_DFU_GetCfgDesc(uint8_t speed, uint16_t *length)
USBD_DFU_GetCfgDesc Returns configuration descriptor.
static __IO uint32_t usbd_dfu_AltSet
#define CMD_SETADDRESSPOINTER
static uint8_t * USBD_DFU_GetUsrStringDesc(uint8_t speed, uint8_t index, uint16_t *length)
USBD_DFU_GetUsrStringDesc Manages the transfer of memory interfaces string descriptors.
#define STATUS_ERRSTALLEDPKT
#define USBD_IDX_INTERFACE_STR
uint16_t MAL_GetStatus(uint32_t SectorAddress, uint8_t Cmd, uint8_t *buffer)
MAL_GetStatus Get the status of a given memory.
static uint8_t usbd_dfu_DeInit(void *pdev, uint8_t cfgidx)
usbd_dfu_Init De-initializes the DFU layer.
static void DFU_Req_ABORT(void *pdev)
DFU_Req_ABORT Handles the DFU ABORT request.
#define STATE_dfuDNLOAD_IDLE
static uint8_t usbd_dfu_Setup(void *pdev, USB_SETUP_REQ *req)
usbd_dfu_Setup Handles the DFU request parsing.
uint16_t MAL_Erase(uint32_t SectorAddress)
MAL_Erase Erase a sector of memory.
static uint8_t usbd_dfu_Init(void *pdev, uint8_t cfgidx)
usbd_dfu_Init Initializes the DFU interface.
#define USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION
static uint8_t EP0_RxReady(void *pdev)
EP0_RxReady Handles the DFU control endpoint data OUT stage.
void DCD_DevDisconnect(USB_OTG_CORE_HANDLE *pdev)
Disconnect device (disable internal pull-up)
static void DFU_Req_CLRSTATUS(void *pdev)
DFU_Req_CLRSTATUS Handles the DFU CLRSTATUS request.
#define USB_REQ_TYPE_MASK
__ALIGN_BEGIN uint8_t usbd_dfu_CfgDesc[USB_DFU_CONFIG_DESC_SIZ] __ALIGN_END
uint8_t * MAL_Read(uint32_t SectorAddress, uint32_t DataLength)
MAL_Read Read sectors of memory.
header file for the usbd_desc.c file