USB Host Shield 2.0
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
HIDComposite Class Referenceabstract

#include <hidcomposite.h>

Inheritance diagram for HIDComposite:
Inheritance graph
[legend]
Collaboration diagram for HIDComposite:
Collaboration graph
[legend]

Classes

struct  HIDInterface
 
struct  ReportParser
 

Public Member Functions

 HIDComposite (USB *p)
 
bool SetReportParser (uint8_t id, HIDReportParser *prs)
 
uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)
 
uint8_t Release ()
 
uint8_t Poll ()
 
virtual uint8_t GetAddress ()
 
virtual bool isReady ()
 
void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
 
uint8_t SndRpt (uint16_t nbytes, uint8_t *dataptr)
 
virtual bool SelectInterface (uint8_t iface, uint8_t proto)=0
 
- Public Member Functions inherited from USBHID
 USBHID (USB *pusb)
 
const USBGetUsb ()
 
uint8_t SetProtocol (uint8_t iface, uint8_t protocol)
 
uint8_t GetProtocol (uint8_t iface, uint8_t *dataptr)
 
uint8_t GetIdle (uint8_t iface, uint8_t reportID, uint8_t *dataptr)
 
uint8_t SetIdle (uint8_t iface, uint8_t reportID, uint8_t duration)
 
uint8_t GetReportDescr (uint16_t wIndex, USBReadParser *parser=NULL)
 
uint8_t GetHidDescr (uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
 
uint8_t GetReport (uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)
 
uint8_t SetReport (uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)
 
- Public Member Functions inherited from USBDeviceConfig
virtual uint8_t ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed)
 
virtual void ResetHubPort (uint8_t port)
 
virtual bool VIDPIDOK (uint16_t vid, uint16_t pid)
 
virtual bool DEVCLASSOK (uint8_t klass)
 
virtual bool DEVSUBCLASSOK (uint8_t subklass)
 

Protected Member Functions

uint16_t GetHidClassDescrLen (uint8_t type, uint8_t num)
 
void Initialize ()
 
HIDInterfaceFindInterface (uint8_t iface, uint8_t alt, uint8_t proto)
 
void ZeroMemory (uint8_t len, uint8_t *buf)
 
HIDReportParserGetReportParser (uint8_t id)
 
virtual uint8_t OnInitSuccessful ()
 
virtual void ParseHIDData (USBHID *hid, uint8_t ep, bool is_rpt_id, uint8_t len, uint8_t *buf)
 
