#include <AnalogDeviceAbstraction.h>
Public Member Functions | |
virtual int | getMaximumRange (AnalogDirection direction, pinid_t pin)=0 |
virtual int | getBitDepth (AnalogDirection direction, pinid_t pin)=0 |
virtual void | initPin (pinid_t pin, AnalogDirection direction)=0 |
virtual unsigned int | getCurrentValue (pinid_t pin)=0 |
virtual float | getCurrentFloat (pinid_t pin)=0 |
virtual void | setCurrentValue (pinid_t pin, unsigned int newValue)=0 |
virtual void | setCurrentFloat (pinid_t pin, float newValue)=0 |
Describes an analog device that has commands to both read values from and write values to a device. Not all devices will support both input and output. When such a case occurs the getMaximumRange would return -1 for that direction. This abstraction can support ADC, PWM DAC and Potentiometer devices. On every device we support, calling internalAnalogIO gives the instance for the internal analog pins.
|
pure virtual |
dir | the direction required |
pin | the pin for which the range is desired |
Implemented in MPR121AnalogAbstraction, and AW9523AnalogAbstraction.
|
pure virtual |
pin | the pin for which the bit depth is required. |
direction | the direction in which the depth is queried (DIR_IN, DIR_OUT) |
Implemented in MPR121AnalogAbstraction, and AW9523AnalogAbstraction.
|
pure virtual |
initialises a pin as either an input or output of analog signals. No validation to check if that pin can support input or output is performed.
pin | the pin to initialise |
direction | the direction required |
Implemented in MPR121AnalogAbstraction, and AW9523AnalogAbstraction.
|
pure virtual |
Returns the current value on the ADC for the given pin
pin | the pin to read from |
Implemented in MPR121AnalogAbstraction, and AW9523AnalogAbstraction.
|
pure virtual |
Sets the current value on an output capable device to a new value
pin | the pin to read from |
newValue | the value to be set |
Implemented in MPR121AnalogAbstraction, and AW9523AnalogAbstraction.
|
pure virtual |
sets the current value based on a float from 0 to 1, where 0 is minimum and 1 is maximum.
pin | the pin for which to set |
newValue | the new value which should be between 0 and 1.0 |
Implemented in MPR121AnalogAbstraction, and AW9523AnalogAbstraction.