29 #define ADC121C021_I2C_BUS 0 30 #define ADC121C021_DEFAULT_I2C_ADDR 0x55 32 #define ADC121C021_RESOLUTION 4096 // 12 bits 38 #define ADC121C021_REG_RESULT 0x00 39 #define ADC121C021_REG_ALERT_STATUS 0x01 40 #define ADC121C021_REG_CONFIG 0x02 41 #define ADC121C021_REG_ALERT_LIM_UNDER 0x03 42 #define ADC121C021_REG_ALERT_LIM_OVER 0x04 43 #define ADC121C021_REG_ALERT_HYS 0x05 44 #define ADC121C021_REG_LOWEST_CONV 0x06 45 #define ADC121C021_REG_HIGHEST_CONV 0x07 48 #define ADC121C021_DEFAULT_VREF 3.0 62 typedef enum { ADC121C021_CYCLE_NONE = 0,
63 ADC121C021_CYCLE_32 = 1,
64 ADC121C021_CYCLE_64 = 2,
65 ADC121C021_CYCLE_128 = 3,
66 ADC121C021_CYCLE_256 = 4,
67 ADC121C021_CYCLE_512 = 5,
68 ADC121C021_CYCLE_1024 = 6,
69 ADC121C021_CYCLE_2048 = 7
100 ADC121C021(
int bus, uint8_t address = ADC121C021_DEFAULT_I2C_ADDR,
101 float vref = ADC121C021_DEFAULT_VREF);
115 mraa_result_t
writeByte(uint8_t reg, uint8_t byte);
124 mraa_result_t
writeWord(uint8_t reg, uint16_t word);
306 mraa_i2c_context m_i2c;
void setAutomaticConversion(ADC121C021_CYCLE_TIME_T cycleTime)
Definition: adc121c021.cxx:211
mraa_result_t writeWord(uint8_t reg, uint16_t word)
Definition: adc121c021.cxx:70
mraa_result_t clearHighestConversion()
Definition: adc121c021.cxx:261
bool getAlertStatus()
Definition: adc121c021.cxx:122
bool alertHighTriggered()
Definition: adc121c021.hpp:181
ADC121C021(int bus, uint8_t address=ADC121C021_DEFAULT_I2C_ADDR, float vref=ADC121C021_DEFAULT_VREF)
Definition: adc121c021.cxx:35
mraa_result_t writeByte(uint8_t reg, uint8_t byte)
Definition: adc121c021.cxx:65
ADC121C021_CYCLE_TIME_T
Definition: adc121c021.hpp:62
float valueToVolts(uint16_t val)
Definition: adc121c021.cxx:112
mraa_result_t setHysteresis(uint16_t limit)
Definition: adc121c021.cxx:242
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
~ADC121C021()
Definition: adc121c021.cxx:60
void enableAlertHold(bool enable)
Definition: adc121c021.cxx:183
uint16_t getLowestConversion()
Definition: adc121c021.cxx:256
bool alertLowTriggered()
Definition: adc121c021.hpp:173
mraa_result_t clearLowestConversion()
Definition: adc121c021.cxx:266
void clearAlertStatus()
Definition: adc121c021.cxx:146
void enableAlertPinPolarityHigh(bool enable)
Definition: adc121c021.cxx:197
void enableAlertFlag(bool enable)
Definition: adc121c021.cxx:155
mraa_result_t setAlertHighLimit(uint16_t limit)
Definition: adc121c021.cxx:233
API for the ADC121C021 I2C Analog-to-Digital Converter.
Definition: adc121c021.hpp:91
uint16_t value()
Definition: adc121c021.cxx:106
uint16_t getHighestConversion()
Definition: adc121c021.cxx:251
uint16_t readWord(uint8_t reg)
Definition: adc121c021.cxx:89
uint8_t readByte(uint8_t reg)
Definition: adc121c021.cxx:80
mraa_result_t setAlertLowLimit(uint16_t limit)
Definition: adc121c021.cxx:224
void enableAlertPin(bool enable)
Definition: adc121c021.cxx:169