16#define USB_CLASS_MASS_STORAGE 8
19#define UMAS_SC_RBC 0x01
20#define UMAS_SC_8020 0x02
21#define UMAS_SC_QIC 0x03
22#define UMAS_SC_UFI 0x04
23#define UMAS_SC_8070 0x05
24#define UMAS_SC_SCSI 0x06
27#define UMAS_PR_CBI 0x00
28#define UMAS_PR_CB 0x01
29#define UMAS_PR_BULK 0x50
30#define UMAS_PR_DPCM_USB 0xf0
38 uint32_t DataTransferLength;
45#define UMAS_BULK_CB_WRAP_LEN 31
46#define UMAS_BULK_CB_SIGN 0x43425355
47#define UMAS_BULK_FLAG_IN 1
48#define UMAS_BULK_FLAG_OUT 0
59#define UMAS_BULK_CS_WRAP_LEN 13
60#define UMAS_BULK_CS_SIGN 0x53425355
61#define UMAS_BULK_STAT_OK 0
62#define UMAS_BULK_STAT_FAIL 1
63#define UMAS_BULK_STAT_PHASE 2
66#define UMAS_BULK_RESET_REQUEST 0xff
67#define UMAS_BULK_GET_MAX_LUN 0xfe
73#define TEST_UNIT_READY 0x00
74#define REQUEST_SENSE 0x03
76#define MODE_SENSE 0x1a
77#define READ_CAPACITY 0x25
80#define MODE_SENSE_10 0x5a
82DRESULT usbh_umas_read(uint8_t *buff, uint32_t sector_no,
int number_of_sector);
83DRESULT usbh_umas_write(uint8_t *buff, uint32_t sector_no,
int number_of_sector);
84DRESULT usbh_umas_ioctl(
int cmd,
void *buff);
85int usbh_umas_disk_status(
void);
int usbh_probe_umass(void)
Try to probe and initialize an USB mass storage device.