Minor updates to the Benito programmer - remove redundant PORT register manipulations.
[pub/USBasp.git] / Demos / Host / LowLevel / MassStorageHost / Lib / MassStoreCommands.h
index 28f6a15..f13b4b1 100644 (file)
@@ -42,7 +42,7 @@
                #include "MassStorageHost.h"\r
                #include "SCSI_Codes.h"\r
 \r
-               #include <LUFA/Drivers/USB/USB.h>                    // USB Functionality\r
+               #include <LUFA/Drivers/USB/USB.h>\r
 \r
        /* Macros: */\r
                /** Class specific request to reset the Mass Storage interface of the attached device */\r
@@ -64,7 +64,7 @@
                #define COMMAND_DIRECTION_DATA_IN        (1 << 7)\r
                \r
                /** Timeout period between the issuing of a CBW to a device, and the reception of the first packet */\r
-               #define COMMAND_DATA_TIMEOUT_MS          500\r
+               #define COMMAND_DATA_TIMEOUT_MS          2000\r
 \r
                /** Pipe number of the Mass Storage data IN pipe */\r
                #define MASS_STORE_DATA_IN_PIPE          1\r
                        uint8_t      SenseKeySpecific[3];\r
                } SCSI_Request_Sense_Response_t;\r
 \r
+               /** Type define for a SCSI Inquiry structure. Structures of this type are filled out by the\r
+                *  device via the MassStore_Inquiry() function, retrieving the attached device's information.\r
+                *  For details of the structure contents, refer to the SCSI specifications.\r
+                */\r
+               typedef struct\r
+               {\r
+                       unsigned char DeviceType          : 5;\r
+                       unsigned char PeripheralQualifier : 3;\r
+                       \r
+                       unsigned char _RESERVED1          : 7;\r
+                       unsigned char Removable           : 1;\r
+                       \r
+                       uint8_t      Version;\r
+                       \r
+                       unsigned char ResponseDataFormat  : 4;\r
+                       unsigned char _RESERVED2          : 1;\r
+                       unsigned char NormACA             : 1;\r
+                       unsigned char TrmTsk              : 1;\r
+                       unsigned char AERC                : 1;\r
+\r
+                       uint8_t      AdditionalLength;\r
+                       uint8_t      _RESERVED3[2];\r
+\r
+                       unsigned char SoftReset           : 1;\r
+                       unsigned char CmdQue              : 1;\r
+                       unsigned char _RESERVED4          : 1;\r
+                       unsigned char Linked              : 1;\r
+                       unsigned char Sync                : 1;\r
+                       unsigned char WideBus16Bit        : 1;\r
+                       unsigned char WideBus32Bit        : 1;\r
+                       unsigned char RelAddr             : 1;\r
+                       \r
+                       uint8_t      VendorID[8];\r
+                       uint8_t      ProductID[16];\r
+                       uint8_t      RevisionID[4];\r
+               } SCSI_Inquiry_Response_t;\r
+               \r
                /** SCSI capacity structure, to hold the total capacity of the device in both the number\r
                 *  of blocks in the current LUN, and the size of each block. This structure is filled by\r
                 *  the device when the MassStore_ReadCapacity() function is called.\r
                        static uint8_t MassStore_GetReturnedStatus(void);\r
                #endif\r
                \r
-               uint8_t MassStore_ClearPipeStall(const uint8_t EndpointNum);\r
                uint8_t MassStore_MassStorageReset(void);\r
                uint8_t MassStore_GetMaxLUN(uint8_t* const MaxLUNIndex);\r
                uint8_t MassStore_RequestSense(const uint8_t LUNIndex, const SCSI_Request_Sense_Response_t* const SensePtr)\r
                                               ATTR_NON_NULL_PTR_ARG(2);\r
+               uint8_t MassStore_Inquiry(const uint8_t LUNIndex, const SCSI_Inquiry_Response_t* const InquiryPtr)\r
+                                              ATTR_NON_NULL_PTR_ARG(2);\r
                uint8_t MassStore_ReadDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAddress,\r
                                                  const uint8_t Blocks, const uint16_t BlockSize, void* BufferPtr) ATTR_NON_NULL_PTR_ARG(5);\r
                uint8_t MassStore_WriteDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAddress,\r