Prusa MINI Firmware overview
BulkOnly Class Reference

#include <masstorage.h>

Inheritance diagram for BulkOnly:
Collaboration diagram for BulkOnly:

Public Member Functions

 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)
 
- Public Member Functions inherited from USBDeviceConfig
virtual uint8_t Init (uint8_t parent __attribute__((unused)), uint8_t port __attribute__((unused)), bool lowspeed __attribute__((unused)))
 
virtual uint8_t ConfigureDevice (uint8_t parent __attribute__((unused)), uint8_t port __attribute__((unused)), bool lowspeed __attribute__((unused)))
 
virtual void ResetHubPort (uint8_t port __attribute__((unused)))
 
virtual bool VIDPIDOK (uint16_t vid __attribute__((unused)), uint16_t pid __attribute__((unused)))
 
virtual bool DEVCLASSOK (uint8_t klass __attribute__((unused)))
 
virtual bool DEVSUBCLASSOK (uint8_t subklass __attribute__((unused)))
 
- Public Member Functions inherited from UsbConfigXtracter
virtual void EndpointXtract (uint8_t conf __attribute__((unused)), uint8_t iface __attribute__((unused)), uint8_t alt __attribute__((unused)), uint8_t proto __attribute__((unused)), const USB_ENDPOINT_DESCRIPTOR *ep __attribute__((unused)))
 

Protected Member Functions

