28 double input, inputLow, inputHigh, outputHigh, outputLow;
31 inputHigh = INT32_MAX;
36 return ((input - inputLow) / (inputHigh - inputLow)) * (outputHigh - outputLow) + outputLow;
virtual int32_t raw_to_voltage(int32_t raw)
Convert raw data to voltage.
uint16_t get_reference() const
Get the reference voltage in micro Voltage.
size_t get_resolution() const
Get the resolution in bits of the ADC.
size_t resolution
resolution of the ADC in bits.
Link * driver
stores the driver.
err_t set_reference(uint16_t mV)
set reference voltage, used to convert raw data to voltage.
err_t set_resolution(size_t bits)
Set resolution of ADC.
uint16_t reference
ADC voltage refrence, for convertage to voltage.