126 mpl->
altitude = (float)(tmp >> 4) / (1 << 4);
static void mpl3115_send_config(struct Mpl3115 *mpl)
void mpl3115_read(struct Mpl3115 *mpl)
volatile bool data_available
data ready flag
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)
#define MPL3115_PT_DATA_CFG
void mpl3115_event(struct Mpl3115 *mpl)
#define MPL3115_REG_STATUS
#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 raw_mode
set to TRUE to enable raw output
struct i2c_transaction req_trans
I2C transaction for conversion request.
void mpl3115_configure(struct Mpl3115 *mpl)
Driver for the baro MPL3115A2 from Freescale (i2c)
bool 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.
enum I2CTransactionStatus status
Transaction status.
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
bool alt_mode
set to TRUE to enable altitude output (otherwise pressure)
int16_t temperature
temperature in 1/16 degrees Celcius
bool initialized
config done flag
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
#define MPL3115_REG_CTRL_REG1
struct i2c_periph * i2c_p