/*---------------------------------------- * @File: ads1112_defs.h * @Brief: * @Author: jwm * @Date: Aug-07 * * ADS1112 characteristics * playing around with some stuff for moment. *----------------------------------------*/ // These define both the ADC index # (0-3) with their I2C addresses #define ADCxy0 0x48 // level sensors #define ADCxy1 0x4A #define ADCxy2 0x4C #define ADCxy3 0x4E #define ADC0 0x49 // PAR sensors #define ADC1 0x4B #define ADC2 0x4D #define ADC3 0x4F #define READ15HZ 0x8c // Command to Read, Single, 15hz, Rate Bits 2,3 #define READ30HZ 0x88 // Command to Read, Single, 15hz, losing 1bit of resolution... #define READ60HZ 0x84 // Command to Read, Single, 15hz #define READ240HZ 0x80 // Command to Read, Single, 15hz #define GAIN0 0 // Gain Bits 0,1 #define GAIN2 1 #define GAIN4 2 #define GAIN8 3 #define CHAN_SE0 0x40 // Channel Bits 5,6 #define CHAN_SE1 0x60 #define CHAN_SE2 0x20 #define CHAN_DIFF0 0x00 #define CHAN_DIFF1 0x20 // Same a SE2 #define CONTINUOUS_CONVERSION 0x00 // bit4 'sc' mask =0 for this #define SINGLE_CONVERSION 0x10 // bit4 'sc' mask =1 for this // These may be redundant, only for menuing/doc perhaps // because the index is what's actually used in the ADS1112 config.reg. struct adsPGAvals {uint8_t setting; uint8_t gain; } adsPGA[4] = { {0,1}, // 0-2.048 (in se mode) {1,2}, // 0-1.024 {2,4}, // 0-0.512 {3,8}}; // 0-0.256vdc struct adsRangeStuff { uint8_t hz; uint8_t cfgRateBitMask; int minVal; uint16_t maxVal; } adsRange[4] = { {15, READ15HZ, 0x8000, 0x7fff}, // -32768, 32767}, {30, READ30HZ, 0xc000, 0x3fff}, // -16384, 16383}, {60, READ60HZ, 0xe000, 0x1fff}, // -8192, 8191}, {240, READ240HZ, 0xf800, 0x07ff}}; // -2048, 2047