Arduino_VESC_Library
VescUtility Class Reference

utility class to get or append data More...

#include <vesc_utility.h>

Static Public Member Functions

static void utility_append_int16 (uint8_t *buffer, int16_t number, int32_t *index)
 append int16 to buffer More...
 
static void utility_append_uint16 (uint8_t *buffer, uint16_t number, int32_t *index)
 append uint16 to buffer More...
 
static void utility_append_int32 (uint8_t *buffer, int32_t number, int32_t *index)
 append int32 to buffer More...
 
static void utility_append_uint32 (uint8_t *buffer, uint32_t number, int32_t *index)
 append uint32 to buffer More...
 
static void utility_append_float16 (uint8_t *buffer, float number, float scale, int32_t *index)
 append float16 to buffer More...
 
static void utility_append_float32 (uint8_t *buffer, float number, float scale, int32_t *index)
 append float32 to buffer More...
 
static void utility_append_float32_auto (uint8_t *buffer, float number, int32_t *index)
 append float32 to buffer auto scale More...
 
static int16_t utility_get_int16 (const uint8_t *buffer, int32_t *index)
 get int16 from buffer More...
 
static uint16_t utility_get_uint16 (const uint8_t *buffer, int32_t *index)
 get uint16_t from buffer More...
 
static int32_t utility_get_int32 (const uint8_t *buffer, int32_t *index)
 get int32_t from buffer More...
 
static uint32_t utility_get_uint32 (const uint8_t *buffer, int32_t *index)
 get uint32_t from buffer More...
 
static float utility_get_float16 (const uint8_t *buffer, float scale, int32_t *index)
 get float16 from buffer More...
 
static float utility_get_float32 (const uint8_t *buffer, float scale, int32_t *index)
 get float32 from buffer More...
 
static float utility_get_float32_auto (const uint8_t *buffer, int32_t *index)
 get float32 from buffer auto scale More...
 

Detailed Description

utility class to get or append data

Definition at line 24 of file vesc_utility.h.

Member Function Documentation

◆ utility_append_float16()

void VescUtility::utility_append_float16 ( uint8_t *  buffer,
float  number,
float  scale,
int32_t *  index 
)
static

append float16 to buffer

Parameters
bufferto write
numberto store
scaleto applicate to number
indexof buffer

Definition at line 83 of file vesc_utility.cpp.

References utility_append_int16().

◆ utility_append_float32()

void VescUtility::utility_append_float32 ( uint8_t *  buffer,
float  number,
float  scale,
int32_t *  index 
)
static

append float32 to buffer

Parameters
bufferto write
numberto store
scaleto applicate to number
indexof buffer

Definition at line 95 of file vesc_utility.cpp.

References utility_append_int32().

Referenced by Vesc::setHandbrake().

◆ utility_append_float32_auto()

void VescUtility::utility_append_float32_auto ( uint8_t *  buffer,
float  number,
int32_t *  index 
)
static

append float32 to buffer auto scale

Parameters
bufferto write
numberto store
indexof buffer

Definition at line 106 of file vesc_utility.cpp.

References utility_append_uint32().

◆ utility_append_int16()

void VescUtility::utility_append_int16 ( uint8_t *  buffer,
int16_t  number,
int32_t *  index 
)
static

append int16 to buffer

Parameters
bufferto write
numberto store
indexof buffer

Definition at line 30 of file vesc_utility.cpp.

Referenced by utility_append_float16().

◆ utility_append_int32()

void VescUtility::utility_append_int32 ( uint8_t *  buffer,
int32_t  number,
int32_t *  index 
)
static

append int32 to buffer

Parameters
bufferto write
numberto store
indexof buffer

Definition at line 54 of file vesc_utility.cpp.

Referenced by Vesc::setBrakeCurrent(), Vesc::setCurrent(), Vesc::setDuty(), Vesc::setPosition(), Vesc::setRPM(), and utility_append_float32().

◆ utility_append_uint16()

void VescUtility::utility_append_uint16 ( uint8_t *  buffer,
uint16_t  number,
int32_t *  index 
)
static

append uint16 to buffer

Parameters
bufferto write
numberto store
indexof buffer

Definition at line 42 of file vesc_utility.cpp.

◆ utility_append_uint32()

void VescUtility::utility_append_uint32 ( uint8_t *  buffer,
uint32_t  number,
int32_t *  index 
)
static

append uint32 to buffer

Parameters
bufferto write
numberto store
indexof buffer

Definition at line 68 of file vesc_utility.cpp.

Referenced by Vesc::getRealtimeValuesSelective(), and utility_append_float32_auto().

◆ utility_get_float16()

float VescUtility::utility_get_float16 ( const uint8_t *  buffer,
float  scale,
int32_t *  index 
)
static

get float16 from buffer

Parameters
bufferto read
scaleto applicate to number
indexof buffer
Returns
float

Definition at line 193 of file vesc_utility.cpp.

References utility_get_int16().

Referenced by Vesc::getDutyCycleNow(), Vesc::getFetTemperature(), Vesc::getInputVoltage(), Vesc::getMosfetsTemperature(), Vesc::getMotorTemperature(), and Vesc::getRealtimeValues().

◆ utility_get_float32()

float VescUtility::utility_get_float32 ( const uint8_t *  buffer,
float  scale,
int32_t *  index 
)
static

◆ utility_get_float32_auto()

float VescUtility::utility_get_float32_auto ( const uint8_t *  buffer,
int32_t *  index 
)
static

get float32 from buffer auto scale

Parameters
bufferto read
indexof buffer
Returns
float

Definition at line 216 of file vesc_utility.cpp.

References utility_get_uint32().

Referenced by Vesc::getMotorConfiguration().

◆ utility_get_int16()

int16_t VescUtility::utility_get_int16 ( const uint8_t *  buffer,
int32_t *  index 
)
static

get int16 from buffer

Parameters
bufferto read
indexof buffer
Returns
int16_t

Definition at line 132 of file vesc_utility.cpp.

Referenced by Vesc::getMotorConfiguration(), and utility_get_float16().

◆ utility_get_int32()

int32_t VescUtility::utility_get_int32 ( const uint8_t *  buffer,
int32_t *  index 
)
static

get int32_t from buffer

Parameters
bufferto read
indexof buffer
Returns
int32_t

Definition at line 160 of file vesc_utility.cpp.

Referenced by Vesc::getMotorConfiguration(), Vesc::getRealtimeValues(), Vesc::getTachometerAbsValue(), Vesc::getTachometerValue(), and utility_get_float32().

◆ utility_get_uint16()

uint16_t VescUtility::utility_get_uint16 ( const uint8_t *  buffer,
int32_t *  index 
)
static

get uint16_t from buffer

Parameters
bufferto read
indexof buffer
Returns
uint16_t

Definition at line 146 of file vesc_utility.cpp.

◆ utility_get_uint32()

uint32_t VescUtility::utility_get_uint32 ( const uint8_t *  buffer,
int32_t *  index 
)
static

get uint32_t from buffer

Parameters
bufferto read
indexof buffer
Returns
uint32_t

Definition at line 176 of file vesc_utility.cpp.

Referenced by Vesc::getMotorConfiguration(), and utility_get_float32_auto().


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