USB::VENDOR::HostDevice Class Referenceabstract

Base class to use for custom devices. More...

#include <HostDevice.h>

Inheritance diagram for USB::VENDOR::HostDevice:
Collaboration diagram for USB::VENDOR::HostDevice:

Classes

struct  Config
 Device configuration received during mount procedure. More...
 
struct  Transfer
 Structure passed to 'transferComplete' method. More...
 

Public Member Functions

void end () override
 Called when device is disconnected. Override as required. More...
 
virtual bool setConfig (uint8_t itf_num)=0
 Set active configuration. More...
 
virtual bool transferComplete (const Transfer &txfr)=0
 Called when a non-control USB transfer has completed. More...
 
bool ownsEndpoint (uint8_t ep_addr)
 
- Public Member Functions inherited from USB::HostInterface
void begin (const Instance &inst)
 Descendant classes should override this method to peform initialisation. More...
 
const char * getName () const
 
uint8_t getAddress () const
 
bool operator== (const HostInterface &other) const
 
bool operator== (const Instance &other) const
 

Protected Member Functions

bool openEndpoint (const tusb_desc_endpoint_t &ep_desc)
 Implementations should call this method during initialisation. More...
 

Additional Inherited Members

- Protected Attributes inherited from USB::HostInterface
Instance inst
 

Detailed Description

Base class to use for custom devices.

Member Function Documentation

◆ end()

void USB::VENDOR::HostDevice::end ( )
inlineoverridevirtual

Called when device is disconnected. Override as required.

Reimplemented from USB::HostInterface.

◆ openEndpoint()

bool USB::VENDOR::HostDevice::openEndpoint ( const tusb_desc_endpoint_t &  ep_desc)
protected

Implementations should call this method during initialisation.

Typically called in a 'begin' method called from the application. Endpoints are released automatically when the device is disconnected.

◆ ownsEndpoint()

bool USB::VENDOR::HostDevice::ownsEndpoint ( uint8_t  ep_addr)

◆ setConfig()

virtual bool USB::VENDOR::HostDevice::setConfig ( uint8_t  itf_num)
pure virtual

Set active configuration.

Implementations typically start communicating.

◆ transferComplete()

virtual bool USB::VENDOR::HostDevice::transferComplete ( const Transfer txfr)
pure virtual

Called when a non-control USB transfer has completed.


The documentation for this class was generated from the following file: