Select one of the symbols to view example projects that use it.
 
Outline
#define __USBH_MSC_BOT_H
#include "usbh_core.h"
BOT_StatusTypeDef
BOT_CMDStateTypeDef
BOT_CSWStatusTypeDef
BOT_StateTypeDef
BOT_CBWTypeDef
BOT_CSWTypeDef
BOT_HandleTypeDef
#define BOT_CBW_SIGNATURE
#define BOT_CBW_TAG
#define BOT_CSW_SIGNATURE
#define BOT_CBW_LENGTH
#define BOT_CSW_LENGTH
#define BOT_SEND_CSW_DISABLE
#define BOT_SEND_CSW_ENABLE
#define BOT_DIR_IN
#define BOT_DIR_OUT
#define BOT_DIR_BOTH
#define BOT_PAGE_LENGTH
#define BOT_CBW_CB_LENGTH
USBH_MSC_BOT_REQ_Reset(USBH_HandleTypeDef *);
USBH_MSC_BOT_REQ_GetMaxLUN(USBH_HandleTypeDef *, uint8_t *);
USBH_MSC_BOT_Init(USBH_HandleTypeDef *);
USBH_MSC_BOT_Process(USBH_HandleTypeDef *, uint8_t);
USBH_MSC_BOT_Error(USBH_HandleTypeDef *, uint8_t);
Files
loading...
CodeScopeSTM32 Libraries and SamplesSTM32_USB_Host_LibraryClass/MSC/Inc/usbh_msc_bot.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * @file usbh_msc_bot.h * @author MCD Application Team * @brief Header file for usbh_msc_bot.c ****************************************************************************** * @attention * * Copyright (c) 2015 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... */ /* Define to prevent recursive ----------------------------------------------*/ #ifndef __USBH_MSC_BOT_H #define __USBH_MSC_BOT_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "usbh_core.h" /** @addtogroup USBH_LIB * @{ *//* ... */ /** @addtogroup USBH_CLASS * @{ *//* ... */ /** @addtogroup USBH_MSC_CLASS * @{ *//* ... */ /** @defgroup USBH_MSC_BOT * @brief This file is the Header file for usbh_msc_bot.c * @{ *//* ... */ /** @defgroup USBH_MSC_BOT_Exported_Types * @{ *//* ... */ typedef enum { BOT_OK = 0, BOT_FAIL = 1, BOT_PHASE_ERROR = 2, BOT_BUSY = 3 ...} BOT_StatusTypeDef; typedef enum { BOT_CMD_IDLE = 0, BOT_CMD_SEND, BOT_CMD_WAIT, ...} BOT_CMDStateTypeDef; /* CSW Status Definitions */ typedef enum { BOT_CSW_CMD_PASSED = 0x00, BOT_CSW_CMD_FAILED = 0x01, BOT_CSW_PHASE_ERROR = 0x02, ...} BOT_CSWStatusTypeDef; typedef enum { BOT_SEND_CBW = 1, BOT_SEND_CBW_WAIT, BOT_DATA_IN, BOT_DATA_IN_WAIT, BOT_DATA_OUT, BOT_DATA_OUT_WAIT, BOT_RECEIVE_CSW, BOT_RECEIVE_CSW_WAIT, BOT_ERROR_IN, BOT_ERROR_OUT, BOT_UNRECOVERED_ERROR ...} BOT_StateTypeDef; typedef union { struct __CBW { uint32_t Signature; uint32_t Tag; uint32_t DataTransferLength; uint8_t Flags; uint8_t LUN; uint8_t CBLength; uint8_t CB[16]; ...} field; uint8_t data[31]; ...} BOT_CBWTypeDef; typedef union { struct __CSW { uint32_t Signature; uint32_t Tag; uint32_t DataResidue; uint8_t Status; ...} field; uint8_t data[13]; ...} BOT_CSWTypeDef; typedef struct { uint32_t data[16]; BOT_StateTypeDef state; BOT_StateTypeDef prev_state; BOT_CMDStateTypeDef cmd_state; BOT_CBWTypeDef cbw; uint8_t Reserved1; BOT_CSWTypeDef csw; uint8_t Reserved2[3]; uint8_t *pbuf; ...} BOT_HandleTypeDef; /** * @} *//* ... */ /** @defgroup USBH_MSC_BOT_Exported_Defines * @{ *//* ... */ #define BOT_CBW_SIGNATURE 0x43425355U #define BOT_CBW_TAG 0x20304050U #define BOT_CSW_SIGNATURE 0x53425355U #define BOT_CBW_LENGTH 31U #define BOT_CSW_LENGTH 13U #define BOT_SEND_CSW_DISABLE 0U #define BOT_SEND_CSW_ENABLE 1U #define BOT_DIR_IN 0U #define BOT_DIR_OUT 1U #define BOT_DIR_BOTH 2U #define BOT_PAGE_LENGTH 512U #define BOT_CBW_CB_LENGTH 16U #define MAX_BULK_STALL_COUNT_LIMIT 0x04U /* If STALL is seen on Bulk Endpoint continuously, this means that device and Host has phase error Hence a Reset is needed *//* ... */ /** * @} *//* ... */ /** @defgroup USBH_MSC_BOT_Exported_Macros * @{ *//* ... */ /** * @} *//* ... */ /** @defgroup USBH_MSC_BOT_Exported_Variables * @{ *//* ... */ /** * @} *//* ... */ /** @defgroup USBH_MSC_BOT_Exported_FunctionsPrototype * @{ *//* ... */ USBH_StatusTypeDef USBH_MSC_BOT_REQ_Reset(USBH_HandleTypeDef *phost); USBH_StatusTypeDef USBH_MSC_BOT_REQ_GetMaxLUN(USBH_HandleTypeDef *phost, uint8_t *Maxlun); USBH_StatusTypeDef USBH_MSC_BOT_Init(USBH_HandleTypeDef *phost); USBH_StatusTypeDef USBH_MSC_BOT_Process(USBH_HandleTypeDef *phost, uint8_t lun); USBH_StatusTypeDef USBH_MSC_BOT_Error(USBH_HandleTypeDef *phost, uint8_t lun); /** * @} *//* ... */ #ifdef __cplusplus }extern "C" { ... } #endif /* ... */ #endif /* __USBH_MSC_BOT_H__ */ /** * @} *//* ... */ /** * @} *//* ... */ /** * @} *//* ... */ /** * @} *//* ... */