void PrintEndpointDescriptor (const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
 
virtual uint8_t OnInit ()
 

Protected Attributes

USBpUsb
 
uint8_t bAddress
 
uint8_t bConfNum
 
uint8_t bIface
 
uint8_t bNumEP
 
uint32_t qNextPollTime
 
bool bPollEnable
 
EpInfo epInfo [MASS_MAX_ENDPOINTS]
 
uint32_t dCBWTag
 
uint8_t bLastUsbError
 
uint8_t bMaxLUN
 
uint8_t bTheLUN
 
uint32_t CurrentCapacity [MASS_MAX_SUPPORTED_LUN]
 
uint16_t CurrentSectorSize [MASS_MAX_SUPPORTED_LUN]
 
bool LUNOk [MASS_MAX_SUPPORTED_LUN]
 
bool WriteOk [MASS_MAX_SUPPORTED_LUN]
 

Static Protected Attributes

static const uint8_t epDataInIndex
 
static const uint8_t epDataOutIndex
 
static const uint8_t epInterruptInIndex
 

Constructor & Destructor Documentation

◆ BulkOnly()

BulkOnly::BulkOnly ( USB p)

Member Function Documentation

◆ PrintEndpointDescriptor()

void BulkOnly::PrintEndpointDescriptor ( const USB_ENDPOINT_DESCRIPTOR *  ep_ptr)
protected

◆ OnInit()

virtual uint8_t BulkOnly::OnInit ( )
protectedvirtual
498 { return 0; }

◆ GetLastUsbError()

uint8_t BulkOnly::GetLastUsbError ( )
503 { return bLastUsbError; };

◆ GetbMaxLUN()

uint8_t BulkOnly::GetbMaxLUN ( )
505 { return bMaxLUN; } // Max LUN

◆ GetbTheLUN()

uint8_t BulkOnly::GetbTheLUN ( )
506 { return bTheLUN; } // Active LUN

◆ WriteProtected()

bool BulkOnly::WriteProtected ( uint8_t  lun)

◆ MediaCTL()

uint8_t BulkOnly::MediaCTL ( uint8_t  lun,
uint8_t  ctl 
)

◆ Read() [1/2]

uint8_t BulkOnly::Read ( uint8_t  lun,
uint32_t  addr,
uint16_t  bsize,
uint8_t  blocks,
uint8_t buf 
)

◆ Read() [2/2]

uint8_t BulkOnly::Read ( uint8_t  lun,
uint32_t  addr,
uint16_t  bsize,
uint8_t  blocks,
USBReadParser prs 
)

◆ Write()

uint8_t BulkOnly::Write ( uint8_t  lun,
uint32_t  addr,
uint16_t  bsize,
uint8_t  blocks,
const uint8_t buf 
)

◆ LockMedia()

uint8_t BulkOnly::LockMedia ( uint8_t  lun,
uint8_t  lock 
)

◆ LUNIsGood()

bool BulkOnly::LUNIsGood ( uint8_t  lun)

◆ GetCapacity()

uint32_t BulkOnly::GetCapacity ( uint8_t  lun)

◆ GetSectorSize()

uint16_t BulkOnly::GetSectorSize ( uint8_t  lun)

◆ Init()

uint8_t BulkOnly::Init ( uint8_t  parent,
uint8_t  port,
bool  lowspeed 
)

◆ ConfigureDevice()

uint8_t BulkOnly::ConfigureDevice ( uint8_t  parent,
uint8_t  port,
bool  lowspeed 
)

◆ Release()

uint8_t BulkOnly::Release ( )
virtual

Reimplemented from USBDeviceConfig.

◆ Poll()

uint8_t BulkOnly::Poll ( )
virtual

Reimplemented from USBDeviceConfig.

◆ GetAddress()

virtual uint8_t BulkOnly::GetAddress ( )
virtual

Reimplemented from USBDeviceConfig.

526 { return bAddress; }

◆ EndpointXtract()

void BulkOnly::EndpointXtract ( uint8_t  conf,
uint8_t  iface,
uint8_t  alt,
uint8_t  proto,
const USB_ENDPOINT_DESCRIPTOR *  ep 
)

◆ DEVCLASSOK()

virtual bool BulkOnly::DEVCLASSOK ( uint8_t  klass)
virtual
531 { return klass == USB_CLASS_MASS_STORAGE; }

◆ SCSITransaction6()

uint8_t BulkOnly::SCSITransaction6 ( CDB6_t cdb,
uint16_t  buf_size,
void buf,
uint8_t  dir 
)

◆ SCSITransaction10()

uint8_t BulkOnly::SCSITransaction10 ( CDB10_t cdb,
uint16_t  buf_size,
void buf,
uint8_t  dir 
)

Member Data Documentation

◆ epDataInIndex

const uint8_t BulkOnly::epDataInIndex
staticprotected

◆ epDataOutIndex

const uint8_t BulkOnly::epDataOutIndex
staticprotected

◆ epInterruptInIndex

const uint8_t BulkOnly::epInterruptInIndex
staticprotected

◆ pUsb

USB* BulkOnly::pUsb
protected

◆ bAddress

uint8_t BulkOnly::bAddress
protected

◆ bConfNum

uint8_t BulkOnly::bConfNum
protected

◆ bIface

uint8_t BulkOnly::bIface
protected

◆ bNumEP

uint8_t BulkOnly::bNumEP
protected

◆ qNextPollTime

uint32_t BulkOnly::qNextPollTime
protected

◆ bPollEnable

bool BulkOnly::bPollEnable
protected

◆ epInfo

EpInfo BulkOnly::epInfo[MASS_MAX_ENDPOINTS]
protected

◆ dCBWTag

uint32_t BulkOnly::dCBWTag
protected

◆ bLastUsbError

uint8_t BulkOnly::bLastUsbError
protected

◆ bMaxLUN

uint8_t BulkOnly::bMaxLUN
protected

◆ bTheLUN

uint8_t BulkOnly::bTheLUN
protected

◆ CurrentCapacity

uint32_t BulkOnly::CurrentCapacity[MASS_MAX_SUPPORTED_LUN]
protected

◆ CurrentSectorSize

uint16_t BulkOnly::CurrentSectorSize[MASS_MAX_SUPPORTED_LUN]
protected

◆ LUNOk

bool BulkOnly::LUNOk[MASS_MAX_SUPPORTED_LUN]
protected

◆ WriteOk

bool BulkOnly::WriteOk[MASS_MAX_SUPPORTED_LUN]
protected
BulkOnly::bMaxLUN
uint8_t bMaxLUN
Definition: masstorage.h:488
BulkOnly::bTheLUN
uint8_t bTheLUN
Definition: masstorage.h:489
BulkOnly::bAddress
uint8_t bAddress
Definition: masstorage.h:476
BulkOnly::bLastUsbError
uint8_t bLastUsbError
Definition: masstorage.h:487
USB_CLASS_MASS_STORAGE
#define USB_CLASS_MASS_STORAGE
Definition: UsbCore.h:79