98 #define LTC1859_CS QUIKEVAL_CS 104 #define LTC1859_CH0 0x80 105 #define LTC1859_CH1 0xC0 106 #define LTC1859_CH2 0x90 107 #define LTC1859_CH3 0xD0 108 #define LTC1859_CH4 0xA0 109 #define LTC1859_CH5 0xE0 110 #define LTC1859_CH6 0xB0 111 #define LTC1859_CH7 0xF0 117 #define LTC1859_P0_N1 0x00 118 #define LTC1859_P1_N0 0x40 120 #define LTC1859_P2_N3 0x10 121 #define LTC1859_P3_N2 0x50 123 #define LTC1859_P4_N5 0x20 124 #define LTC1859_P5_N4 0x60 126 #define LTC1859_P6_N7 0x30 127 #define LTC1859_P7_N6 0x70 133 #define LTC1859_UNIPOLAR_MODE 0x08 134 #define LTC1859_BIPOLAR_MODE 0x00 136 #define LTC1859_SINGLE_ENDED_MODE 0x80 137 #define LTC1859_DIFFERENTIAL_MODE 0x00 139 #define LTC1859_LOW_RANGE_MODE 0x00 140 #define LTC1859_HIGH_RANGE_MODE 0x04 146 #define LTC1859_SLEEP_MODE 0x01 147 #define LTC1859_NORMAL_MODE 0x00 149 #define LTC1859_NAP_MODE 0x02 static uint8_t adc_command
uint8_t LTC1859_build_command(uint8_t ch_designate, uint8_t uni_bipolar, uint8_t range_low_high)
Builds the ADC command and returns an 8 bit command.
static uint8_t uni_bipolar
Default set for unipolar mode.
float LTC1859_code_to_voltage(uint16_t adc_code, float vref, uint8_t range_low_high, uint8_t uni_bipolar)
Calculates the LTC1859 input's unipolar voltage given the binary data and lsb weight.
static uint8_t range_low_high
Default set for high range mode.
void LTC1859_read(uint8_t cs, uint8_t adc_command, uint16_t *adc_code)
Reads the ADC and returns 16-bit data.