Prusa MINI Firmware overview
usbh_core.h
Go to the documentation of this file.
1 /**
2  ******************************************************************************
3  * @file usbh_core.h
4  * @author MCD Application Team
5  * @version V3.2.2
6  * @date 07-July-2015
7  * @brief Header file for usbh_core.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_CORE_H
30 #define __USBH_CORE_H
31 
32 #ifdef __cplusplus
33  extern "C" {
34 #endif
35 
36 /* Includes ------------------------------------------------------------------*/
37 #include "usbh_conf.h"
38 #include "usbh_def.h"
39 #include "usbh_ioreq.h"
40 #include "usbh_pipes.h"
41 #include "usbh_ctlreq.h"
42 
43 /** @addtogroup USBH_LIB
44  * @{
45  */
46 
47 /** @addtogroup USBH_LIB_CORE
48 * @{
49 */
50 
51 /** @defgroup USBH_CORE
52  * @brief This file is the Header file for usbh_core.c
53  * @{
54  */
55 
56 
57 /** @defgroup USBH_CORE_Exported_Defines
58  * @{
59  */
60 
61 /**
62  * @}
63  */
64 #define HOST_USER_SELECT_CONFIGURATION 1
65 #define HOST_USER_CLASS_ACTIVE 2
66 #define HOST_USER_CLASS_SELECTED 3
67 #define HOST_USER_CONNECTION 4
68 #define HOST_USER_DISCONNECTION 5
69 #define HOST_USER_UNRECOVERED_ERROR 6
70 
71 
72 /**
73  * @}
74  */
75 
76 
77 
78 /** @defgroup USBH_CORE_Exported_Macros
79  * @{
80  */
81 
82 /**
83  * @}
84  */
85 
86 /** @defgroup USBH_CORE_Exported_Variables
87  * @{
88  */
89 
90 /**
91  * @}
92  */
93 
94 /** @defgroup USBH_CORE_Exported_FunctionsPrototype
95  * @{
96  */
97 
98 
104  uint8_t Class,
105  uint8_t SubClass,
106  uint8_t Protocol);
108 
110  uint8_t interface_number,
111  uint8_t alt_settings);
112 
117 
118 /* USBH Low Level Driver */
123 
130 
135 #if (USBH_USE_OS == 1)
136 USBH_StatusTypeDef USBH_LL_NotifyURBChange (USBH_HandleTypeDef *phost);
137 #endif
140 
141 /* USBH Time base */
142 void USBH_Delay (uint32_t Delay);
143 void USBH_LL_SetTimer (USBH_HandleTypeDef *phost, uint32_t );
145 /**
146  * @}
147  */
148 
149 #ifdef __cplusplus
150 }
151 #endif
152 
153 #endif /* __USBH_CORE_H */
154 /**
155  * @}
156  */
157 
158 /**
159  * @}
160  */
161 
162 /**
163 * @}
164 */
165 
166 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
MSC_REQ_GET_MAX_LUN
Definition: usbh_msc.h:91
USBH_malloc
#define USBH_malloc
Definition: usbh_conf.h:148
usbh_conf.h
: Header for usbh_conf.c file.
USBH_Process
USBH_StatusTypeDef USBH_Process(USBH_HandleTypeDef *phost)
USBH_Process Background process of the USB Core.
Definition: usbh_core.c:397
USBH_CtrlTypeDef::setup
USB_Setup_TypeDef setup
Definition: usbh_def.h:412
BOT_CBWTypeDef::__CBW::LUN
uint8_t LUN
Definition: usbh_msc_bot.h:110
_MSC_Process::timer
uint32_t timer
Definition: usbh_msc.h:133
USBH_LL_DeInit
USBH_StatusTypeDef USBH_LL_DeInit(USBH_HandleTypeDef *phost)
De-Initialize the low level portion of the host driver.
Definition: usbh_conf.c:221
USBH_BulkSendData
USBH_StatusTypeDef USBH_BulkSendData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t hc_num, uint8_t do_ping)
USBH_BulkSendData Sends the Bulk Packet to the device.
Definition: usbh_ioreq.c:186
MSC_NOT_READY
Definition: usbh_msc.h:81
DATA_LEN_INQUIRY
#define DATA_LEN_INQUIRY
Definition: usbh_msc_scsi.h:97
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
USBH_LL_GetSpeed
USBH_SpeedTypeDef USBH_LL_GetSpeed(USBH_HandleTypeDef *phost)
Return the USB host speed from the low level driver.
Definition: usbh_conf.c:314
MSC_TRANSPARENT
#define MSC_TRANSPARENT
Definition: usbh_msc.h:157
MSC_REQ_ERROR
Definition: usbh_msc.h:92
BOT_CBWTypeDef::__CBW::CBLength
uint8_t CBLength
Definition: usbh_msc_bot.h:111
USBH_UNRECOVERED_ERROR
Definition: usbh_def.h:308
MSC_TEST_UNIT_READY
Definition: usbh_msc.h:67
USBH_LL_SubmitURB
USBH_StatusTypeDef USBH_LL_SubmitURB(USBH_HandleTypeDef *phost, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t *, uint16_t, uint8_t)
Submit a new URB to the low level driver.
Definition: usbh_conf.c:475
auto_build.error
bool error
Definition: auto_build.py:637
USBH_MSC_SCSI_Read
USBH_StatusTypeDef USBH_MSC_SCSI_Read(USBH_HandleTypeDef *phost, uint8_t lun, uint32_t address, uint8_t *pbuf, uint32_t length)
USBH_MSC_SCSI_Read Issue Read10 command.
Definition: usbh_msc_scsi.c:384
HOST_USER_CLASS_ACTIVE
#define HOST_USER_CLASS_ACTIVE
Definition: usbh_core.h:65
USBH_SelectInterface
USBH_StatusTypeDef USBH_SelectInterface(USBH_HandleTypeDef *phost, uint8_t interface)
USBH_SelectInterface Select current interface.
Definition: usbh_core.c:233
BOT_CBW_TAG
#define BOT_CBW_TAG
Definition: usbh_msc_bot.h:155
USBH_CLASS_EVENT
Definition: usbh_def.h:398
USBH_MSC_BOT_Init
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
USBH_MSC_BOT_Process
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
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
MSC_LUNTypeDef::capacity
SCSI_CapacityTypeDef capacity
Definition: usbh_msc.h:107
USBH_URB_NOTREADY
Definition: usbh_def.h:387
BOT_ERROR_IN
Definition: usbh_msc_bot.h:96
BOT_CBW_LENGTH
#define BOT_CBW_LENGTH
Definition: usbh_msc_bot.h:157
_USB_Setup::_SetupPkt_Struc::bRequest
uint8_t bRequest
Definition: usbh_def.h:222
BOT_CBWTypeDef::__CBW::CB
uint8_t CB[16]
Definition: usbh_msc_bot.h:112
BOT_CSWTypeDef::data
uint8_t data[13]
Definition: usbh_msc_bot.h:127
SCSI_SENSE_KEY_UNIT_ATTENTION
#define SCSI_SENSE_KEY_UNIT_ATTENTION
Definition: usbh_msc_scsi.h:112
CBW_LENGTH
#define CBW_LENGTH
Definition: usbh_msc_scsi.h:101
BOT_CBWTypeDef::__CBW::Tag
uint32_t Tag
Definition: usbh_msc_bot.h:107
USBH_CtlReq
USBH_StatusTypeDef USBH_CtlReq(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length)
USBH_CtlReq USBH_CtlReq sends a control request and provide the status after completion of the reques...
Definition: usbh_ctlreq.c:531
MSC_LUNTypeDef
Definition: usbh_msc.h:102
BOT_DATA_IN_WAIT
Definition: usbh_msc_bot.h:91
CBW_CB_LENGTH
#define CBW_CB_LENGTH
Definition: usbh_msc_scsi.h:100
USBH_ClrFeature
USBH_StatusTypeDef USBH_ClrFeature(USBH_HandleTypeDef *phost, uint8_t ep_num)
USBH_ClrFeature This request is used to clear or disable a specific feature.
Definition: usbh_ctlreq.c:308
USBH_MSC_SCSI_ReadCapacity
USBH_StatusTypeDef USBH_MSC_SCSI_ReadCapacity(USBH_HandleTypeDef *phost, uint8_t lun, SCSI_CapacityTypeDef *capacity)
USBH_MSC_SCSI_ReadCapacity Issue Read Capacity command.
Definition: usbh_msc_scsi.c:146
BOT_CBWTypeDef::data
uint8_t data[31]
Definition: usbh_msc_bot.h:114
USBH_Delay
void USBH_Delay(uint32_t Delay)
Delay routine for the USB Host Library.
Definition: usbh_conf.c:601
USBH_free
#define USBH_free
Definition: usbh_conf.h:151
MSC_UNRECOVERED_ERROR
Definition: usbh_msc.h:73
SCSI_CapacityTypeDef
Definition: usbh_msc_scsi.h:59
BOT_RECEIVE_CSW_WAIT
Definition: usbh_msc_bot.h:95
BOT_DIR_IN
#define BOT_DIR_IN
Definition: usbh_msc_bot.h:165
usbh_pipes.h
Header file for usbh_pipes.c.
OPCODE_READ10
#define OPCODE_READ10
Definition: usbh_msc_scsi.h:90
BOT_HandleTypeDef::cbw
BOT_CBWTypeDef cbw
Definition: usbh_msc_bot.h:137
BOT_CBW_SIGNATURE
#define BOT_CBW_SIGNATURE
Definition: usbh_msc_bot.h:154
USBH_msc
USBH_ClassTypeDef USBH_msc
Definition: usbh_msc.c:111
USBH_LL_DriverVBUS
USBH_StatusTypeDef USBH_LL_DriverVBUS(USBH_HandleTypeDef *phost, uint8_t)
Drive VBUS.
Definition: usbh_conf.c:532
BOT_CSWTypeDef::field
struct BOT_CSWTypeDef::__CSW field
USBH_MSC_BOT_Init
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
i
uint8_t i
Definition: screen_test_graph.c:72
usbh_ioreq.h
Header file for usbh_ioreq.c.
_USB_Setup::_SetupPkt_Struc::wIndex
uint16_t_uint8_t wIndex
Definition: usbh_def.h:224
USBH_MSC_SCSI_Read
USBH_StatusTypeDef USBH_MSC_SCSI_Read(USBH_HandleTypeDef *phost, uint8_t lun, uint32_t address, uint8_t *pbuf, uint32_t length)
USBH_MSC_SCSI_Read Issue Read10 command.
Definition: usbh_msc_scsi.c:384
USBH_URB_DONE
Definition: usbh_def.h:386
OPCODE_INQUIRY
#define OPCODE_INQUIRY
Definition: usbh_msc_scsi.h:93
USBH_ClosePipe
USBH_StatusTypeDef USBH_ClosePipe(USBH_HandleTypeDef *phost, uint8_t pipe_num)
USBH_ClosePipe Close a pipe.
Definition: usbh_pipes.c:121
MSC_WRITE
Definition: usbh_msc.h:72
SCSI_SenseTypeDef::key
uint8_t key
Definition: usbh_msc_scsi.h:69
USBH_MSC_Process
static USBH_StatusTypeDef USBH_MSC_Process(USBH_HandleTypeDef *phost)
USBH_MSC_Process The function is for managing state machine for MSC data transfers.
Definition: usbh_msc.c:325
USBH_MSC_SCSI_TestUnitReady
USBH_StatusTypeDef USBH_MSC_SCSI_TestUnitReady(USBH_HandleTypeDef *phost, uint8_t lun)
USBH_MSC_SCSI_TestUnitReady Issue TestUnitReady command.
Definition: usbh_msc_scsi.c:104
SCSI_StdInquiryDataTypeDef::product_id
uint8_t product_id[17]
Definition: usbh_msc_scsi.h:81
usbh_def.h
Definitions used in the USB host library.
USBH_MSC_BOT_Process
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
USB_EP_DIR_IN
#define USB_EP_DIR_IN
Definition: usbh_def.h:176
USBH_MSC_SCSI_Write
USBH_StatusTypeDef USBH_MSC_SCSI_Write(USBH_HandleTypeDef *phost, uint8_t lun, uint32_t address, uint8_t *pbuf, uint32_t length)
USBH_MSC_SCSI_Write Issue write10 command.
Definition: usbh_msc_scsi.c:323
BOT_CBWTypeDef::field
struct BOT_CBWTypeDef::__CBW field
USBH_BulkReceiveData
USBH_StatusTypeDef USBH_BulkReceiveData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t hc_num)
USBH_BulkReceiveData Receives IN bulk packet from device.
Definition: usbh_ioreq.c:218
USBH_LL_OpenPipe
USBH_StatusTypeDef USBH_LL_OpenPipe(USBH_HandleTypeDef *phost, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint16_t)
Open a pipe of the low level driver.
Definition: usbh_conf.c:388
BOT_HandleTypeDef::cmd_state
BOT_CMDStateTypeDef cmd_state
Definition: usbh_msc_bot.h:136
_USBH_HandleTypeDef::Timer
__IO uint32_t Timer
Definition: usbh_def.h:461
_MSC_Process::OutEpSize
uint16_t OutEpSize
Definition: usbh_msc.h:123
_USBH_HandleTypeDef
Definition: usbh_def.h:450
USBH_FindInterfaceIndex
uint8_t USBH_FindInterfaceIndex(USBH_HandleTypeDef *phost, uint8_t interface_number, uint8_t alt_settings)
USBH_FindInterfaceIndex Find the interface index for a specific class interface and alternate setting...
Definition: usbh_core.c:306
USBH_MSC_BOT_REQ_GetMaxLUN
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
_MSC_Process::hbot
BOT_HandleTypeDef hbot
Definition: usbh_msc.h:129
NULL
#define NULL
Definition: usbd_def.h:53
USBH_ClassTypeDef::pData
void * pData
Definition: usbh_def.h:446
USBH_memset
#define USBH_memset
Definition: usbh_conf.h:154
_USBH_HandleTypeDef::Control
USBH_CtrlTypeDef Control
Definition: usbh_def.h:455
USBH_memcpy
#define USBH_memcpy
Definition: usbh_conf.h:157
USBH_URB_IDLE
Definition: usbh_def.h:385
_USB_Setup::_SetupPkt_Struc::wValue
uint16_t_uint8_t wValue
Definition: usbh_def.h:223
USBH_LL_ResetPort
USBH_StatusTypeDef USBH_LL_ResetPort(USBH_HandleTypeDef *phost)
Reset the Host port of the low level driver.
Definition: usbh_conf.c:342
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
USBH_LL_Stop
USBH_StatusTypeDef USBH_LL_Stop(USBH_HandleTypeDef *phost)
Stop the low level portion of the host driver.
Definition: usbh_conf.c:283
BOT_RECEIVE_CSW
Definition: usbh_msc_bot.h:94
MSC_LUNTypeDef::inquiry
SCSI_StdInquiryDataTypeDef inquiry
Definition: usbh_msc.h:109
USBH_MSC_RdWrProcess
static USBH_StatusTypeDef USBH_MSC_RdWrProcess(USBH_HandleTypeDef *phost, uint8_t lun)
USBH_MSC_RdWrProcess The function is for managing state machine for MSC I/O Process.
Definition: usbh_msc.c:523
USBH_FreePipe
USBH_StatusTypeDef USBH_FreePipe(USBH_HandleTypeDef *phost, uint8_t idx)
USBH_Free_Pipe Free the USB Pipe.
Definition: usbh_pipes.c:158
SCSI_SenseTypeDef::asc
uint8_t asc
Definition: usbh_msc_scsi.h:70
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
USBH_OpenPipe
USBH_StatusTypeDef USBH_OpenPipe(USBH_HandleTypeDef *phost, uint8_t ch_num, uint8_t epnum, uint8_t dev_address, uint8_t speed, uint8_t ep_type, uint16_t mps)
USBH_Open_Pipe Open a pipe.
Definition: usbh_pipes.c:93
USBH_LL_SetTimer
void USBH_LL_SetTimer(USBH_HandleTypeDef *phost, uint32_t)
USBH_LL_SetTimer Set the initial Host Timer tick.
Definition: usbh_core.c:791
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
USBH_LL_Start
USBH_StatusTypeDef USBH_LL_Start(USBH_HandleTypeDef *phost)
Start the low level portion of the host driver.
Definition: usbh_conf.c:252
USBH_MSC_SOFProcess
static USBH_StatusTypeDef USBH_MSC_SOFProcess(USBH_HandleTypeDef *phost)
USBH_MSC_SOFProcess The function is for SOF state.
Definition: usbh_msc.c:511
USBH_MSC_SCSI_Inquiry
USBH_StatusTypeDef USBH_MSC_SCSI_Inquiry(USBH_HandleTypeDef *phost, uint8_t lun, SCSI_StdInquiryDataTypeDef *inquiry)
USBH_MSC_SCSI_Inquiry Issue Inquiry command.
Definition: usbh_msc_scsi.c:202
OPCODE_READ_CAPACITY10
#define OPCODE_READ_CAPACITY10
Definition: usbh_msc_scsi.h:89
USBH_LL_GetToggle
uint8_t USBH_LL_GetToggle(USBH_HandleTypeDef *phost, uint8_t)
Return the current toggle of a pipe.
Definition: usbh_conf.c:583
_USB_Setup::_SetupPkt_Struc::wLength
uint16_t_uint8_t wLength
Definition: usbh_def.h:225
USBH_URB_EVENT
Definition: usbh_def.h:396
BOT_CSWTypeDef::__CSW::Signature
uint32_t Signature
Definition: usbh_msc_bot.h:122
_MSC_Process::prev_req_state
MSC_ReqStateTypeDef prev_req_state
Definition: usbh_msc.h:128
SCSI_SenseTypeDef
Definition: usbh_msc_scsi.h:67
MSC_OK
Definition: usbh_msc.h:80
MSC_READ_INQUIRY
Definition: usbh_msc.h:69
BOT_DATA_OUT
Definition: usbh_msc_bot.h:92
MSC_LUNTypeDef::state_changed
uint8_t state_changed
Definition: usbh_msc.h:110
USBH_Stop
USBH_StatusTypeDef USBH_Stop(USBH_HandleTypeDef *phost)
USBH_Stop Stop the USB Host Core.
Definition: usbh_core.c:350
SCSI_SenseTypeDef::ascq
uint8_t ascq
Definition: usbh_msc_scsi.h:71
USBH_LL_Disconnect
USBH_StatusTypeDef USBH_LL_Disconnect(USBH_HandleTypeDef *phost)
USBH_LL_Disconnect Handle USB Host disconnection event.
Definition: usbh_core.c:854
USBH_OK
Definition: usbh_def.h:304
osMessagePut
osStatus osMessagePut(osMessageQId queue_id, uint32_t info, uint32_t millisec)
Put a Message to a Queue.
Definition: cmsis_os.c:1113
BOT_CSW_CMD_PASSED
Definition: usbh_msc_bot.h:81
USBH_MSC_SCSI_Inquiry
USBH_StatusTypeDef USBH_MSC_SCSI_Inquiry(USBH_HandleTypeDef *phost, uint8_t lun, SCSI_StdInquiryDataTypeDef *inquiry)
USBH_MSC_SCSI_Inquiry Issue Inquiry command.
Definition: usbh_msc_scsi.c:202
BOT_CSW_PHASE_ERROR
Definition: usbh_msc_bot.h:83
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usbd_def.h:74
BOT_CMD_SEND
Definition: usbh_msc_bot.h:72
USBH_DbgLog
#define USBH_DbgLog(...)
Definition: usbh_conf.h:185
_USBH_HandleTypeDef::device
USBH_DeviceTypeDef device
Definition: usbh_def.h:456
SCSI_StdInquiryDataTypeDef::revision_id
uint8_t revision_id[5]
Definition: usbh_msc_scsi.h:82
_MSC_Process::rw_lun
uint16_t rw_lun
Definition: usbh_msc.h:132
USBH_DeviceTypeDef::is_connected
__IO uint8_t is_connected
Definition: usbh_def.h:427
USBH_MSC_BOT_REQ_Reset
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::Status
uint8_t Status
Definition: usbh_msc_bot.h:125
_MSC_Process::unit
MSC_LUNTypeDef unit[MAX_SUPPORTED_LUN]
Definition: usbh_msc.h:130
USBH_ReEnumerate
USBH_StatusTypeDef USBH_ReEnumerate(USBH_HandleTypeDef *phost)
HCD_ReEnumerate Perform a new Enumeration phase.
Definition: usbh_core.c:371
MSC_REQUEST_SENSE
Definition: usbh_msc.h:70
BOT_CBWTypeDef::__CBW::Flags
uint8_t Flags
Definition: usbh_msc_bot.h:109
USBH_LL_IncTimer
void USBH_LL_IncTimer(USBH_HandleTypeDef *phost)
USBH_LL_IncTimer Increment Host Timer tick.
Definition: usbh_core.c:801
USBH_MSC_SCSI_ReadCapacity
USBH_StatusTypeDef USBH_MSC_SCSI_ReadCapacity(USBH_HandleTypeDef *phost, uint8_t lun, SCSI_CapacityTypeDef *capacity)
USBH_MSC_SCSI_ReadCapacity Issue Read Capacity command.
Definition: usbh_msc_scsi.c:146
if
if(size<=((png_alloc_size_t) -1) - ob)
Definition: pngwrite.c:2176
BOT_CBWTypeDef::__CBW::Signature
uint32_t Signature
Definition: usbh_msc_bot.h:106
SCSI_SENSE_KEY_NOT_READY
#define SCSI_SENSE_KEY_NOT_READY
Definition: usbh_msc_scsi.h:108
SCSI_CapacityTypeDef::block_nbr
uint32_t block_nbr
Definition: usbh_msc_scsi.h:61
USBH_URB_STALL
Definition: usbh_def.h:390
_MSC_Process::state
MSC_StateTypeDef state
Definition: usbh_msc.h:125
USBH_LL_GetURBState
USBH_URBStateTypeDef USBH_LL_GetURBState(USBH_HandleTypeDef *phost, uint8_t)
Get a URB state from the low level driver.
Definition: usbh_conf.c:519
SCSI_StdInquiryDataTypeDef::vendor_id
uint8_t vendor_id[9]
Definition: usbh_msc_scsi.h:80
_MSC_Process::current_lun
uint16_t current_lun
Definition: usbh_msc.h:131
SCSI_StdInquiryDataTypeDef::PeripheralQualifier
uint8_t PeripheralQualifier
Definition: usbh_msc_scsi.h:77
BOT_HandleTypeDef::csw
BOT_CSWTypeDef csw
Definition: usbh_msc_bot.h:139
SCSI_StdInquiryDataTypeDef
Definition: usbh_msc_scsi.h:75
BOT_CSWStatusTypeDef
BOT_CSWStatusTypeDef
Definition: usbh_msc_bot.h:78
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
USBH_UsrLog
#define USBH_UsrLog(...)
Definition: usbh_conf.h:166
address
UsbDeviceAddress address
Definition: address.h:202
BOT_ERROR_OUT
Definition: usbh_msc_bot.h:97
USBH_LL_Init
USBH_StatusTypeDef USBH_LL_Init(USBH_HandleTypeDef *phost)
Initialize the low level portion of the host driver.
Definition: usbh_conf.c:191
_MSC_Process::req_state
MSC_ReqStateTypeDef req_state
Definition: usbh_msc.h:127
_USB_Setup::b
struct _USB_Setup::_SetupPkt_Struc b
DATA_LEN_READ_CAPACITY10
#define DATA_LEN_READ_CAPACITY10
Definition: usbh_msc_scsi.h:96
MSC_BOT
#define MSC_BOT
Definition: usbh_msc.h:156
USBH_StatusTypeDef
USBH_StatusTypeDef
Definition: usbh_def.h:302
BOT_DATA_IN
Definition: usbh_msc_bot.h:90
usbh_msc_bot.h
Header file for usbh_msc_bot.c.
USBH_MSC_DecodeCSW
static BOT_CSWStatusTypeDef USBH_MSC_DecodeCSW(USBH_HandleTypeDef *phost)
USBH_MSC_BOT_DecodeCSW This function decodes the CSW received by the device and updates the same to u...
Definition: usbh_msc_bot.c:514
USB_MSC_CLASS
#define USB_MSC_CLASS
Definition: usbh_msc.h:153
BOT_HandleTypeDef::state
BOT_StateTypeDef state
Definition: usbh_msc_bot.h:134
_MSC_Process::InEpSize
uint16_t InEpSize
Definition: usbh_msc.h:124
USBH_Start
USBH_StatusTypeDef USBH_Start(USBH_HandleTypeDef *phost)
USBH_Start Start the USB Host Core.
Definition: usbh_core.c:333
USB_EP_TYPE_BULK
#define USB_EP_TYPE_BULK
Definition: usbh_def.h:172
USBH_LL_SetToggle
USBH_StatusTypeDef USBH_LL_SetToggle(USBH_HandleTypeDef *phost, uint8_t, uint8_t)
Set toggle for a pipe.
Definition: usbh_conf.c:564
USBH_GetActiveClass
uint8_t USBH_GetActiveClass(USBH_HandleTypeDef *phost)
USBH_GetActiveClass Return Device Class.
Definition: usbh_core.c:260
USBH_RegisterClass
USBH_StatusTypeDef USBH_RegisterClass(USBH_HandleTypeDef *phost, USBH_ClassTypeDef *pclass)
USBH_RegisterClass Link class driver to Host Core.
Definition: usbh_core.c:199
BOT_HandleTypeDef::pbuf
uint8_t * pbuf
Definition: usbh_msc_bot.h:141
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
status
static status_t status
Definition: filament_sensor.c:37
USB_H2D
#define USB_H2D
Definition: usbh_def.h:108
_MSC_Process::InEp
uint8_t InEp
Definition: usbh_msc.h:122
BOT_UNRECOVERED_ERROR
Definition: usbh_msc_bot.h:98
_MSC_Process::error
MSC_ErrorTypeDef error
Definition: usbh_msc.h:126
USBH_MSC_SCSI_RequestSense
USBH_StatusTypeDef USBH_MSC_SCSI_RequestSense(USBH_HandleTypeDef *phost, uint8_t lun, SCSI_SenseTypeDef *sense_data)
USBH_MSC_SCSI_RequestSense Issue RequestSense command.
Definition: usbh_msc_scsi.c:264
USB_REQ_BOT_RESET
#define USB_REQ_BOT_RESET
Definition: usbh_msc.h:148
_MSC_Process::OutPipe
uint8_t OutPipe
Definition: usbh_msc.h:120
OPCODE_REQUEST_SENSE
#define OPCODE_REQUEST_SENSE
Definition: usbh_msc_scsi.h:92
BOT_CSW_SIGNATURE
#define BOT_CSW_SIGNATURE
Definition: usbh_msc_bot.h:156
_MSC_Process::max_lun
uint32_t max_lun
Definition: usbh_msc.h:118
USBH_MSC_SCSI_Write
USBH_StatusTypeDef USBH_MSC_SCSI_Write(USBH_HandleTypeDef *phost, uint8_t lun, uint32_t address, uint8_t *pbuf, uint32_t length)
USBH_MSC_SCSI_Write Issue write10 command.
Definition: usbh_msc_scsi.c:323
USBH_FindInterface
uint8_t USBH_FindInterface(USBH_HandleTypeDef *phost, uint8_t Class, uint8_t SubClass, uint8_t Protocol)
USBH_FindInterface Find the interface index for a specific class.
Definition: usbh_core.c:274
USBH_MSC_BOT_REQ_GetMaxLUN
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
uint16_t_uint8_t::w
uint16_t w
Definition: usbh_def.h:204
USBH_SpeedTypeDef
USBH_SpeedTypeDef
Definition: usbh_def.h:317
usbh_ctlreq.h
Header file for usbh_ctlreq.c.
MSC_READ
Definition: usbh_msc.h:71
_MSC_Process::OutEp
uint8_t OutEp
Definition: usbh_msc.h:121
USBH_FAIL
Definition: usbh_def.h:306
DATA_LEN_MODE_TEST_UNIT_READY
#define DATA_LEN_MODE_TEST_UNIT_READY
Definition: usbh_msc_scsi.h:95
USB_D2H
#define USB_D2H
Definition: usbh_def.h:109
USBH_BUSY
Definition: usbh_def.h:305
SCSI_StdInquiryDataTypeDef::RemovableMedia
uint8_t RemovableMedia
Definition: usbh_msc_scsi.h:79
SCSI_StdInquiryDataTypeDef::DeviceType
uint8_t DeviceType
Definition: usbh_msc_scsi.h:78
usbh_msc_scsi.h
Header file for usbh_msc_scsi.c.
USBH_DeInit
USBH_StatusTypeDef USBH_DeInit(USBH_HandleTypeDef *phost)
HCD_Init De-Initialize the Host portion of the driver.
Definition: usbh_core.c:143
MSC_IDLE
Definition: usbh_msc.h:66
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
BOT_CSW_CMD_FAILED
Definition: usbh_msc_bot.h:82
USBH_LL_Connect
USBH_StatusTypeDef USBH_LL_Connect(USBH_HandleTypeDef *phost)
USBH_LL_Connect Handle USB Host connexion event.
Definition: usbh_core.c:826
_USBH_HandleTypeDef::pUser
void(* pUser)(struct _USBH_HandleTypeDef *pHandle, uint8_t id)
Definition: usbh_def.h:464
USBH_LL_ClosePipe
USBH_StatusTypeDef USBH_LL_ClosePipe(USBH_HandleTypeDef *phost, uint8_t)
Close a pipe of the low level driver.
Definition: usbh_conf.c:422
BOT_HandleTypeDef::data
uint32_t data[16]
Definition: usbh_msc_bot.h:133
usbh_msc.h
This file contains all the prototypes for the usbh_msc.c.
MSC_INIT
Definition: usbh_msc.h:65
length
png_uint_32 length
Definition: png.c:2247
USBH_Init
USBH_StatusTypeDef USBH_Init(USBH_HandleTypeDef *phost, void(*pUsrFunc)(USBH_HandleTypeDef *phost, uint8_t), uint8_t id)
HCD_Init Initialize the HOST Core.
Definition: usbh_core.c:92
USBH_MSC_InterfaceInit
static USBH_StatusTypeDef USBH_MSC_InterfaceInit(USBH_HandleTypeDef *phost)
USBH_MSC_InterfaceInit The function init the MSC class.
Definition: usbh_msc.c:149
USBH_URBStateTypeDef
USBH_URBStateTypeDef
Definition: usbh_def.h:384
_USB_Setup::_SetupPkt_Struc::bmRequestType
uint8_t bmRequestType
Definition: usbh_def.h:221
OPCODE_TEST_UNIT_READY
#define OPCODE_TEST_UNIT_READY
Definition: usbh_msc_scsi.h:88
USBH_MSC_ClassRequest
static USBH_StatusTypeDef USBH_MSC_ClassRequest(USBH_HandleTypeDef *phost)
USBH_MSC_ClassRequest The function is responsible for handling Standard requests for MSC class.
Definition: usbh_msc.c:269
_USBH_HandleTypeDef::pActiveClass
USBH_ClassTypeDef * pActiveClass
Definition: usbh_def.h:458
BOT_SEND_CBW_WAIT
Definition: usbh_msc_bot.h:89
USBH_MSC_SCSI_TestUnitReady
USBH_StatusTypeDef USBH_MSC_SCSI_TestUnitReady(USBH_HandleTypeDef *phost, uint8_t lun)
USBH_MSC_SCSI_TestUnitReady Issue TestUnitReady command.
Definition: usbh_msc_scsi.c:104
BOT_CBWTypeDef::__CBW::DataTransferLength
uint32_t DataTransferLength
Definition: usbh_msc_bot.h:108
_USBH_HandleTypeDef::gState
__IO HOST_StateTypeDef gState
Definition: usbh_def.h:452
USBH_LL_GetLastXferSize
uint32_t USBH_LL_GetLastXferSize(USBH_HandleTypeDef *phost, uint8_t)
Return the last transfered packet size.
Definition: usbh_conf.c:373
BOT_DIR_OUT
#define BOT_DIR_OUT
Definition: usbh_msc_bot.h:166
BOT_SEND_CBW
Definition: usbh_msc_bot.h:88
BOT_CSWTypeDef::__CSW::Tag
uint32_t Tag
Definition: usbh_msc_bot.h:123
USB_REQ_GET_MAX_LUN
#define USB_REQ_GET_MAX_LUN
Definition: usbh_msc.h:149
pbuf
Definition: pbuf.h:142
OPCODE_WRITE10
#define OPCODE_WRITE10
Definition: usbh_msc_scsi.h:91
BOT_CMD_WAIT
Definition: usbh_msc_bot.h:73
USBH_AllocPipe
uint8_t USBH_AllocPipe(USBH_HandleTypeDef *phost, uint8_t ep_addr)
USBH_Alloc_Pipe Allocate a new Pipe.
Definition: usbh_pipes.c:138
MSC_LUNTypeDef::state
MSC_StateTypeDef state
Definition: usbh_msc.h:104
MSC_REQ_IDLE
Definition: usbh_msc.h:89
HOST_CLASS
Definition: usbh_def.h:338
MSC_ERROR
Definition: usbh_msc.h:82
BOT_CSW_LENGTH
#define BOT_CSW_LENGTH
Definition: usbh_msc_bot.h:158
USBH_MSC_SCSI_RequestSense
USBH_StatusTypeDef USBH_MSC_SCSI_RequestSense(USBH_HandleTypeDef *phost, uint8_t lun, SCSI_SenseTypeDef *sense_data)
USBH_MSC_SCSI_RequestSense Issue RequestSense command.
Definition: usbh_msc_scsi.c:264
_MSC_Process
Definition: usbh_msc.h:116
USBH_MSC_BOT_Abort
static USBH_StatusTypeDef USBH_MSC_BOT_Abort(USBH_HandleTypeDef *phost, uint8_t lun, uint8_t dir)
USBH_MSC_BOT_Abort The function handle the BOT Abort process.
Definition: usbh_msc_bot.c:475
USB_REQ_DIR_MASK
#define USB_REQ_DIR_MASK
Definition: usbh_def.h:107
DATA_LEN_REQUEST_SENSE
#define DATA_LEN_REQUEST_SENSE
Definition: usbh_msc_scsi.h:98
SCSI_CapacityTypeDef::block_size
uint16_t block_size
Definition: usbh_msc_scsi.h:62
USBH_NOT_SUPPORTED
Definition: usbh_def.h:307
BOT_DATA_OUT_WAIT
Definition: usbh_msc_bot.h:93
USBH_MSC_InterfaceDeInit
static USBH_StatusTypeDef USBH_MSC_InterfaceDeInit(USBH_HandleTypeDef *phost)
USBH_MSC_InterfaceDeInit The function DeInit the Pipes used for the MSC class.
Definition: usbh_msc.c:235
MSC_LUNTypeDef::sense
SCSI_SenseTypeDef sense
Definition: usbh_msc.h:108
USBH_ClassTypeDef
Definition: usbh_def.h:437
USB_EP_DIR_OUT
#define USB_EP_DIR_OUT
Definition: usbh_def.h:175
info
uint8_t info[12]
Definition: masstorage.h:54