35 #define PACK_STRUCT_STRUCT __attribute__((packed))
36 #define PACK_STRUCT_BEGIN
37 #define PACK_STRUCT_END
40 #define USB_MS_DATA_EP 1
49 #define EVT_USB_RESET (1 << 0)
50 #define EVT_BOT_RESET (1 << 1)
51 #define EVT_SEM_TAKEN (1 << 2)
52 #define EVT_SEM_RELEASED (1 << 3)
53 #define EVT_USB_CONFIGURED (1 << 4)
54 #define EVT_SCSI_REQ_TEST_UNIT_READY (1 << 5)
55 #define EVT_SCSI_REQ_READ_FMT_CAP (1 << 6)
56 #define EVT_SCSI_REQ_SENSE6 (1 << 7)
57 #define EVT_SCSI_REQ_SENSE10 (1 << 8)
58 #define EVT_WAIT_FOR_COMMAND_BLOCK (1 << 9)
59 #define EVT_SCSI_REQ_SEND_DIAGNOSTIC (1 << 10)
60 #define EVT_SCSI_REQ_READ_CAP10 (1 << 11)
61 #define EVT_SCSI_PROC_INQ (1 << 12)
145 void (*rw_activity_callback)(bool);
void init_msd_driver(void *dbgThreadPtr, USBMassStorageConfig *msdConfig)
BlockDeviceInfo block_dev_info
bool msdRequestsHook(USBDriver *usbp)
Default requests hook.
usbep_t bulk_ep
Index of the USB endpoint to use for transfers.
msd_state_t
Possible states for the USB mass storage driver.
Response to a READ_CAPACITY_10 SCSI command.
uint8_t additional_length
const USBMassStorageConfig * config
event_source_t evt_ejected
void msdInit(USBMassStorageDriver *msdp)
Initializes a USB mass storage driver.
USB mass storage driver structure.
void msdConfigureHookI(USBMassStorageDriver *msdp)
USB device configured handler.
Driver configuration structure.
void msd_register_evt_connected(event_listener_t *elp, eventmask_t mask)
register connected event source in local event mask
bool reconfigured_or_reset_event
USBDriver * usbp
USB driver to use for communication.
static USBMassStorageConfig msdConfig
void msd_register_evt_ejected(event_listener_t *elp, eventmask_t mask)
register ejected event source in local event mask
#define PACK_STRUCT_BEGIN
uint8_t response_data_format
void msdStart(USBMassStorageDriver *msdp, const USBMassStorageConfig *config)
Starts a USB mass storage driver.
static const struct usb_config_descriptor config
void msdStop(USBMassStorageDriver *msdp)
Stops a USB mass storage driver.
void deinit_msd_driver(void)
msd_scsi_inquiry_response_t inquiry
BaseBlockDevice * bbdp
Block device to use for storage.
msd_scsi_sense_response_t sense