RSeries astromech firmware
SerialConsoleController Class Reference

#include <drive/SerialConsoleController.h>

+ Inheritance diagram for SerialConsoleController:
+ Collaboration diagram for SerialConsoleController:

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

 SerialConsoleController (Stream &serial)
 
float getSpeed ()
 
void setSpeed (float speed)
 
void increaseSpeed ()
 
void decreaseSpeed ()
 
void update ()
 
void connect ()
 
virtual void disconnect () override
 
bool isEmulationActive () const
 
- 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

char readCharBlocking ()
 
int read ()
 

Static Protected Member Functions

static uint16_t updateDirection (float speed)
 

Protected Attributes

Stream * fSerial = nullptr
 
uint32_t fLastTime = 0
 
float fSpeed = 0.5
 
bool fEmulationActive = false
 
- 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

◆ SerialConsoleController()

SerialConsoleController::SerialConsoleController ( Stream &  serial)
inline

Member Function Documentation

◆ connect()

void SerialConsoleController::connect ( )
inline

◆ decreaseSpeed()

void SerialConsoleController::decreaseSpeed ( )
inline

◆ disconnect()

virtual void SerialConsoleController::disconnect ( )
inlineoverridevirtual

Reimplemented from JoystickController.

◆ getSpeed()

float SerialConsoleController::getSpeed ( )
inline

◆ increaseSpeed()

void SerialConsoleController::increaseSpeed ( )
inline

◆ isEmulationActive()

bool SerialConsoleController::isEmulationActive ( ) const
inline

◆ read()

int SerialConsoleController::read ( )
inlineprotected

◆ readCharBlocking()

char SerialConsoleController::readCharBlocking ( )
inlineprotected

◆ setSpeed()

void SerialConsoleController::setSpeed ( float  speed)
inline

◆ update()

void SerialConsoleController::update ( )
inline

◆ updateDirection()

static uint16_t SerialConsoleController::updateDirection ( float  speed)
inlinestaticprotected

Member Data Documentation

◆ button

bool SerialConsoleController::button[5]

◆ circle

LongPress SerialConsoleController::circle

◆ cross

LongPress SerialConsoleController::cross

◆ fEmulationActive

bool SerialConsoleController::fEmulationActive = false
protected

◆ fLastTime

uint32_t SerialConsoleController::fLastTime = 0
protected

◆ fSerial

Stream* SerialConsoleController::fSerial = nullptr
protected

◆ fSpeed

float SerialConsoleController::fSpeed = 0.5
protected

◆ l3

LongPress SerialConsoleController::l3

◆ lastPacket

uint32_t SerialConsoleController::lastPacket

◆ longpress

struct { ... } SerialConsoleController::longpress

◆ square

LongPress SerialConsoleController::square

◆ triangle

LongPress SerialConsoleController::triangle

◆ w1

uint16_t SerialConsoleController::w1

◆ w2

uint16_t SerialConsoleController::w2

◆ x

uint16_t SerialConsoleController::x

◆ y

uint16_t SerialConsoleController::y

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