2 ******************************************************************************
4 * @author MCD Application Team
7 * @brief header for the usbd_msc_bot.c file
8 ******************************************************************************
11 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
18 * <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2>
19 ******************************************************************************
22 /* Define to prevent recursive inclusion -------------------------------------*/
24 #include "usbd_core.h"
26 /* Define to prevent recursive inclusion -------------------------------------*/
27 #ifndef __USBD_MSC_BOT_H
28 #define __USBD_MSC_BOT_H
30 /** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY
35 * @brief This file is the Header file for usbd_bot.c
40 /** @defgroup USBD_CORE_Exported_Defines
43 #define BOT_IDLE 0 /* Idle state */
44 #define BOT_DATA_OUT 1 /* Data Out state */
45 #define BOT_DATA_IN 2 /* Data In state */
46 #define BOT_LAST_DATA_IN 3 /* Last Data In Last */
47 #define BOT_SEND_DATA 4 /* Send Immediate data */
49 #define BOT_CBW_SIGNATURE 0x43425355
50 #define BOT_CSW_SIGNATURE 0x53425355
51 #define BOT_CBW_LENGTH 31
52 #define BOT_CSW_LENGTH 13
54 /* CSW Status Definitions */
55 #define CSW_CMD_PASSED 0x00
56 #define CSW_CMD_FAILED 0x01
57 #define CSW_PHASE_ERROR 0x02
60 #define BOT_STATE_NORMAL 0
61 #define BOT_STATE_RECOVERY 1
62 #define BOT_STATE_ERROR 2
73 /** @defgroup MSC_CORE_Private_TypesDefinitions
77 typedef struct _MSC_BOT_CBW
90 typedef struct _MSC_BOT_CSW
94 uint32_t dDataResidue;
104 /** @defgroup USBD_CORE_Exported_Types
108 extern uint8_t MSC_BOT_Data[];
109 extern uint16_t MSC_BOT_DataLen;
110 extern uint8_t MSC_BOT_State;
111 extern uint8_t MSC_BOT_BurstMode;
112 extern MSC_BOT_CBW_TypeDef MSC_BOT_cbw;
113 extern MSC_BOT_CSW_TypeDef MSC_BOT_csw;
117 /** @defgroup USBD_CORE_Exported_FunctionsPrototypes
120 void MSC_BOT_Init (USB_OTG_CORE_HANDLE *pdev);
121 void MSC_BOT_Reset (USB_OTG_CORE_HANDLE *pdev);
122 void MSC_BOT_DeInit (USB_OTG_CORE_HANDLE *pdev);
123 void MSC_BOT_DataIn (USB_OTG_CORE_HANDLE *pdev,
126 void MSC_BOT_DataOut (USB_OTG_CORE_HANDLE *pdev,
129 void MSC_BOT_SendCSW (USB_OTG_CORE_HANDLE *pdev,
132 void MSC_BOT_CplClrFeature (USB_OTG_CORE_HANDLE *pdev,
138 #endif /* __USBD_MSC_BOT_H */
146 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/