- Protected Member Functions inherited from USBHID
void PrintEndpointDescriptor (const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
 
void PrintHidDescriptor (const USB_HID_DESCRIPTOR *pDesc)
 

Protected Attributes

struct HIDComposite::ReportParser rptParsers [MAX_REPORT_PARSERS]
 
HID_CLASS_DESCRIPTOR_LEN_AND_TYPE descrInfo [HID_MAX_HID_CLASS_DESCRIPTORS]
 
uint8_t bConfNum
 
uint8_t bNumIface
 
uint8_t bNumEP
 
uint32_t qNextPollTime
 
uint8_t pollInterval
 
bool bPollEnable
 
EpInfo epInfo [totalEndpoints]
 
HIDInterface hidInterfaces [maxHidInterfaces]
 
bool bHasReportId
 
uint16_t PID
 
uint16_t VID
 
- Protected Attributes inherited from USBHID
USBpUsb
 
uint8_t bAddress
 

Static Protected Attributes

static const uint16_t constBuffLen = 64
 
- Static Protected Attributes inherited from USBHID
static const uint8_t epInterruptInIndex = 1
 
static const uint8_t epInterruptOutIndex = 2
 
static const uint8_t maxHidInterfaces = 5
 
static const uint8_t maxEpPerInterface = 2
 
static const uint8_t totalEndpoints = (maxHidInterfaces * maxEpPerInterface + 1)
 

Detailed Description

Definition at line 24 of file hidcomposite.h.

Constructor & Destructor Documentation

◆ HIDComposite()

HIDComposite::HIDComposite ( USB p)

Definition at line 20 of file hidcomposite.cpp.

Member Function Documentation

◆ GetHidClassDescrLen()

uint16_t HIDComposite::GetHidClassDescrLen ( uint8_t  type,
uint8_t  num 
)
protected

Definition at line 32 of file hidcomposite.cpp.

◆ Initialize()

void HIDComposite::Initialize ( )
protected

Definition at line 43 of file hidcomposite.cpp.

◆ FindInterface()

HIDComposite::HIDInterface * HIDComposite::FindInterface ( uint8_t  iface,
uint8_t  alt,
uint8_t  proto 
)
protected

Definition at line 289 of file hidcomposite.cpp.

◆ ZeroMemory()

void HIDComposite::ZeroMemory ( uint8_t  len,
uint8_t *  buf 
)
protected

Definition at line 364 of file hidcomposite.cpp.

◆ GetReportParser()

HIDReportParser * HIDComposite::GetReportParser ( uint8_t  id)
protectedvirtual

Reimplemented from USBHID.

Definition at line 83 of file hidcomposite.cpp.

◆ OnInitSuccessful()

virtual uint8_t HIDComposite::OnInitSuccessful ( )
inlineprotectedvirtual

Reimplemented in PSBuzz, MiniDSP, PS5USB, PS4USB, and SwitchProUSB.

Definition at line 76 of file hidcomposite.h.

◆ ParseHIDData()

virtual void HIDComposite::ParseHIDData ( USBHID hid,
uint8_t  ep,
bool  is_rpt_id,
uint8_t  len,
uint8_t *  buf 
)
inlineprotectedvirtual

Definition at line 80 of file hidcomposite.h.

◆ SetReportParser()

bool HIDComposite::SetReportParser ( uint8_t  id,
HIDReportParser prs 
)
virtual

Reimplemented from USBHID.

Definition at line 72 of file hidcomposite.cpp.

◆ Init()

uint8_t HIDComposite::Init ( uint8_t  parent,
uint8_t  port,
bool  lowspeed 
)
virtual

Reimplemented from USBDeviceConfig.

Definition at line 94 of file hidcomposite.cpp.

◆ Release()

uint8_t HIDComposite::Release ( )
virtual

Reimplemented from USBDeviceConfig.

Definition at line 354 of file hidcomposite.cpp.

◆ Poll()

uint8_t HIDComposite::Poll ( )
virtual

Reimplemented from USBDeviceConfig.

Reimplemented in HIDUniversal.

Definition at line 369 of file hidcomposite.cpp.

◆ GetAddress()

virtual uint8_t HIDComposite::GetAddress ( )
inlinevirtual

Reimplemented from USBDeviceConfig.

Definition at line 95 of file hidcomposite.h.

◆ isReady()

virtual bool HIDComposite::isReady ( )
inlinevirtual

Definition at line 99 of file hidcomposite.h.

◆ EndpointXtract()

void HIDComposite::EndpointXtract ( uint8_t  conf,
uint8_t  iface,
uint8_t  alt,
uint8_t  proto,
const USB_ENDPOINT_DESCRIPTOR ep 
)
virtual

Reimplemented from UsbConfigXtracter.

Reimplemented in HIDUniversal.

Definition at line 297 of file hidcomposite.cpp.

◆ SndRpt()

uint8_t HIDComposite::SndRpt ( uint16_t  nbytes,
uint8_t *  dataptr 
)

Definition at line 427 of file hidcomposite.cpp.

◆ SelectInterface()

virtual bool HIDComposite::SelectInterface ( uint8_t  iface,
uint8_t  proto 
)
pure virtual

Member Data Documentation

◆ rptParsers

struct HIDComposite::ReportParser HIDComposite::rptParsers[MAX_REPORT_PARSERS]
protected

◆ descrInfo

Definition at line 34 of file hidcomposite.h.

◆ bConfNum

uint8_t HIDComposite::bConfNum
protected

Definition at line 48 of file hidcomposite.h.

◆ bNumIface

uint8_t HIDComposite::bNumIface
protected

Definition at line 49 of file hidcomposite.h.

◆ bNumEP

uint8_t HIDComposite::bNumEP
protected

Definition at line 50 of file hidcomposite.h.

◆ qNextPollTime

uint32_t HIDComposite::qNextPollTime
protected

Definition at line 51 of file hidcomposite.h.

◆ pollInterval

uint8_t HIDComposite::pollInterval
protected

Definition at line 52 of file hidcomposite.h.

◆ bPollEnable

bool HIDComposite::bPollEnable
protected

Definition at line 53 of file hidcomposite.h.

◆ constBuffLen

const uint16_t HIDComposite::constBuffLen = 64
staticprotected

Definition at line 55 of file hidcomposite.h.

◆ epInfo

EpInfo HIDComposite::epInfo[totalEndpoints]
protected

Definition at line 63 of file hidcomposite.h.

◆ hidInterfaces

HIDInterface HIDComposite::hidInterfaces[maxHidInterfaces]
protected

Definition at line 64 of file hidcomposite.h.

◆ bHasReportId

bool HIDComposite::bHasReportId
protected

Definition at line 69 of file hidcomposite.h.

◆ PID

uint16_t HIDComposite::PID
protected

Definition at line 71 of file hidcomposite.h.

◆ VID

uint16_t HIDComposite::VID
protected

Definition at line 71 of file hidcomposite.h.


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