host msc: call read_capacity as part of enumeration

- add tuh_msc_get_block_count(), tuh_msc_get_block_size()
- rename tuh_msc_mounted_cb/tuh_msc_unmounted_cb to
tuh_msc_mount_cb/tuh_msc_unmount_cb to match device stack naming
- change tuh_msc_is_busy() to tuh_msc_ready()
- add CFG_TUH_MSC_MAXLUN (default to 4) to hold lun capacities
- add host msc configured to for state check.
This commit is contained in:
hathach
2021-02-23 19:41:11 +07:00
parent 386a386345
commit 5108d76136
5 changed files with 125 additions and 93 deletions

View File

@@ -48,7 +48,7 @@ CFG_TUSB_MEM_SECTION static FATFS fatfs[CFG_TUSB_HOST_DEVICE_MAX];
//--------------------------------------------------------------------+
// tinyusb callbacks
//--------------------------------------------------------------------+
void tuh_msc_mounted_cb(uint8_t dev_addr)
void tuh_msc_mount_cb(uint8_t dev_addr)
{
puts("\na MassStorage device is mounted");
@@ -94,7 +94,7 @@ void tuh_msc_mounted_cb(uint8_t dev_addr)
}
}
void tuh_msc_unmounted_cb(uint8_t dev_addr)
void tuh_msc_unmount_cb(uint8_t dev_addr)
{
puts("\na MassStorage device is unmounted");