35 #define MPL3115_I2C_ADDR 0xC0
38 #define MPL3115_REG_STATUS 0x00
39 #define MPL3115_REG_OUT_P_MSB 0x01
40 #define MPL3115_REG_OUT_P_CSB 0x02
41 #define MPL3115_REG_OUT_P_LSB 0x03
42 #define MPL3115_REG_OUT_T_MSB 0x04
43 #define MPL3115_REG_OUT_T_LSB 0x05
44 #define MPL3115_REG_WHO_AM_I 0x0C
45 #define MPL3115_REG_PT_DATA_CFG 0x13
46 #define MPL3115_REG_CTRL_REG1 0x26
47 #define MPL3115_REG_CTRL_REG2 0x27
48 #define MPL3115_REG_CTRL_REG3 0x28
49 #define MPL3115_REG_CTRL_REG4 0x29
50 #define MPL3115_REG_CTRL_REG5 0x2A
52 #define MPL3115_OST_BIT (1<<1)
55 #ifndef MPL3115_PT_DATA_CFG
56 #define MPL3115_PT_DATA_CFG 0x2
58 #ifndef MPL3115_OVERSAMPLING
59 #define MPL3115_OVERSAMPLING 0x5
I2C transaction structure.
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
uint32_t pressure
pressure in 1/4 Pascal
bool alt_mode
set to TRUE to enable altitude output (otherwise pressure)
float altitude
altitude in meters
void mpl3115_read(struct Mpl3115 *mpl)
bool initialized
config done flag
struct i2c_transaction req_trans
I2C transaction for conversion request.
bool raw_mode
set to TRUE to enable raw output
void mpl3115_periodic(struct Mpl3115 *mpl)
int16_t temperature
temperature in 1/16 degrees Celcius
struct i2c_periph * i2c_p
void mpl3115_init(struct Mpl3115 *mpl, struct i2c_periph *i2c_p, uint8_t addr)
void mpl3115_configure(struct Mpl3115 *mpl)
enum Mpl3115Status init_status
struct i2c_transaction trans
I2C transaction for reading and configuring.
volatile bool data_available
data ready flag
void mpl3115_event(struct Mpl3115 *mpl)
Paparazzi fixed point algebra.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.