The friendly Operating System for the Internet of Things

Interface definition for the MPL3115A2 sensor driver. More...

Detailed Description

Johann Fischer

Definition in file mpl3115a2.h.

#include <stdint.h>
#include <stdbool.h>
#include "periph/i2c.h"
+ Include dependency graph for mpl3115a2.h:

Go to the source code of this file.

Data Structures

struct  mpl3115a2_t
 Device descriptor for MPL3115A2 sensors. More...


#define MPL3115A2_I2C_ADDRESS   0x60
 Pressure Sensor Default Address.
#define MPL3115A2_OS_RATIO_1   0
 Oversample Ratio 1, conversion time 6 ms.
#define MPL3115A2_OS_RATIO_2   1
 Oversample Ratio 2, conversion time 10 ms.
#define MPL3115A2_OS_RATIO_4   2
 Oversample Ratio 4, conversion time 18 ms.
#define MPL3115A2_OS_RATIO_8   3
 Oversample Ratio 8, conversion time 34 ms.
#define MPL3115A2_OS_RATIO_16   4
 Oversample Ratio 16, conversion time 66 ms.
#define MPL3115A2_OS_RATIO_32   5
 Oversample Ratio 32, conversion time 130 ms.
#define MPL3115A2_OS_RATIO_64   6
 Oversample Ratio 64, conversion time 258 ms.
#define MPL3115A2_OS_RATIO_128   7
 Oversample Ratio 128, conversion time 512 ms.
#define MPL3115A2_OS_RATIO_DEFAULT   MPL3115A2_OS_RATIO_128
 Default Ratio for testing.
#define MPL3115A2_CONVERSION_TIME   512000
 Maximum Conversion Time in us.


int mpl3115a2_test (mpl3115a2_t *dev)
 MPL3115A2 sensor test. More...
int mpl3115a2_init (mpl3115a2_t *dev, i2c_t i2c, uint8_t address, uint8_t os_ratio)
 Initialize the MPL3115A2 sensor driver. More...
int mpl3115a2_reset (mpl3115a2_t *dev)
 Reset the MPL3115A2 sensor. More...
int mpl3115a2_set_active (mpl3115a2_t *dev)
 Set active mode, this enables periodic measurements. More...
int mpl3115a2_set_standby (mpl3115a2_t *dev)
 Set standby mode. More...
int mpl3115a2_is_ready (mpl3115a2_t *dev)
 Check for new set of measurement data. More...
int mpl3115a2_read_pressure (mpl3115a2_t *dev, uint32_t *pres, uint8_t *status)
 Read sensor's data in pressure mode. More...
int mpl3115a2_read_temp (mpl3115a2_t *dev, int16_t *temp)
 Read sensor's temperature. More...