Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_tag_temperature.c
1 #include <bc_tag_temperature.h>
2 
4 {
5  bc_tmp112_init(self, i2c_channel, (uint8_t) i2c_address);
6 }
7 
8 void bc_tag_temperature_set_event_handler(bc_tag_temperature_t *self, void (*event_handler)(bc_tag_temperature_t *, bc_tag_temperature_event_t, void *), void *event_param)
9 {
10  bc_tmp112_set_event_handler(self, (void (*)(bc_tmp112_t *, bc_tmp112_event_t, void *)) event_handler, event_param);
11 }
12 
14 {
15  bc_tmp112_set_update_interval(self, interval);
16 }
17 
19 {
20  return bc_tmp112_measure(self);
21 }
22 
24 {
25  return bc_tmp112_get_temperature_raw(self, raw);
26 }
27 
29 {
30  return bc_tmp112_get_temperature_celsius(self, celsius);
31 }
32 
34 {
35  return bc_tmp112_get_temperature_fahrenheit(self, fahrenheit);
36 }
37 
39 {
40  return bc_tmp112_get_temperature_kelvin(self, kelvin);
41 }
bool bc_tag_temperature_get_temperature_celsius(bc_tag_temperature_t *self, float *celsius)
Get measured temperature in degrees of Celsius.
void bc_tmp112_init(bc_tmp112_t *self, bc_i2c_channel_t i2c_channel, uint8_t i2c_address)
Initialize TMP112.
Definition: bc_tmp112.c:11
uint64_t bc_tick_t
Timestamp data type.
Definition: bc_tick.h:16
void bc_tag_temperature_set_update_interval(bc_tag_temperature_t *self, bc_tick_t interval)
Set measurement interval.
bc_tmp112_event_t
Callback events.
Definition: bc_tmp112.h:13
bool bc_tag_temperature_get_temperature_kelvin(bc_tag_temperature_t *self, float *kelvin)
Get measured temperature in kelvin.
bool bc_tag_temperature_measure(bc_tag_temperature_t *self)
Start measurement manually.
bool bc_tag_temperature_get_temperature_raw(bc_tag_temperature_t *self, int16_t *raw)
Get measured temperature as raw value.
bc_tag_temperature_i2c_address_t
I2C address.
bool bc_tmp112_get_temperature_fahrenheit(bc_tmp112_t *self, float *fahrenheit)
Get measured temperature in degrees of Fahrenheit.
Definition: bc_tmp112.c:97
void bc_tmp112_set_update_interval(bc_tmp112_t *self, bc_tick_t interval)
Set measurement interval.
Definition: bc_tmp112.c:41
struct bc_tmp112_t bc_tmp112_t
TMP112 instance.
Definition: bc_tmp112.h:25
bool bc_tmp112_get_temperature_kelvin(bc_tmp112_t *self, float *kelvin)
Get measured temperature in kelvin.
Definition: bc_tmp112.c:111
bool bc_tmp112_get_temperature_celsius(bc_tmp112_t *self, float *celsius)
Get measured temperature in degrees of Celsius.
Definition: bc_tmp112.c:83
void bc_tag_temperature_init(bc_tag_temperature_t *self, bc_i2c_channel_t i2c_channel, bc_tag_temperature_i2c_address_t i2c_address)
Initialize BigClown Temperature Tag.
void bc_tmp112_set_event_handler(bc_tmp112_t *self, void(*event_handler)(bc_tmp112_t *, bc_tmp112_event_t, void *), void *event_param)
Set callback function.
Definition: bc_tmp112.c:35
bc_i2c_channel_t
I2C channels.
Definition: bc_i2c.h:15
void bc_tag_temperature_set_event_handler(bc_tag_temperature_t *self, void(*event_handler)(bc_tag_temperature_t *, bc_tag_temperature_event_t, void *), void *event_param)
Set callback function.
bc_tmp112_t bc_tag_temperature_t
BigClown Temperature Tag instance.
bool bc_tag_temperature_get_temperature_fahrenheit(bc_tag_temperature_t *self, float *fahrenheit)
Get measured temperature in degrees of Fahrenheit.
bool bc_tmp112_measure(bc_tmp112_t *self)
Start measurement manually.
Definition: bc_tmp112.c:57
bc_tag_temperature_event_t
Callback events.
bool bc_tmp112_get_temperature_raw(bc_tmp112_t *self, int16_t *raw)
Get measured temperature as raw value.
Definition: bc_tmp112.c:71