17#define MPL3115A2_ADDRESS (0x60 << 1)
23 MPL3115A2_REGISTER_STATUS = (0x00),
25 MPL3115A2_REGISTER_PRESSURE_MSB = (0x01),
26 MPL3115A2_REGISTER_PRESSURE_CSB = (0x02),
27 MPL3115A2_REGISTER_PRESSURE_LSB = (0x03),
29 MPL3115A2_REGISTER_TEMP_MSB = (0x04),
30 MPL3115A2_REGISTER_TEMP_LSB = (0x05),
32 MPL3115A2_WHOAMI = (0x0C),
49 MPL3115A2_PT_DATA_CFG = 0x13,
60 MPL3115A2_CTRL_REG1 = (0x26),
: Common application definitions for the MPL3115A2 tutorial.
static uint16_t devAddr
STM32 HAL-formatted MPL3115A2 I2C address.
Definition mpl31152a.c:17
HAL_StatusTypeDef MPL31152A_Init(I2C_HandleTypeDef *hi2c, uint16_t devAddr)
Initialize the MPL3115A2 sensor for barometer and temperature reads.
Definition mpl31152a.c:31
HAL_StatusTypeDef MPL3115A2_ReadPressure(float *pressure_inHg)
Read pressure from the MPL3115A2.
Definition mpl31152a.c:149
@ MPL3115A2_CTRL_REG1_OS128
Definition mpl31152a.h:76
@ MPL3115A2_PT_DATA_CFG_TDEFE
Definition mpl31152a.h:50
@ MPL3115A2_PT_DATA_CFG_DREM
Definition mpl31152a.h:52
@ MPL3115A2_PT_DATA_CFG_PDEFE
Definition mpl31152a.h:51
@ MPL3115A2_CTRL_REG1_SBYB
Definition mpl31152a.h:68
@ MPL3115A2_REGISTER_STATUS_PTDR
Definition mpl31152a.h:41
@ MPL3115A2_REGISTER_STATUS_TDR
Definition mpl31152a.h:40
HAL_StatusTypeDef MPL3115A2_ReadTemperature(float *celsius)
Read temperature from the MPL3115A2.
Definition mpl31152a.c:120
HAL_StatusTypeDef MPL31152A_getStatus(uint8_t *data)
Read the MPL3115A2 STATUS register.
Definition mpl31152a.c:98