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

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

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
SCSI command
Mass Storage Device | Mass Storage Device

## Detailed Description

## Macros
#define | SCSI_SET_SENSE(Key, Acode, Aqual)
#define | DATA_READ true
#define | DATA_WRITE false
#define | DEVICE_TYPE_BLOCK 0x00
#define | DEVICE_TYPE_CDROM 0x05

## Functions
bool | SCSI_DecodeSCSICommand (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo)
| Main routine to process the SCSI command located in the Command Block Wrapper read from the host. This dispatches to the appropriate SCSI command handling routine if the issued command is supported by the device, else it returns a command failure due to a ILLEGAL REQUEST.

## Macro Definition Documentation

#define DATA_READ true

Macro for the SCSI_Command_ReadWrite_10() function, to indicate that data is to be read from the storage medium.

Definition at line 63 of file SCSI.h.

#define DATA_WRITE false

Macro for the SCSI_Command_ReadWrite_10() function, to indicate that data is to be written to the storage medium.

Definition at line 66 of file SCSI.h.

#define DEVICE_TYPE_BLOCK 0x00

Value for the DeviceType entry in the SCSI_Inquiry_Response_t enum, indicating a Block Media device.

Definition at line 69 of file SCSI.h.

#define DEVICE_TYPE_CDROM 0x05

Value for the DeviceType entry in the SCSI_Inquiry_Response_t enum, indicating a CD-ROM device.

Definition at line 72 of file SCSI.h.

#define SCSI_SET_SENSE | ( |  | Key,
|  |  | Acode,
|  |  | Aqual
| ) |  |

Value:
MACROS {SenseData.SenseKey = (Key); \
SenseData.AdditionalSenseCode = (Acode); \
SenseData.AdditionalSenseQualifier = (Aqual); } MACROE

Macro to set the current SCSI sense data to the given key, additional sense code and additional sense qualifier. This is for convenience, as it allows for all three sense values (returned upon request to the host to give information about the last command failure) in a quick and easy manner.

Parameters

  Key | : New SCSI sense key to set the sense code to
  Acode | : New SCSI additional sense key to set the additional sense code to
  Aqual | : New SCSI additional sense key qualifier to set the additional sense qualifier code to

Definition at line 58 of file SCSI.h.

## Function Documentation

bool SCSI_DecodeSCSICommand | ( | USB_ClassInfo_MS_Device_t *const | MSInterfaceInfo | ) |

Main routine to process the SCSI command located in the Command Block Wrapper read from the host. This dispatches to the appropriate SCSI command handling routine if the issued command is supported by the device, else it returns a command failure due to a ILLEGAL REQUEST.

Parameters

  MSInterfaceInfo | : Pointer to the Mass Storage class interface structure that the command is associated with

Returns
  Boolean true if the command completed successfully, false otherwise

Under development, not working yet. Main routine to process the SCSI command located in the Command Block Wrapper read from the host. This dispatches to the appropriate SCSI command handling routine if the issued command is supported by the device, else it returns a command failure due to a ILLEGAL REQUEST.

Definition at line 105 of file SCSI.c.