USB::MSC::LogicalUnit Class Reference
A physical device instance managed by an MSC interface. More...
#include <Device.h>
Inheritance diagram for USB::MSC::LogicalUnit:
Collaboration diagram for USB::MSC::LogicalUnit:
Public Member Functions | |
operator bool () const | |
void | getCapacity (uint32_t *block_count, uint16_t *block_size) |
int | read (uint32_t lba, uint32_t offset, void *buffer, uint32_t bufsize) |
int | write (uint32_t lba, uint32_t offset, uint8_t *buffer, uint32_t bufsize) |
LogicalUnit (HostDevice &device, uint8_t lun) | |
Type | getType () const override |
Obtain device type. More... | |
String | getName () const override |
Obtain unique device name. More... | |
uint32_t | getId () const override |
Obtain device ID. More... | |
Public Member Functions inherited from Storage::Disk::BlockDevice | |
bool | read (storage_size_t address, void *dst, size_t size) override |
Read data from the storage device. More... | |
bool | write (storage_size_t address, const void *src, size_t size) override |
Write data to the storage device. More... | |
bool | erase_range (storage_size_t address, storage_size_t size) override |
Erase a region of storage in preparation for writing. More... | |
size_t | getBlockSize () const override |
Obtain smallest allocation unit for erase operations. More... | |
storage_size_t | getSize () const override |
Obtain addressable size of this device. More... | |
storage_size_t | getSectorCount () const override |
Obtain total number of sectors on this device. More... | |
bool | sync () override |
Flush any pending writes to the physical media. More... | |
bool | allocateBuffers (unsigned numBuffers) |
Set number of sector buffers to use. More... | |
Public Member Functions inherited from Storage::Device | |
Device () | |
~Device () | |
bool | operator== (const String &name) const |
const PartitionTable & | partitions () const |
Provide read-only access to partition table. More... | |
PartitionTable & | editablePartitions () |
Provide full access to partition table. More... | |
bool | loadPartitions (uint32_t tableOffset) |
Load partition table entries @tableOffset Location of partition table to read. More... | |
bool | loadPartitions (Device &source, uint32_t tableOffset) |
Load partition table entries from another table. More... | |
virtual uint16_t | getSectorSize () const |
Get sector size, the unit of allocation for block-access devices. More... | |
size_t | printTo (Print &p) const |
Public Member Functions inherited from LinkedObjectTemplate< Device > | |
Device * | getNext () const |
bool | insertAfter (Device *object) |
Iterator | begin () const |
Iterator | end () const |
Iterator | cbegin () const |
Iterator | cend () const |
Public Member Functions inherited from LinkedObject | |
virtual | ~LinkedObject () |
virtual LinkedObject * | next () const |
bool | insertAfter (LinkedObject *object) |
bool | operator== (const LinkedObject &other) const |
bool | operator!= (const LinkedObject &other) const |
Public Attributes | |
Storage::Device * | device |
bool | readOnly |
Public Attributes inherited from Storage::Disk::BlockDevice | |
Stat | stat |
Protected Member Functions | |
bool | raw_sector_read (storage_size_t address, void *dst, size_t size) override |
bool | raw_sector_write (storage_size_t address, const void *src, size_t size) override |
bool | raw_sector_erase_range (storage_size_t address, size_t size) override |
bool | raw_sync () override |
Protected Member Functions inherited from Storage::Disk::BlockDevice | |
bool | flushBuffer (Buffer &buf) |
bool | flushBuffers () |
Additional Inherited Members | |
Public Types inherited from Storage::Device | |
enum class | Type : uint8_t { partitionType = uint8_t(Partition::Type::storage) , XX } |
Storage type. More... | |
using | List = LinkedObjectListTemplate< Device > |
using | OwnedList = OwnedLinkedObjectListTemplate< Device > |
Public Types inherited from LinkedObjectTemplate< Device > | |
using | Iterator = IteratorTemplate< Device, Device *, Device & > |
using | ConstIterator = IteratorTemplate< const Device, const Device *, const Device & > |
Static Public Attributes inherited from Storage::Device | |
static constexpr uint16_t | defaultSectorSize {512} |
Protected Attributes inherited from Storage::Disk::BlockDevice | |
std::unique_ptr< BufferList > | buffers |
uint64_t | sectorCount {0} |
uint16_t | sectorSize {defaultSectorSize} |
uint8_t | sectorSizeShift {getSizeBits(defaultSectorSize)} |
Protected Attributes inherited from Storage::Device | |
PartitionTable | mPartitions |
Detailed Description
A physical device instance managed by an MSC interface.
Constructor & Destructor Documentation
◆ LogicalUnit()
USB::MSC::LogicalUnit::LogicalUnit | ( | HostDevice & | device, |
uint8_t | lun | ||
) |
Member Function Documentation
◆ getCapacity()
|
inline |
◆ getId()
|
overridevirtual |
◆ getName()
|
overridevirtual |
Obtain unique device name.
Implements Storage::Device.
◆ getType()
|
inlineoverridevirtual |
Obtain device type.
Implements Storage::Device.
◆ operator bool()
|
inline |
◆ raw_sector_erase_range()
|
overrideprotectedvirtual |
Implements Storage::Disk::BlockDevice.
◆ raw_sector_read()
|
overrideprotectedvirtual |
Implements Storage::Disk::BlockDevice.
◆ raw_sector_write()
|
overrideprotectedvirtual |
Implements Storage::Disk::BlockDevice.
◆ raw_sync()
|
overrideprotectedvirtual |
Implements Storage::Disk::BlockDevice.
◆ read()
|
inline |
◆ write()
|
inline |
Member Data Documentation
◆ device
Storage::Device* USB::MSC::LogicalUnit::device |
◆ readOnly
bool USB::MSC::LogicalUnit::readOnly |
The documentation for this class was generated from the following files: