140 if (gain_compression == 1)
143 voltage = (float)adc_code;
144 voltage = voltage / (pow(2,31)-1);
145 voltage = voltage * vref + 0.1;
uint8_t LT_byte[4]
4 bytes (unsigned 8-bit integers) to be converted to a 32-bit signed or unsigned integer ...
Header File for Linduino Libraries and Demo Code.
union LT_union_int32_4bytes data
void LTC2380_read(uint8_t cs, int32_t *ptr_adc_code)
Reads the LTC2380 and returns 32-bit data in 2's complement format.
uint16_t LT_uint16
16-bit unsigned integer to be converted to two bytes
int32_t LT_int32
32-bit signed integer to be converted to four bytes
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
float LTC2380_code_to_voltage(int32_t adc_code, uint8_t gain_compression, float vref)
Calculates the LTC2380 input voltage given the binary data and lsb weight.
This union splits one int32_t (32-bit signed integer) or uint32_t (32-bit unsigned integer) four uint...
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 ...
LTC2376-16: 16-Bit, 250Ksps ADC LTC2376-18: 18-Bit, 250Ksps ADC LTC2376-20: 20-Bit, 250Ksps ADC LTC2377-16: 16-Bit, 500Ksps ADC LTC2377-18: 18-Bit, 500Ksps ADC LTC2377-20: 20-Bit, 500Ksps ADC LTC2378-16: 16-Bit, 1Msps ADC LTC2378-18: 18-Bit, 1Msps ADC LTC2378-20: 20-Bit, 1Msps ADC LTC2379-18: 18-Bit, 1.6Msps ADC LTC2380-16: 16-Bit, 2Msps ADC.