Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the baro MPL3115A2 from Freescale (i2c) More...
Go to the source code of this file.
Data Structures | |
struct | Mpl3115 |
Macros | |
#define | MPL3115_I2C_ADDR 0xC0 |
#define | MPL3115_REG_STATUS 0x00 |
#define | MPL3115_REG_OUT_P_MSB 0x01 |
#define | MPL3115_REG_OUT_P_CSB 0x02 |
#define | MPL3115_REG_OUT_P_LSB 0x03 |
#define | MPL3115_REG_OUT_T_MSB 0x04 |
#define | MPL3115_REG_OUT_T_LSB 0x05 |
#define | MPL3115_REG_WHO_AM_I 0x0C |
#define | MPL3115_REG_PT_DATA_CFG 0x13 |
#define | MPL3115_REG_CTRL_REG1 0x26 |
#define | MPL3115_REG_CTRL_REG2 0x27 |
#define | MPL3115_REG_CTRL_REG3 0x28 |
#define | MPL3115_REG_CTRL_REG4 0x29 |
#define | MPL3115_REG_CTRL_REG5 0x2A |
#define | MPL3115_OST_BIT (1<<1) |
#define | MPL3115_PT_DATA_CFG 0x2 |
#define | MPL3115_OVERSAMPLING 0x5 |
Enumerations | |
enum | Mpl3115Status { MPL_CONF_UNINIT, MPL_CONF_PT_DATA, MPL_CONF_CTRL1, MPL_CONF_DONE } |
Functions | |
void | mpl3115_init (struct Mpl3115 *mpl, struct i2c_periph *i2c_p, uint8_t addr) |
void | mpl3115_configure (struct Mpl3115 *mpl) |
void | mpl3115_read (struct Mpl3115 *mpl) |
void | mpl3115_event (struct Mpl3115 *mpl) |
void | mpl3115_periodic (struct Mpl3115 *mpl) |
Driver for the baro MPL3115A2 from Freescale (i2c)
Definition in file mpl3115.h.
struct Mpl3115 |
Data Fields | ||
---|---|---|
bool_t | alt_mode | set to TRUE to enable altitude output (otherwise pressure) |
float | altitude | altitude in meters |
volatile bool_t | data_available | data ready flag |
struct i2c_periph * | i2c_p | |
enum Mpl3115Status | init_status | |
bool_t | initialized | config done flag |
uint32_t | pressure | pressure in 1/4 Pascal |
bool_t | raw_mode | set to TRUE to enable raw output |
struct i2c_transaction | req_trans | I2C transaction for conversion request. |
int16_t | temperature | temperature in 1/16 degrees Celcius |
struct i2c_transaction | trans | I2C transaction for reading and configuring. |
#define MPL3115_I2C_ADDR 0xC0 |
Definition at line 35 of file mpl3115.h.
Referenced by baro_init().
#define MPL3115_OST_BIT (1<<1) |
Definition at line 52 of file mpl3115.h.
Referenced by mpl3115_read().
#define MPL3115_OVERSAMPLING 0x5 |
Definition at line 59 of file mpl3115.h.
Referenced by mpl3115_read(), and mpl3115_send_config().
#define MPL3115_PT_DATA_CFG 0x2 |
Definition at line 56 of file mpl3115.h.
Referenced by mpl3115_send_config().
#define MPL3115_REG_CTRL_REG1 0x26 |
Definition at line 46 of file mpl3115.h.
Referenced by mpl3115_read(), and mpl3115_send_config().
#define MPL3115_REG_PT_DATA_CFG 0x13 |
Definition at line 45 of file mpl3115.h.
Referenced by mpl3115_send_config().
#define MPL3115_REG_STATUS 0x00 |
Definition at line 38 of file mpl3115.h.
Referenced by mpl3115_read().
enum Mpl3115Status |
void mpl3115_configure | ( | struct Mpl3115 * | mpl | ) |
Definition at line 81 of file mpl3115.c.
References I2CTransDone, I2CTransSuccess, Mpl3115::init_status, mpl3115_send_config(), MPL_CONF_UNINIT, i2c_transaction::status, and Mpl3115::trans.
Referenced by mpl3115_periodic().
void mpl3115_event | ( | struct Mpl3115 * | mpl | ) |
Definition at line 107 of file mpl3115.c.
References Mpl3115::alt_mode, Mpl3115::altitude, i2c_transaction::buf, Mpl3115::data_available, I2CTransDone, I2CTransFailed, I2CTransSuccess, Mpl3115::init_status, Mpl3115::initialized, mpl3115_send_config(), MPL_CONF_UNINIT, Mpl3115::pressure, Mpl3115::raw_mode, Mpl3115::req_trans, i2c_transaction::status, Mpl3115::temperature, Mpl3115::trans, and TRUE.
Referenced by apogee_baro_event(), and baro_mpl3115_read_event().
void mpl3115_init | ( | struct Mpl3115 * | mpl, |
struct i2c_periph * | i2c_p, | ||
uint8_t | addr | ||
) |
Definition at line 31 of file mpl3115.c.
References Mpl3115::alt_mode, Mpl3115::altitude, FALSE, Mpl3115::i2c_p, I2CTransDone, Mpl3115::init_status, Mpl3115::initialized, MPL_CONF_UNINIT, Mpl3115::pressure, Mpl3115::raw_mode, Mpl3115::req_trans, i2c_transaction::slave_addr, i2c_transaction::status, Mpl3115::temperature, and Mpl3115::trans.
Referenced by baro_init(), and baro_mpl3115_init().
void mpl3115_periodic | ( | struct Mpl3115 * | mpl | ) |
Definition at line 153 of file mpl3115.c.
References Mpl3115::initialized, mpl3115_configure(), and mpl3115_read().
Referenced by baro_mpl3115_read_periodic(), and baro_periodic().
void mpl3115_read | ( | struct Mpl3115 * | mpl | ) |
Definition at line 92 of file mpl3115.c.
References Mpl3115::alt_mode, i2c_transaction::buf, Mpl3115::i2c_p, i2c_transceive(), i2c_transmit(), I2CTransDone, Mpl3115::initialized, MPL3115_OST_BIT, MPL3115_OVERSAMPLING, MPL3115_REG_CTRL_REG1, MPL3115_REG_STATUS, Mpl3115::raw_mode, Mpl3115::req_trans, i2c_transaction::slave_addr, i2c_transaction::status, and Mpl3115::trans.
Referenced by mpl3115_periodic().