Artim
API documentation
|
Arduino Runtime Control and Measurement class. More...
#include <Artim.h>
Public Member Functions | |
Artim (unsigned int loopTime_ms) | |
Constructor. More... | |
void | loopBegin (void) |
loopBegin needs to be invoked as very first operation of the loop. More... | |
void | loopEnd (void) |
loopEnd needs to be invoked as very last operation of the loop. More... | |
float | getAvgLoad (void) |
API function that provides the average load in %. More... | |
float | getMinLoad (void) |
API function that provides the minimum load in %. More... | |
float | getMaxLoad (void) |
API function that provides the maximum load in %. More... | |
unsigned int | getLoadHist (byte rangeIdx) |
API function that provides the histogram data for a range provided as input parameter. More... | |
unsigned int | getOverloadHist (void) |
API function that provides the overload historgram data. More... | |
Arduino Runtime Control and Measurement class.
Artim::Artim | ( | unsigned int | loopTime_ms | ) |
Constructor.
loopTime_ms | Desired loop time in ms as input to calculate wait time and load. |
float Artim::getAvgLoad | ( | void | ) |
API function that provides the average load in %.
The average load is calculated for the whole power-cycle.
unsigned int Artim::getLoadHist | ( | byte | rangeIdx | ) |
API function that provides the histogram data for a range provided as input parameter.
The histogram provides the information about the load distribution during runtime. Each loop execution is considered.
rangeIdx | Histogram index. Valid range: 0...9. |
float Artim::getMaxLoad | ( | void | ) |
API function that provides the maximum load in %.
The maximum load observed for one loop execution. The maximum load is calculated for the whole power cycle.
float Artim::getMinLoad | ( | void | ) |
API function that provides the minimum load in %.
The minimum load observed for one loop execution. The minimum load is calculated for the whole power cycle.
unsigned int Artim::getOverloadHist | ( | void | ) |
API function that provides the overload historgram data.
In case the desired loop time is exceeded before loopEnd is called, an overload is detected. The overload will be counted in a separate histogram variable. The function returns the overload count.
void Artim::loopBegin | ( | void | ) |
loopBegin needs to be invoked as very first operation of the loop.
It takes the start timestamp for load calculation and calculates the load of the last cycle.
void Artim::loopEnd | ( | void | ) |
loopEnd needs to be invoked as very last operation of the loop.
It takes the end time stamp for load calculation and triggers the calculation of the wait time and executes the wait.