#include <masstorage.h>
|
| BulkOnly (USB *p) |
|
uint8_t | GetLastUsbError () |
|
uint8_t | GetbMaxLUN () |
|
uint8_t | GetbTheLUN () |
|
bool | WriteProtected (uint8_t lun) |
|
uint8_t | MediaCTL (uint8_t lun, uint8_t ctl) |
|
uint8_t | Read (uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf) |
|
uint8_t | Read (uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, USBReadParser *prs) |
|
uint8_t | Write (uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, const uint8_t *buf) |
|
uint8_t | LockMedia (uint8_t lun, uint8_t lock) |
|
bool | LUNIsGood (uint8_t lun) |
|
uint32_t | GetCapacity (uint8_t lun) |
|
uint16_t | GetSectorSize (uint8_t lun) |
|
uint8_t | Init (uint8_t parent, uint8_t port, bool lowspeed) |
|
uint8_t | ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed) |
|
uint8_t | Release () |
|
uint8_t | Poll () |
|
virtual uint8_t | GetAddress () |
|
void | EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) |
|
virtual bool | DEVCLASSOK (uint8_t klass) |
|
uint8_t | SCSITransaction6 (CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir) |
|
uint8_t | SCSITransaction10 (CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir) |
|
virtual void | ResetHubPort (uint8_t port) |
|
virtual bool | VIDPIDOK (uint16_t vid, uint16_t pid) |
|
virtual bool | DEVSUBCLASSOK (uint8_t subklass) |
|
Definition at line 462 of file masstorage.h.
BulkOnly::BulkOnly |
( |
USB * |
p | ) |
|
virtual uint8_t BulkOnly::OnInit |
( |
| ) |
|
|
inlineprotectedvirtual |
uint8_t BulkOnly::GetLastUsbError |
( |
| ) |
|
|
inline |
uint8_t BulkOnly::GetbMaxLUN |
( |
| ) |
|
|
inline |
uint8_t BulkOnly::GetbTheLUN |
( |
| ) |
|
|
inline |
bool BulkOnly::WriteProtected |
( |
uint8_t |
lun | ) |
|
Test if LUN is write protected
- Parameters
-
- Returns
- cached status of write protect switch
Definition at line 70 of file masstorage.cpp.
uint8_t BulkOnly::MediaCTL |
( |
uint8_t |
lun, |
|
|
uint8_t |
ctl |
|
) |
| |
Media control, for spindle motor and media tray or door. This includes CDROM, TAPE and anything with a media loader.
- Parameters
-
lun | Logical Unit Number |
ctl | 0x00 Stop Motor, 0x01 Start Motor, 0x02 Eject Media, 0x03 Load Media |
- Returns
- 0 on success
Definition at line 130 of file masstorage.cpp.
uint8_t BulkOnly::Read |
( |
uint8_t |
lun, |
|
|
uint32_t |
addr, |
|
|
uint16_t |
bsize, |
|
|
uint8_t |
blocks, |
|
|
uint8_t * |
buf |
|
) |
| |
Read data from media
- Parameters
-
lun | Logical Unit Number |
addr | LBA address on media to read |
bsize | size of a block (we should probably use the cached size) |
blocks | how many blocks to read |
buf | memory that is able to hold the requested data |
- Returns
- 0 on success
Definition at line 154 of file masstorage.cpp.
uint8_t BulkOnly::Read |
( |
uint8_t |
lun, |
|
|
uint32_t |
addr, |
|
|
uint16_t |
bsize, |
|
|
uint8_t |
blocks, |
|
|
USBReadParser * |
prs |
|
) |
| |
uint8_t BulkOnly::Write |
( |
uint8_t |
lun, |
|
|
uint32_t |
addr, |
|
|
uint16_t |
bsize, |
|
|
uint8_t |
blocks, |
|
|
const uint8_t * |
buf |
|
) |
| |
Write data to media
- Parameters
-
lun | Logical Unit Number |
addr | LBA address on media to write |
bsize | size of a block (we should probably use the cached size) |
blocks | how many blocks to write |
buf | memory that contains the data to write |
- Returns
- 0 on success
Definition at line 188 of file masstorage.cpp.
uint8_t BulkOnly::LockMedia |
( |
uint8_t |
lun, |
|
|
uint8_t |
lock |
|
) |
| |
Lock or Unlock the tray or door on device. Caution: Some devices with buggy firmware will lock up.
- Parameters
-
lun | Logical Unit Number |
lock | 1 to lock, 0 to unlock |
- Returns
Definition at line 114 of file masstorage.cpp.
bool BulkOnly::LUNIsGood |
( |
uint8_t |
lun | ) |
|
Test if LUN is ready for use
- Parameters
-
- Returns
- true if LUN is ready for use
Definition at line 60 of file masstorage.cpp.
uint32_t BulkOnly::GetCapacity |
( |
uint8_t |
lun | ) |
|
Get the capacity of the media
- Parameters
-
- Returns
- media capacity
Definition at line 36 of file masstorage.cpp.
uint16_t BulkOnly::GetSectorSize |
( |
uint8_t |
lun | ) |
|
Get the sector (block) size used on the media
- Parameters
-
- Returns
- media sector size
Definition at line 48 of file masstorage.cpp.
uint8_t BulkOnly::Init |
( |
uint8_t |
parent, |
|
|
uint8_t |
port, |
|
|
bool |
lowspeed |
|
) |
| |
|
virtual |
- Parameters
-
parent | (not used) |
port | (not used) |
lowspeed | true if device is low speed |
- Returns
- 0 for success
Reimplemented from USBDeviceConfig.
Definition at line 326 of file masstorage.cpp.
uint8_t BulkOnly::ConfigureDevice |
( |
uint8_t |
parent, |
|
|
uint8_t |
port, |
|
|
bool |
lowspeed |
|
) |
| |
|
virtual |
USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET == success We need to standardize either the rcode, or change the API to return values so a signal that additional actions are required can be produced. Some of these codes do exist already.
TECHNICAL: We could do most of this code elsewhere, with the exception of checking the class instance. Doing so would save some program memory when using multiple drivers.
- Parameters
-
parent | USB address of parent |
port | address of port on parent |
lowspeed | true if device is low speed |
- Returns
Reimplemented from USBDeviceConfig.
Definition at line 251 of file masstorage.cpp.
uint8_t BulkOnly::Release |
( |
| ) |
|
|
virtual |
uint8_t BulkOnly::Poll |
( |
| ) |
|
|
virtual |
virtual uint8_t BulkOnly::GetAddress |
( |
| ) |
|
|
inlinevirtual |
void BulkOnly::EndpointXtract |
( |
uint8_t |
conf, |
|
|
uint8_t |
iface, |
|
|
uint8_t |
alt, |
|
|
uint8_t |
proto, |
|
|
const USB_ENDPOINT_DESCRIPTOR * |
pep |
|
) |
| |
|
virtual |
virtual bool BulkOnly::DEVCLASSOK |
( |
uint8_t |
klass | ) |
|
|
inlinevirtual |
uint8_t BulkOnly::SCSITransaction6 |
( |
CDB6_t * |
cdb, |
|
|
uint16_t |
buf_size, |
|
|
void * |
buf, |
|
|
uint8_t |
dir |
|
) |
| |
Wrap and execute a SCSI CDB with length of 6
- Parameters
-
cdb | CDB to execute |
buf_size | Size of expected transaction |
buf | Buffer |
dir | MASS_CMD_DIR_IN | MASS_CMD_DIR_OUT |
- Returns
Definition at line 83 of file masstorage.cpp.
uint8_t BulkOnly::SCSITransaction10 |
( |
CDB10_t * |
cdb, |
|
|
uint16_t |
buf_size, |
|
|
void * |
buf, |
|
|
uint8_t |
dir |
|
) |
| |
Wrap and execute a SCSI CDB with length of 10
- Parameters
-
cdb | CDB to execute |
buf_size | Size of expected transaction |
buf | Buffer |
dir | MASS_CMD_DIR_IN | MASS_CMD_DIR_OUT |
- Returns
Definition at line 99 of file masstorage.cpp.
const uint8_t BulkOnly::epDataInIndex = 1 |
|
staticprotected |
const uint8_t BulkOnly::epDataOutIndex = 2 |
|
staticprotected |
const uint8_t BulkOnly::epInterruptInIndex = 3 |
|
staticprotected |
uint8_t BulkOnly::bAddress |
|
protected |
uint8_t BulkOnly::bConfNum |
|
protected |
uint32_t BulkOnly::qNextPollTime |
|
protected |
bool BulkOnly::bPollEnable |
|
protected |
uint32_t BulkOnly::dCBWTag |
|
protected |
uint8_t BulkOnly::bLastUsbError |
|
protected |
uint8_t BulkOnly::bMaxLUN |
|
protected |
uint8_t BulkOnly::bTheLUN |
|
protected |
The documentation for this class was generated from the following files: