Artim
API documentation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Artim Class Reference

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...
 

Detailed Description

Arduino Runtime Control and Measurement class.

Constructor & Destructor Documentation

◆ Artim()

Artim::Artim ( unsigned int  loopTime_ms)

Constructor.

Parameters
loopTime_msDesired loop time in ms as input to calculate wait time and load.

Member Function Documentation

◆ getAvgLoad()

float Artim::getAvgLoad ( void  )

API function that provides the average load in %.

The average load is calculated for the whole power-cycle.

Returns
Average load in %.

◆ getLoadHist()

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.

  • Index 0: Number of loop executions with load of 0...9,9%
  • Index 1: Number of loop executions with load of 10...19,9%
  • Index 2: Number of loop executions with load of 20...29,9%
  • Index 3: Number of loop executions with load of 30...39,9%
  • Index 4: Number of loop executions with load of 40...49,9%
  • Index 5: Number of loop executions with load of 50...59,9%
  • Index 6: Number of loop executions with load of 60...69,9%
  • Index 7: Number of loop executions with load of 70...79,9%
  • Index 8: Number of loop executions with load of 80...89,9%
  • Index 9: Number of loop executions with load of 90...99,9%
    Parameters
    rangeIdxHistogram index. Valid range: 0...9.
    Returns
    Returns the current histogram data for the given index. If the input is out of range, it returns 0.

◆ getMaxLoad()

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.

Returns
Maximum load in %.

◆ getMinLoad()

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.

Returns
Minimum load in %.

◆ getOverloadHist()

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.

Returns
Returns the number of overload events (number of loop executions that exceeded the configured loop time).

◆ loopBegin()

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.

◆ loopEnd()

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.


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