summaryrefslogtreecommitdiff
path: root/src/class/msc/msc_device.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-05-06 15:01:38 +0700
committerhathach <[email protected]>2019-05-06 15:01:38 +0700
commitefefbd3a4ef9d867d4aaa05e3c06e51b441aca6e (patch)
tree7755b35141b5724f5caeb701c01cc626ddc387f9 /src/class/msc/msc_device.h
parentfae9aba68f7fb2cb5309b21933bcc0d3fdc480e0 (diff)
add Test Unit Ready to builtin command, add tud_msc_test_unit_ready_cb()
- rename tud_msc_maxlun_cb to tud_msc_get_maxlun_cb
Diffstat (limited to 'src/class/msc/msc_device.h')
-rw-r--r--src/class/msc/msc_device.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/class/msc/msc_device.h b/src/class/msc/msc_device.h
index 068bea3ef..cbaea4bb8 100644
--- a/src/class/msc/msc_device.h
+++ b/src/class/msc/msc_device.h
@@ -97,12 +97,19 @@ int32_t tud_msc_write10_cb (uint8_t lun, uint32_t lba, uint32_t offset, uint8_t*
// Application fill vendor id, product id and revision with string up to 8, 16, 4 characters respectively
void tud_msc_inquiry_cb(uint8_t lun, uint8_t vendor_id[8], uint8_t product_id[16], uint8_t product_rev[4]);
+// Invoked when received Test Unit Ready command.
+// return true allowing host to read/write this LUN e.g SD card inserted
+bool tud_msc_test_unit_ready_cb(uint8_t lun);
+
// Invoked when received SCSI_CMD_READ_CAPACITY_10 and SCSI_CMD_READ_FORMAT_CAPACITY to determine the disk size
// Application update block count and block size
void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_size);
/**
- * Callback invoked when received an SCSI command not in built-in list below.
+ * Invoked when received an SCSI command not in built-in list below.
+ * - READ_CAPACITY10, READ_FORMAT_CAPACITY, INQUIRY, MODE_SENSE6, REQUEST_SENSE
+ * - READ10 and WRITE10 has their own callbacks
+ *
* \param[in] lun Logical unit number
* \param[in] scsi_cmd SCSI command contents which application must examine to response accordingly
* \param[out] buffer Buffer for SCSI Data Stage.
@@ -113,17 +120,13 @@ void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_siz
* \return Actual bytes processed, can be zero for no-data command.
* \retval negative Indicate error e.g unsupported command, tinyusb will \b STALL the corresponding
* endpoint and return failed status in command status wrapper phase.
- *
- * \note Following command is automatically handled by tinyusb stack, callback should not be worried:
- * - READ_CAPACITY10, READ_FORMAT_CAPACITY, INQUIRY, MODE_SENSE6, REQUEST_SENSE
- * - READ10 and WRITE10 has their own callbacks
*/
int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize);
/*------------- Optional callbacks -------------*/
-// Invoked when received GET_MAX_LUN request
-ATTR_WEAK uint8_t tud_msc_maxlun_cb(void);
+// Invoked when received GET_MAX_LUN request, required for multiple LUNs implementation
+ATTR_WEAK uint8_t tud_msc_get_maxlun_cb(void);
// Invoked when Read10 command is complete
ATTR_WEAK void tud_msc_read10_complete_cb(uint8_t lun);