30 #define AM2315_NAME "am2315"
31 #define AM2315_I2C_ADDRESS 0x5c
33 #define AM2315_READ 0x03
34 #define AM2315_WRITE 0x10
37 #define AM2315_HUMIDITY 0x00
38 #define AM2315_TEMP 0x02
39 #define AM2315_MODEL 0x08
40 #define AM2315_VERSION 0x0A
41 #define AM2315_ID 0x0B
42 #define AM2315_STATUS 0x0F
43 #define AM2315_USER_A 0x10
44 #define AM2315_USER_B 0x12
46 #define AM2315_SAMPLE 2
48 #define HIGH_PRIORITY 99
89 AM2315 (
int bus,
int devAddr=AM2315_I2C_ADDRESS);
183 mraa_i2c_context m_i2ControlCtx;
185 void update_values(
void);
186 uint8_t i2cReadReg(
int reg, uint8_t* data,
int ilen);
187 int i2cWriteReg(uint8_t reg, uint8_t* data, uint8_t ilen);
188 uint16_t crc16(uint8_t* ptr, uint8_t len);
190 int32_t m_temperature;
200 pthread_t this_thread;
int i2cWriteReg_32(int reg, uint32_t ival)
Definition: am2315.cpp:273
AM2315(int bus, int devAddr=AM2315_I2C_ADDRESS)
Definition: am2315.cpp:39
~AM2315()
Definition: am2315.cpp:72
float getHumidity(void)
Definition: am2315.cpp:107
API for the AM2315 Temperature & Humidity Sensor.
Definition: am2315.h:80
uint8_t i2cReadReg_8(int reg)
Definition: am2315.cpp:314
float getTemperatureF(void)
Definition: am2315.cpp:101
int testSensor(void)
Definition: am2315.cpp:120
float getTemperature(void)
Definition: am2315.cpp:94
int i2cWriteReg_8(int reg, uint8_t ival)
Definition: am2315.cpp:291
uint32_t i2cReadReg_32(int reg)
Definition: am2315.cpp:299
uint16_t i2cReadReg_16(int reg)
Definition: am2315.cpp:307
int i2cWriteReg_16(int reg, uint16_t ival)
Definition: am2315.cpp:283