Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
tap::arch Namespace Reference

Namespaces

namespace  clock
 

Classes

class  ConditionalTimer
 
class  PeriodicTimer
 
class  Profiler
 
class  Timeout
 

Typedefs

using ConditionalMilliTimer = ConditionalTimer< MilliTimeout >
 
using PeriodicMilliTimer = PeriodicTimer< MilliTimeout >
 
using PeriodicMicroTimer = PeriodicTimer< MicroTimeout >
 
using MicroTimeout = Timeout< tap::arch::clock::getTimeMicroseconds >
 
using MilliTimeout = Timeout< tap::arch::clock::getTimeMilliseconds >
 

Functions

template<typename T >
void dataToByteArray (T data, uint8_t *bytesOut, bool forward)
 
template<typename T >
void byteArrayToData (T *data, const uint8_t *bytesIn, bool forward)
 
template<typename T >
void convertToLittleEndian (T data, uint8_t *bytesOut)
 
template<typename T >
void convertToBigEndian (T data, uint8_t *bytesOut)
 
template<typename T >
void convertFromLittleEndian (T *data, const uint8_t *bytesIn)
 
template<typename T >
void convertFromBigEndian (T *data, const uint8_t *bytesIn)
 
float bigEndianInt16ToFloat (const uint8_t *buff)
 

Typedef Documentation

◆ ConditionalMilliTimer

◆ MicroTimeout

◆ MilliTimeout

◆ PeriodicMicroTimer

◆ PeriodicMilliTimer

Function Documentation

◆ bigEndianInt16ToFloat()

float tap::arch::bigEndianInt16ToFloat ( const uint8_t *  buff)
inline

Convert int16_t stored in big endian format in buff to a floating point value.

Parameters
[in]buffBuffer containing two bytes representing an int16_t in big endian format.
Returns
A float, the converted int16_t in floating point form.

◆ byteArrayToData()

template<typename T >
void tap::arch::byteArrayToData ( T *  data,
const uint8_t *  bytesIn,
bool  forward 
)
inline

Reads a byte array and stores its numeric value in the given number reference.

Template Parameters
Tthe type to be read.
Parameters
[out]datathe reference to the number in which the byte array's numeric representation will be stored
[in]bytesInthe byte array to be read
[in]forwardan indication of if the byte array should be read forwards or not

◆ convertFromBigEndian()

template<typename T >
void tap::arch::convertFromBigEndian ( T *  data,
const uint8_t *  bytesIn 
)

Converts a byte array from big endian and stores its numeric value in the given number reference. If the current architecture is in big endian, the bytes are maintained in the current order. If the current architecture is in little endian, the bytes are read and stored in reverse order.

Template Parameters
Tthe type to be read.
Parameters
[out]datathe reference to the number in which the byte array's numeric representation will be stored
[in]bytesInthe byte array to be read from big endian

◆ convertFromLittleEndian()

template<typename T >
void tap::arch::convertFromLittleEndian ( T *  data,
const uint8_t *  bytesIn 
)

Converts a byte array from little endian and stores its numeric value in the given number reference. If the current architecture is in little endian, the bytes are maintained in the current order. If the current architecture is in big endian, the bytes are read and stored in reverse order.

Template Parameters
Tthe type to be read.
Parameters
[out]datathe reference to the number in which the byte array's numeric representation will be stored
[in]bytesInthe byte array to be read from little endian

◆ convertToBigEndian()

template<typename T >
void tap::arch::convertToBigEndian ( data,
uint8_t *  bytesOut 
)

Converts a number into a byte array in big endian. If the current architecture is in big endian, the bytes are maintained in the current order. If the current architecture is in little endian, the bytes are read and stored in reverse order.

Template Parameters
Tthe type to be read.
Parameters
[in]datathe number to be read
[out]bytesOutthe reference to the array in which the bytes will be stored

◆ convertToLittleEndian()

template<typename T >
void tap::arch::convertToLittleEndian ( data,
uint8_t *  bytesOut 
)

Converts a number into a byte array in little endian. If the current architecture is in little endian, the bytes are maintained in the current order. If the current architecture is in big endian, the bytes are read and stored in reverse order.

Template Parameters
Tthe type to be read.
Parameters
[in]datathe number to be read
[out]bytesOutthe reference to the array in which the bytes will be stored

◆ dataToByteArray()

template<typename T >
void tap::arch::dataToByteArray ( data,
uint8_t *  bytesOut,
bool  forward 
)
inline

Reads a number and stores its byte array representation in the given array reference.

Template Parameters
Tthe type to be read.
Parameters
[in]datathe number to be read.
[out]bytesOutthe reference to the array in which the bytes will be stored.
[in]forwardan indication of if the number's bytes should be read forwards or not.