Minor documentation page updates.
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Device / MassStorage.h
index c1874b2..cf2b574 100644 (file)
 \r
                #include <string.h>\r
 \r
 \r
                #include <string.h>\r
 \r
+       /* Enable C linkage for C++ Compilers: */\r
+               #if defined(__cplusplus)\r
+                       extern "C" {\r
+               #endif\r
+\r
        /* Macros: */\r
                /** Mass Storage Class specific request to reset the Mass Storage interface, ready for the next command. */\r
                #define REQ_MassStorageReset       0xFF\r
 \r
                /** Mass Storage Class specific request to retrieve the total number of Logical Units (drives) in the SCSI device. */\r
                #define REQ_GetMaxLUN              0xFE\r
        /* Macros: */\r
                /** Mass Storage Class specific request to reset the Mass Storage interface, ready for the next command. */\r
                #define REQ_MassStorageReset       0xFF\r
 \r
                /** Mass Storage Class specific request to retrieve the total number of Logical Units (drives) in the SCSI device. */\r
                #define REQ_GetMaxLUN              0xFE\r
-\r
-               /** Maximum length of a SCSI command which can be issued by the device or host in a Mass Storage bulk wrapper. */\r
-               #define MAX_SCSI_COMMAND_LENGTH    16\r
                \r
                /** Magic signature for a Command Block Wrapper used in the Mass Storage Bulk-Only transport protocol. */\r
                \r
                /** Magic signature for a Command Block Wrapper used in the Mass Storage Bulk-Only transport protocol. */\r
-               #define CBW_SIGNATURE              0x43425355UL\r
+               #define MS_CBW_SIGNATURE           0x43425355UL\r
 \r
                /** Magic signature for a Command Status Wrapper used in the Mass Storage Bulk-Only transport protocol. */\r
 \r
                /** Magic signature for a Command Status Wrapper used in the Mass Storage Bulk-Only transport protocol. */\r
-               #define CSW_SIGNATURE              0x53425355UL\r
+               #define MS_CSW_SIGNATURE           0x53425355UL\r
                \r
                /** Mask for a Command Block Wrapper's flags attribute to specify a command with data sent from host-to-device. */\r
                \r
                /** Mask for a Command Block Wrapper's flags attribute to specify a command with data sent from host-to-device. */\r
-               #define COMMAND_DIRECTION_DATA_OUT (0 << 7)\r
+               #define MS_COMMAND_DIR_DATA_OUT    (0 << 7)\r
 \r
                /** Mask for a Command Block Wrapper's flags attribute to specify a command with data sent from device-to-host. */\r
 \r
                /** Mask for a Command Block Wrapper's flags attribute to specify a command with data sent from device-to-host. */\r
-               #define COMMAND_DIRECTION_DATA_IN  (1 << 7)\r
+               #define MS_COMMAND_DIR_DATA_IN     (1 << 7)\r
 \r
        /* Type defines: */\r
                /** Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */\r
 \r
        /* Type defines: */\r
                /** Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */\r
@@ -68,7 +70,7 @@
                        uint8_t  Flags; /**< Command block flags, indicating command data direction */\r
                        uint8_t  LUN; /**< Logical Unit number this command is issued to */\r
                        uint8_t  SCSICommandLength; /**< Length of the issued SCSI command within the SCSI command data array */\r
                        uint8_t  Flags; /**< Command block flags, indicating command data direction */\r
                        uint8_t  LUN; /**< Logical Unit number this command is issued to */\r
                        uint8_t  SCSICommandLength; /**< Length of the issued SCSI command within the SCSI command data array */\r
-                       uint8_t  SCSICommandData[MAX_SCSI_COMMAND_LENGTH]; /**< Issued SCSI command in the Command Block */\r
+                       uint8_t  SCSICommandData[16]; /**< Issued SCSI command in the Command Block */\r
                } CommandBlockWrapper_t;\r
                \r
                /** Type define for a Command Status Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */\r
                } CommandBlockWrapper_t;\r
                \r
                /** Type define for a Command Status Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */\r
@@ -84,9 +86,9 @@
                /** Enum for the possible command status wrapper return status codes. */\r
                enum MassStorage_CommandStatusCodes_t\r
                {\r
                /** Enum for the possible command status wrapper return status codes. */\r
                enum MassStorage_CommandStatusCodes_t\r
                {\r
-                       Command_Pass = 0, /**< Command completed with no error */\r
-                       Command_Fail = 1, /**< Command failed to complete - host may check the exact error via a SCSI REQUEST SENSE command */\r
-                       Phase_Error  = 2  /**< Command failed due to being invalid in the current phase */\r
+                       SCSI_Command_Pass = 0, /**< Command completed with no error */\r
+                       SCSI_Command_Fail = 1, /**< Command failed to complete - host may check the exact error via a SCSI REQUEST SENSE command */\r
+                       SCSI_Phase_Error  = 2  /**< Command failed due to being invalid in the current phase */\r
                };\r
                \r
        /* Type Defines: */\r
                };\r
                \r
        /* Type Defines: */\r
                        static uint8_t StreamCallback_AbortOnMassStoreReset(void);\r
                #endif\r
        \r
                        static uint8_t StreamCallback_AbortOnMassStoreReset(void);\r
                #endif\r
        \r
-               void USB_MS_USBTask(USB_ClassInfo_MS_t* MSInterfaceInfo);\r
                bool USB_MS_ConfigureEndpoints(USB_ClassInfo_MS_t* MSInterfaceInfo);\r
                void USB_MS_ProcessControlPacket(USB_ClassInfo_MS_t* MSInterfaceInfo);\r
                bool USB_MS_ConfigureEndpoints(USB_ClassInfo_MS_t* MSInterfaceInfo);\r
                void USB_MS_ProcessControlPacket(USB_ClassInfo_MS_t* MSInterfaceInfo);\r
+               void USB_MS_USBTask(USB_ClassInfo_MS_t* MSInterfaceInfo);\r
                \r
                bool CALLBACK_USB_MS_SCSICommandReceived(USB_ClassInfo_MS_t* MSInterfaceInfo);\r
                \r
                \r
                bool CALLBACK_USB_MS_SCSICommandReceived(USB_ClassInfo_MS_t* MSInterfaceInfo);\r
                \r
+       /* Disable C linkage for C++ Compilers: */\r
+               #if defined(__cplusplus)\r
+                       }\r
+               #endif\r
+               \r
 #endif\r
 #endif\r