| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Typedefs | Enumerations
MassStorageClassCommon.h File Reference
`#include "../../Core/StdDescriptors.h"`

Go to the source code of this file.

## Macros
#define | MS_CBW_SIGNATURE 0x43425355UL
#define | MS_CSW_SIGNATURE 0x53425355UL
#define | MS_COMMAND_DIR_DATA_OUT (0 << 7)
#define | MS_COMMAND_DIR_DATA_IN (1 << 7)
SCSI Commands
#define | SCSI_CMD_INQUIRY 0x12
#define | SCSI_CMD_REQUEST_SENSE 0x03
#define | SCSI_CMD_TEST_UNIT_READY 0x00
#define | SCSI_CMD_READ_CAPACITY_10 0x25
#define | SCSI_CMD_SEND_DIAGNOSTIC 0x1D
#define | SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1E
#define | SCSI_CMD_WRITE_10 0x2A
#define | SCSI_CMD_READ_10 0x28
#define | SCSI_CMD_WRITE_6 0x0A
#define | SCSI_CMD_READ_6 0x08
#define | SCSI_CMD_VERIFY_10 0x2F
#define | SCSI_CMD_MODE_SENSE_6 0x1A
#define | SCSI_CMD_MODE_SENSE_10 0x5A
SCSI Sense Key Values
#define | SCSI_SENSE_KEY_GOOD 0x00
#define | SCSI_SENSE_KEY_RECOVERED_ERROR 0x01
#define | SCSI_SENSE_KEY_NOT_READY 0x02
#define | SCSI_SENSE_KEY_MEDIUM_ERROR 0x03
#define | SCSI_SENSE_KEY_HARDWARE_ERROR 0x04
#define | SCSI_SENSE_KEY_ILLEGAL_REQUEST 0x05
#define | SCSI_SENSE_KEY_UNIT_ATTENTION 0x06
#define | SCSI_SENSE_KEY_DATA_PROTECT 0x07
#define | SCSI_SENSE_KEY_BLANK_CHECK 0x08
#define | SCSI_SENSE_KEY_VENDOR_SPECIFIC 0x09
#define | SCSI_SENSE_KEY_COPY_ABORTED 0x0A
#define | SCSI_SENSE_KEY_ABORTED_COMMAND 0x0B
#define | SCSI_SENSE_KEY_VOLUME_OVERFLOW 0x0D
#define | SCSI_SENSE_KEY_MISCOMPARE 0x0E
SCSI Additional Sense Codes
#define | SCSI_ASENSE_NO_ADDITIONAL_INFORMATION 0x00
#define | SCSI_ASENSE_LOGICAL_UNIT_NOT_READY 0x04
#define | SCSI_ASENSE_INVALID_FIELD_IN_CDB 0x24
#define | SCSI_ASENSE_NOT_READY_TO_READY_CHANGE 0x28
#define | SCSI_ASENSE_WRITE_PROTECTED 0x27
#define | SCSI_ASENSE_FORMAT_ERROR 0x31
#define | SCSI_ASENSE_INVALID_COMMAND 0x20
#define | SCSI_ASENSE_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE 0x21
#define | SCSI_ASENSE_MEDIUM_NOT_PRESENT 0x3A
SCSI Additional Sense Key Code Qualifiers
#define | SCSI_ASENSEQ_NO_QUALIFIER 0x00
#define | SCSI_ASENSEQ_FORMAT_COMMAND_FAILED 0x01
#define | SCSI_ASENSEQ_INITIALIZING_COMMAND_REQUIRED 0x02
#define | SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07

## Typedefs
struct {
uint32_t Signature
uint32_t Tag
uint32_t DataTransferLength
uint8_t Flags
uint8_t LUN
uint8_t SCSICommandLength
uint8_t SCSICommandData [16]
} | MS_CommandBlockWrapper_t
struct {
uint32_t Signature
uint32_t Tag
uint32_t DataTransferResidue
uint8_t Status
} | MS_CommandStatusWrapper_t
struct {
uint8_t ResponseCode
uint8_t SegmentNumber
unsigned SenseKey: 4
unsigned Reserved: 1
unsigned ILI: 1
unsigned EOM: 1
unsigned FileMark: 1
uint8_t Information [4]
uint8_t AdditionalLength
uint8_t CmdSpecificInformation [4]
uint8_t AdditionalSenseCode
uint8_t AdditionalSenseQualifier
uint8_t FieldReplaceableUnitCode
uint8_t SenseKeySpecific [3]
} | SCSI_Request_Sense_Response_t
struct {
unsigned DeviceType: 5
unsigned PeripheralQualifier: 3
unsigned Reserved: 7
unsigned Removable: 1
uint8_t Version
unsigned ResponseDataFormat: 4
unsigned Reserved2: 1
unsigned NormACA: 1
unsigned TrmTsk: 1
unsigned AERC: 1
uint8_t AdditionalLength
uint8_t Reserved3 [2]
unsigned SoftReset: 1
unsigned CmdQue: 1
unsigned Reserved4: 1
unsigned Linked: 1
unsigned Sync: 1
unsigned WideBus16Bit: 1
unsigned WideBus32Bit: 1
unsigned RelAddr: 1
uint8_t VendorID [8]
uint8_t ProductID [16]
uint8_t RevisionID [4]
} | SCSI_Inquiry_Response_t

