Prusa MINI Firmware overview
UHS_Bulk_Storage Class Reference

#include <UHS_BULK_STORAGE.h>

Inheritance diagram for UHS_Bulk_Storage:
Collaboration diagram for UHS_Bulk_Storage:

Public Member Functions

 UHS_Bulk_Storage (UHS_USB_HOST_BASE *p)
 
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 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 SCSITransaction6 (SCSI_CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir)
 
uint8_t SCSITransaction10 (SCSI_CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir)
 
uint8_t Start ()
 
bool OKtoEnumerate (ENUMERATION_INFO *ei)
 
uint8_t SetInterface (ENUMERATION_INFO *ei)
 
uint8_t GetAddress ()
 
void Poll ()
 
void DriverDefaults ()
 

Public Attributes

volatile UHS_EpInfo epInfo [MASS_MAX_ENDPOINTS]
 

Protected Member Functions

void PrintEndpointDescriptor (const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
 

Protected Attributes

uint8_t bMaxLUN
 
volatile uint32_t dCBWTag
 
volatile uint8_t bTheLUN
 
volatile uint32_t CurrentCapacity [MASS_MAX_SUPPORTED_LUN]
 
volatile uint16_t CurrentSectorSize [MASS_MAX_SUPPORTED_LUN]
 
volatile bool LUNOk [MASS_MAX_SUPPORTED_LUN]
 
volatile bool WriteOk [MASS_MAX_SUPPORTED_LUN]
 

Static Protected Attributes

static const uint8_t epDataInIndex = 1
 
static const uint8_t epDataOutIndex = 2
 
static const uint8_t epInterruptInIndex = 3
 

Constructor & Destructor Documentation

◆ UHS_Bulk_Storage()

UHS_Bulk_Storage::UHS_Bulk_Storage ( UHS_USB_HOST_BASE *  p)

Member Function Documentation

◆ PrintEndpointDescriptor()

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

◆ GetbMaxLUN()

uint8_t UHS_Bulk_Storage::GetbMaxLUN ( )
184  {
185  return bMaxLUN; // Max LUN
186  }

◆ GetbTheLUN()

uint8_t UHS_Bulk_Storage::GetbTheLUN ( )
188  {
189  return bTheLUN; // Active LUN
190  }

◆ WriteProtected()

bool UHS_Bulk_Storage::WriteProtected ( uint8_t  lun)

◆ MediaCTL()

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

◆ Read()

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

◆ Write()

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

◆ LockMedia()

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

◆ LUNIsGood()

bool UHS_Bulk_Storage::LUNIsGood ( uint8_t  lun)

◆ GetCapacity()

uint32_t UHS_Bulk_Storage::GetCapacity ( uint8_t  lun)

◆ GetSectorSize()

uint16_t UHS_Bulk_Storage::GetSectorSize ( uint8_t  lun)

◆ SCSITransaction6()

uint8_t UHS_Bulk_Storage::SCSITransaction6 ( SCSI_CDB6_t cdb,
uint16_t  buf_size,
void buf,
uint8_t  dir 
)

◆ SCSITransaction10()

uint8_t UHS_Bulk_Storage::SCSITransaction10 ( SCSI_CDB10_t cdb,
uint16_t  buf_size,
void buf,
uint8_t  dir 
)

◆ Start()

uint8_t UHS_Bulk_Storage::Start ( )

◆ OKtoEnumerate()

bool UHS_Bulk_Storage::OKtoEnumerate ( ENUMERATION_INFO *  ei)

◆ SetInterface()

uint8_t UHS_Bulk_Storage::SetInterface ( ENUMERATION_INFO *  ei)

◆ GetAddress()

uint8_t UHS_Bulk_Storage::GetAddress ( )
210  {
211  return bAddress;
212  };

◆ Poll()

void UHS_Bulk_Storage::Poll ( )

◆ DriverDefaults()

void UHS_Bulk_Storage::DriverDefaults ( )

Member Data Documentation

◆ epDataInIndex

const uint8_t UHS_Bulk_Storage::epDataInIndex = 1
staticprotected

◆ epDataOutIndex

const uint8_t UHS_Bulk_Storage::epDataOutIndex = 2
staticprotected

◆ epInterruptInIndex

const uint8_t UHS_Bulk_Storage::epInterruptInIndex = 3
staticprotected

◆ bMaxLUN

uint8_t UHS_Bulk_Storage::bMaxLUN
protected

◆ dCBWTag

volatile uint32_t UHS_Bulk_Storage::dCBWTag
protected

◆ bTheLUN

volatile uint8_t UHS_Bulk_Storage::bTheLUN
protected

◆ CurrentCapacity

volatile uint32_t UHS_Bulk_Storage::CurrentCapacity[MASS_MAX_SUPPORTED_LUN]
protected

◆ CurrentSectorSize

volatile uint16_t UHS_Bulk_Storage::CurrentSectorSize[MASS_MAX_SUPPORTED_LUN]
protected

◆ LUNOk

volatile bool UHS_Bulk_Storage::LUNOk[MASS_MAX_SUPPORTED_LUN]
protected

◆ WriteOk

volatile bool UHS_Bulk_Storage::WriteOk[MASS_MAX_SUPPORTED_LUN]
protected

◆ epInfo

volatile UHS_EpInfo UHS_Bulk_Storage::epInfo[MASS_MAX_ENDPOINTS]
UHS_Bulk_Storage::bTheLUN
volatile uint8_t bTheLUN
Definition: UHS_BULK_STORAGE.h:172
UHS_Bulk_Storage::bMaxLUN
uint8_t bMaxLUN
Definition: UHS_BULK_STORAGE.h:170