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);
static const struct usb_config_descriptor config
Driver configuration structure.
BaseBlockDevice * bbdp
Block device to use for storage.
usbep_t bulk_ep
Index of the USB endpoint to use for transfers.
USBDriver * usbp
USB driver to use for communication.
static USBMassStorageConfig msdConfig
const USBMassStorageConfig * config
msd_scsi_sense_response_t sense
bool reconfigured_or_reset_event
bool msdRequestsHook(USBDriver *usbp)
Default requests hook.
void init_msd_driver(void *dbgThreadPtr, USBMassStorageConfig *msdConfig)
BlockDeviceInfo block_dev_info
uint8_t response_data_format
#define PACK_STRUCT_BEGIN
void msdStart(USBMassStorageDriver *msdp, const USBMassStorageConfig *config)
Starts a USB mass storage driver.
msd_scsi_inquiry_response_t inquiry
void msdInit(USBMassStorageDriver *msdp)
Initializes a USB mass storage driver.
void msdConfigureHookI(USBMassStorageDriver *msdp)
USB device configured handler.
void msd_register_evt_connected(event_listener_t *elp, eventmask_t mask)
register connected event source in local event mask
void msd_register_evt_ejected(event_listener_t *elp, eventmask_t mask)
register ejected event source in local event mask
event_source_t evt_connected
void msdStop(USBMassStorageDriver *msdp)
Stops a USB mass storage driver.
uint8_t additional_length
void deinit_msd_driver(void)
msd_state_t
Possible states for the USB mass storage driver.
Response to a READ_CAPACITY_10 SCSI command.
USB mass storage driver structure.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.