bot.h
上传用户:sourcesun
上传日期:2013-09-23
资源大小:362k
文件大小:2k
- /*************************************************************************
- *
- * Used with ICCARM and AARM.
- *
- * (c) Copyright IAR Systems 2005
- *
- * File name : bot.h
- * Description : Define USB Mass storage device bulk-only transport module
- *
- * History :
- * 1. Data : September 8, 2005
- * Author : Stanimir Bonev
- * Description : Create
- *
- * $Revision: 1.2.2.1 $
- **************************************************************************/
- #include <includes.h>
- #ifndef __BOT_H
- #define __BOT_H
- #define CbwSignature 0x43425355
- #define CswSignature 0x53425355
- typedef enum
- {
- BotWaitCbw = 0, BotEpDataOut, BotEpDataIn, BotSendCsw, BotFatalError,
- } BotState_t;
- typedef enum
- {
- UsbBotInterfaceGetMaxLun = 0xFE,
- MassStorageClassReqReset ,
- } MassStorageClassRequest_t;
- typedef enum
- {
- BotPass = 0, BotError, BotNotReady, BotNotAlignment
- } BotToUserStatus_t;
- typedef enum
- {
- CswPassed = 0, CswFailed, CswPhaseError
- } CSWStatus_t;
- typedef enum
- {
- BotDataFormHostToDev = 0,BotDataFormDevToHost,
- } BotDataDir_t;
- typedef union
- {
- Int8U Data;
- struct
- {
- Int8U : 7;
- Int8U Dir : 1;
- };
- } CbwFlags_t;
- #pragma pack(1)
- typedef union
- {
- Int8U Data[31];
- struct
- {
- Int32U dCBWSignature;
- Int32U dCBWTag;
- Int32U dCBWDataTransferLength;
- CbwFlags_t bmCBWFlags;
- Int8U bCBWLUN;
- Int8U bCBWCBLength;
- Int8U CBWCB[16];
- };
- } Cbw_t, * pCbw_t;
- typedef union
- {
- Int8U Data[13];
- struct
- {
- Int32U dCSWSignature;
- Int32U dCSWTag;
- Int32U dCSWDataResidue;
- Int8U bCSWStatus;
- };
- } Csw_t, * pCsw_t;
- typedef union
- {
- Int8U Flags;
- struct
- {
- Int8U PhaseError : 1;
- Int8U CmdFault : 1;
- Int8U BotStatus : 1;
- Int8U DataComplete: 1;
- Int8U ShortPacket : 1;
- };
- } BotStatus_t;
- #define bPhaseErrorMask_t 0x01
- #define bCmdFaultMask_t 0x02
- #define bBotStatusMask_t 0x04
- #define bBotDataCompleteMask_t 0x10
- #pragma pack()
- #endif //__BOT_H