aboutsummaryrefslogtreecommitdiff
path: root/LUFA/Drivers/USB/Class/Host/MassStorage.h
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2009-08-27 06:28:18 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2009-08-27 06:28:18 +0000
commita3f72571a3fd5a839b60be98a694900adf93f091 (patch)
treecd36aa95d85050525b2f57976571ef84350ce06f /LUFA/Drivers/USB/Class/Host/MassStorage.h
parent53f4cd87c56f3f9e3274ce6c302eddf90c15ad8a (diff)
Completed initial Host mode Mass Storage class driver.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@778 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host/MassStorage.h')
-rw-r--r--LUFA/Drivers/USB/Class/Host/MassStorage.h57
1 files changed, 55 insertions, 2 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.h b/LUFA/Drivers/USB/Class/Host/MassStorage.h
index 1678aefe..e64e143a 100644
--- a/LUFA/Drivers/USB/Class/Host/MassStorage.h
+++ b/LUFA/Drivers/USB/Class/Host/MassStorage.h
@@ -226,21 +226,74 @@
uint8_t MS_Host_GetInquiryData(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex,
SCSI_Inquiry_Response_t* InquiryData) ATTR_NON_NULL_PTR_ARG(1, 3);
+ /** Sends a TEST UNIT READY command to the device, to determine if it is ready to accept other SCSI commands.
+ *
+ * \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
+ * \param[in] LUNIndex LUN index within the device the command is being issued to
+ *
+ * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
+ */
uint8_t MS_Host_TestUnitReady(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex) ATTR_NON_NULL_PTR_ARG(1);
+ /** Retrieves the total capacity of the attached USB Mass Storage device, in blocks, and block size.
+ *
+ * \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
+ * \param[in] LUNIndex LUN index within the device the command is being issued to
+ * \param[out] DeviceCapacity Pointer to the location where the capacity information should be stored
+ *
+ * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
+ */
uint8_t MS_Host_ReadDeviceCapacity(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex,
SCSI_Capacity_t* DeviceCapacity) ATTR_NON_NULL_PTR_ARG(1, 3);
+ /** Retrieves the device sense data, indicating the current device state and error codes for the previously
+ * issued command.
+ *
+ * \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
+ * \param[in] LUNIndex LUN index within the device the command is being issued to
+ * \param[out] SenseData Pointer to the location where the sense information should be stored
+ *
+ * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
+ */
uint8_t MS_Host_RequestSense(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex,
SCSI_Request_Sense_Response_t* SenseData) ATTR_NON_NULL_PTR_ARG(1, 3);
+ /** Issues a PREVENT MEDIUM REMOVAL command, to logically (or, depending on the type of device, physically) lock
+ * the device from removal so that blocks of data on the medium can be read or altered.
+ *
+ * \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
+ * \param[in] LUNIndex LUN index within the device the command is being issued to
+ * \param[in] PreventRemoval Boolean true if the device should be locked from removal, false otherwise
+ *
+ * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
+ */
uint8_t MS_Host_PreventAllowMediumRemoval(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex,
bool PreventRemoval) ATTR_NON_NULL_PTR_ARG(1);
- uint8_t MS_Host_ReadDeviceBlocks(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex, uint32_t BlockAddr,
+ /** Reads blocks of data from the attached Mass Storage device's medium.
+ *
+ * \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
+ * \param[in] LUNIndex LUN index within the device the command is being issued to
+ * \param[in] BlockAddress Starting block address within the device to read from
+ * \param[in] Blocks Total number of blocks to read
+ * \param[out] BlockBuffer Pointer to where the read data from the device should be stored
+ *
+ * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
+ */
+ uint8_t MS_Host_ReadDeviceBlocks(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex, uint32_t BlockAddress,
uint8_t Blocks, uint16_t BlockSize, void* BlockBuffer) ATTR_NON_NULL_PTR_ARG(1, 6);
- uint8_t MS_Host_WriteDeviceBlocks(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex, uint32_t BlockAddr,
+ /** Writes blocks of data to the attached Mass Storage device's medium.
+ *
+ * \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
+ * \param[in] LUNIndex LUN index within the device the command is being issued to
+ * \param[in] BlockAddress Starting block address within the device to write to
+ * \param[in] Blocks Total number of blocks to read
+ * \param[in] BlockBuffer Pointer to where the data to write should be sourced from
+ *
+ * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
+ */
+ uint8_t MS_Host_WriteDeviceBlocks(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint8_t LUNIndex, uint32_t BlockAddress,
uint8_t Blocks, uint16_t BlockSize, void* BlockBuffer) ATTR_NON_NULL_PTR_ARG(1, 6);
/* Private Interface - For use in library only: */