## Enumerations
enum | MS_Descriptor_ClassSubclassProtocol_t { MS_CSCP_MassStorageClass = 0x08, MS_CSCP_SCSITransparentSubclass = 0x06, MS_CSCP_BulkOnlyTransportProtocol = 0x50 }
enum | MS_ClassRequests_t { MS_REQ_GetMaxLUN = 0xFE, MS_REQ_MassStorageReset = 0xFF }
enum | MS_CommandStatusCodes_t { MS_SCSI_COMMAND_Pass = 0, MS_SCSI_COMMAND_Fail = 1, MS_SCSI_COMMAND_PhaseError = 2 }

## Variable Documentation

uint8_t AdditionalLength

Definition at line 301 of file MassStorageClassCommon.h.

uint8_t AdditionalSenseCode

Definition at line 303 of file MassStorageClassCommon.h.

uint8_t AdditionalSenseQualifier

Definition at line 304 of file MassStorageClassCommon.h.

unsigned AERC

Definition at line 331 of file MassStorageClassCommon.h.

unsigned CmdQue

Definition at line 337 of file MassStorageClassCommon.h.

uint8_t CmdSpecificInformation[4]

Definition at line 302 of file MassStorageClassCommon.h.

uint32_t DataTransferLength

Length of the optional data portion of the issued command, in bytes.

Definition at line 260 of file MassStorageClassCommon.h.

uint32_t DataTransferResidue

Number of bytes of data not processed in the SCSI command.

Definition at line 277 of file MassStorageClassCommon.h.

unsigned DeviceType

Definition at line 319 of file MassStorageClassCommon.h.

unsigned EOM

Definition at line 297 of file MassStorageClassCommon.h.

uint8_t FieldReplaceableUnitCode

Definition at line 305 of file MassStorageClassCommon.h.

unsigned FileMark

Definition at line 298 of file MassStorageClassCommon.h.

uint8_t Flags

Command block flags, indicating command data direction.

Definition at line 261 of file MassStorageClassCommon.h.

unsigned ILI

Definition at line 296 of file MassStorageClassCommon.h.

uint8_t Information[4]

Definition at line 300 of file MassStorageClassCommon.h.

unsigned Linked

Definition at line 339 of file MassStorageClassCommon.h.

uint8_t LUN

Logical Unit number this command is issued to.

Definition at line 262 of file MassStorageClassCommon.h.

unsigned NormACA

Definition at line 329 of file MassStorageClassCommon.h.

unsigned PeripheralQualifier

Definition at line 320 of file MassStorageClassCommon.h.

uint8_t ProductID[16]

Definition at line 346 of file MassStorageClassCommon.h.

unsigned RelAddr

Definition at line 343 of file MassStorageClassCommon.h.

unsigned Removable

Definition at line 323 of file MassStorageClassCommon.h.

unsigned Reserved

Definition at line 295 of file MassStorageClassCommon.h.

unsigned Reserved2

Definition at line 328 of file MassStorageClassCommon.h.

uint8_t Reserved3[2]

Definition at line 334 of file MassStorageClassCommon.h.

unsigned Reserved4

Definition at line 338 of file MassStorageClassCommon.h.

uint8_t ResponseCode

Definition at line 290 of file MassStorageClassCommon.h.

unsigned ResponseDataFormat

Definition at line 327 of file MassStorageClassCommon.h.

uint8_t RevisionID[4]

Definition at line 347 of file MassStorageClassCommon.h.

uint8_t SCSICommandData[16]

Issued SCSI command in the Command Block.

Definition at line 264 of file MassStorageClassCommon.h.

uint8_t SCSICommandLength

Length of the issued SCSI command within the SCSI command data array.

Definition at line 263 of file MassStorageClassCommon.h.

uint8_t SegmentNumber

Definition at line 292 of file MassStorageClassCommon.h.

unsigned SenseKey

Definition at line 294 of file MassStorageClassCommon.h.

uint8_t SenseKeySpecific[3]

Definition at line 306 of file MassStorageClassCommon.h.

uint32_t Signature

Command block signature, must be MS_CBW_SIGNATURE to indicate a valid Command Block.

Status block signature, must be MS_CSW_SIGNATURE to indicate a valid Command Status.

Definition at line 258 of file MassStorageClassCommon.h.

unsigned SoftReset

Definition at line 336 of file MassStorageClassCommon.h.

uint8_t Status

Status code of the issued command - a value from the MS_CommandStatusCodes_t enum.

Definition at line 278 of file MassStorageClassCommon.h.

unsigned Sync

Definition at line 340 of file MassStorageClassCommon.h.

uint32_t Tag

Unique command ID value, to associate a command block wrapper with its command status wrapper.

Definition at line 259 of file MassStorageClassCommon.h.

unsigned TrmTsk

Definition at line 330 of file MassStorageClassCommon.h.

uint8_t VendorID[8]

Definition at line 345 of file MassStorageClassCommon.h.

uint8_t Version

Definition at line 325 of file MassStorageClassCommon.h.

unsigned WideBus16Bit

Definition at line 341 of file MassStorageClassCommon.h.

unsigned WideBus32Bit

Definition at line 342 of file MassStorageClassCommon.h.