Public Types | Public Member Functions | Private Attributes | List of all members
BlackADC Class Reference

Interacts with end user, to use ADC feature. More...

#include <BlackLib.h>

Inheritance diagram for BlackADC:
BlackCoreADC

Public Types

enum  flags {
  cpmgrErr = 0, ocpErr = 1,
  helperErr = 2, dtErr = 3,
  ReadErr = 4
}
 

Public Member Functions

 BlackADC (adc_name adc)
 Constructor of BlackADC class. More...
 
virtual ~BlackADC ()
 Destructor of BlackADC class. More...
 
std::string getValue ()
 Exports analog input DC value(mV). More...
 
int getNumericValue ()
 Exports analog input DC value(mV). More...
 
float getParsedValue (digit_after_point dap)
 Exports converted analog input DC value(Volt). More...
 
adc_name getName ()
 Exports analog input pin name. More...
 
bool fail ()
 Is used for general debugging. More...
 
bool fail (BlackADC::flags f)
 Is used for specific debugging. More...
 

Private Attributes

errorADCadcErrors
 is used to hold the errors of BlackADC class More...
 
std::string ainPath
 is used to hold the AINx file path More...
 
adc_name adcName
 is used to hold the selected adc name More...
 

Additional Inherited Members

- Private Member Functions inherited from BlackCoreADC
 BlackCoreADC ()
 Constructor of BlackCoreADC class. More...
 
virtual ~BlackCoreADC ()
 Destructor of BlackCoreADC class. More...
 
errorCoreADCgetErrorsFromCoreADC ()
 Exports errorCoreADC struct to derived class. More...
 
std::string getHelperPath ()
 Exports helper path to derived class. More...
 

Detailed Description

Interacts with end user, to use ADC feature.

This class is end node to use analog inputs. End users interact with analog inputs from this class. It includes public functions for reading analog inputs, and includes enum type flags for error debugging.

Member Enumeration Documentation

This enum is used to define ADC debugging flags.

Enumerator
cpmgrErr 

enumeration for errorCore::capeMgrError status

ocpErr 

enumeration for errorCore::ocpError status

helperErr 

enumeration for errorCoreADC::helperError status

dtErr 

enumeration for errorCoreADC::dtError status

ReadErr 

enumeration for errorADC::readError status

Constructor & Destructor Documentation

BlackADC::BlackADC ( adc_name  adc)

Constructor of BlackADC class.

This function initializes errorADC struct, sets value path for reading analog input and prints message related to errorCoreADC::dtError variable, for informing user about the result of the initialization process.

Parameters
[in]adcname of adc (enum),(AINx)
See Also
getOcpName()
getHelperPath()
adc_name
BlackADC::~BlackADC ( )
virtual

Destructor of BlackADC class.

Member Function Documentation

bool BlackADC::fail ( )

Is used for general debugging.

Returns
True if any error occured, else false.
See Also
errorADC
bool BlackADC::fail ( BlackADC::flags  f)

Is used for specific debugging.

You can use this function, after call BlackADC member functions in your code. The input parameter is used for finding out status of selected error.

Parameters
[in]fspecific error type (enum)
Returns
Value of selected error.
See Also
errorADC
adc_name BlackADC::getName ( )

Exports analog input pin name.

Returns
BlackADC::adcName variable.
int BlackADC::getNumericValue ( )

Exports analog input DC value(mV).

This function reads specified file from path, where defined at BlackADC::ainPath variable. This file holds analog input voltage at milivolt level.

Returns
integer type analog input value. If file opening fails, it returns -1.
float BlackADC::getParsedValue ( digit_after_point  dap)

Exports converted analog input DC value(Volt).

This function gets value by using getNumericValue() function and converts this value to volt level, according to input parameter.

Parameters
[in]dapconvertion level (enum),(dapX) Expansion: digit after point
Returns
converted analog input value as float.
See Also
getNumericValue()
digit_after_point
std::string BlackADC::getValue ( )
virtual

Exports analog input DC value(mV).

This function reads specified file from path, where defined at BlackADC::ainPath variable. This file holds analog input voltage at milivolt level.

Returns
String type analog input value. If file opening fails, it returns error message.

Implements BlackCoreADC.

Member Data Documentation

errorADC* BlackADC::adcErrors
private

is used to hold the errors of BlackADC class

adc_name BlackADC::adcName
private

is used to hold the selected adc name

std::string BlackADC::ainPath
private

is used to hold the AINx file path


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