Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_mpl3115a2

Driver for MPL3115A2 pressure/altitude sensor. More...

Typedefs

typedef struct bc_mpl3115a2_t bc_mpl3115a2_t
 MPL3115A2 instance.
 

Enumerations

enum  bc_mpl3115a2_event_t {
  BC_MPL3115A2_EVENT_ERROR = 0,
  BC_MPL3115A2_EVENT_UPDATE = 1
}
 Callback events. More...
 

Functions

void bc_mpl3115a2_init (bc_mpl3115a2_t *self, bc_i2c_channel_t i2c_channel, uint8_t i2c_address)
 Initialize MPL3115A2. More...
 
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. More...
 
void bc_mpl3115a2_set_update_interval (bc_mpl3115a2_t *self, bc_tick_t interval)
 Set measurement interval. More...
 
bool bc_mpl3115a2_measure (bc_mpl3115a2_t *self)
 Start measurement manually. More...
 
bool bc_mpl3115a2_get_altitude_meter (bc_mpl3115a2_t *self, float *meter)
 Get measured altitude in meters. More...
 
bool bc_mpl3115a2_get_pressure_pascal (bc_mpl3115a2_t *self, float *pascal)
 Get measured pressured in Pascal. More...
 

Detailed Description

Driver for MPL3115A2 pressure/altitude sensor.

Enumeration Type Documentation

Callback events.

Enumerator
BC_MPL3115A2_EVENT_ERROR 

Error event.

BC_MPL3115A2_EVENT_UPDATE 

Update event.

Definition at line 13 of file bc_mpl3115a2.h.

Function Documentation

bool bc_mpl3115a2_get_altitude_meter ( bc_mpl3115a2_t self,
float *  meter 
)

Get measured altitude in meters.

Parameters
[in]selfInstance
[in]meterPointer to variable where result will be stored
Returns
true When value is valid
false When value is invalid

Definition at line 62 of file bc_mpl3115a2.c.

Referenced by bc_module_climate_get_altitude_meter(), and bc_tag_barometer_get_altitude_meter().

Here is the caller graph for this function:

bool bc_mpl3115a2_get_pressure_pascal ( bc_mpl3115a2_t self,
float *  pascal 
)

Get measured pressured in Pascal.

Parameters
[in]selfInstance
[in]pascalPointer to variable where result will be stored
Returns
true When value is valid
false When value is invalid

Definition at line 76 of file bc_mpl3115a2.c.

Referenced by bc_module_climate_get_pressure_pascal(), and bc_tag_barometer_get_pressure_pascal().

Here is the caller graph for this function:

void bc_mpl3115a2_init ( bc_mpl3115a2_t self,
bc_i2c_channel_t  i2c_channel,
uint8_t  i2c_address 
)

Initialize MPL3115A2.

Parameters
[in]selfInstance
[in]i2c_channelI2C channel
[in]i2c_addressI2C device address

Definition at line 11 of file bc_mpl3115a2.c.

Referenced by bc_module_climate_init(), and bc_tag_barometer_init().

Here is the call graph for this function:

Here is the caller graph for this function:

bool bc_mpl3115a2_measure ( bc_mpl3115a2_t self)

Start measurement manually.

Parameters
[in]selfInstance
Returns
true On success
false When other measurement is in progress

Definition at line 48 of file bc_mpl3115a2.c.

Referenced by bc_module_climate_measure_all_sensors(), bc_module_climate_measure_barometer(), bc_mpl3115a2_set_update_interval(), and bc_tag_barometer_measure().

Here is the call graph for this function:

Here is the caller graph for this function:

void bc_mpl3115a2_set_event_handler ( bc_mpl3115a2_t self,
void(*)(bc_mpl3115a2_t *, bc_mpl3115a2_event_t, void *)  event_handler,
void *  event_param 
)

Set callback function.

Parameters
[in]selfInstance
[in]event_handlerFunction address
[in]event_paramOptional event parameter (can be NULL)

Definition at line 26 of file bc_mpl3115a2.c.

Referenced by bc_module_climate_init(), and bc_tag_barometer_set_event_handler().

Here is the caller graph for this function:

void bc_mpl3115a2_set_update_interval ( bc_mpl3115a2_t self,
bc_tick_t  interval 
)

Set measurement interval.

Parameters
[in]selfInstance
[in]intervalMeasurement interval

Definition at line 32 of file bc_mpl3115a2.c.

Referenced by bc_module_climate_set_update_interval_all_sensors(), bc_module_climate_set_update_interval_barometer(), and bc_tag_barometer_set_update_interval().

Here is the call graph for this function:

Here is the caller graph for this function: