#include <xbox.h>

Inheritance diagram for USB::VENDOR::Xbox:
Collaboration diagram for USB::VENDOR::Xbox:

Classes

struct  InputData
 

Public Types

enum class  Input { XX , MAX }
 
enum class  LedCommand {
  off , all_blink_once , top_left_blink_on , top_right_blink_on ,
  bottom_left_blink_on , bottom_right_blink_on , top_left_on , top_right_on ,
  bottom_left_on , bottom_right_on , rotate , blink ,
  slow_blink , rotate2 , slow_blink_persist , blink_once
}
 
using InputMask = BitSet< uint32_t, Input >
 
using InputChange = Delegate< void(InputMask changed)>
 

Public Member Functions

bool begin (const Instance &inst, const Config &cfg)
 
bool read ()
 
bool setled (LedCommand cmd)
 
bool rumble (uint8_t strong, uint8_t weak)
 
void onChange (InputChange callback)
 
const InputDatainputs () const
 
bool setConfig (uint8_t itf_num) override
 Set active configuration. More...
 
bool transferComplete (const Transfer &txfr) override
 Called when a non-control USB transfer has completed. More...
 
- Public Member Functions inherited from USB::VENDOR::HostDevice
void end () override
 Called when device is disconnected. Override as required. 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
 

Static Public Member Functions

static const char * getInputName (Xbox::Input input)
 

Additional Inherited Members

- Protected Member Functions inherited from USB::VENDOR::HostDevice
bool openEndpoint (const tusb_desc_endpoint_t &ep_desc)
 Implementations should call this method during initialisation. More...
 
- Protected Attributes inherited from USB::HostInterface
Instance inst
 

Member Typedef Documentation

◆ InputChange

◆ InputMask

Member Enumeration Documentation

◆ Input

Enumerator
XX 
MAX 

◆ LedCommand

Enumerator
off 
all_blink_once 
top_left_blink_on 
top_right_blink_on 
bottom_left_blink_on 
bottom_right_blink_on 
top_left_on 
top_right_on 
bottom_left_on 
bottom_right_on 
rotate 
blink 
slow_blink 
rotate2 
slow_blink_persist 
blink_once 

Member Function Documentation

◆ begin()

bool USB::VENDOR::Xbox::begin ( const Instance inst,
const Config cfg 
)

◆ getInputName()

static const char* USB::VENDOR::Xbox::getInputName ( Xbox::Input  input)
static

◆ inputs()

const InputData& USB::VENDOR::Xbox::inputs ( ) const
inline

◆ onChange()

void USB::VENDOR::Xbox::onChange ( InputChange  callback)
inline

◆ read()

bool USB::VENDOR::Xbox::read ( )

◆ rumble()

bool USB::VENDOR::Xbox::rumble ( uint8_t  strong,
uint8_t  weak 
)

◆ setConfig()

bool USB::VENDOR::Xbox::setConfig ( uint8_t  itf_num)
overridevirtual

Set active configuration.

Implementations typically start communicating.

Implements USB::VENDOR::HostDevice.

◆ setled()

bool USB::VENDOR::Xbox::setled ( LedCommand  cmd)

◆ transferComplete()

bool USB::VENDOR::Xbox::transferComplete ( const Transfer txfr)
overridevirtual

Called when a non-control USB transfer has completed.

Implements USB::VENDOR::HostDevice.


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