23 #ifndef __USBH_MSC_BOT_H__
24 #define __USBH_MSC_BOT_H__
56 uint32_t CBWSignature;
58 uint32_t CBWTransferLength;
69 USBH_MSC_BOT_INIT_STATE = 0,
72 USBH_MSC_TEST_UNIT_READY,
73 USBH_MSC_READ_CAPACITY10,
75 USBH_MSC_REQUEST_SENSE,
76 USBH_MSC_BOT_USB_TRANSFERS,
77 USBH_MSC_DEFAULT_APPLI_STATE,
78 USBH_MSC_CTRL_ERROR_STATE,
79 USBH_MSC_UNRECOVERED_STATE
88 uint8_t MSCStateCurrent;
89 uint8_t CmdStateMachine;
94 uint8_t BOTXferErrorCount;
95 uint8_t BOTXferStatus;
103 uint32_t CSWSignature;
105 uint32_t CSWDataResidue;
108 uint8_t CSWArray[13];
120 #define USBH_MSC_SEND_CBW 1
121 #define USBH_MSC_SENT_CBW 2
122 #define USBH_MSC_BOT_DATAIN_STATE 3
123 #define USBH_MSC_BOT_DATAOUT_STATE 4
124 #define USBH_MSC_RECEIVE_CSW_STATE 5
125 #define USBH_MSC_DECODE_CSW 6
126 #define USBH_MSC_BOT_ERROR_IN 7
127 #define USBH_MSC_BOT_ERROR_OUT 8
130 #define USBH_MSC_BOT_CBW_SIGNATURE 0x43425355
131 #define USBH_MSC_BOT_CBW_TAG 0x20304050
132 #define USBH_MSC_BOT_CSW_SIGNATURE 0x53425355
133 #define USBH_MSC_CSW_DATA_LENGTH 0x000D
134 #define USBH_MSC_BOT_CBW_PACKET_LENGTH 31
135 #define USBH_MSC_CSW_LENGTH 13
136 #define USBH_MSC_CSW_MAX_LENGTH 63
139 #define USBH_MSC_CSW_CMD_PASSED 0x00
140 #define USBH_MSC_CSW_CMD_FAILED 0x01
141 #define USBH_MSC_CSW_PHASE_ERROR 0x02
143 #define USBH_MSC_SEND_CSW_DISABLE 0
144 #define USBH_MSC_SEND_CSW_ENABLE 1
146 #define USBH_MSC_DIR_IN 0
147 #define USBH_MSC_DIR_OUT 1
148 #define USBH_MSC_BOTH_DIR 2
151 #define USBH_MSC_PAGE_LENGTH 512
154 #define CBW_CB_LENGTH 16
155 #define CBW_LENGTH 10
156 #define CBW_LENGTH_TEST_UNIT_READY 6
158 #define USB_REQ_BOT_RESET 0xFF
159 #define USB_REQ_GET_MAX_LUN 0xFE
161 #define MAX_BULK_STALL_COUNT_LIMIT 0x04
202 #endif //__USBH_MSC_BOT_H__
Definition: usbh_msc_bot.h:84
Header file for usbh_stdreq.c.
Definition: usbh_msc_bot.h:101
Definition: usbh_msc_bot.h:99
Definition: usbh_msc_bot.h:54
Definition: usb_core.h:287
uint8_t USBH_MSC_DecodeCSW(USB_OTG_CORE_HANDLE *pdev, USBH_HOST *phost)
USBH_MSC_DecodeCSW This function decodes the CSW received by the device and updates the same to upper...
Definition: usbh_msc_bot.c:487
void USBH_MSC_Init(USB_OTG_CORE_HANDLE *pdev)
USBH_MSC_Init Initializes the mass storage parameters.
Definition: usbh_msc_bot.c:125
USBH_Status USBH_MSC_BOT_Abort(USB_OTG_CORE_HANDLE *pdev, USBH_HOST *phost, uint8_t direction)
USBH_MSC_BOT_Abort This function manages the different Error handling for STALL.
Definition: usbh_msc_bot.c:432
void USBH_MSC_HandleBOTXfer(USB_OTG_CORE_HANDLE *pdev, USBH_HOST *phost)
USBH_MSC_HandleBOTXfer This function manages the different states of BOT transfer and updates the sta...
Definition: usbh_msc_bot.c:147
Definition: usbh_msc_bot.h:52
Definition: usbh_core.h:215