STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
usbh_msc_bot.h
Go to the documentation of this file.
1 
28 /* Define to prevent recursive ----------------------------------------------*/
29 #ifndef __USBH_MSC_BOT_H
30 #define __USBH_MSC_BOT_H
31 
32 #ifdef __cplusplus
33  extern "C" {
34 #endif
35 
36 /* Includes ------------------------------------------------------------------*/
37 #include "usbh_core.h"
38 #include "usbh_msc_bot.h"
39 
62 typedef enum {
63  BOT_OK = 0,
64  BOT_FAIL = 1,
67 }
69 
70 typedef enum {
74 }
76 
77 /* CSW Status Definitions */
78 typedef enum
79 {
80 
84 }
86 
87 typedef enum {
99 }
101 
102 typedef union
103 {
104  struct __CBW
105  {
106  uint32_t Signature;
107  uint32_t Tag;
109  uint8_t Flags;
110  uint8_t LUN;
111  uint8_t CBLength;
112  uint8_t CB[16];
113  }field;
114  uint8_t data[31];
115 }
117 
118 typedef union
119 {
120  struct __CSW
121  {
122  uint32_t Signature;
123  uint32_t Tag;
124  uint32_t DataResidue;
125  uint8_t Status;
126  }field;
127  uint8_t data[13];
128 }
130 
131 typedef struct
132 {
133  uint32_t data[16];
134  BOT_StateTypeDef state;
135  BOT_StateTypeDef prev_state;
136  BOT_CMDStateTypeDef cmd_state;
138  uint8_t Reserved1;
140  uint8_t Reserved2[3];
141  uint8_t *pbuf;
142 }
144 
154 #define BOT_CBW_SIGNATURE 0x43425355
155 #define BOT_CBW_TAG 0x20304050
156 #define BOT_CSW_SIGNATURE 0x53425355
157 #define BOT_CBW_LENGTH 31
158 #define BOT_CSW_LENGTH 13
159 
160 
161 
162 #define BOT_SEND_CSW_DISABLE 0
163 #define BOT_SEND_CSW_ENABLE 1
164 
165 #define BOT_DIR_IN 0
166 #define BOT_DIR_OUT 1
167 #define BOT_DIR_BOTH 2
168 
169 #define BOT_PAGE_LENGTH 512
170 
171 
172 #define BOT_CBW_CB_LENGTH 16
173 
174 
175 #define USB_REQ_BOT_RESET 0xFF
176 #define USB_REQ_GET_MAX_LUN 0xFE
177 
178 #define MAX_BULK_STALL_COUNT_LIMIT 0x04 /* If STALL is seen on Bulk
179  Endpoint continuously, this means
180  that device and Host has phase error
181  Hence a Reset is needed */
182 
207 
211 
212 
213 
218 #ifdef __cplusplus
219 }
220 #endif
221 
222 #endif /* __USBH_MSC_BOT_H__ */
223 
224 
240 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
241 
USBH_StatusTypeDef USBH_MSC_BOT_Init(USBH_HandleTypeDef *phost)
USBH_MSC_BOT_Init The function Initializes the BOT protocol.
Definition: usbh_msc_bot.c:151
Header file for usbh_core.c.
BOT_CBWTypeDef cbw
Definition: usbh_msc_bot.h:137
Header file for usbh_msc_bot.c.
USBH_StatusTypeDef USBH_MSC_BOT_Process(USBH_HandleTypeDef *phost, uint8_t lun)
USBH_MSC_BOT_Process The function handle the BOT protocol.
Definition: usbh_msc_bot.c:173
BOT_StateTypeDef
Definition: usbh_msc_bot.h:87
BOT_StateTypeDef prev_state
Definition: usbh_msc_bot.h:135
BOT_StatusTypeDef
Definition: usbh_msc_bot.h:62
USBH_StatusTypeDef USBH_MSC_BOT_REQ_GetMaxLUN(USBH_HandleTypeDef *phost, uint8_t *Maxlun)
USBH_MSC_BOT_REQ_GetMaxLUN The function the MSC BOT GetMaxLUN request.
Definition: usbh_msc_bot.c:130
BOT_StateTypeDef state
Definition: usbh_msc_bot.h:134
BOT_CMDStateTypeDef
Definition: usbh_msc_bot.h:70
BOT_CMDStateTypeDef cmd_state
Definition: usbh_msc_bot.h:136
USBH_StatusTypeDef USBH_MSC_BOT_Error(USBH_HandleTypeDef *phost, uint8_t lun)
USBH_StatusTypeDef
Definition: usbh_def.h:302
USBH_StatusTypeDef USBH_MSC_BOT_REQ_Reset(USBH_HandleTypeDef *phost)
USBH_MSC_BOT_REQ_Reset The function the MSC BOT Reset request.
Definition: usbh_msc_bot.c:109
BOT_CSWTypeDef csw
Definition: usbh_msc_bot.h:139
BOT_CSWStatusTypeDef
Definition: usbh_msc_bot.h:78