|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
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) // One Shot control bit
55 #ifndef MPL3115_PT_DATA_CFG
56 #define MPL3115_PT_DATA_CFG 0x2 // Enable data event flag for pressure
58 #ifndef MPL3115_OVERSAMPLING
59 #define MPL3115_OVERSAMPLING 0x5 // Oversample ratio (0x5: 130ms between data sample)
void mpl3115_configure(struct Mpl3115 *mpl)
void mpl3115_read(struct Mpl3115 *mpl)
uint32_t pressure
pressure in 1/4 Pascal
Paparazzi fixed point algebra.
void mpl3115_init(struct Mpl3115 *mpl, struct i2c_periph *i2c_p, uint8_t addr)
struct i2c_transaction req_trans
I2C transaction for conversion request.
bool initialized
config done flag
I2C transaction structure.
enum Mpl3115Status init_status
bool raw_mode
set to TRUE to enable raw output
struct i2c_transaction trans
I2C transaction for reading and configuring.
bool alt_mode
set to TRUE to enable altitude output (otherwise pressure)
void mpl3115_periodic(struct Mpl3115 *mpl)
int16_t temperature
temperature in 1/16 degrees Celcius
void mpl3115_event(struct Mpl3115 *mpl)
float altitude
altitude in meters
struct i2c_periph * i2c_p
volatile bool data_available
data ready flag