USB Host Shield 2.0
Public Member Functions | Public Attributes | Protected Attributes | List of all members
AMBX Class Reference

#include <AMBX.h>

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

Public Member Functions

 AMBX (USB *pUsb)
 
void setLight (uint8_t ambx_light, uint8_t r, uint8_t g, uint8_t b)
 
void setLight (AmbxLightsEnum ambx_light, AmbxColorsEnum color)
 
void setAllLights (AmbxColorsEnum color)
 
void attachOnInit (void(*funcOnInit)(void))
 
USBDeviceConfig implementation
uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)
 
uint8_t Release ()
 
uint8_t Poll ()
 
virtual uint8_t GetAddress ()
 
virtual bool VIDPIDOK (uint16_t vid, uint16_t pid)
 
- 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 DEVCLASSOK (uint8_t klass)
 
virtual bool DEVSUBCLASSOK (uint8_t subklass)
 

Public Attributes

bool AMBXConnected
 

Protected Attributes

USBpUsb
 
uint8_t bAddress
 
EpInfo epInfo [AMBX_MAX_ENDPOINTS]
 

Detailed Description

This class implements support for AMBX One can only set the color of the bulbs, no other accesories like rumble pad, fans, etc. are supported

Definition at line 63 of file AMBX.h.

Constructor & Destructor Documentation

◆ AMBX()

AMBX::AMBX ( USB pUsb)

Constructor for the AMBX class.

Parameters
pUsbPointer to USB class instance.

Definition at line 21 of file AMBX.cpp.

Member Function Documentation

◆ Init()

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

Initialize the AMBX Controller.

Parameters
parentHub number.
portPort number on the hub.
lowspeedSpeed of the device.
Returns
0 on success.

Reimplemented from USBDeviceConfig.

Definition at line 37 of file AMBX.cpp.

◆ Release()

uint8_t AMBX::Release ( )
virtual

Release the USB device.

Returns
0 on success.

Reimplemented from USBDeviceConfig.

Definition at line 205 of file AMBX.cpp.

◆ Poll()

uint8_t AMBX::Poll ( )
virtual

Poll the USB Input endpoins and run the state machines.

Returns
0 on success.

Reimplemented from USBDeviceConfig.

Definition at line 212 of file AMBX.cpp.

◆ GetAddress()

virtual uint8_t AMBX::GetAddress ( )
inlinevirtual

Get the device address.

Returns
The device address.

Reimplemented from USBDeviceConfig.

Definition at line 95 of file AMBX.h.

◆ VIDPIDOK()

virtual bool AMBX::VIDPIDOK ( uint16_t  vid,
uint16_t  pid 
)
inlinevirtual

Used by the USB core to check what this driver support.

Parameters
vidThe device's VID.
pidThe device's PID.
Returns
Returns true if the device's VID and PID matches this driver.

Reimplemented from USBDeviceConfig.

Definition at line 105 of file AMBX.h.

◆ setLight() [1/2]

void AMBX::setLight ( uint8_t  ambx_light,
uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Use this to set the Color using RGB values.

Parameters
r,g,bRGB value.

Definition at line 223 of file AMBX.cpp.

◆ setLight() [2/2]

void AMBX::setLight ( AmbxLightsEnum  ambx_light,
AmbxColorsEnum  color 
)

Use this to set the color using the predefined colors in ColorsEnum.

Parameters
colorThe desired color.

Definition at line 233 of file AMBX.cpp.

◆ setAllLights()

void AMBX::setAllLights ( AmbxColorsEnum  color)

Use this to set the color using the predefined colors in ColorsEnum.

Parameters
colorThe desired color.

Definition at line 237 of file AMBX.cpp.

◆ attachOnInit()

void AMBX::attachOnInit ( void(*)(void)  funcOnInit)
inline

Used to call your own function when the controller is successfully initialized.

Parameters
funcOnInitFunction to call.

Definition at line 131 of file AMBX.h.

Member Data Documentation

◆ AMBXConnected

bool AMBX::AMBXConnected

Definition at line 133 of file AMBX.h.

◆ pUsb

USB* AMBX::pUsb
protected

Pointer to USB class instance.

Definition at line 140 of file AMBX.h.

◆ bAddress

uint8_t AMBX::bAddress
protected

Device address.

Definition at line 142 of file AMBX.h.

◆ epInfo

EpInfo AMBX::epInfo[AMBX_MAX_ENDPOINTS]
protected

Endpoint info structure.

Definition at line 144 of file AMBX.h.


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