Firmware SDK
twr_tag_temperature.h
1 #ifndef _TWR_TAG_TEMPERATURE_H
2 #define _TWR_TAG_TEMPERATURE_H
3 
4 #include <twr_tmp112.h>
5 
9 
11 
12 typedef enum
13 {
16 
19 
21 
23 
24 typedef enum
25 {
28 
31 
33 
35 
37 
42 
44 
49 
50 void twr_tag_temperature_set_event_handler(twr_tag_temperature_t *self, void (*event_handler)(twr_tag_temperature_t *, twr_tag_temperature_event_t, void *), void *event_param);
51 
55 
57 
62 
64 
70 
72 
78 
80 
86 
88 
94 
96 
98 
99 #endif // _TWR_TAG_TEMPERATURE_H
twr_i2c_channel_t
I2C channels.
Definition: twr_i2c.h:16
void twr_tag_temperature_init(twr_tag_temperature_t *self, twr_i2c_channel_t i2c_channel, twr_tag_temperature_i2c_address_t i2c_address)
Initialize HARDWARIO Temperature Module.
void twr_tag_temperature_set_event_handler(twr_tag_temperature_t *self, void(*event_handler)(twr_tag_temperature_t *, twr_tag_temperature_event_t, void *), void *event_param)
Set callback function.
void twr_tag_temperature_set_update_interval(twr_tag_temperature_t *self, twr_tick_t interval)
Set measurement interval.
bool twr_tag_temperature_get_temperature_celsius(twr_tag_temperature_t *self, float *celsius)
Get measured temperature in degrees of Celsius.
twr_tag_temperature_event_t
Callback events.
bool twr_tag_temperature_get_temperature_raw(twr_tag_temperature_t *self, int16_t *raw)
Get measured temperature as raw value.
bool twr_tag_temperature_get_temperature_fahrenheit(twr_tag_temperature_t *self, float *fahrenheit)
Get measured temperature in degrees of Fahrenheit.
bool twr_tag_temperature_get_temperature_kelvin(twr_tag_temperature_t *self, float *kelvin)
Get measured temperature in kelvin.
twr_tag_temperature_i2c_address_t
I2C address.
twr_tmp112_t twr_tag_temperature_t
HARDWARIO Temperature Module instance.
bool twr_tag_temperature_measure(twr_tag_temperature_t *self)
Start measurement manually.
@ TWR_TAG_TEMPERATURE_EVENT_ERROR
Error event.
@ TWR_TAG_TEMPERATURE_EVENT_UPDATE
Update event.
@ TWR_TAG_TEMPERATURE_I2C_ADDRESS_DEFAULT
Default I2C address.
@ TWR_TAG_TEMPERATURE_I2C_ADDRESS_ALTERNATE
Alternate I2C address.
uint64_t twr_tick_t
Timestamp data type.
Definition: twr_tick.h:16
struct twr_tmp112_t twr_tmp112_t
TMP112 instance.
Definition: twr_tmp112.h:25
@ TWR_TMP112_EVENT_ERROR
Error event.
Definition: twr_tmp112.h:16
@ TWR_TMP112_EVENT_UPDATE
Update event.
Definition: twr_tmp112.h:19