Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_tag_barometer.c
1 #include <bc_tag_barometer.h>
2 
4 {
5  bc_mpl3115a2_init(self, i2c_channel, 0x60);
6 }
7 
8 void bc_tag_barometer_set_event_handler(bc_tag_barometer_t *self, void (*event_handler)(bc_tag_barometer_t *, bc_tag_barometer_event_t, void *), void *event_param)
9 {
10  bc_mpl3115a2_set_event_handler(self, (void (*)(bc_mpl3115a2_t *, bc_mpl3115a2_event_t, void *)) event_handler, event_param);
11 }
12 
14 {
15  bc_mpl3115a2_set_update_interval(self, interval);
16 }
17 
19 {
20  return bc_mpl3115a2_measure(self);
21 }
22 
24 {
25  return bc_mpl3115a2_get_altitude_meter(self, meter);
26 }
27 
29 {
30  return bc_mpl3115a2_get_pressure_pascal(self, pascal);
31 }
uint64_t bc_tick_t
Timestamp data type.
Definition: bc_tick.h:16
bool bc_tag_barometer_get_altitude_meter(bc_tag_barometer_t *self, float *meter)
Get measured altitude in meters.
bool bc_tag_barometer_get_pressure_pascal(bc_tag_barometer_t *self, float *pascal)
Get measured pressure in Pascal.
struct bc_mpl3115a2_t bc_mpl3115a2_t
MPL3115A2 instance.
Definition: bc_mpl3115a2.h:25
bool bc_mpl3115a2_get_pressure_pascal(bc_mpl3115a2_t *self, float *pascal)
Get measured pressured in Pascal.
Definition: bc_mpl3115a2.c:76
bc_tag_barometer_event_t
Callback events.
bc_mpl3115a2_event_t
Callback events.
Definition: bc_mpl3115a2.h:13
void bc_mpl3115a2_init(bc_mpl3115a2_t *self, bc_i2c_channel_t i2c_channel, uint8_t i2c_address)
Initialize MPL3115A2.
Definition: bc_mpl3115a2.c:11
void bc_tag_barometer_set_update_interval(bc_tag_barometer_t *self, bc_tick_t interval)
Set measurement interval.
void bc_tag_barometer_init(bc_tag_barometer_t *self, bc_i2c_channel_t i2c_channel)
Initialize BigClown Barometer Tag.
bool bc_mpl3115a2_get_altitude_meter(bc_mpl3115a2_t *self, float *meter)
Get measured altitude in meters.
Definition: bc_mpl3115a2.c:62
void bc_tag_barometer_set_event_handler(bc_tag_barometer_t *self, void(*event_handler)(bc_tag_barometer_t *, bc_tag_barometer_event_t, void *), void *event_param)
Set callback function.
bc_i2c_channel_t
I2C channels.
Definition: bc_i2c.h:15
void bc_mpl3115a2_set_event_handler(bc_mpl3115a2_t *self, void(*event_handler)(bc_mpl3115a2_t *, bc_mpl3115a2_event_t, void *), void *event_param)
Set callback function.
Definition: bc_mpl3115a2.c:26
bc_mpl3115a2_t bc_tag_barometer_t
BigClown Barometer Tag instance.
bool bc_tag_barometer_measure(bc_tag_barometer_t *self)
Start measurement manually.
bool bc_mpl3115a2_measure(bc_mpl3115a2_t *self)
Start measurement manually.
Definition: bc_mpl3115a2.c:48
void bc_mpl3115a2_set_update_interval(bc_mpl3115a2_t *self, bc_tick_t interval)
Set measurement interval.
Definition: bc_mpl3115a2.c:32