|
upm
0.3.1
Sensor/Actuator repository for libmraa (v0.7.2)
|
API for AM2315 chip (Temperature & Humidity Sensor) More...
Measurement Specialties AM2315 is a digital humidity sensor with temperature output. RH will report between 0 and 100% and temperature range is -40 to +125 degC. The sampling period of this sensor is 2 seconds. Reads occurring more often than that will return cached data.
Public Member Functions | |
| AM2315 (int bus, int devAddr=AM2315_I2C_ADDRESS) | |
| ~AM2315 () | |
| float | getHumidity (void) |
| float | getTemperature (void) |
| float | getTemperatureF (void) |
| int | testSensor (void) |
| int | i2cWriteReg_32 (int reg, uint32_t ival) |
| int | i2cWriteReg_16 (int reg, uint16_t ival) |
| int | i2cWriteReg_8 (int reg, uint8_t ival) |
| uint32_t | i2cReadReg_32 (int reg) |
| uint16_t | i2cReadReg_16 (int reg) |
| uint8_t | i2cReadReg_8 (int reg) |
| AM2315 | ( | int | bus, |
| int | devAddr = AM2315_I2C_ADDRESS |
||
| ) |
| float getHumidity | ( | void | ) |
Get the current measured humidity [RH] Data is updated every 2 seconds - accesses more often than that will return cached data

| float getTemperature | ( | void | ) |
Get the humidity cell temperature [degC] Data is updated every 2 seconds - accesses more often than that will return cached data

| float getTemperatureF | ( | void | ) |
Get the humidity cell temperature [degF] Data is updated every 2 seconds - accesses more often than that will return cached data

| int testSensor | ( | void | ) |
Function intended to test the device and verify it is correctly operating.

| int i2cWriteReg_32 | ( | int | reg, |
| uint32_t | ival | ||
| ) |
Write four byte (32b) register
Note: These access routines are not the normal accesses to an i2c device. The AM2315 contains a microcontroller that manages the actual readings. These handlers then make requests over i2c using a protocol defined by the AM2315.
| reg | address of a register |
| ival | 32b value |
| int i2cWriteReg_16 | ( | int | reg, |
| uint16_t | ival | ||
| ) |
Write two byte (16b) register
| reg | address of a register |
| ival | 16b value |
| int i2cWriteReg_8 | ( | int | reg, |
| uint8_t | ival | ||
| ) |
Write one byte (8b) register
| reg | address of a register |
| ival | 8b value |
| uint32_t i2cReadReg_32 | ( | int | reg | ) |
Read four bytes register
| reg | address of a register |

| uint16_t i2cReadReg_16 | ( | int | reg | ) |
Read two bytes register
| reg | address of a register |

| uint8_t i2cReadReg_8 | ( | int | reg | ) |
Read one byte register
| reg | address of a register |

1.8.9.1