/* Calculates the LTC2312 input voltage given the binary data and LSB weight. */
void ltc2312_code_to_voltage(struct ltc2312_dev *dev, uint16_t adc_code, float vref, float *voltage)
/* Calculates the LTC2312 input voltage given the binary data and LSB weight. */
void ltc2312_code_to_voltage(struct ltc2312_dev *dev, uint16_t adc_code, float vref, float *voltage)
{
	uint8_t shift;
	*voltage = (float)adc_code;
	shift = ltc2312_get_shift(dev);
	*voltage = *voltage / (pow(2,(16 - shift))-1);
	*voltage = *voltage * vref;
}