SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
SerialVar::SerialVar< T > Class Template Reference

Template of a Serial Variable. More...

#include <SerialVar.h>

Public Member Functions

 SerialVar (int ID)
 Construct a new Serial Var given the predefined ID defined in SerialVars.def.
 
 operator T () const
 Cast to the given primitive data type of this variable.
 
SerialVaroperator= (T val)
 Set this variable's buffer given the primitive data type T.
 

Detailed Description

template<typename T>
class SerialVar::SerialVar< T >

Template of a Serial Variable.

Template Parameters
TThe primitive data type of this variable
IDThe unique ID of this variable, used to update it in the background
Note
Each instance of a SerialVar must be defined in SerialVars.def, where you can then declare in instance of SerialVar as so.
c++
#define SERIALVAR_TORQUE_VECTORING_AGGRESSION
ID for Torque vectoring aggression serial var.
Template of a Serial Variable.
Definition SerialVar.h:48
uint8_t * getVariable(size_t ID)
Get the Serial Variable for a given ID.

Definition at line 48 of file SerialVar.h.

Constructor & Destructor Documentation

◆ SerialVar()

template<typename T >
SerialVar::SerialVar< T >::SerialVar ( int  ID)
inline

Construct a new Serial Var given the predefined ID defined in SerialVars.def.

Parameters
IDthe predefined ID

Definition at line 58 of file SerialVar.h.

Member Function Documentation

◆ operator T()

template<typename T >
SerialVar::SerialVar< T >::operator T ( ) const
inline

Cast to the given primitive data type of this variable.

Returns
T The buffer interpreted as the primitive data type of this variable

Definition at line 67 of file SerialVar.h.

◆ operator=()

template<typename T >
SerialVar & SerialVar::SerialVar< T >::operator= ( val)
inline

Set this variable's buffer given the primitive data type T.

Parameters
valValue to interpret
Returns
SerialVar& pointer to this object

Definition at line 75 of file SerialVar.h.


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