98 #define LTC1867_CS QUIKEVAL_CS 104 #define LTC1867_CH0 0x80 105 #define LTC1867_CH1 0xC0 106 #define LTC1867_CH2 0x90 107 #define LTC1867_CH3 0xD0 108 #define LTC1867_CH4 0xA0 109 #define LTC1867_CH5 0xE0 110 #define LTC1867_CH6 0xB0 111 #define LTC1867_CH7 0xF0 117 #define LTC1867_P0_N1 0x00 118 #define LTC1867_P1_N0 0x40 120 #define LTC1867_P2_N3 0x10 121 #define LTC1867_P3_N2 0x50 123 #define LTC1867_P4_N5 0x20 124 #define LTC1867_P5_N4 0x60 126 #define LTC1867_P6_N7 0x30 127 #define LTC1867_P7_N6 0x70 133 #define LTC1867_CH0_7COM 0x88 134 #define LTC1867_CH1_7COM 0xC8 135 #define LTC1867_CH2_7COM 0x98 136 #define LTC1867_CH3_7COM 0xD8 137 #define LTC1867_CH4_7COM 0xA8 138 #define LTC1867_CH5_7COM 0xE8 139 #define LTC1867_CH6_7COM 0xB8 145 #define LTC1867_SLEEP_MODE 0x02 146 #define LTC1867_EXIT_SLEEP_MODE 0x00 147 #define LTC1867_UNIPOLAR_MODE 0x04 // Bitwise OR with channel commands for unipolar mode 148 #define LTC1867_BIPOLAR_MODE 0x00 182 uint16_t zero_bipolar_code,
static uint8_t adc_command
static int32_t LTC1867_offset_unipolar_code
Ideal unipolar offset for a perfect part.
void LTC1867_read(uint8_t cs, uint8_t adc_command, uint16_t *adc_code)
Reads the ADC and returns 16-bit data.
float LTC1867_bipolar_code_to_voltage(uint16_t adc_code, float LTC1867_lsb, int32_t LTC1867_offset_bipolar_code)
Calculates the LTC1867 input's bipolar voltage given the two's compliment data and lsb weight...
float LTC1867_unipolar_code_to_voltage(uint16_t adc_code, float LTC1867_lsb, int32_t LTC1867_offset_unipolar_code)
Calculates the LTC1867 input's unipolar voltage given the binary data and lsb weight.
static float LTC1867_lsb
Ideal LSB voltage for a perfect part.
void LTC1867_cal_voltage(uint16_t zero_unipolar_code, uint16_t zero_bipolar_code, uint16_t fs_code, float zero_voltage, float fs_voltage, float *LTC1867_lsb, int32_t *LTC1867_offset_unipolar_code, int32_t *LTC1867_offset_bipolar_code)
Calibrate the offset and LSB voltage given two measured offset codes, and a full-scale voltage with t...
static int32_t LTC1867_offset_bipolar_code
Ideal bipolar offset for a perfect part.