TeensyNanoExoCode
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
UARTHandler Class Reference

Singleton Class to handle the UART Work. More...

#include <UARTHandler.h>

Public Member Functions

void UART_msg (uint8_t msg_id, uint8_t len, uint8_t joint_id, float *buffer)
 Packs and sends a UART message.
 
void UART_msg (UART_msg_t msg)
 
UART_msg_t poll (float timeout_us=RX_TIMEOUT_US)
 Check for incoming data. If there is data read the message, timing out if it takes too long.
 
uint8_t check_for_data ()
 See if data is available in the UART buffer.
 

Static Public Member Functions

static UARTHandlerget_instance ()
 Get the instance object.
 

Detailed Description

Singleton Class to handle the UART Work.

Member Function Documentation

◆ check_for_data()

uint8_t UARTHandler::check_for_data ( )
inline

See if data is available in the UART buffer.

Returns
uint8_t The ammount of bytes available in the UART buffer (max 64 for Arduino)

◆ get_instance()

UARTHandler * UARTHandler::get_instance ( )
static

Get the instance object.

Returns
UARTHandler* A reference to the singleton

◆ poll()

UART_msg_t UARTHandler::poll ( float  timeout_us = RX_TIMEOUT_US)

Check for incoming data. If there is data read the message, timing out if it takes too long.

Parameters
timeout_us
Returns
UART_msg_t
Here is the call graph for this function:

◆ UART_msg() [1/2]

void UARTHandler::UART_msg ( UART_msg_t  msg)
Here is the call graph for this function:

◆ UART_msg() [2/2]

void UARTHandler::UART_msg ( uint8_t  msg_id,
uint8_t  len,
uint8_t  joint_id,
float *  buffer 
)

Packs and sends a UART message.

Parameters
msg_idAn ID used to associate data on the receiver
lenLength of data
joint_idJoint ID associated with data
bufferPayload

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