The Pedigree Project 0.1
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
UsbHumanInterfaceDevice Class Reference
+ Inheritance diagram for UsbHumanInterfaceDevice:
+ Collaboration diagram for UsbHumanInterfaceDevice:

Classes

struct  HidDescriptor
 

Public Member Functions

 UsbHumanInterfaceDevice (UsbDevice *dev)
 
virtual void initialiseDriver ()
 Implemented by the driver class, initialises driver-specific stuff.
 
virtual void getName (String &str)
 
- Public Member Functions inherited from UsbDevice
 UsbDevice (UsbHub *pHub, uint8_t nPort, UsbSpeed speed)
 Default constructor.
 
 UsbDevice (UsbDevice *pDev)
 Copy constructor.
 
virtual ~UsbDevice ()
 Destructor.
 
void initialise (uint8_t nAddress)
 Initialises the device at the given address.
 
virtual void getUsbDeviceName (String &str)
 
uint8_t getAddress ()
 Returns the current address of the device.
 
uint8_t getPort ()
 Returns the number of the port on which the device is connected.
 
UsbHub * getHub () const
 
UsbSpeed getSpeed ()
 Returns the speed at which the device operates.
 
UsbState getUsbState ()
 Returns the current state of the device.
 
DeviceDescriptor * getDescriptor ()
 Returns the device descriptor of the device.
 
ConfigDescriptor * getConfiguration ()
 Returns the configuration in use.
 
Interface * getInterface ()
 Returns the interface in use.
 
void useConfiguration (uint8_t nConfig)
 Switches to the given configuration.
 
void useInterface (uint8_t nInterface)
 Switches to the given interface.
 
UsbDeviceContainer * getContainer () const
 Gets our Device container, for replacing parents on hubs etc.
 
virtual bool hasSubtree () const
 Do we expose our own Device tree?
 
virtual Device * getDevice ()
 
virtual void prepareForDriverRetirement ()
 
virtual void quiesceForRetirement ()
 
virtual void prepareForDisconnection ()
 

Private Member Functions

void inputHandler (size_t bytes)
 

Static Private Member Functions

static void callback (uintptr_t pParam, ssize_t ret)
 

Private Attributes

Endpoint * m_pInEndpoint
 The endpoint used to receive input reports from the device.
 
HidReport * m_pReport
 The report instance used for input parsing.
 
UsbInterruptInHandle m_InterruptIn
 Owns and synchronously cancels the recurring controller callback.
 
uint8_t * m_pInReportBuffer
 Input report buffer.
 
uint8_t * m_pOldInReportBuffer
 Old input report buffer.
 
bool m_ReceivedInput
 

Additional Inherited Members

- Public Types inherited from UsbDevice
enum  UsbState {
  Connected = 0 , Addressed , HasDescriptors , Configured ,
  HasInterface , HasDriver
}
 Possible states for an USB device. More...
 
- Public Attributes inherited from UsbDevice
struct UsbDevice::Setup PACKED
 
struct UsbDevice::DeviceQualifier PACKED
 
- Protected Member Functions inherited from UsbDevice
ssize_t doSync (Endpoint *pEndpoint, UsbPid pid, uintptr_t pBuffer, size_t nBytes, size_t timeout)
 
ssize_t syncIn (Endpoint *pEndpoint, uintptr_t pBuffer, size_t nBytes, size_t timeout=5000)
 
ssize_t syncOut (Endpoint *pEndpoint, uintptr_t pBuffer, size_t nBytes, size_t timeout=5000)
 
MUST_USE_RESULT bool addInterruptInHandler (Endpoint *pEndpoint, uintptr_t pBuffer, uint16_t nBytes, void(*pCallback)(uintptr_t, ssize_t), UsbInterruptInHandle &handle, uintptr_t pParam=0)
 
bool controlRequest (uint8_t nRequestType, uint8_t nRequest, uint16_t nValue, uint16_t nIndex, uint16_t nLength=0, uintptr_t pBuffer=0, uint32_t timeout=5000)
 Performs an USB control request.
 
ssize_t controlRequestResult (uint8_t nRequestType, uint8_t nRequest, uint16_t nValue, uint16_t nIndex, uint16_t nLength=0, uintptr_t pBuffer=0, uint32_t timeout=5000)
 Returns data bytes transferred, or a negative UsbError.
 
