⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rbccmd.h

📁 smartARM2400 USB OTG例程
💻 H
📖 第 1 页 / 共 2 页
字号:
     *	__uint8 OperationCode; 2FH
     */
    __uint8 Reserved0;
	__uint8 LBA[4];			                                            /* Big Endian                   */
	__uint8 Reserved1;
    __uint8 VerifyLength[2];		                                    /* Big Endian                   */
	__uint8 Control;
} __VERIFY_RBC, *__PVERIFY_RBC;

/*********************************************************************************************************
  SPC-2 of SCSI-3 commands
*********************************************************************************************************/
/*
 *  INQUIRY Command
 */
typedef  __packed struct _INQUIRY_SPC {
    /*
     *	__uint8 OperationCode; 12H
     */
	unsigned EnableVPD:1 ;
    unsigned CmdSupportData:1 ;
	unsigned Reserved0:6 ;
	
	__uint8 PageCode;
	__uint8 Reserved1;
	__uint8 AllocationLen;
    __uint8 Control;
} __INQUIRY_SPC, *__PINQUIRY_SPC;


typedef struct _STD_INQUIRYDATA {
    unsigned DeviceType : 5;
    unsigned Reserved0 : 3;

    unsigned Reserved1 : 7;
    unsigned RemovableMedia : 1;

    __uint8 Version;

    unsigned Reserved3 : 5;
    unsigned NormACA : 1;
    unsigned Obsolete0 : 1;
    unsigned AERC : 1;

    __uint8 Reserved4[3];

    unsigned SoftReset : 1;
    unsigned CommandQueue : 1;
	unsigned Reserved5 : 1;
	unsigned LinkedCommands : 1;
	unsigned Synchronous : 1;
	unsigned Wide16Bit : 1;
	unsigned Wide32Bit : 1;
	unsigned RelativeAddressing : 1;

	__uint8 VendorId[8];

	__uint8 ProductId[16];

	__uint8 ProductRevisionLevel[4];

/*
 *  Above is 36 bytes
 *  can be tranmitted by Bulk
 */

    __uint8 VendorSpecific[20];
    
    unsigned InfoUnitSupport : 1;
    unsigned QuickArbitSupport : 1;
    unsigned Clocking : 2;
    unsigned Reserved6 : 4;

    __uint8  Reserved7 ;
    __uint16 VersionDescriptor[8] ;

    __uint8 Reserved8[22];
    
} __STD_INQUIRYDATA, *__PSTD_INQUIRYDATA;                               /*  96bytes                     */

typedef struct _SERIALNUMBER_PAGE {
    unsigned DeviceType : 5;
    unsigned DeviceTypeQualifier : 3;

    __uint8 PageCode ;
    __uint8 Reserved0 ;

    __uint8 PageLength ;
    __uint8 SerialNumber[24] ;

}__VPD_SERIAL_PAGE, * __PVPD_SERIAL_PAGE;                               /*  28bytes                     */

#define __ASCII_ID_STRING 32
typedef struct _ID_DESCRIPTOR {
	unsigned   CodeSet : 4;
	unsigned   Reserved0 : 4;

	unsigned   IDType : 4;
    unsigned   Association : 2;
    unsigned   Reserved1 : 2;

    __uint8   Reserved2;

	__uint8   IDLength ;
	__uint8   AsciiID[__ASCII_ID_STRING];
} __ASCII_ID_DESCRIPTOR, * __PASCII_ID_DESCRIPTOR;                      /*  36bytes                     */

typedef struct _DEVICE_ID_PAGE
{
    unsigned DeviceType : 5;
    unsigned DeviceTypeQualifier : 3;

    __uint8 PageCode;
    __uint8 Reserved0;

    __uint8 PageLength;

    __ASCII_ID_DESCRIPTOR   AsciiIdDescriptor[1];
} __VPD_DEVICE_ID_PAGE, * __PVPD_DEVICE_ID_PAGE;                        /*  40bytes                     */



/*
 *  Mode Select
 */
typedef  __packed struct _MODE_SELECT_SPC {
    /*
     *	__uint8 OperationCode; 15H
     */
	unsigned SavePage : 1 ;
	unsigned Reseved0 : 3 ;
	unsigned PageFormat : 1 ;
	unsigned Reserved1 : 3 ;
	
	__uint8 Reserved2[2];
	__uint8 ParameterLen;
	__uint8 Control;
} __MODE_SELECT_SPC, * __PMODE_SELECT_SPC;

/*
 *  Mode Sense
 */
typedef  __packed struct _MODE_SENSE_SPC {
    /*
     *	__uint8 OperationCode; 1AH
     */
    unsigned Reseved0 : 3 ;
    unsigned DisableBlockDescriptor : 1 ;
    unsigned Reserved0 : 4 ;
    
    unsigned PageCode:6 ;
    unsigned PageControl : 2 ;
    
    __uint8 Reserved1;
    __uint8 ParameterLen;
    __uint8 Control;
} __MODE_SENSE_SPC, * __PMODE_SENSE_SPC;


typedef struct _MODE_PARAMETER_HEAD {
    __uint8 DataLen;
    __uint8 MediumType;
    __uint8 DeviceParameter;
    __uint8 BlockDescriptorLen;
} __MODE_PARAMETER_HEAD, * __PMODE_PARAMETER_HEAD;


/*
 *  Define Device Capabilities page.
 */
