Added iVDiv interface
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
committed by
Mihai Tudor Panu
parent
fd34b9669d
commit
f5f2920c70
@@ -27,6 +27,7 @@
|
||||
#include <iostream>
|
||||
#include <stdint.h>
|
||||
#include <mraa/aio.h>
|
||||
#include <interfaces/iVDiv.hpp>
|
||||
|
||||
// reference voltage in millivolts
|
||||
#define VDIV_VREF 4980
|
||||
@@ -58,7 +59,7 @@ namespace upm {
|
||||
* @image html vdiv.jpg
|
||||
* @snippet vdiv.cxx Interesting
|
||||
*/
|
||||
class VDiv {
|
||||
class VDiv : virtual public iVDiv {
|
||||
public:
|
||||
/**
|
||||
* Voltage Divider sensor constructor
|
||||
@@ -80,6 +81,13 @@ namespace upm {
|
||||
*/
|
||||
unsigned int value(unsigned int samples);
|
||||
|
||||
/**
|
||||
* Gets the conversion value from the sensor
|
||||
*
|
||||
* @return ADC conversion value
|
||||
*/
|
||||
virtual unsigned int getValue();
|
||||
|
||||
/**
|
||||
* Computes the measured voltage
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user