VMX-pi C++ HAL Library for Raspberry Pi
VMX-pi Robotics Controller & Vision/Motion Processor
Public Member Functions | Public Attributes | List of all members
AccumulatorConfig Struct Reference

Contains the configuration data for a VMXResource whose VMXResourceType is Accumulator. More...

#include <VMXResourceConfig.h>

Inheritance diagram for AccumulatorConfig:
VMXResourceConfig

Public Member Functions

 AccumulatorConfig ()
 AccumulatorConfig default constructor; sets all values to defaults.
 
 AccumulatorConfig (uint8_t num_oversample_bits, uint8_t num_average_bits)
 AccumulatorConfig constructor; initializes values with the provided input parameters *. More...
 
uint8_t GetNumAverageBits ()
 Returns the configured number of average bits. More...
 
uint8_t GetNumOversampleBits ()
 Returns the configured number of oversample bits. More...
 
void SetNumAverageBits (uint8_t num_average_bits)
 Sets the configured number of average bits. More...
 
void SetNumOversampleBits (uint8_t num_oversample_bits)
 Sets the configured number of oversample bits. More...
 
void SetEnableAccumulationCounter (bool assign)
 Enables an accumulation counter on the accumulator resource. More...
 
bool GetEnableAccumulationCounter ()
 Indicates whether an accumulation counter is enabled on the accumulator resource. More...
 
void SetAccumulationCounterDeadband (int16_t deadband)
 Sets the deadband on the enabled accmulation counter; if a non-zero center value is configured, and after that value is subtracted, the remaining value is within the deadband range, the raw value is set to 0 before being added to accumulator counter. More...
 
int16_t GetAccumulationCounterDeadband ()
 Gets the deadband on the enabled accmulation counter; if a non-zero center value is configured, and after that value is subtracted, the remaining value is within the deadband range, the raw value is set to 0 before being added to accumulator counter.
 
void SetAccumulationCounterCenter (int16_t center)
 Sets the center value on the enabled accmulation counter; if non-zero, this value is subracted from each sample added to the counter. More...
 
int16_t GetAccumulationCounterCenter ()
 Gets the center value on the enabled accmulation counter; if non-zero, this value is subracted from each sample added to the counter. More...
 
virtual size_t GetSize () const
 
virtual VMXResourceConfigGetCopy () const
 Instantiates a copy of the configuration data. More...
 
virtual bool Copy (const VMXResourceConfig *p_config)
 Copies the contents of the source VMXResourceConfig object into this object. More...
 
- Public Member Functions inherited from VMXResourceConfig
 VMXResourceConfig (VMXResourceType res_type)
 
VMXResourceType GetResourceType () const
 VMXResourceType which this configuration applies to.
 

Public Attributes

uint8_t num_average_bits
 
uint8_t num_oversample_bits
 
bool assign_to_accumulator
 
int16_t center
 
int16_t deadband
 
- Public Attributes inherited from VMXResourceConfig
VMXResourceType res_type
 

Detailed Description

Contains the configuration data for a VMXResource whose VMXResourceType is Accumulator.

Constructor & Destructor Documentation

◆ AccumulatorConfig()

AccumulatorConfig::AccumulatorConfig ( uint8_t  num_oversample_bits,
uint8_t  num_average_bits 
)
inline

AccumulatorConfig constructor; initializes values with the provided input parameters *.

Parameters
num_oversample_bitsThe configured number of oversample bits
num_average_bitsThe configured number of average bits

Member Function Documentation

◆ Copy()

virtual bool AccumulatorConfig::Copy ( const VMXResourceConfig p_config)
inlinevirtual

Copies the contents of the source VMXResourceConfig object into this object.

NOTE: The source object's VMXResourceType must match this object's VMXResourceType.

Parameters
[in]p_configThe source VMXResourceConfig object from which to copy configuration data into this object.

Implements VMXResourceConfig.

◆ GetAccumulationCounterCenter()

int16_t AccumulatorConfig::GetAccumulationCounterCenter ( )
inline

Gets the center value on the enabled accmulation counter; if non-zero, this value is subracted from each sample added to the counter.

◆ GetCopy()

virtual VMXResourceConfig* AccumulatorConfig::GetCopy ( ) const
inlinevirtual

Instantiates a copy of the configuration data.

NOTE: The caller is responsible to delete the object returned from this method.

Implements VMXResourceConfig.

◆ GetEnableAccumulationCounter()

bool AccumulatorConfig::GetEnableAccumulationCounter ( )
inline

Indicates whether an accumulation counter is enabled on the accumulator resource.

◆ GetNumAverageBits()

uint8_t AccumulatorConfig::GetNumAverageBits ( )
inline

Returns the configured number of average bits.

Each averaged value is comprised of 2^num_average_bits samples.

◆ GetNumOversampleBits()

uint8_t AccumulatorConfig::GetNumOversampleBits ( )
inline

Returns the configured number of oversample bits.

◆ SetAccumulationCounterCenter()

void AccumulatorConfig::SetAccumulationCounterCenter ( int16_t  center)
inline

Sets the center value on the enabled accmulation counter; if non-zero, this value is subracted from each sample added to the counter.

◆ SetAccumulationCounterDeadband()

void AccumulatorConfig::SetAccumulationCounterDeadband ( int16_t  deadband)
inline

Sets the deadband on the enabled accmulation counter; if a non-zero center value is configured, and after that value is subtracted, the remaining value is within the deadband range, the raw value is set to 0 before being added to accumulator counter.

◆ SetEnableAccumulationCounter()

void AccumulatorConfig::SetEnableAccumulationCounter ( bool  assign)
inline

Enables an accumulation counter on the accumulator resource.

◆ SetNumAverageBits()

void AccumulatorConfig::SetNumAverageBits ( uint8_t  num_average_bits)
inline

Sets the configured number of average bits.

◆ SetNumOversampleBits()

void AccumulatorConfig::SetNumOversampleBits ( uint8_t  num_oversample_bits)
inline

Sets the configured number of oversample bits.


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