Select one of the symbols to view example projects that use it.
 
Outline
#define __USBH_MSC_H
#include "usbh_core.h"
#include "usbh_msc_bot.h"
#include "usbh_msc_scsi.h"
MSC_StateTypeDef
MSC_ErrorTypeDef
MSC_ReqStateTypeDef
#define MAX_SUPPORTED_LUN
MSC_LUNTypeDef
_MSC_Process
#define USB_REQ_BOT_RESET
#define USB_REQ_GET_MAX_LUN
#define USB_MSC_CLASS
#define MSC_BOT
#define MSC_TRANSPARENT
USBH_msc;
#define USBH_MSC_CLASS
USBH_MSC_IsReady(USBH_HandleTypeDef *);
USBH_MSC_GetMaxLUN(USBH_HandleTypeDef *);
USBH_MSC_UnitIsReady(USBH_HandleTypeDef *, uint8_t);
USBH_MSC_GetLUNInfo(USBH_HandleTypeDef *, uint8_t, MSC_LUNTypeDef *);
USBH_MSC_Read(USBH_HandleTypeDef *, uint8_t, uint32_t, uint8_t *, uint32_t);
USBH_MSC_Write(USBH_HandleTypeDef *, uint8_t, uint32_t, uint8_t *, uint32_t);
Files
loading...
SourceVuSTM32 Libraries and SamplesSTM32_USB_Host_LibraryClass/MSC/Inc/usbh_msc.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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * @file usbh_msc.h * @author MCD Application Team * @brief This file contains all the prototypes for the usbh_msc.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_H #define __USBH_MSC_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "usbh_core.h" #include "usbh_msc_bot.h" #include "usbh_msc_scsi.h" /** @addtogroup USBH_LIB * @{ *//* ... */ /** @addtogroup USBH_CLASS * @{ *//* ... */ /** @addtogroup USBH_MSC_CLASS * @{ *//* ... */ /** @defgroup USBH_MSC_CORE * @brief This file is the Header file for usbh_msc.c * @{ *//* ... */ /** @defgroup USBH_MSC_CORE_Exported_Types * @{ *//* ... */ typedef enum { MSC_INIT = 0, MSC_IDLE, MSC_TEST_UNIT_READY, MSC_READ_CAPACITY10, MSC_READ_INQUIRY, MSC_REQUEST_SENSE, MSC_READ, MSC_WRITE, MSC_UNRECOVERED_ERROR, MSC_PERIODIC_CHECK, ...} MSC_StateTypeDef; typedef enum { MSC_OK, MSC_NOT_READY, MSC_ERROR, ...} MSC_ErrorTypeDef; typedef enum { MSC_REQ_IDLE = 0, MSC_REQ_RESET, MSC_REQ_GET_MAX_LUN, MSC_REQ_ERROR, ...} MSC_ReqStateTypeDef; #ifndef MAX_SUPPORTED_LUN #define MAX_SUPPORTED_LUN 2U #endif /* Structure for LUN */ typedef struct { MSC_StateTypeDef state; MSC_ErrorTypeDef error; USBH_StatusTypeDef prev_ready_state; SCSI_CapacityTypeDef capacity; SCSI_SenseTypeDef sense; SCSI_StdInquiryDataTypeDef inquiry; uint8_t state_changed; ...} MSC_LUNTypeDef; /* Structure for MSC process */ typedef struct _MSC_Process { uint8_t max_lun; uint8_t Reserved[3]; uint8_t InPipe; uint8_t OutPipe; uint8_t OutEp; uint8_t InEp; uint16_t OutEpSize; uint16_t InEpSize; MSC_StateTypeDef state; MSC_ErrorTypeDef error; MSC_ReqStateTypeDef req_state; MSC_ReqStateTypeDef prev_req_state; BOT_HandleTypeDef hbot; MSC_LUNTypeDef unit[MAX_SUPPORTED_LUN]; uint16_t current_lun; uint16_t rw_lun; uint32_t timer; ...} MSC_HandleTypeDef; /** * @} *//* ... */ /** @defgroup USBH_MSC_CORE_Exported_Defines * @{ *//* ... */ #define USB_REQ_BOT_RESET 0xFFU #define USB_REQ_GET_MAX_LUN 0xFEU /* MSC Class Codes */ #define USB_MSC_CLASS 0x08U /* Interface Descriptor field values for HID Boot Protocol */ #define MSC_BOT 0x50U #define MSC_TRANSPARENT 0x06U 5 defines/** * @} *//* ... */ /** @defgroup USBH_MSC_CORE_Exported_Macros * @{ *//* ... */ /** * @} *//* ... */ /** @defgroup USBH_MSC_CORE_Exported_Variables * @{ *//* ... */ extern USBH_ClassTypeDef USBH_msc; #define USBH_MSC_CLASS &USBH_msc /** * @} *//* ... */ /** @defgroup USBH_MSC_CORE_Exported_FunctionsPrototype * @{ *//* ... */ uint8_t USBH_MSC_IsReady(USBH_HandleTypeDef *phost); uint8_t USBH_MSC_GetMaxLUN(USBH_HandleTypeDef *phost); uint8_t USBH_MSC_UnitIsReady(USBH_HandleTypeDef *phost, uint8_t lun); USBH_StatusTypeDef USBH_MSC_GetLUNInfo(USBH_HandleTypeDef *phost, uint8_t lun, MSC_LUNTypeDef *info); USBH_StatusTypeDef USBH_MSC_Read(USBH_HandleTypeDef *phost, uint8_t lun, uint32_t address, uint8_t *pbuf, uint32_t length); USBH_StatusTypeDef USBH_MSC_Write(USBH_HandleTypeDef *phost, uint8_t lun, uint32_t address, uint8_t *pbuf, uint32_t length); /** * @} *//* ... */ #ifdef __cplusplus }extern "C" { ... } #endif /* ... */ #endif /* __USBH_MSC_H */ /** * @} *//* ... */ /** * @} *//* ... */ /** * @} *//* ... */ /** * @} *//* ... */
Details
Show:
from
Types: Columns:
This file uses the notable symbols shown below. Click anywhere in the file to view more details.