120 #ifndef LTC24XX_general_H 121 #define LTC24XX_general_H 125 #define LTC24XX_CS QUIKEVAL_CS 136 #define LTC24XX_HS_MULTI_KEEP_PREVIOUS_MODE 0x80 137 #define LTC24XX_HS_MULTI_KEEP_PREVIOUS_SPEED_RESOLUTION 0x00 138 #define LTC24XX_HS_MULTI_SPEED_1X 0x00 139 #define LTC24XX_HS_MULTI_SPEED_2X 0x08 148 #define LTC24XX_EZ_MULTI_VIN 0b10000000 149 #define LTC24XX_EZ_MULTI_PTAT 0b11000000 152 #define LTC24XX_EZ_MULTI_R50 0b10010000 153 #define LTC24XX_EZ_MULTI_R55 0b10000000 154 #define LTC24XX_EZ_MULTI_R60 0b10100000 157 #define LTC24XX_EZ_MULTI_SLOW 0b10000000 // slow output rate with autozero 158 #define LTC24XX_EZ_MULTI_FAST 0b10001000 // fast output rate with no autozero 182 #define LTC24XX_MULTI_CH_CH0 0xB0 183 #define LTC24XX_MULTI_CH_CH1 0xB8 184 #define LTC24XX_MULTI_CH_CH2 0xB1 185 #define LTC24XX_MULTI_CH_CH3 0xB9 186 #define LTC24XX_MULTI_CH_CH4 0xB2 187 #define LTC24XX_MULTI_CH_CH5 0xBA 188 #define LTC24XX_MULTI_CH_CH6 0xB3 189 #define LTC24XX_MULTI_CH_CH7 0xBB 190 #define LTC24XX_MULTI_CH_CH8 0xB4 191 #define LTC24XX_MULTI_CH_CH9 0xBC 192 #define LTC24XX_MULTI_CH_CH10 0xB5 193 #define LTC24XX_MULTI_CH_CH11 0xBD 194 #define LTC24XX_MULTI_CH_CH12 0xB6 195 #define LTC24XX_MULTI_CH_CH13 0xBE 196 #define LTC24XX_MULTI_CH_CH14 0xB7 197 #define LTC24XX_MULTI_CH_CH15 0xBF 206 #define LTC24XX_MULTI_CH_P0_N1 0xA0 207 #define LTC24XX_MULTI_CH_P1_N0 0xA8 209 #define LTC24XX_MULTI_CH_P2_N3 0xA1 210 #define LTC24XX_MULTI_CH_P3_N2 0xA9 212 #define LTC24XX_MULTI_CH_P4_N5 0xA2 213 #define LTC24XX_MULTI_CH_P5_N4 0xAA 215 #define LTC24XX_MULTI_CH_P6_N7 0xA3 216 #define LTC24XX_MULTI_CH_P7_N6 0xAB 218 #define LTC24XX_MULTI_CH_P8_N9 0xA4 219 #define LTC24XX_MULTI_CH_P9_N8 0xAC 221 #define LTC24XX_MULTI_CH_P10_N11 0xA5 222 #define LTC24XX_MULTI_CH_P11_N10 0xAD 224 #define LTC24XX_MULTI_CH_P12_N13 0xA6 225 #define LTC24XX_MULTI_CH_P13_N12 0xAE 227 #define LTC24XX_MULTI_CH_P14_N15 0xA7 228 #define LTC24XX_MULTI_CH_P15_N14 0xAF 242 #define LTC24XX_MULTI_CH_OSR_64 0x10 243 #define LTC24XX_MULTI_CH_OSR_128 0x20 244 #define LTC24XX_MULTI_CH_OSR_256 0x30 245 #define LTC24XX_MULTI_CH_OSR_512 0x40 246 #define LTC24XX_MULTI_CH_OSR_1024 0x50 247 #define LTC24XX_MULTI_CH_OSR_2048 0x60 248 #define LTC24XX_MULTI_CH_OSR_4096 0x70 249 #define LTC24XX_MULTI_CH_OSR_8192 0x80 250 #define LTC24XX_MULTI_CH_OSR_16384 0x90 251 #define LTC24XX_MULTI_CH_OSR_32768 0xF0 258 uint16_t miso_timeout
285 uint8_t adc_command_high,
286 uint8_t adc_command_low,
294 uint8_t *adc_channel,
320 uint8_t adc_command_high,
321 uint8_t adc_command_low,
337 uint8_t *adc_channel,
371 uint8_t adc_command_high,
372 uint8_t adc_command_low,
404 uint8_t adc_command_high,
405 uint8_t adc_command_low,
429 int32_t LTC24XX_offset_code
439 int32_t *LTC24XX_offset_code
497 #endif // LTC24XX_general_H void LTC24XX_SPI_8bit_command_32bit_data(uint8_t cs, uint8_t adc_command, int32_t *adc_code)
Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result.
void LTC24XX_SPI_8bit_command_24bit_data(uint8_t cs, uint8_t adc_command, int32_t *adc_code)
Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result.
void LTC24XX_SPI_2ch_ping_pong_24bit_data(uint8_t cs, uint8_t *adc_channel, int32_t *code)
Reads from LTC24XX two channel "Ping-Pong" ADC, placing the channel information in the adc_channel pa...
static uint8_t adc_command
void LTC24XX_SPI_16bit_command_32bit_data(uint8_t cs, uint8_t adc_command_high, uint8_t adc_command_low, int32_t *adc_code)
Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result.
void LTC24XX_SPI_8bit_command_16bit_data(uint8_t cs, uint8_t adc_command, int32_t *adc_code)
Reads from LTC24XX ADC that accepts a 8 bit configuration and returns a 16 bit result.
void LTC24XX_SPI_16bit_command_24bit_data(uint8_t cs, uint8_t adc_command_high, uint8_t adc_command_low, int32_t *adc_code)
Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result.
void LTC24XX_SPI_32bit_data(uint8_t cs, int32_t *adc_code)
Reads from LTC24XX ADC that has no configuration word and returns a 32 bit result.
int8_t LTC24XX_I2C_16bit_command_32bit_data(uint8_t i2c_address, uint8_t adc_command_high, uint8_t adc_command_low, int32_t *adc_code, uint16_t eoc_timeout)
Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result.
float LTC24XX_diff_code_to_voltage(int32_t adc_code, float vref)
Calculates the voltage corresponding to an ADC code, given the reference voltage. ...
int8_t LTC24XX_I2C_32bit_data(uint8_t i2c_address, int32_t *adc_code, uint16_t eoc_timeout)
Reads from LTC24XX ADC that has no configuration word and returns a 32 bit result.
int8_t LTC24XX_I2C_8bit_command_32bit_data(uint8_t i2c_address, uint8_t adc_command, int32_t *adc_code, uint16_t eoc_timeout)
Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result.
void LTC24XX_calibrate_voltage(int32_t zero_code, int32_t fs_code, float zero_voltage, float fs_voltage, float *LTC24XX_lsb, int32_t *LTC24XX_offset_code)
Calculate the lsb weight and offset code given a full-scale code and a measured zero-code.
float LTC24XX_diff_code_to_calibrated_voltage(int32_t adc_code, float LTC24XX_lsb, int32_t LTC24XX_offset_code)
Calculates the voltage corresponding to an ADC code, given lsb weight (in volts) and the calibrated A...
int8_t LTC24XX_EOC_timeout(uint8_t cs, uint16_t miso_timeout)
Checks for EOC with a specified timeout.
int8_t LTC24XX_I2C_16bit_command_24bit_data(uint8_t i2c_address, uint8_t adc_command_high, uint8_t adc_command_low, int32_t *adc_code, uint16_t eoc_timeout)
Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result.
static uint16_t eoc_timeout
timeout in ms
void LTC24XX_SPI_24bit_data(uint8_t cs, int32_t *adc_code)
Reads from LTC24XX ADC that has no configuration word and returns a 32 bit result.
float LTC24XX_SE_code_to_voltage(int32_t adc_code, float vref)
Calculates the voltage corresponding to an ADC code, given the reference voltage. ...
int8_t LTC24XX_I2C_8bit_command_24bit_data(uint8_t i2c_address, uint8_t adc_command, int32_t *adc_code, uint16_t eoc_timeout)
Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 32 bit result.
void LTC24XX_SPI_2ch_ping_pong_32bit_data(uint8_t cs, uint8_t *adc_channel, int32_t *code)
Reads from LTC24XX two channel "Ping-Pong" ADC, placing the channel information in the adc_channel pa...
int8_t LTC24XX_I2C_24bit_data(uint8_t i2c_address, int32_t *adc_code, uint16_t eoc_timeout)
Reads from LTC24XX ADC that has no configuration word and returns a 32 bit result.