Prusa MINI Firmware overview
usbh_msc.h
Go to the documentation of this file.
1 /**
2  ******************************************************************************
3  * @file usbh_msc.h
4  * @author MCD Application Team
5  * @version V3.2.2
6  * @date 07-July-2015
7  * @brief This file contains all the prototypes for the usbh_msc.c
8  ******************************************************************************
9  * @attention
10  *
11  * <h2><center>&copy; COPYRIGHT 2015 STMicroelectronics</center></h2>
12  *
13  * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
14  * You may not use this file except in compliance with the License.
15  * You may obtain a copy of the License at:
16  *
17  * http://www.st.com/software_license_agreement_liberty_v2
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS,
21  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  *
25  ******************************************************************************
26  */
27 
28 /* Define to prevent recursive ----------------------------------------------*/
29 #ifndef __USBH_MSC_H
30 #define __USBH_MSC_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 #include "usbh_msc_scsi.h"
40 
41 /** @addtogroup USBH_LIB
42  * @{
43  */
44 
45 /** @addtogroup USBH_CLASS
46  * @{
47  */
48 
49 /** @addtogroup USBH_MSC_CLASS
50  * @{
51  */
52 
53 /** @defgroup USBH_MSC_CORE
54  * @brief This file is the Header file for usbh_msc.c
55  * @{
56  */
57 
58 
59 /** @defgroup USBH_MSC_CORE_Exported_Types
60  * @{
61  */
62 
63 typedef enum
64 {
65  MSC_INIT = 0,
75 }
77 
78 typedef enum
79 {
83 
84 }
86 
87 typedef enum
88 {
93 }
95 
96 #ifndef MAX_SUPPORTED_LUN
97  #define MAX_SUPPORTED_LUN 2
98 #endif
99 
100 
101 /* Structure for LUN */
102 typedef struct
103 {
111 
112 }
114 
115 /* Structure for MSC process */
116 typedef struct _MSC_Process
117 {
118  uint32_t max_lun;
123  uint16_t OutEpSize;
124  uint16_t InEpSize;
131  uint16_t current_lun;
132  uint16_t rw_lun;
133  uint32_t timer;
134 }
136 
137 
138 /**
139  * @}
140  */
141 
142 
143 
144 /** @defgroup USBH_MSC_CORE_Exported_Defines
145  * @{
146  */
147 
148 #define USB_REQ_BOT_RESET 0xFF
149 #define USB_REQ_GET_MAX_LUN 0xFE
150 
151 
152 /* MSC Class Codes */
153 #define USB_MSC_CLASS 0x08
154 
155 /* Interface Descriptor field values for HID Boot Protocol */
156 #define MSC_BOT 0x50
157 #define MSC_TRANSPARENT 0x06
158 /**
159  * @}
160  */
161 
162 /** @defgroup USBH_MSC_CORE_Exported_Macros
163  * @{
164  */
165 /**
166  * @}
167  */
168 
169 /** @defgroup USBH_MSC_CORE_Exported_Variables
170  * @{
171  */
173 #define USBH_MSC_CLASS &USBH_msc
174 
175 /**
176  * @}
177  */
178 
179 /** @defgroup USBH_MSC_CORE_Exported_FunctionsPrototype
180  * @{
181  */
182 
183 /* Common APIs */
185 
186 /* APIs for LUN */
187 int8_t USBH_MSC_GetMaxLUN (USBH_HandleTypeDef *phost);
188 
190 
192 
194  uint8_t lun,
195  uint32_t address,
196  uint8_t *pbuf,
197  uint32_t length);
198 
200  uint8_t lun,
201  uint32_t address,
202  uint8_t *pbuf,
203  uint32_t length);
204 /**
205  * @}
206  */
207 
208 #ifdef __cplusplus
209 }
210 #endif
211 
212 #endif /* __USBH_MSC_H */
213 
214 
215 /**
216  * @}
217  */
218 
219 /**
220  * @}
221  */
222 
223 /**
224  * @}
225  */
226 
227 /**
228  * @}
229  */
230 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
MSC_REQ_GET_MAX_LUN
Definition: usbh_msc.h:91
USB_REQ_SET_ADDRESS
#define USB_REQ_SET_ADDRESS
Definition: usbd_def.h:86
usbd_ctlreq.h
USB_REQ_GET_STATUS
#define USB_REQ_GET_STATUS
Definition: usbd_def.h:83
USBD_STATE_ADDRESSED
#define USBD_STATE_ADDRESSED
Definition: usbd_def.h:119
USB_DESC_TYPE_STRING
#define USB_DESC_TYPE_STRING
Definition: usbd_def.h:97
_MSC_Process::timer
uint32_t timer
Definition: usbh_msc.h:133
USB_REQ_SET_CONFIGURATION
#define USB_REQ_SET_CONFIGURATION
Definition: usbd_def.h:90
USBD_LL_IsoINIncomplete
USBD_StatusTypeDef USBD_LL_IsoINIncomplete(USBD_HandleTypeDef *pdev, uint8_t epnum)
USBD_IsoINIncomplete Handle iso in incomplete event.
Definition: usbd_core.c:509
USBD_EP0_STATUS_OUT
#define USBD_EP0_STATUS_OUT
Definition: usbd_def.h:130
USBD_IDX_CONFIG_STR
#define USBD_IDX_CONFIG_STR
Definition: usbd_def.h:70
MSC_NOT_READY
Definition: usbh_msc.h:81
USBD_DescriptorsTypeDef::GetSerialStrDescriptor
uint8_t *(* GetSerialStrDescriptor)(USBD_SpeedTypeDef speed, uint16_t *length)
Definition: usbd_def.h:207
USBD_DescriptorsTypeDef::GetConfigurationStrDescriptor
uint8_t *(* GetConfigurationStrDescriptor)(USBD_SpeedTypeDef speed, uint16_t *length)
Definition: usbd_def.h:208
MAX_SUPPORTED_LUN
#define MAX_SUPPORTED_LUN
Definition: usbh_msc.h:97
_Device_cb::DeInit
uint8_t(* DeInit)(struct _USBD_HandleTypeDef *pdev, uint8_t cfgidx)
Definition: usbd_def.h:163
_USBD_HandleTypeDef::dev_old_state
uint8_t dev_old_state
Definition: usbd_def.h:237
USBD_ErrLog
#define USBD_ErrLog(...)
Definition: usbd_conf.h:157
_Device_cb::SOF
uint8_t(* SOF)(struct _USBD_HandleTypeDef *pdev)
Definition: usbd_def.h:171
USBD_EndpointTypeDef::status
uint32_t status
Definition: usbd_def.h:218
MSC_REQ_ERROR
Definition: usbh_msc.h:92
MSC_TEST_UNIT_READY
Definition: usbh_msc.h:67
USBD_RunTestMode
USBD_StatusTypeDef USBD_RunTestMode(USBD_HandleTypeDef *pdev)
USBD_RunTestMode Launch test mode process.
Definition: usbd_core.c:213
USBD_DescriptorsTypeDef
Definition: usbd_def.h:201
USB_CONFIG_SELF_POWERED
#define USB_CONFIG_SELF_POWERED
Definition: usbd_def.h:105
USBD_CtlContinueRx
USBD_StatusTypeDef USBD_CtlContinueRx(USBD_HandleTypeDef *pdev, uint8_t *pbuf, uint16_t len)
USBD_CtlContinueRx continue receive data on the ctl pipe.
Definition: usbd_ioreq.c:160
usb_setup_req::wLength
uint16_t wLength
Definition: usbd_def.h:155
USBD_ClrClassConfig
USBD_StatusTypeDef USBD_ClrClassConfig(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
USBD_ClrClassConfig Clear current configuration.
Definition: usbd_core.c:249
USBD_LL_Start
USBD_StatusTypeDef USBD_LL_Start(USBD_HandleTypeDef *pdev)
Starts the low level portion of the device driver.
Definition: usbd_conf.c:355
usbh_core.h
Header file for usbh_core.c.
_USBD_HandleTypeDef::request
USBD_SetupReqTypedef request
Definition: usbd_def.h:243
MSC_HandleTypeDef
struct _MSC_Process MSC_HandleTypeDef
USBD_StdEPReq
USBD_StatusTypeDef USBD_StdEPReq(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_StdEPReq Handle standard usb endpoint requests.
Definition: usbd_ctlreq.c:207
USBD_STATE_CONFIGURED
#define USBD_STATE_CONFIGURED
Definition: usbd_def.h:120
USBH_MSC_Write
USBH_StatusTypeDef USBH_MSC_Write(USBH_HandleTypeDef *phost, uint8_t lun, uint32_t address, uint8_t *pbuf, uint32_t length)
USBH_MSC_Write The function performs a Write operation.
Definition: usbh_msc.c:748
MSC_LUNTypeDef::capacity
SCSI_CapacityTypeDef capacity
Definition: usbh_msc.h:107
USBD_LL_SetSpeed
USBD_StatusTypeDef USBD_LL_SetSpeed(USBD_HandleTypeDef *pdev, USBD_SpeedTypeDef speed)
USBD_LL_Reset Handle Reset event.
Definition: usbd_core.c:451
USBD_LL_GetRxDataSize
uint32_t USBD_LL_GetRxDataSize(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Returns the last transfered packet size.
Definition: usbd_conf.c:696
LOBYTE
#define LOBYTE(x)
Definition: usbd_def.h:263
USBD_ClrClassConfig
USBD_StatusTypeDef USBD_ClrClassConfig(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
USBD_ClrClassConfig Clear current configuration.
Definition: usbd_core.c:249
_Device_cb::Setup
uint8_t(* Setup)(struct _USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
Definition: usbd_def.h:165
_USBD_HandleTypeDef::pClass
USBD_ClassTypeDef * pClass
Definition: usbd_def.h:245
MSC_LUNTypeDef
Definition: usbh_msc.h:102
USBD_Init
USBD_StatusTypeDef USBD_Init(USBD_HandleTypeDef *pdev, USBD_DescriptorsTypeDef *pdesc, uint8_t id)
USBD_Init Initializes the device stack and load the class driver.
Definition: usbd_core.c:96
USBD_LL_Reset
USBD_StatusTypeDef USBD_LL_Reset(USBD_HandleTypeDef *pdev)
USBD_LL_Reset Handle Reset event.
Definition: usbd_core.c:415
MIN
#define MIN(a, b)
Definition: usbd_def.h:265
MSC_UNRECOVERED_ERROR
Definition: usbh_msc.h:73
SCSI_CapacityTypeDef
Definition: usbh_msc_scsi.h:59
USBD_FAIL
Definition: usbd_def.h:197
USBD_SetClassConfig
USBD_StatusTypeDef USBD_SetClassConfig(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
USBD_SetClassConfig Configure device and start the interface.
Definition: usbd_core.c:227
_Device_cb::DataOut
uint8_t(* DataOut)(struct _USBD_HandleTypeDef *pdev, uint8_t epnum)
Definition: usbd_def.h:170
_USBD_HandleTypeDef::dev_state
uint8_t dev_state
Definition: usbd_def.h:236
USB_REQ_CLEAR_FEATURE
#define USB_REQ_CLEAR_FEATURE
Definition: usbd_def.h:84
_USBD_HandleTypeDef::ep0_state
uint32_t ep0_state
Definition: usbd_def.h:234
USBD_Stop
USBD_StatusTypeDef USBD_Stop(USBD_HandleTypeDef *pdev)
USBD_Stop Stop the USB Device Core.
Definition: usbd_core.c:196
_USBD_HandleTypeDef::ep_in
USBD_EndpointTypeDef ep_in[15]
Definition: usbd_def.h:232
_USBD_HandleTypeDef::pDesc
USBD_DescriptorsTypeDef * pDesc
Definition: usbd_def.h:244
_Device_cb::GetHSConfigDescriptor
uint8_t *(* GetHSConfigDescriptor)(uint16_t *length)
Definition: usbd_def.h:175
MSC_WRITE
Definition: usbh_msc.h:72
USBD_EP0_DATA_OUT
#define USBD_EP0_DATA_OUT
Definition: usbd_def.h:128
USBD_LL_ClearStallEP
USBD_StatusTypeDef USBD_LL_ClearStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Clears a Stall condition on an endpoint of the Low Level Driver.
Definition: usbd_conf.c:548
USBD_LL_SetUSBAddress
USBD_StatusTypeDef USBD_LL_SetUSBAddress(USBD_HandleTypeDef *pdev, uint8_t dev_addr)
Assigns a USB address to the device.
Definition: usbd_conf.c:596
USBH_MSC_Read
USBH_StatusTypeDef USBH_MSC_Read(USBH_HandleTypeDef *phost, uint8_t lun, uint32_t address, uint8_t *pbuf, uint32_t length)
USBH_MSC_Read The function performs a Read operation.
Definition: usbh_msc.c:700
USBD_DescriptorsTypeDef::GetLangIDStrDescriptor
uint8_t *(* GetLangIDStrDescriptor)(USBD_SpeedTypeDef speed, uint16_t *length)
Definition: usbd_def.h:204
USBD_IDX_PRODUCT_STR
#define USBD_IDX_PRODUCT_STR
Definition: usbd_def.h:68
USB_DESC_TYPE_CONFIGURATION
#define USB_DESC_TYPE_CONFIGURATION
Definition: usbd_def.h:96
usb_setup_req::bmRequest
uint8_t bmRequest
Definition: usbd_def.h:151
USBD_EP0_SETUP
#define USBD_EP0_SETUP
Definition: usbd_def.h:126
MSC_REQ_RESET
Definition: usbh_msc.h:90
_MSC_Process::OutEpSize
uint16_t OutEpSize
Definition: usbh_msc.h:123
USB_DESC_TYPE_DEVICE_QUALIFIER
#define USB_DESC_TYPE_DEVICE_QUALIFIER
Definition: usbd_def.h:100
_USBD_HandleTypeDef::ep0_data_len
uint32_t ep0_data_len
Definition: usbd_def.h:235
USB_REQ_GET_CONFIGURATION
#define USB_REQ_GET_CONFIGURATION
Definition: usbd_def.h:89
USB_DESC_TYPE_DEVICE
#define USB_DESC_TYPE_DEVICE
Definition: usbd_def.h:95
_USBH_HandleTypeDef
Definition: usbh_def.h:450
_USBD_HandleTypeDef::pClassData
void * pClassData
Definition: usbd_def.h:246
_MSC_Process::hbot
BOT_HandleTypeDef hbot
Definition: usbh_msc.h:129
NULL
#define NULL
Definition: usbd_def.h:53
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
Definition: usbd_def.h:115
USBD_GetLen
static uint8_t USBD_GetLen(uint8_t *buf)
USBD_GetLen return the string length.
Definition: usbd_ctlreq.c:756
USBD_LL_Suspend
USBD_StatusTypeDef USBD_LL_Suspend(USBD_HandleTypeDef *pdev)
USBD_Suspend Handle Suspend event.
Definition: usbd_core.c:464
USBD_DescriptorsTypeDef::GetManufacturerStrDescriptor
uint8_t *(* GetManufacturerStrDescriptor)(USBD_SpeedTypeDef speed, uint16_t *length)
Definition: usbd_def.h:205
_USBD_HandleTypeDef::dev_config
uint32_t dev_config
Definition: usbd_def.h:228
USBD_MAX_NUM_CONFIGURATION
#define USBD_MAX_NUM_CONFIGURATION
Definition: usbd_conf.h:97
MSC_READ_CAPACITY10
Definition: usbh_msc.h:68
_MSC_Process::InPipe
uint8_t InPipe
Definition: usbh_msc.h:119
MSC_LUNTypeDef::error
MSC_ErrorTypeDef error
Definition: usbh_msc.h:105
createSpeedLookupTable.default
default
Definition: createSpeedLookupTable.py:15
USBD_LL_Resume
USBD_StatusTypeDef USBD_LL_Resume(USBD_HandleTypeDef *pdev)
USBD_Resume Handle Resume event.
Definition: usbd_core.c:478
USB_REQ_RECIPIENT_DEVICE
#define USB_REQ_RECIPIENT_DEVICE
Definition: usbd_def.h:78
USB_REQ_RECIPIENT_INTERFACE
#define USB_REQ_RECIPIENT_INTERFACE
Definition: usbd_def.h:79
USBD_StdEPReq
USBD_StatusTypeDef USBD_StdEPReq(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_StdEPReq Handle standard usb endpoint requests.
Definition: usbd_ctlreq.c:207
USBD_LL_OpenEP
USBD_StatusTypeDef USBD_LL_OpenEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_mps)
Opens an endpoint of the low level driver.
Definition: usbd_conf.c:420
MSC_LUNTypeDef::inquiry
SCSI_StdInquiryDataTypeDef inquiry
Definition: usbh_msc.h:109
USBD_StdDevReq
USBD_StatusTypeDef USBD_StdDevReq(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_StdDevReq Handle standard usb device requests.
Definition: usbd_ctlreq.c:119
USB_REQ_GET_DESCRIPTOR
#define USB_REQ_GET_DESCRIPTOR
Definition: usbd_def.h:87
USBD_ParseSetupRequest
void USBD_ParseSetupRequest(USBD_SetupReqTypedef *req, uint8_t *pdata)
USBD_ParseSetupRequest Copy buffer into setup structure.
Definition: usbd_ctlreq.c:698
USBD_CtlSendData
USBD_StatusTypeDef USBD_CtlSendData(USBD_HandleTypeDef *pdev, uint8_t *buf, uint16_t len)
USBD_CtlSendData send data on the ctl pipe.
Definition: usbd_ioreq.c:95
USBD_IDX_MFC_STR
#define USBD_IDX_MFC_STR
Definition: usbd_def.h:67
USB_DESC_TYPE_BOS
#define USB_DESC_TYPE_BOS
Definition: usbd_def.h:102
USBD_LL_Init
USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev)
Initializes the low level portion of the device driver.
Definition: usbd_conf.c:290
USB_FEATURE_REMOTE_WAKEUP
#define USB_FEATURE_REMOTE_WAKEUP
Definition: usbd_def.h:108
USBD_ParseSetupRequest
void USBD_ParseSetupRequest(USBD_SetupReqTypedef *req, uint8_t *pdata)
USBD_ParseSetupRequest Copy buffer into setup structure.
Definition: usbd_ctlreq.c:698
USBD_StdDevReq
USBD_StatusTypeDef USBD_StdDevReq(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_StdDevReq Handle standard usb device requests.
Definition: usbd_ctlreq.c:119
MSC_ReqStateTypeDef
MSC_ReqStateTypeDef
Definition: usbh_msc.h:87
USB_FEATURE_EP_HALT
#define USB_FEATURE_EP_HALT
Definition: usbd_def.h:107
USBD_SetClassConfig
USBD_StatusTypeDef USBD_SetClassConfig(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
USBD_SetClassConfig Configure device and start the interface.
Definition: usbd_core.c:227
USBD_IDX_INTERFACE_STR
#define USBD_IDX_INTERFACE_STR
Definition: usbd_def.h:71
USBH_MSC_GetLUNInfo
USBH_StatusTypeDef USBH_MSC_GetLUNInfo(USBH_HandleTypeDef *phost, uint8_t lun, MSC_LUNTypeDef *info)
USBH_MSC_GetLUNInfo The function return a LUN information.
Definition: usbh_msc.c:676
USBD_LL_Stop
USBD_StatusTypeDef USBD_LL_Stop(USBD_HandleTypeDef *pdev)
Stops the low level portion of the device driver.
Definition: usbd_conf.c:386
_USBD_HandleTypeDef
Definition: usbd_def.h:225
USBD_RegisterClass
USBD_StatusTypeDef USBD_RegisterClass(USBD_HandleTypeDef *pdev, USBD_ClassTypeDef *pclass)
USBD_RegisterClass Link class driver to Device Core.
Definition: usbd_core.c:157
_MSC_Process::prev_req_state
MSC_ReqStateTypeDef prev_req_state
Definition: usbh_msc.h:128
USBD_DescriptorsTypeDef::GetInterfaceStrDescriptor
uint8_t *(* GetInterfaceStrDescriptor)(USBD_SpeedTypeDef speed, uint16_t *length)
Definition: usbd_def.h:209
USBD_LL_StallEP
USBD_StatusTypeDef USBD_LL_StallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Sets a Stall condition on an endpoint of the Low Level Driver.
Definition: usbd_conf.c:516
USBD_EndpointTypeDef
Definition: usbd_def.h:216
SCSI_SenseTypeDef
Definition: usbh_msc_scsi.h:67
MSC_OK
Definition: usbh_msc.h:80
MSC_READ_INQUIRY
Definition: usbh_msc.h:69
MSC_LUNTypeDef::state_changed
uint8_t state_changed
Definition: usbh_msc.h:110
USBD_IDX_LANGID_STR
#define USBD_IDX_LANGID_STR
Definition: usbd_def.h:66
_USBD_HandleTypeDef::dev_remote_wakeup
uint32_t dev_remote_wakeup
Definition: usbd_def.h:241
USBD_CtlContinueRx
USBD_StatusTypeDef USBD_CtlContinueRx(USBD_HandleTypeDef *pdev, uint8_t *pbuf, uint16_t len)
USBD_CtlContinueRx continue receive data on the ctl pipe.
Definition: usbd_ioreq.c:160
_USBD_HandleTypeDef::dev_config_status
uint32_t dev_config_status
Definition: usbd_def.h:230
USBD_Start
USBD_StatusTypeDef USBD_Start(USBD_HandleTypeDef *pdev)
USBD_Start Start the USB Device Core.
Definition: usbd_core.c:181
USBH_MSC_UnitIsReady
uint8_t USBH_MSC_UnitIsReady(USBH_HandleTypeDef *phost, uint8_t lun)
USBH_MSC_UnitIsReady The function check whether a LUN is ready.
Definition: usbh_msc.c:655
_Device_cb
Definition: usbd_def.h:160
_MSC_Process::rw_lun
uint16_t rw_lun
Definition: usbh_msc.h:132
_Device_cb::EP0_RxReady
uint8_t(* EP0_RxReady)(struct _USBD_HandleTypeDef *pdev)
Definition: usbd_def.h:167
_MSC_Process::unit
MSC_LUNTypeDef unit[MAX_SUPPORTED_LUN]
Definition: usbh_msc.h:130
USBD_EndpointTypeDef::rem_length
uint32_t rem_length
Definition: usbd_def.h:220
MSC_REQUEST_SENSE
Definition: usbh_msc.h:70
_Device_cb::DataIn
uint8_t(* DataIn)(struct _USBD_HandleTypeDef *pdev, uint8_t epnum)
Definition: usbd_def.h:169
USBD_CtlSendStatus
USBD_StatusTypeDef USBD_CtlSendStatus(USBD_HandleTypeDef *pdev)
USBD_CtlSendStatus send zero lzngth packet on the ctl pipe.
Definition: usbd_ioreq.c:177
usb_setup_req::wIndex
uint16_t wIndex
Definition: usbd_def.h:154
USBD_LL_Transmit
USBD_StatusTypeDef USBD_LL_Transmit(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint16_t size)
Transmits data over an endpoint.
Definition: usbd_conf.c:630
_Device_cb::Init
uint8_t(* Init)(struct _USBD_HandleTypeDef *pdev, uint8_t cfgidx)
Definition: usbd_def.h:162
MSC_PERIODIC_CHECK
Definition: usbh_msc.h:74
USBD_GetConfig
static void USBD_GetConfig(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_GetConfig Handle Get device configuration request.
Definition: usbd_ctlreq.c:568
_MSC_Process::state
MSC_StateTypeDef state
Definition: usbh_msc.h:125
usbd_ioreq.h
Header file for the usbd_ioreq.c file.
USBD_CtlContinueSendData
USBD_StatusTypeDef USBD_CtlContinueSendData(USBD_HandleTypeDef *pdev, uint8_t *pbuf, uint16_t len)
USBD_CtlContinueSendData continue sending data on the ctl pipe.
Definition: usbd_ioreq.c:117
SWAPBYTE
#define SWAPBYTE(addr)
Definition: usbd_def.h:260
USBD_SetFeature
static void USBD_SetFeature(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_SetFeature Handle Set device feature request.
Definition: usbd_ctlreq.c:648
_MSC_Process::current_lun
uint16_t current_lun
Definition: usbh_msc.h:131
USBD_SPEED_HIGH
Definition: usbd_def.h:188
USBD_LL_SOF
USBD_StatusTypeDef USBD_LL_SOF(USBD_HandleTypeDef *pdev)
USBD_SOF Handle SOF event.
Definition: usbd_core.c:491
USBD_CtlError
void USBD_CtlError(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_CtlError Handle USB low level Error.
Definition: usbd_ctlreq.c:716
USBH_msc
USBH_ClassTypeDef USBH_msc
Definition: usbh_msc.c:111
SCSI_StdInquiryDataTypeDef
Definition: usbh_msc_scsi.h:75
_USBD_HandleTypeDef::id
uint8_t id
Definition: usbd_def.h:227
uint8_t
const uint8_t[]
Definition: 404_html.c:3
MSC_LUNTypeDef::prev_ready_state
USBH_StatusTypeDef prev_ready_state
Definition: usbh_msc.h:106
address
UsbDeviceAddress address
Definition: address.h:202
usb_setup_req
Definition: usbd_def.h:148
USBD_LL_DevConnected
USBD_StatusTypeDef USBD_LL_DevConnected(USBD_HandleTypeDef *pdev)
USBD_DevConnected Handle device connection event.
Definition: usbd_core.c:531
_MSC_Process::req_state
MSC_ReqStateTypeDef req_state
Definition: usbh_msc.h:127
USBD_SetConfig
static void USBD_SetConfig(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_SetConfig Handle Set device configuration request.
Definition: usbd_ctlreq.c:491
_USBD_HandleTypeDef::dev_speed
USBD_SpeedTypeDef dev_speed
Definition: usbd_def.h:231
USBH_StatusTypeDef
USBH_StatusTypeDef
Definition: usbh_def.h:302
USBD_LL_PrepareReceive
USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint16_t size)
Prepares an endpoint for reception.
Definition: usbd_conf.c:664
USBD_GetStatus
static void USBD_GetStatus(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_GetStatus Handle Get Status request.
Definition: usbd_ctlreq.c:608
usbh_msc_bot.h
Header file for usbh_msc_bot.c.
_MSC_Process::InEpSize
uint16_t InEpSize
Definition: usbh_msc.h:124
usb_setup_req::wValue
uint16_t wValue
Definition: usbd_def.h:153
_USBD_HandleTypeDef::ep_out
USBD_EndpointTypeDef ep_out[15]
Definition: usbd_def.h:233
USBD_CtlSendStatus
USBD_StatusTypeDef USBD_CtlSendStatus(USBD_HandleTypeDef *pdev)
USBD_CtlSendStatus send zero lzngth packet on the ctl pipe.
Definition: usbd_ioreq.c:177
USBD_STATE_DEFAULT
#define USBD_STATE_DEFAULT
Definition: usbd_def.h:118
USBD_DescriptorsTypeDef::GetProductStrDescriptor
uint8_t *(* GetProductStrDescriptor)(USBD_SpeedTypeDef speed, uint16_t *length)
Definition: usbd_def.h:206
BOT_HandleTypeDef
Definition: usbh_msc_bot.h:131
USBH_MSC_IsReady
uint8_t USBH_MSC_IsReady(USBH_HandleTypeDef *phost)
USBH_MSC_IsReady The function check if the MSC function is ready.
Definition: usbh_msc.c:617
USBD_IDX_SERIAL_STR
#define USBD_IDX_SERIAL_STR
Definition: usbd_def.h:69
USB_REQ_SET_FEATURE
#define USB_REQ_SET_FEATURE
Definition: usbd_def.h:85
_USBD_HandleTypeDef::dev_test_mode
uint8_t dev_test_mode
Definition: usbd_def.h:240
USBD_CtlReceiveStatus
USBD_StatusTypeDef USBD_CtlReceiveStatus(USBD_HandleTypeDef *pdev)
USBD_CtlReceiveStatus receive zero lzngth packet on the ctl pipe.
Definition: usbd_ioreq.c:195
USBD_DescriptorsTypeDef::GetDeviceDescriptor
uint8_t *(* GetDeviceDescriptor)(USBD_SpeedTypeDef speed, uint16_t *length)
Definition: usbd_def.h:203
status
static status_t status
Definition: filament_sensor.c:37
USBD_StatusTypeDef
USBD_StatusTypeDef
Definition: usbd_def.h:194
_MSC_Process::InEp
uint8_t InEp
Definition: usbh_msc.h:122
USBD_StdItfReq
USBD_StatusTypeDef USBD_StdItfReq(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_StdItfReq Handle standard usb interface requests.
Definition: usbd_ctlreq.c:170
_MSC_Process::error
MSC_ErrorTypeDef error
Definition: usbh_msc.h:126
_MSC_Process::OutPipe
uint8_t OutPipe
Definition: usbh_msc.h:120
USBD_LL_IsStallEP
uint8_t USBD_LL_IsStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Returns Stall condition.
Definition: usbd_conf.c:580
USBD_CtlReceiveStatus
USBD_StatusTypeDef USBD_CtlReceiveStatus(USBD_HandleTypeDef *pdev)
USBD_CtlReceiveStatus receive zero lzngth packet on the ctl pipe.
Definition: usbd_ioreq.c:195
_MSC_Process::max_lun
uint32_t max_lun
Definition: usbh_msc.h:118
usb_setup_req::bRequest
uint8_t bRequest
Definition: usbd_def.h:152
USBD_GetRxCount
uint16_t USBD_GetRxCount(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
USBD_GetRxCount returns the received data length.
Definition: usbd_ioreq.c:217
MSC_READ
Definition: usbh_msc.h:71
USB_REQ_RECIPIENT_ENDPOINT
#define USB_REQ_RECIPIENT_ENDPOINT
Definition: usbd_def.h:80
USB_CONFIG_REMOTE_WAKEUP
#define USB_CONFIG_REMOTE_WAKEUP
Definition: usbd_def.h:104
MSC_ErrorTypeDef
MSC_ErrorTypeDef
Definition: usbh_msc.h:78
_MSC_Process::OutEp
uint8_t OutEp
Definition: usbh_msc.h:121
USBD_DeInit
USBD_StatusTypeDef USBD_DeInit(USBD_HandleTypeDef *pdev)
USBD_DeInit Re-Initialize th device library.
Definition: usbd_core.c:132
MSC_StateTypeDef
MSC_StateTypeDef
Definition: usbh_msc.h:63
USBD_LL_IsoOUTIncomplete
USBD_StatusTypeDef USBD_LL_IsoOUTIncomplete(USBD_HandleTypeDef *pdev, uint8_t epnum)
USBD_IsoOUTIncomplete Handle iso out incomplete event.
Definition: usbd_core.c:520
USBD_CtlPrepareRx
USBD_StatusTypeDef USBD_CtlPrepareRx(USBD_HandleTypeDef *pdev, uint8_t *pbuf, uint16_t len)
USBD_CtlPrepareRx receive data on the ctl pipe.
Definition: usbd_ioreq.c:135
USBD_SpeedTypeDef
USBD_SpeedTypeDef
Definition: usbd_def.h:186
_Device_cb::GetFSConfigDescriptor
uint8_t *(* GetFSConfigDescriptor)(uint16_t *length)
Definition: usbd_def.h:176
usbh_msc_scsi.h
Header file for usbh_msc_scsi.c.
USBD_MAX_NUM_INTERFACES
#define USBD_MAX_NUM_INTERFACES
Definition: usbd_conf.h:95
MSC_IDLE
Definition: usbh_msc.h:66
USBD_EP0_STATUS_IN
#define USBD_EP0_STATUS_IN
Definition: usbd_def.h:129
USBD_EP_TYPE_CTRL
#define USBD_EP_TYPE_CTRL
Definition: usbd_def.h:133
USBD_ClrFeature
static void USBD_ClrFeature(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_ClrFeature Handle clear device feature request.
Definition: usbd_ctlreq.c:669
MSC_INIT
Definition: usbh_msc.h:65
length
png_uint_32 length
Definition: png.c:2247
_USBD_HandleTypeDef::dev_address
uint8_t dev_address
Definition: usbd_def.h:238
_Device_cb::GetDeviceQualifierDescriptor
uint8_t *(* GetDeviceQualifierDescriptor)(uint16_t *length)
Definition: usbd_def.h:178
USBD_STATE_SUSPENDED
#define USBD_STATE_SUSPENDED
Definition: usbd_def.h:121
USBD_EP0_DATA_IN
#define USBD_EP0_DATA_IN
Definition: usbd_def.h:127
_Device_cb::EP0_TxSent
uint8_t(* EP0_TxSent)(struct _USBD_HandleTypeDef *pdev)
Definition: usbd_def.h:166
_USBD_HandleTypeDef::dev_default_config
uint32_t dev_default_config
Definition: usbd_def.h:229
USBD_LL_DataOutStage
USBD_StatusTypeDef USBD_LL_DataOutStage(USBD_HandleTypeDef *pdev, uint8_t epnum, uint8_t *pdata)
USBD_DataOutStage Handle data OUT stage.
Definition: usbd_core.c:299
pbuf
Definition: pbuf.h:142
USBH_MSC_GetMaxLUN
int8_t USBH_MSC_GetMaxLUN(USBH_HandleTypeDef *phost)
USBH_MSC_GetMaxLUN The function return the Max LUN supported.
Definition: usbh_msc.c:637
USBD_LL_DataInStage
USBD_StatusTypeDef USBD_LL_DataInStage(USBD_HandleTypeDef *pdev, uint8_t epnum, uint8_t *pdata)
USBD_DataInStage Handle data in stage.
Definition: usbd_core.c:343
MSC_LUNTypeDef::state
MSC_StateTypeDef state
Definition: usbh_msc.h:104
MSC_REQ_IDLE
Definition: usbh_msc.h:89
USBD_OK
Definition: usbd_def.h:195
MSC_ERROR
Definition: usbh_msc.h:82
USBD_GetDescriptor
static void USBD_GetDescriptor(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_GetDescriptor Handle Get Descriptor requests.
Definition: usbd_ctlreq.c:331
_MSC_Process
Definition: usbh_msc.h:116
USBD_EndpointTypeDef::maxpacket
uint32_t maxpacket
Definition: usbd_def.h:221
USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION
#define USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION
Definition: usbd_def.h:101
USBD_CtlContinueSendData
USBD_StatusTypeDef USBD_CtlContinueSendData(USBD_HandleTypeDef *pdev, uint8_t *pbuf, uint16_t len)
USBD_CtlContinueSendData continue sending data on the ctl pipe.
Definition: usbd_ioreq.c:117
USBD_GetString
void USBD_GetString(uint8_t *desc, uint8_t *unicode, uint16_t *len)
USBD_GetString Convert Ascii string into unicode one.
Definition: usbd_ctlreq.c:732
MSC_LUNTypeDef::sense
SCSI_SenseTypeDef sense
Definition: usbh_msc.h:108
USBD_LL_DevDisconnected
USBD_StatusTypeDef USBD_LL_DevDisconnected(USBD_HandleTypeDef *pdev)
USBD_DevDisconnected Handle device disconnection event.
Definition: usbd_core.c:542
USBD_CtlSendData
USBD_StatusTypeDef USBD_CtlSendData(USBD_HandleTypeDef *pdev, uint8_t *pbuf, uint16_t len)
USBD_CtlSendData send data on the ctl pipe.
Definition: usbd_ioreq.c:95
USBD_LL_SetupStage
USBD_StatusTypeDef USBD_LL_SetupStage(USBD_HandleTypeDef *pdev, uint8_t *psetup)
USBD_SetupStage Handle the setup stage.
Definition: usbd_core.c:263
USBD_SetAddress
static void USBD_SetAddress(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_SetAddress Set device address.
Definition: usbd_ctlreq.c:449
_Device_cb::GetOtherSpeedConfigDescriptor
uint8_t *(* GetOtherSpeedConfigDescriptor)(uint16_t *length)
Definition: usbd_def.h:177
USBD_EndpointTypeDef::total_length
uint32_t total_length
Definition: usbd_def.h:219
USBD_LL_DeInit
USBD_StatusTypeDef USBD_LL_DeInit(USBD_HandleTypeDef *pdev)
De-Initializes the low level portion of the device driver.
Definition: usbd_conf.c:324
USBD_StdItfReq
USBD_StatusTypeDef USBD_StdItfReq(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_StdItfReq Handle standard usb interface requests.
Definition: usbd_ctlreq.c:170
USBH_ClassTypeDef
Definition: usbh_def.h:437
usbd_core.h
Header file for usbd_core.c file.
info
uint8_t info[12]
Definition: masstorage.h:54