MSC/HostDevice.h
Go to the documentation of this file.
Type
Storage type.
Definition: Components/Storage/src/include/Storage/Device.h:42
Base class for sector-addressable (block) devices.
Definition: BlockDevice.h:34
A USB mass storage device supports one or more logical units, each of which is a physical storage dev...
Definition: MSC/HostDevice.h:83
storage_size_t getSectorCount(uint8_t lun) const
Get the number of blocks/sectors for a unit.
Definition: MSC/HostDevice.h:129
bool write_sectors(uint8_t lun, uint32_t lba, const void *src, size_t size)
Write data to a unit.
size_t getSectorSize(uint8_t lun) const
Get the declared block/sector size for a unit.
Definition: MSC/HostDevice.h:119
bool enumerate(EnumCallback callback)
Enumerate all logical units managed by this device.
Delegate< bool(LogicalUnit &unit, const Inquiry &inquiry)> EnumCallback
Callback passed to enumerate() method.
Definition: MSC/HostDevice.h:91
LogicalUnit * operator[](unsigned lun) const
Access a specific logical unit by number.
Definition: MSC/HostDevice.h:109
std::unique_ptr< LogicalUnit > units[MAX_LUN]
Definition: MSC/HostDevice.h:165
bool read_sectors(uint8_t lun, uint32_t lba, void *dst, size_t size)
Read data from a unit.
bool begin(const Instance &inst)
Definition: Libraries/USB/src/USB/MSC/Device.h:26
void onUnmount(UnmountCallback callback)
Application should call this method to receive device disconnection notifications.
void onMount(MountCallback callback)
Application should call this method to receive device connection notifications.
uint8_t dev_addr
Device address (from 1)
Definition: HostInterface.h:36
A physical device instance managed by an MSC interface.
Definition: Libraries/USB/src/USB/MSC/Device.h:27
bool raw_sector_write(storage_size_t address, const void *src, size_t size) override
bool raw_sync() override
bool raw_sector_erase_range(storage_size_t address, size_t size) override
LogicalUnit(HostDevice &device, uint8_t lun)
bool raw_sector_read(storage_size_t address, void *dst, size_t size) override
Type getType() const override
Obtain device type.
Definition: MSC/HostDevice.h:37
Storage::Device * device
Definition: Libraries/USB/src/USB/MSC/Device.h:28