126 mpl->
altitude = (float)(tmp >> 4) / (1 << 4);
static void mpl3115_send_config(struct Mpl3115 *mpl)
void mpl3115_read(struct Mpl3115 *mpl)
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
transaction successfully finished by I2C driver
void mpl3115_init(struct Mpl3115 *mpl, struct i2c_periph *i2c_p, uint8_t addr)
bool_t raw_mode
set to TRUE to enable raw output
bool_t alt_mode
set to TRUE to enable altitude output (otherwise pressure)
#define MPL3115_PT_DATA_CFG
void mpl3115_event(struct Mpl3115 *mpl)
#define MPL3115_REG_STATUS
bool_t i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
#define MPL3115_OVERSAMPLING
void mpl3115_periodic(struct Mpl3115 *mpl)
#define MPL3115_REG_PT_DATA_CFG
uint32_t pressure
pressure in 1/4 Pascal
transaction set to done by user level
bool_t i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
struct i2c_transaction req_trans
I2C transaction for conversion request.
void mpl3115_configure(struct Mpl3115 *mpl)
Driver for the baro MPL3115A2 from Freescale (i2c)
enum I2CTransactionStatus status
Transaction status.
int16_t temperature
temperature in 1/16 degrees Celcius
struct i2c_transaction trans
I2C transaction for reading and configuring.
uint8_t slave_addr
Slave address.
I2C peripheral structure.
enum Mpl3115Status init_status
float altitude
altitude in meters
bool_t initialized
config done flag
volatile bool_t data_available
data ready flag
#define MPL3115_REG_CTRL_REG1
struct i2c_periph * i2c_p