TR-mbed 1.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
Remote Class Reference

#include <DJIRemote.h>

Public Types

enum class  Channel { RIGHT_HORIZONTAL , RIGHT_VERTICAL , LEFT_HORIZONTAL , LEFT_VERTICAL }
 
enum class  Switch { LEFT_SWITCH , RIGHT_SWITCH }
 
enum class  SwitchState { UNKNOWN , DOWN , MID , UP }
 
enum class  Key {
  W = 0 , S , A , D ,
  SHIFT , CTRL , Q , E ,
  R , F , G , Z ,
  X , C , V , B
}
 

Public Member Functions

 Remote (PinName dbus)
 
void initialize ()
 
void read ()
 
 __attribute__ ((unused)) bool isConnected() const
 
float getChannel (Channel ch) const
 
int16_t getChannelInt (Channel ch) const
 
void printAxisData () const
 
void dumpInfo () const
 
SwitchState getSwitch (Switch sw) const
 
int16_t getMouseX () const
 
int16_t getMouseY () const
 
int16_t getMouseZ () const
 
bool getMouseL () const
 
bool getMouseR () const
 
bool keyPressed (Key key) const
 
int16_t getWheel () const
 
uint32_t getUpdateCounter () const
 
int leftX () const
 
int leftY () const
 
int rightX () const
 
int rightY () const
 
Remote::SwitchState leftSwitch () const
 
Remote::SwitchState rightSwitch () const
 

Public Attributes

long badDataChainNumber = 0
 
long goodDataChainNumber = 0
 
bool unfiltered = false
 

Detailed Description

A unique UART handler that uses timing in leu of DBUS communication (mbed does not support DBUS) to interact with the DR16 receiver.

Member Enumeration Documentation

◆ Channel

enum class Remote::Channel
strong

Specifies a particular joystick.

Enumerator
RIGHT_HORIZONTAL 
RIGHT_VERTICAL 
LEFT_HORIZONTAL 
LEFT_VERTICAL 

◆ Key

enum class Remote::Key
strong

A list of the particular keys to interact with, in bit order.

Enumerator
SHIFT 
CTRL 

◆ Switch

enum class Remote::Switch
strong

Specifies a particular switch.

Enumerator
LEFT_SWITCH 
RIGHT_SWITCH 

◆ SwitchState

enum class Remote::SwitchState
strong

Different switch orientations.

Enumerator
UNKNOWN 
DOWN 
MID 
UP 

Constructor & Destructor Documentation

◆ Remote()

Remote::Remote ( PinName  dbus)

Member Function Documentation

◆ __attribute__()

Remote::__attribute__ ( (unused)  ) const
Returns
true if the remote is connected, false otherwise.
Note
A timer is used to determine if the remote is disconnected, so expect a second or so of delay from disconnecting the remote to this function saying the remote is disconnected.

◆ dumpInfo()

void Remote::dumpInfo ( ) const

◆ getChannel()

float Remote::getChannel ( Channel  ch) const
Returns
The value of the given channel, between [-1, 1].

◆ getChannelInt()

int16_t Remote::getChannelInt ( Channel  ch) const

◆ getMouseL()

bool Remote::getMouseL ( ) const
Returns
The current mouse l value.

◆ getMouseR()

bool Remote::getMouseR ( ) const
Returns
The current mouse r value.

◆ getMouseX()

int16_t Remote::getMouseX ( ) const
Returns
The current mouse x value.

◆ getMouseY()

int16_t Remote::getMouseY ( ) const
Returns
The current mouse y value.

◆ getMouseZ()

int16_t Remote::getMouseZ ( ) const
Returns
The current mouse z value.

◆ getSwitch()

SwitchState Remote::getSwitch ( Switch  sw) const
Returns
The state of the given switch.

◆ getUpdateCounter()

uint32_t Remote::getUpdateCounter ( ) const
Returns
the number of times remote info has been received.

◆ getWheel()

int16_t Remote::getWheel ( ) const
Returns
the value of the wheel, between [-STICK_MAX_VALUE, STICK_MAX_VALUE].

◆ initialize()

void Remote::initialize ( )

Enables and initializes bound_ports::REMOTE_SERIAL_UART_PORT.

◆ keyPressed()

bool Remote::keyPressed ( Key  key) const
Returns
true if the given key is pressed, false otherwise.

◆ leftSwitch()

Remote::SwitchState Remote::leftSwitch ( ) const
inline

◆ leftX()

int Remote::leftX ( ) const
inline

◆ leftY()

int Remote::leftY ( ) const
inline

◆ printAxisData()

void Remote::printAxisData ( ) const

◆ read()

void Remote::read ( )

Reads/parses the current buffer and updates the current remote info state and CommandMapper state.

◆ rightSwitch()

Remote::SwitchState Remote::rightSwitch ( ) const
inline

◆ rightX()

int Remote::rightX ( ) const
inline

◆ rightY()

int Remote::rightY ( ) const
inline

Member Data Documentation

◆ badDataChainNumber

long Remote::badDataChainNumber = 0

◆ goodDataChainNumber

long Remote::goodDataChainNumber = 0

◆ unfiltered

bool Remote::unfiltered = false

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