COSA
An Object-Oriented Platform for Arduino Programming
|
#include <Si70XX.hh>
Public Member Functions | |
Si70XX () | |
bool | read_user_register (uint8_t ®) |
bool | read_electronic_serial_number (uint8_t snr[8]) |
bool | read_firmware_revision (uint8_t &rev) |
bool | measure_humidity () |
float | read_humidity () |
float | read_humidity_temperature () |
bool | measure_temperature () |
float | read_temperature () |
Protected Types | |
enum | Command { MEASURE_RH_HOLD = 0xE5, MEASURE_RH_NO_HOLD = 0xF5, MEASURE_TEMP_HOLD = 0xE3, MEASURE_TEMP_NO_HOLD = 0xF3, READ_RH_TEMP = 0xE0, RESET = 0xFE, WRITE_RHT_USER_REG_1 = 0xE6, READ_RHT_USER_REG_1 = 0xE7, READ_ID_1 = 0xFA0F, READ_ID_2 = 0xFCC8, READ_REV = 0x84B8 } |
Protected Member Functions | |
bool | issue (uint8_t cmd) |
bool | read (uint16_t &value, bool check=true) |
bool | read (uint8_t cmd, uint8_t &value) |
Private Member Functions | |
bool | is_async () const |
void | sync_request () |
void | async_request () |
virtual void | on_completion (uint8_t type, int count) |
Private Attributes | |
uint8_t | m_addr |
bool | m_async |
Cosa TWI driver for Silicon Labs, Si70XX I2C Humidity and Temperature Sensor. The device driver does not block on measurements.
The GY-21 module with pull-up resistors for TWI signals and 3V3 internal voltage converter.
|
protected |
I2C Command Table (See tab. 11, pp. 19).
|
protected |
Issue given command. Return true(1) if successful otherwise false(0).
[in] | cmd | command. |
Definition at line 35 of file Si70XX.cpp.
|
inline |
Issue a humidity measurement. Call read_humidity() for result of measurement. Return true(1) if successful otherwise false(0).
|
inline |
Issue a temperature measurement. Call read_temperature() for result of measurement. Return true(1) if successful otherwise false(0).
|
protected |
Read 16-bit value after issued command. Return true(1) if successful otherwise false(0).
[out] | value | register value. |
[in] | check | crc value (default true). |
Definition at line 46 of file Si70XX.cpp.
|
protected |
Read 8-bit register value given command. Return true(1) if successful otherwise false(0).
[in] | cmd | command. |
[out] | value | register value. |
Definition at line 72 of file Si70XX.cpp.
bool Si70XX::read_electronic_serial_number | ( | uint8_t | snr[8] | ) |
Read electronic serial number, Return true(1) if successful otherwise false(0).
[out] | snr | serial number register (64-bits). |
Definition at line 87 of file Si70XX.cpp.
bool Si70XX::read_firmware_revision | ( | uint8_t & | rev | ) |
Read firmware revision, Return true(1) if successful otherwise false(0).
[out] | rev | revision code. |
Definition at line 135 of file Si70XX.cpp.
|
inline |
|
inline |
|
inline |
|
inline |