typedef  __packed struct _MODE_RBC_DEVICE_PARAMETERS_PAGE {
    unsigned PageCode : 6;
	unsigned Reserved : 1;
    unsigned PageSavable : 1;
    
    __uint8 PageLength;
    
    unsigned WriteCacheDisable : 1;
    unsigned Reserved1 : 7;
    
    __uint8 LogicalBlockSize[2];
    __uint8 NumberOfLogicalBlocks[5];
    __uint8 PowerPerformance;
    
    unsigned Lockable : 1;
    unsigned Formattable : 1;
    unsigned Writable : 1;
    unsigned Readable : 1;
    unsigned Reserved2 : 4;
    
    __uint8 Reserved3;
}__MODE_RBC_DEVICE_PARAMETERS_PAGE, *__PMODE_RBC_DEVICE_PARAMETERS_PAGE;

typedef struct _MODE_PAGE {
    __MODE_PARAMETER_HEAD   paraHead;
    __MODE_RBC_DEVICE_PARAMETERS_PAGE   devParaPage;
} __MODE_PAGE;

/*
 * prevent/allow medium removal
 */
typedef  __packed struct _MEDIA_REMOVAL_SPC {
    /*
     *	__uint8 OperationCode; 1EH
     */
	__uint8 Reserved0[3];
	unsigned Prevent:2 ;
	unsigned Reserved1:6 ;
	__uint8 Control;
} __MEDIA_REMOVAL_SPC, *__PMEDIA_REMOVAL_SPC;

/*
 *  Request Sense
 */
typedef struct _REQUEST_SENSE_SPC {
    /*
     *	__uint8 OperationCode; 03H
     */
	__uint8 Reserved[3];
    __uint8 AllocationLen;
    __uint8 Control;
} __REQUEST_SENSE_SPC, *__PREQUEST_SENSE_SPC;


typedef struct _READ_FORMAT_CAPACITIES{
	__uint8 Reserved[3];
	__uint8 Length;
	/*
	 *  Current/Maximum Capacity Descriptor 
	 */
	__uint8 CapacityLBA[4];		                                        /* Big Endian                   */

	unsigned Reserved1 :6;
	unsigned DescriptorCode :2;
    __uint8 CapacityLength[3];		                                    /* Big Endian                   */
	/*
	 *  Formattable Capacity Descriptor
	 */
	__uint8 FormattableLBA[4];			                                /* Big Endian                   */
	__uint8 Reserved2;
    __uint8 FormattableLength[3];		                                /* Big Endian                   */

}__READ_FORMAT_CAPACITIES, *__PREAD_FORMAT_CAPACITIES;

typedef  __packed struct _REQUEST_SENSE_DATA {
    unsigned ResponseCode : 7;
    unsigned Valid : 1;

    __uint8 SegmentNum;

    unsigned SenseKey : 4;
    unsigned Reserved0 : 1;
    unsigned WrongLenIndicator : 1;
    unsigned EndofMedium : 1;
    unsigned FileMark : 1;

    __uint8 Info_0;
    __uint8 Info_1;
    __uint8 Info_2;
    __uint8 Info_3;

    __uint8 AdditionalSenseLen;

    __uint8 CommandSpecInfo_0;
    __uint8 CommandSpecInfo_1;
    __uint8 CommandSpecInfo_2;
    __uint8 CommandSpecInfo_3;

    __uint8 ASC;
    __uint8 ASCQ;
    __uint8 FieldReplacableUnitCode;
    
    unsigned SenseKeySpec_0 : 7;
    unsigned SenseKeySpecValid : 1;
    
    __uint8 SenseKeySpec_1;
    __uint8 SenseKeySpec_2;

} __REQUEST_SENSE_DATA, *__PREQUEST_SENSE_DATA;                         /*  18 bytes                    */             

/*
 *  Test Unit Ready
 */
typedef struct _TEST_UNIT_SPC {
    /*
     *	__uint8 OperationCode; 00H
     */
	__uint8 Reserved[4];
	__uint8 Control;
} __TEST_UNIT_SPC, *__PTEST_UNIT_SPC;

/*
 *  Write Buffer
 */
typedef  __packed struct _WRITE_BUFFER_SPC {
    /*
     *	__uint8 OperationCode; 3BH
     */
    unsigned Mode:4 ;
    unsigned Reserved0:4 ;
	__uint8 BufferID;
    __uint8 BufferOff_2;
    __uint8 BufferOff_1;
    __uint8 BufferOff_0;
    __uint8 ParameterLen_2;
    __uint8 ParameterLen_1;
	__uint8 ParameterLen_0;
    __uint8 Control;
} __WRITE_BUFFER_SPC, *__PWRITE_BUFFER_SPC;

typedef union _CDB_RBC {
    __GENERIC_CDB             Cdb_Generic;
    /*
     * RBC commands
     */
    __GENERIC_RBC             RbcCdb_Generic;

    __FORMAT_RBC              RbcCdb_Format;
	__READ_RBC                RbcCdb_Read;
    __READ_CAPACITY_RBC       RbcCdb_ReadCapacity;
    __START_STOP_RBC          RbcCdb_OnOffUnit;
    __SYNCHRONIZE_CACHE_RBC   RbcCdb_SyncCache;
    __VERIFY_RBC              RbcCdb_Verify;
    __WRITE_RBC               RbcCdb_Write;
    /*
     * SPC-2 commands
     */
    __INQUIRY_SPC             SpcCdb_Inquiry;
    __MODE_SELECT_SPC         SpcCdb_ModeSelect;
    __MODE_SENSE_SPC          SpcCdb_ModeSense;
    __MEDIA_REMOVAL_SPC       SpcCdb_Remove;
    __REQUEST_SENSE_SPC       SpcCdb_RequestSense;
    __TEST_UNIT_SPC           SpcCdb_TestUnit;
    __WRITE_BUFFER_SPC        SpcCdb_WriteBuffer;
	
	__READ_FORMAT_CAPACITIES RE_FM_Capacities;
} __CDB_RBC, *__PCDB_RBC;


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -