1 #include <twr_tag_humidity.h>
13 memset(
self, 0,
sizeof(*
self));
15 self->_revision = revision;
45 self->_event_handler = event_handler;
46 self->_event_param = event_param;
175 if (self->_event_handler != NULL)
194 if (self->_event_handler != NULL)
213 if (self->_event_handler != NULL)
232 if (self->_event_handler != NULL)
twr_hdc2080_event_t
Callback events.
struct twr_hdc2080_t twr_hdc2080_t
HDC2080 instance.
void twr_hdc2080_init(twr_hdc2080_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address)
Initialize HDC2080.
bool twr_hdc2080_get_temperature_celsius(twr_hdc2080_t *self, float *celsius)
Get measured temperature in degrees of Celsius.
bool twr_hdc2080_get_temperature_raw(twr_hdc2080_t *self, uint16_t *raw)
Get measured temperature as raw value.
bool twr_hdc2080_measure(twr_hdc2080_t *self)
Start measurement manually.
bool twr_hdc2080_get_humidity_percentage(twr_hdc2080_t *self, float *percentage)
Get measured humidity as percentage.
bool twr_hdc2080_get_humidity_raw(twr_hdc2080_t *self, uint16_t *raw)
Get measured humidity as raw value.
void twr_hdc2080_set_update_interval(twr_hdc2080_t *self, twr_tick_t interval)
Set measurement interval.
void twr_hdc2080_set_event_handler(twr_hdc2080_t *self, void(*event_handler)(twr_hdc2080_t *, twr_hdc2080_event_t, void *), void *event_param)
Set callback function.
@ TWR_HDC2080_EVENT_UPDATE
Update event.
@ TWR_HDC2080_EVENT_ERROR
Error event.
void twr_hts221_set_update_interval(twr_hts221_t *self, twr_tick_t interval)
Set measurement interval.
bool twr_hts221_measure(twr_hts221_t *self)
Start measurement manually.
struct twr_hts221_t twr_hts221_t
HTS221 instance.
bool twr_hts221_get_humidity_percentage(twr_hts221_t *self, float *percentage)
Get measured humidity as percentage.
void twr_hts221_set_event_handler(twr_hts221_t *self, void(*event_handler)(twr_hts221_t *, twr_hts221_event_t, void *), void *event_param)
Set callback function.
void twr_hts221_init(twr_hts221_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address)
Initialize HTS221.
twr_hts221_event_t
Callback events.
@ TWR_HTS221_EVENT_ERROR
Error event.
@ TWR_HTS221_EVENT_UPDATE
Update event.
twr_i2c_channel_t
I2C channels.
bool twr_sht20_get_temperature_celsius(twr_sht20_t *self, float *celsius)
Get measured temperature in degrees of Celsius.
struct twr_sht20_t twr_sht20_t
SHT20 instance.
void twr_sht20_init(twr_sht20_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address)
Initialize SHT20.
bool twr_sht20_measure(twr_sht20_t *self)
Start measurement manually.
void twr_sht20_set_update_interval(twr_sht20_t *self, twr_tick_t interval)
Set measurement interval.
bool twr_sht20_get_temperature_raw(twr_sht20_t *self, uint16_t *raw)
Get measured temperature as raw value.
bool twr_sht20_get_humidity_raw(twr_sht20_t *self, uint16_t *raw)
Get measured humidity as raw value.
bool twr_sht20_get_humidity_percentage(twr_sht20_t *self, float *percentage)
Get measured humidity as percentage.
void twr_sht20_set_event_handler(twr_sht20_t *self, void(*event_handler)(twr_sht20_t *, twr_sht20_event_t, void *), void *event_param)
Set callback function.
twr_sht20_event_t
Callback events.
@ TWR_SHT20_EVENT_UPDATE
Update event.
@ TWR_SHT20_EVENT_ERROR
Error event.
void twr_sht30_set_update_interval(twr_sht30_t *self, twr_tick_t interval)
Set measurement interval.
bool twr_sht30_get_temperature_celsius(twr_sht30_t *self, float *celsius)
Get measured temperature in degrees of Celsius.
bool twr_sht30_measure(twr_sht30_t *self)
Start measurement manually.
struct twr_sht30_t twr_sht30_t
SHT30 instance.
twr_sht30_event_t
Callback events.
void twr_sht30_set_event_handler(twr_sht30_t *self, void(*event_handler)(twr_sht30_t *, twr_sht30_event_t, void *), void *event_param)
Set callback function.
bool twr_sht30_get_humidity_percentage(twr_sht30_t *self, float *percentage)
Get measured humidity as percentage.
void twr_sht30_init(twr_sht30_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address)
Initialize SHT30.
bool twr_sht30_get_temperature_raw(twr_sht30_t *self, uint16_t *raw)
Get measured temperature as raw value.
bool twr_sht30_get_humidity_raw(twr_sht30_t *self, uint16_t *raw)
Get measured humidity as raw value.
@ TWR_SHT30_EVENT_ERROR
Error event.
@ TWR_SHT30_EVENT_UPDATE
Update event.
bool twr_tag_humidity_get_temperature_raw(twr_tag_humidity_t *self, uint16_t *raw)
Get measured temperature as raw value.
bool twr_tag_humidity_measure(twr_tag_humidity_t *self)
Start measurement manually.
struct twr_tag_humidity_t twr_tag_humidity_t
HARDWARIO Humidity Module instance.
void twr_tag_humidity_set_update_interval(twr_tag_humidity_t *self, twr_tick_t interval)
Set measurement interval.
twr_tag_humidity_revision_t
Humidity Tag hardware revision.
bool twr_tag_humidity_get_humidity_raw(twr_tag_humidity_t *self, uint16_t *raw)
Get measured humidity as raw value.
bool twr_tag_humidity_get_temperature_celsius(twr_tag_humidity_t *self, float *celsius)
Get measured temperature in degrees of Celsius.
bool twr_tag_humidity_get_humidity_percentage(twr_tag_humidity_t *self, float *percentage)
Get measured humidity as percentage.
twr_tag_humidity_i2c_address_t
I2C address.
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.
twr_tag_humidity_event_t
Callback events.
void twr_tag_humidity_set_event_handler(twr_tag_humidity_t *self, void(*event_handler)(twr_tag_humidity_t *, twr_tag_humidity_event_t, void *), void *event_param)
Set callback function.
@ TWR_TAG_HUMIDITY_REVISION_R3
Hardware revision R3.
@ TWR_TAG_HUMIDITY_REVISION_R1
Hardware revision R1.
@ TWR_TAG_HUMIDITY_REVISION_R2
Hardware revision R2.
@ TWR_TAG_HUMIDITY_I2C_ADDRESS_DEFAULT
Default I2C address.
@ TWR_TAG_HUMIDITY_EVENT_UPDATE
Update event.
@ TWR_TAG_HUMIDITY_EVENT_ERROR
Error event.
uint64_t twr_tick_t
Timestamp data type.