SAMV71 Xplained Ultra Software Package 1.3

SBCMethods.h File Reference

#include "SBC.h"
#include "MSDLun.h"
#include "MSDDStateMachine.h"

Go to the source code of this file.

Defines

#define SBC_STATE_READ   0x01
#define SBC_STATE_WAIT_READ   0x02
#define SBC_STATE_READ_ERROR   0x03
#define SBC_STATE_NEXT_READ   0x04
#define SBC_STATE_WRITE   0x05
#define SBC_STATE_WAIT_WRITE   0x06
#define SBC_STATE_WRITE_ERROR   0x07
#define SBC_STATE_NEXT_WRITE   0x08
#define SBC_STATE_NEXT_BLOCK   0x09

Functions

void SBC_UpdateSenseData (SBCRequestSenseData *requestSenseData, unsigned char senseKey, unsigned char additionalSenseCode, unsigned char additionalSenseCodeQualifier)
 Updates the sense data of a LUN with the given key and codes.
unsigned char SBC_GetCommandInformation (void *command, unsigned int *length, unsigned char *type, MSDLun *lun)
 Return information about the transfer length and direction expected by the device for a particular command.
unsigned char SBC_ProcessCommand (MSDLun *lun, MSDCommandState *commandState)
 Processes a SBC command by dispatching it to a subfunction.

Detailed Description

Purpose

SCSI commands implementation.

section Usage

  1. After a CBW is received from host, use SBC_GetCommandInformation to check if the command is supported, and get the command length and type information before processing it.
  2. Then SBC_ProcessCommand can be used to handle a valid command, to perform the command operations.
  3. SBC_UpdateSenseData is used to update the sense data that will be sent to host.

Definition in file SBCMethods.h.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines