libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
Functions | |
usbd_mass_storage * | usb_msc_init (usbd_device *usbd_dev, uint8_t ep_in, uint8_t ep_in_size, uint8_t ep_out, uint8_t ep_out_size, const char *vendor_id, const char *product_id, const char *product_revision_level, const uint32_t block_count, int(*read_block)(uint32_t lba, uint8_t *copy_to), int(*write_block)(uint32_t lba, const uint8_t *copy_from)) |
Initializes the USB Mass Storage subsystem. More... | |
usbd_mass_storage * usb_msc_init | ( | usbd_device * | usbd_dev, |
uint8_t | ep_in, | ||
uint8_t | ep_in_size, | ||
uint8_t | ep_out, | ||
uint8_t | ep_out_size, | ||
const char * | vendor_id, | ||
const char * | product_id, | ||
const char * | product_revision_level, | ||
const uint32_t | block_count, | ||
int(*)(uint32_t lba, uint8_t *copy_to) | read_block, | ||
int(*)(uint32_t lba, const uint8_t *copy_from) | write_block | ||
) |
Initializes the USB Mass Storage subsystem.
[in] | usbd_dev | The USB device to associate the Mass Storage with. |
[in] | ep_in | The USB 'IN' endpoint. |
[in] | ep_in_size | The maximum endpoint size. Valid values: 8, 16, 32 or 64 |
[in] | ep_out | The USB 'OUT' endpoint. |
[in] | ep_out_size | The maximum endpoint size. Valid values: 8, 16, 32 or 64 |
[in] | vendor_id | The SCSI vendor ID to return. Maximum used length is 8. |
[in] | product_id | The SCSI product ID to return. Maximum used length is 16. |
[in] | product_revision_level | The SCSI product revision level to return. Maximum used length is 4. |
[in] | block_count | The number of 512-byte blocks available. |
[in] | read_block | The function called when the host requests to read a LBA block. Must NOT be NULL. |
[in] | write_block | The function called when the host requests to write a LBA block. Must NOT be NULL. |
Definition at line 801 of file usb_msc.c.
References _mass_storage, usb_msc_trans::block_count, _usbd_mass_storage::block_count, usb_msc_trans::byte_count, usb_msc_trans::bytes_to_read, usb_msc_trans::bytes_to_write, usb_msc_trans::cbw_cnt, usb_msc_trans::csw_sent, usb_msc_trans::csw_valid, usb_msc_trans::current_block, _usbd_mass_storage::ep_in, _usbd_mass_storage::ep_in_size, _usbd_mass_storage::ep_out, _usbd_mass_storage::ep_out_size, usb_msc_trans::lba_start, _usbd_mass_storage::lock, msc_set_config(), _usbd_mass_storage::product_id, _usbd_mass_storage::product_revision_level, _usbd_mass_storage::read_block, set_sbc_status_good(), _usbd_mass_storage::trans, _usbd_mass_storage::unlock, _usbd_mass_storage::usbd_dev, usbd_register_set_config_callback(), _usbd_mass_storage::vendor_id, and _usbd_mass_storage::write_block.