Firmware SDK
|
Driver for HARDWARIO Humidity Module. More...
Typedefs | |
typedef struct twr_tag_humidity_t | twr_tag_humidity_t |
HARDWARIO Humidity Module instance. | |
Enumerations | |
enum | twr_tag_humidity_revision_t { TWR_TAG_HUMIDITY_REVISION_R1 = 0 , TWR_TAG_HUMIDITY_REVISION_R2 = 1 , TWR_TAG_HUMIDITY_REVISION_R3 = 2 , TWR_TAG_HUMIDITY_REVISION_R4 = 3 } |
Humidity Tag hardware revision. More... | |
enum | twr_tag_humidity_i2c_address_t { TWR_TAG_HUMIDITY_I2C_ADDRESS_DEFAULT = 0 , TWR_TAG_HUMIDITY_I2C_ADDRESS_ALTERNATE = 1 } |
I2C address. More... | |
enum | twr_tag_humidity_event_t { TWR_TAG_HUMIDITY_EVENT_ERROR = 0 , TWR_TAG_HUMIDITY_EVENT_UPDATE = 1 } |
Callback events. More... | |
Driver for HARDWARIO Humidity Module.
Callback events.
Enumerator | |
---|---|
TWR_TAG_HUMIDITY_EVENT_ERROR | Error event. |
TWR_TAG_HUMIDITY_EVENT_UPDATE | Update event. |
Definition at line 46 of file twr_tag_humidity.h.
I2C address.
Enumerator | |
---|---|
TWR_TAG_HUMIDITY_I2C_ADDRESS_DEFAULT | Default I2C address. |
TWR_TAG_HUMIDITY_I2C_ADDRESS_ALTERNATE | Alternate I2C address. |
Definition at line 34 of file twr_tag_humidity.h.
Humidity Tag hardware revision.
Definition at line 15 of file twr_tag_humidity.h.
bool twr_tag_humidity_get_humidity_percentage | ( | twr_tag_humidity_t * | self, |
float * | percentage | ||
) |
Get measured humidity as percentage.
[in] | self | Instance |
[in] | percentage | Pointer to variable where result will be stored |
Definition at line 149 of file twr_tag_humidity.c.
bool twr_tag_humidity_get_humidity_raw | ( | twr_tag_humidity_t * | self, |
uint16_t * | raw | ||
) |
Get measured humidity as raw value.
[in] | self | Instance |
[in] | raw | Pointer to variable where result will be stored |
Definition at line 129 of file twr_tag_humidity.c.
bool twr_tag_humidity_get_temperature_celsius | ( | twr_tag_humidity_t * | self, |
float * | celsius | ||
) |
Get measured temperature in degrees of Celsius.
[in] | self | Instance |
[in] | celsius | Pointer to variable where result will be stored |
Definition at line 109 of file twr_tag_humidity.c.
bool twr_tag_humidity_get_temperature_raw | ( | twr_tag_humidity_t * | self, |
uint16_t * | raw | ||
) |
Get measured temperature as raw value.
[in] | self | Instance |
[in] | raw | Pointer to variable where result will be stored |
Definition at line 89 of file twr_tag_humidity.c.
void twr_tag_humidity_init | ( | twr_tag_humidity_t * | self, |
twr_tag_humidity_revision_t | revision, | ||
twr_i2c_channel_t | i2c_channel, | ||
twr_tag_humidity_i2c_address_t | i2c_address | ||
) |
Initialize HARDWARIO Humidity Module.
[in] | self | Instance |
[in] | revision | Hardware revision of connected Humidity Tag |
[in] | i2c_channel | I2C channel |
[in] | i2c_address | I2C device address |
Definition at line 11 of file twr_tag_humidity.c.
bool twr_tag_humidity_measure | ( | twr_tag_humidity_t * | self | ) |
Start measurement manually.
[in] | self | Instance |
Definition at line 69 of file twr_tag_humidity.c.
void twr_tag_humidity_set_event_handler | ( | twr_tag_humidity_t * | self, |
void(*)(twr_tag_humidity_t *, twr_tag_humidity_event_t, void *) | event_handler, | ||
void * | event_param | ||
) |
Set callback function.
[in] | self | Instance |
[in] | event_handler | Function address |
[in] | event_param | Optional event parameter (can be NULL) |
Definition at line 43 of file twr_tag_humidity.c.
void twr_tag_humidity_set_update_interval | ( | twr_tag_humidity_t * | self, |
twr_tick_t | interval | ||
) |
Set measurement interval.
[in] | self | Instance |
[in] | interval | Measurement interval |
Definition at line 49 of file twr_tag_humidity.c.