101 voltage = (float)adc_code;
102 voltage = voltage / (pow(2,15)-1);
103 voltage = voltage *
vref;
float LTC2383_code_to_voltage(int16_t adc_code, float vref)
Calculates the LTC2383 input voltage given the binary data and lsb weight.
Header File for Linduino Libraries and Demo Code.
union LT_union_int32_4bytes data
int16_t LT_int16
16-bit signed integer to be converted to two bytes
uint16_t LT_uint16
16-bit unsigned integer to be converted to two bytes
LTC2381-16: 16-Bit, 250Ksps ADC.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
void LTC2383_read(uint8_t cs, uint16_t *ptr_adc_code)
Reads the LTC2383 and returns 16-bit data in 2's complement format.
This union splits one int16_t (16-bit signed integer) or uint16_t (16-bit unsigned integer) into two ...
void spi_transfer_block(uint8_t cs_pin, uint8_t *tx, uint8_t *rx, uint8_t length)
Reads and sends a byte array.
uint8_t LT_byte[2]
2 bytes (unsigned 8-bit integers) to be converted to a 16-bit signed or unsigned integer ...