RSeries astromech firmware
ProgrammableController Class Reference

#include <drive/ProgrammableController.h>

+ Inheritance diagram for ProgrammableController:
+ Collaboration diagram for ProgrammableController:

Classes

struct  LongPress
 

Public Types

enum  { kHome = -50, kPageUp = -53, kPageDown = -54, kEnd = -70 }
 
- Public Types inherited from JoystickController
enum  BatteryStatus {
  kShutdown = 0x01, kDying = 0x02, kLow = 0x03, kHigh = 0x04,
  kFull = 0x05, kCharging = 0xEE
}
 
enum  ConnectionStatus { kUSB, kBluetooth }
 

Public Member Functions

 ProgrammableController ()
 
float getSpeed ()
 
void setSpeed (float speed)
 
void increaseSpeed ()
 
void decreaseSpeed ()
 
bool connect ()
 
bool disconnect ()
 
void update ()
 
void updateState (float upDown, float leftRight)
 
- Public Member Functions inherited from JoystickController
 JoystickController ()
 
bool isConnected () const
 
bool isConnecting () const
 
bool isCongested () const
 
virtual void notify ()
 
virtual void onConnect ()
 
virtual void onDisconnect ()
 
virtual void stop ()
 

Public Attributes

uint16_t y
 
uint16_t x
 
uint16_t w1
 
uint16_t w2
 
bool button [5]
 
struct {
   LongPress   l3
 
   LongPress   triangle
 
   LongPress   circle
 
   LongPress   cross
 
   LongPress   square
 
longpress
 
uint32_t lastPacket
 
- Public Attributes inherited from JoystickController
State state
 
Event event
 

Protected Member Functions

int read ()
 

Static Protected Member Functions

static uint16_t updateDirection (float speed)
 

Protected Attributes

uint32_t fLastTime = 0
 
float fSpeed = 0.5
 
- Protected Attributes inherited from JoystickController
bool fConnected
 
bool fConnecting
 
bool fCongested
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kHome 
kPageUp 
kPageDown 
kEnd 

Constructor & Destructor Documentation

◆ ProgrammableController()

ProgrammableController::ProgrammableController ( )
inline

Member Function Documentation

◆ connect()

bool ProgrammableController::connect ( )
inline

◆ decreaseSpeed()

void ProgrammableController::decreaseSpeed ( )
inline

◆ disconnect()

bool ProgrammableController::disconnect ( )
inlinevirtual

Reimplemented from JoystickController.

◆ getSpeed()

float ProgrammableController::getSpeed ( )
inline

◆ increaseSpeed()

void ProgrammableController::increaseSpeed ( )
inline

◆ read()

int ProgrammableController::read ( )
inlineprotected

◆ setSpeed()

void ProgrammableController::setSpeed ( float  speed)
inline

◆ update()

void ProgrammableController::update ( )
inline

◆ updateDirection()

static uint16_t ProgrammableController::updateDirection ( float  speed)
inlinestaticprotected

◆ updateState()

void ProgrammableController::updateState ( float  upDown,
float  leftRight 
)
inline

Member Data Documentation

◆ button

bool ProgrammableController::button[5]

◆ circle

LongPress ProgrammableController::circle

◆ cross

LongPress ProgrammableController::cross

◆ fLastTime

uint32_t ProgrammableController::fLastTime = 0
protected

◆ fSpeed

float ProgrammableController::fSpeed = 0.5
protected

◆ l3

LongPress ProgrammableController::l3

◆ lastPacket

uint32_t ProgrammableController::lastPacket

◆ longpress

struct { ... } ProgrammableController::longpress

◆ square

LongPress ProgrammableController::square

◆ triangle

LongPress ProgrammableController::triangle

◆ w1

uint16_t ProgrammableController::w1

◆ w2

uint16_t ProgrammableController::w2

◆ x

uint16_t ProgrammableController::x

◆ y

uint16_t ProgrammableController::y

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