uint16_t getStatus ()
 Gets device's current status.
 
bool clearEndpointHalt (Endpoint *pEndpoint)
 Clears a halt on the given endpoint.
 
void * getDescriptor (uint8_t nDescriptorType, uint8_t nDescriptorIndex, uint16_t nBytes, uint8_t requestType=0)
 Gets a descriptor from the device.
 
uint8_t getDescriptorLength (uint8_t nDescriptorType, uint8_t nDescriptorIndex, uint8_t requestType=0)
 Gets a descriptor's length from the device.
 
String getString (uint8_t nString)
 Gets a string.
 
- Protected Attributes inherited from UsbDevice
uint8_t m_nAddress
 The current address of the device.
 
uint16_t m_ControlPacketSize
 
uint8_t m_nPort
 The number of the port on which the device is connected.
 
uint8_t m_nRootPort
 Root-controller connection which owns this device generation.
 
size_t m_nRootPortGeneration
 
UsbSpeed m_Speed
 The speed at which the device operates.
 
UsbState m_UsbState
 The current state of the device.
 
DeviceDescriptor * m_pDescriptor
 Device descriptor for this device.
 
ConfigDescriptor * m_pConfiguration
 Configuration in use.
 
Interface * m_pInterface
 Interface in use.
 
UsbHub * m_pHub
 Parent USB hub.
 
UsbDeviceContainer * m_pContainer
 Our current container.
 

Detailed Description

Definition at line 33 of file UsbHumanInterfaceDevice.h.

Constructor & Destructor Documentation

◆ UsbHumanInterfaceDevice()

UsbHumanInterfaceDevice::UsbHumanInterfaceDevice ( UsbDevice *  dev)

Definition at line 32 of file UsbHumanInterfaceDevice.cc.

◆ ~UsbHumanInterfaceDevice()

UsbHumanInterfaceDevice::~UsbHumanInterfaceDevice ( )
virtual

Definition at line 41 of file UsbHumanInterfaceDevice.cc.

Member Function Documentation

◆ callback()

void UsbHumanInterfaceDevice::callback ( uintptr_t  pParam,
ssize_t  ret 
)
staticprivate

Definition at line 126 of file UsbHumanInterfaceDevice.cc.

◆ getName()

virtual void UsbHumanInterfaceDevice::getName ( String &  str)
inlinevirtual

Definition at line 40 of file UsbHumanInterfaceDevice.h.

◆ initialiseDriver()

void UsbHumanInterfaceDevice::initialiseDriver ( )
virtual

◆ inputHandler()

void UsbHumanInterfaceDevice::inputHandler ( size_t  bytes)
private

Definition at line 132 of file UsbHumanInterfaceDevice.cc.

Member Data Documentation

◆ m_InterruptIn

UsbInterruptInHandle UsbHumanInterfaceDevice::m_InterruptIn
private

Owns and synchronously cancels the recurring controller callback.

Definition at line 74 of file UsbHumanInterfaceDevice.h.

Referenced by initialiseDriver().

◆ m_pInEndpoint

Endpoint* UsbHumanInterfaceDevice::m_pInEndpoint
private

The endpoint used to receive input reports from the device.

Definition at line 68 of file UsbHumanInterfaceDevice.h.

Referenced by initialiseDriver().

◆ m_pInReportBuffer

uint8_t* UsbHumanInterfaceDevice::m_pInReportBuffer
private

Input report buffer.

Definition at line 77 of file UsbHumanInterfaceDevice.h.

Referenced by initialiseDriver().

◆ m_pOldInReportBuffer

uint8_t* UsbHumanInterfaceDevice::m_pOldInReportBuffer
private

Old input report buffer.

Definition at line 79 of file UsbHumanInterfaceDevice.h.

Referenced by initialiseDriver().

◆ m_pReport

HidReport* UsbHumanInterfaceDevice::m_pReport
private

The report instance used for input parsing.

Definition at line 71 of file UsbHumanInterfaceDevice.h.

Referenced by initialiseDriver().

◆ m_ReceivedInput

bool UsbHumanInterfaceDevice::m_ReceivedInput
private

Definition at line 81 of file UsbHumanInterfaceDevice.h.


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