EU1KY AA FW
usbd_msc_bot.h
Go to the documentation of this file.
1 
28 /* Define to prevent recursive inclusion -------------------------------------*/
29 #ifndef __USBD_MSC_BOT_H
30 #define __USBD_MSC_BOT_H
31 
32 #ifdef __cplusplus
33  extern "C" {
34 #endif
35 
36 /* Includes ------------------------------------------------------------------*/
37 #include "usbd_core.h"
38 
52 #define USBD_BOT_IDLE 0 /* Idle state */
53 #define USBD_BOT_DATA_OUT 1 /* Data Out state */
54 #define USBD_BOT_DATA_IN 2 /* Data In state */
55 #define USBD_BOT_LAST_DATA_IN 3 /* Last Data In Last */
56 #define USBD_BOT_SEND_DATA 4 /* Send Immediate data */
57 #define USBD_BOT_NO_DATA 5 /* No data Stage */
58 
59 #define USBD_BOT_CBW_SIGNATURE 0x43425355
60 #define USBD_BOT_CSW_SIGNATURE 0x53425355
61 #define USBD_BOT_CBW_LENGTH 31
62 #define USBD_BOT_CSW_LENGTH 13
63 #define USBD_BOT_MAX_DATA 256
64 
65 /* CSW Status Definitions */
66 #define USBD_CSW_CMD_PASSED 0x00
67 #define USBD_CSW_CMD_FAILED 0x01
68 #define USBD_CSW_PHASE_ERROR 0x02
69 
70 /* BOT Status */
71 #define USBD_BOT_STATUS_NORMAL 0
72 #define USBD_BOT_STATUS_RECOVERY 1
73 #define USBD_BOT_STATUS_ERROR 2
74 
75 
76 #define USBD_DIR_IN 0
77 #define USBD_DIR_OUT 1
78 #define USBD_BOTH_DIR 2
79 
88 typedef struct
89 {
90  uint32_t dSignature;
91  uint32_t dTag;
92  uint32_t dDataLength;
93  uint8_t bmFlags;
94  uint8_t bLUN;
95  uint8_t bCBLength;
96  uint8_t CB[16];
98 }
100 
101 
102 typedef struct
103 {
104  uint32_t dSignature;
105  uint32_t dTag;
106  uint32_t dDataResidue;
107  uint8_t bStatus;
108  uint8_t ReservedForAlign[3];
109 }
111 
127 void MSC_BOT_Init (USBD_HandleTypeDef *pdev);
128 void MSC_BOT_Reset (USBD_HandleTypeDef *pdev);
131  uint8_t epnum);
132 
134  uint8_t epnum);
135 
137  uint8_t CSW_Status);
138 
140  uint8_t epnum);
145 #ifdef __cplusplus
146 }
147 #endif
148 
149 #endif /* __USBD_MSC_BOT_H */
150 
157 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
158 
uint8_t ReservedForAlign
Definition: usbd_msc_bot.h:97
Definition: usbd_def.h:225
uint32_t dTag
Definition: usbd_msc_bot.h:105
uint32_t dTag
Definition: usbd_msc_bot.h:91
uint8_t bmFlags
Definition: usbd_msc_bot.h:93
Definition: usbd_msc_bot.h:102
Definition: usbd_msc_bot.h:88
uint32_t dDataResidue
Definition: usbd_msc_bot.h:106
uint8_t bLUN
Definition: usbd_msc_bot.h:94
void MSC_BOT_Init(USBD_HandleTypeDef *pdev)
MSC_BOT_Init Initialize the BOT Process.
Definition: usbd_msc_bot.c:105
uint32_t dSignature
Definition: usbd_msc_bot.h:90
uint32_t dSignature
Definition: usbd_msc_bot.h:104
uint32_t dDataLength
Definition: usbd_msc_bot.h:92
void MSC_BOT_SendCSW(USBD_HandleTypeDef *pdev, uint8_t CSW_Status)
MSC_BOT_SendCSW Send the Command Status Wrapper.
Definition: usbd_msc_bot.c:320
void MSC_BOT_DeInit(USBD_HandleTypeDef *pdev)
MSC_BOT_DeInit Deinitialize the BOT Machine.
Definition: usbd_msc_bot.c:153
uint8_t bCBLength
Definition: usbd_msc_bot.h:95
void MSC_BOT_Reset(USBD_HandleTypeDef *pdev)
MSC_BOT_Reset Reset the BOT Machine.
Definition: usbd_msc_bot.c:133
uint8_t bStatus
Definition: usbd_msc_bot.h:107
void MSC_BOT_DataIn(USBD_HandleTypeDef *pdev, uint8_t epnum)
MSC_BOT_DataIn Handle BOT IN data stage.
Definition: usbd_msc_bot.c:166
void MSC_BOT_CplClrFeature(USBD_HandleTypeDef *pdev, uint8_t epnum)
MSC_BOT_CplClrFeature Complete the clear feature request.
Definition: usbd_msc_bot.c:378
void MSC_BOT_DataOut(USBD_HandleTypeDef *pdev, uint8_t epnum)
MSC_BOT_DataOut Process MSC OUT data.
Definition: usbd_msc_bot.c:199
Header file for usbd_core.c file.