aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/LowLevel/MassStorage/MassStorage.h
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Device/LowLevel/MassStorage/MassStorage.h')
-rw-r--r--Demos/Device/LowLevel/MassStorage/MassStorage.h58
1 files changed, 3 insertions, 55 deletions
diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.h b/Demos/Device/LowLevel/MassStorage/MassStorage.h
index d993a9a5d..825d96912 100644
--- a/Demos/Device/LowLevel/MassStorage/MassStorage.h
+++ b/Demos/Device/LowLevel/MassStorage/MassStorage.h
@@ -53,27 +53,6 @@
#include <LUFA/Drivers/Board/Dataflash.h>
/* Macros: */
- /** Mass Storage Class specific request to reset the Mass Storage interface, ready for the next command. */
- #define REQ_MassStorageReset 0xFF
-
- /** Mass Storage Class specific request to retrieve the total number of Logical Units (drives) in the SCSI device. */
- #define REQ_GetMaxLUN 0xFE
-
- /** Maximum length of a SCSI command which can be issued by the device or host in a Mass Storage bulk wrapper. */
- #define MAX_SCSI_COMMAND_LENGTH 16
-
- /** Magic signature for a Command Block Wrapper used in the Mass Storage Bulk-Only transport protocol. */
- #define CBW_SIGNATURE 0x43425355UL
-
- /** Magic signature for a Command Status Wrapper used in the Mass Storage Bulk-Only transport protocol. */
- #define CSW_SIGNATURE 0x53425355UL
-
- /** Mask for a Command Block Wrapper's flags attribute to specify a command with data sent from host-to-device. */
- #define COMMAND_DIRECTION_DATA_OUT (0 << 7)
-
- /** Mask for a Command Block Wrapper's flags attribute to specify a command with data sent from device-to-host. */
- #define COMMAND_DIRECTION_DATA_IN (1 << 7)
-
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
#define LEDMASK_USB_NOTREADY LEDS_LED1
@@ -89,41 +68,10 @@
/** LED mask for the library LED driver, to indicate that the USB interface is busy. */
#define LEDMASK_USB_BUSY LEDS_LED2
- /* Type Defines: */
- /** Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */
- typedef struct
- {
- uint32_t Signature; /**< Command block signature, must be CBW_SIGNATURE to indicate a valid Command Block */
- uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper */
- uint32_t DataTransferLength; /**< Length of the optional data portion of the issued command, in bytes */
- uint8_t Flags; /**< Command block flags, indicating command data direction */
- uint8_t LUN; /**< Logical Unit number this command is issued to */
- uint8_t SCSICommandLength; /**< Length of the issued SCSI command within the SCSI command data array */
- uint8_t SCSICommandData[MAX_SCSI_COMMAND_LENGTH]; /**< Issued SCSI command in the Command Block */
- } CommandBlockWrapper_t;
-
- /** Type define for a Command Status Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */
- typedef struct
- {
- uint32_t Signature; /**< Status block signature, must be CSW_SIGNATURE to indicate a valid Command Status */
- uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper */
- uint32_t DataTransferResidue; /**< Number of bytes of data not processed in the SCSI command */
- uint8_t Status; /**< Status code of the issued command - a value from the MassStorage_CommandStatusCodes_t enum */
- } CommandStatusWrapper_t;
-
- /* Enums: */
- /** Enum for the possible command status wrapper return status codes. */
- enum MassStorage_CommandStatusCodes_t
- {
- Command_Pass = 0, /**< Command completed with no error */
- Command_Fail = 1, /**< Command failed to complete - host may check the exact error via a SCSI REQUEST SENSE command */
- Phase_Error = 2 /**< Command failed due to being invalid in the current phase */
- };
-
/* Global Variables: */
- extern CommandBlockWrapper_t CommandBlock;
- extern CommandStatusWrapper_t CommandStatus;
- extern volatile bool IsMassStoreReset;
+ extern MS_CommandBlockWrapper_t CommandBlock;
+ extern MS_CommandStatusWrapper_t CommandStatus;
+ extern volatile bool IsMassStoreReset;
/* Function Prototypes: */
void SetupHardware(void);