Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_tag_humidity.h
1 #ifndef _BC_TAG_HUMIDITY_H
2 #define _BC_TAG_HUMIDITY_H
3 
4 #include <bc_hts221.h>
5 #include <bc_hdc2080.h>
6 #include <bc_sht20.h>
7 #include <bc_sht30.h>
8 
12 
14 
15 typedef enum
16 {
19 
22 
25 
28 
29 
31 
33 
34 typedef enum
35 {
38 
41 
43 
45 
46 typedef enum
47 {
50 
53 
55 
57 
59 
61 
62 struct bc_tag_humidity_t
63 {
65  void (*_event_handler)(bc_tag_humidity_t *, bc_tag_humidity_event_t, void *);
66  void *_event_param;
67  union
68  {
69  bc_hts221_t hts221;
70  bc_hdc2080_t hdc2080;
71  bc_sht20_t sht20;
72  bc_sht30_t sht30;
73  } _sensor;
74 };
75 
77 
83 
85 
90 
91 void bc_tag_humidity_set_event_handler(bc_tag_humidity_t *self, void (*event_handler)(bc_tag_humidity_t *, bc_tag_humidity_event_t, void *), void *event_param);
92 
96 
98 
103 
105 
111 
112 bool bc_tag_humidity_get_temperature_raw(bc_tag_humidity_t *self, uint16_t *raw);
113 
119 
121 
127 
128 bool bc_tag_humidity_get_humidity_raw(bc_tag_humidity_t *self, uint16_t *raw);
129 
135 
136 bool bc_tag_humidity_get_humidity_percentage(bc_tag_humidity_t *self, float *percentage);
137 
139 
140 #endif // _BC_TAG_HUMIDITY_H
struct bc_hdc2080_t bc_hdc2080_t
HDC2080 instance.
Definition: bc_hdc2080.h:25
uint64_t bc_tick_t
Timestamp data type.
Definition: bc_tick.h:16
bc_tag_humidity_event_t
Callback events.
bool bc_tag_humidity_measure(bc_tag_humidity_t *self)
Start measurement manually.
struct bc_sht30_t bc_sht30_t
SHT30 instance.
Definition: bc_sht30.h:28
void bc_tag_humidity_set_event_handler(bc_tag_humidity_t *self, void(*event_handler)(bc_tag_humidity_t *, bc_tag_humidity_event_t, void *), void *event_param)
Set callback function.
struct bc_tag_humidity_t bc_tag_humidity_t
BigClown Humidity Tag instance.
bool bc_tag_humidity_get_humidity_percentage(bc_tag_humidity_t *self, float *percentage)
Get measured humidity as percentage.
Hardware revision R1.
void bc_tag_humidity_init(bc_tag_humidity_t *self, bc_tag_humidity_revision_t revision, bc_i2c_channel_t i2c_channel, bc_tag_humidity_i2c_address_t i2c_address)
Initialize BigClown Humidity Tag.
bc_tag_humidity_i2c_address_t
I2C address.
bool bc_tag_humidity_get_temperature_raw(bc_tag_humidity_t *self, uint16_t *raw)
Get measured temperature as raw value.
Hardware revision R3.
struct bc_hts221_t bc_hts221_t
HTS221 instance.
Definition: bc_hts221.h:25
bool bc_tag_humidity_get_humidity_raw(bc_tag_humidity_t *self, uint16_t *raw)
Get measured humidity as raw value.
struct bc_sht20_t bc_sht20_t
SHT20 instance.
Definition: bc_sht20.h:25
bc_i2c_channel_t
I2C channels.
Definition: bc_i2c.h:15
bool bc_tag_humidity_get_temperature_celsius(bc_tag_humidity_t *self, float *celsius)
Get measured temperature in degrees of Celsius.
bc_tag_humidity_revision_t
Humidity Tag hardware revision.
void bc_tag_humidity_set_update_interval(bc_tag_humidity_t *self, bc_tick_t interval)
Set measurement interval.
Hardware revision R2.
Hardware revision R4.