Tetrapod Project
teensy_serial.h
Go to the documentation of this file.
1 #ifndef teensy_serial_h
2 #define teensy_serial_h
3 
4 #include "Arduino.h"
5 
7 {
8  // Constructor
9  public: TeensySerial(int _number_of_motors);
10 
11  // Destructor
12  public: ~TeensySerial();
13 
16  public: bool areControlCommandsAvailable();
17 
22  public: void receiveControlCommands(double &_control_command_type, double* _control_commands);
23 
28  public: void sendStates(double *_joint_positions, double *_joint_velocities, double *_joint_torques);
29 
30  public: void printTxBuffer();
31 
33  private: int number_of_motors;
34 
36  private: int tx_buffer_size;
37 
39  private: int rx_buffer_size;
40 
42  private: unsigned char* rx_buffer;
43 
45  private: unsigned char* tx_buffer;
46 };
47 
48 #endif
void receiveControlCommands(double &_control_command_type, double *_control_commands)
Reads control command data available on the serial command and stores it.
unsigned char * tx_buffer
Transmit buffer.
Definition: teensy_serial.h:45
void sendStates(double *_joint_positions, double *_joint_velocities, double *_joint_torques)
Sends the joint states to the serial line.
int tx_buffer_size
Transmit buffer size.
Definition: teensy_serial.h:36
bool areControlCommandsAvailable()
Checks if there is any available data on the serial port.
int rx_buffer_size
Receive buffer size.
Definition: teensy_serial.h:39
int number_of_motors
Number of motors.
Definition: teensy_serial.h:33
void printTxBuffer()
TeensySerial(int _number_of_motors)
unsigned char * rx_buffer
Receive buffer.
Definition: teensy_serial.h:42