F439_CPP_MPL3115A2_Project_01
STM32F439 MPL3115A2 pressure and temperature tutorial
Loading...
Searching...
No Matches
mpl31152a.h
Go to the documentation of this file.
1
11#ifndef MPL31152A_H_
12#define MPL31152A_H_
13
14#include <main.h>
15
17#define MPL3115A2_ADDRESS (0x60 << 1)
18
22enum {
23 MPL3115A2_REGISTER_STATUS = (0x00),
24
25 MPL3115A2_REGISTER_PRESSURE_MSB = (0x01),
26 MPL3115A2_REGISTER_PRESSURE_CSB = (0x02),
27 MPL3115A2_REGISTER_PRESSURE_LSB = (0x03),
28
29 MPL3115A2_REGISTER_TEMP_MSB = (0x04),
30 MPL3115A2_REGISTER_TEMP_LSB = (0x05),
31
32 MPL3115A2_WHOAMI = (0x0C),
33};
39enum {
42};
48enum {
49 MPL3115A2_PT_DATA_CFG = 0x13,
53};
59enum {
60 MPL3115A2_CTRL_REG1 = (0x26),
61};
67enum {
69};
75enum {
77};
91HAL_StatusTypeDef MPL31152A_Init(I2C_HandleTypeDef *hi2c, uint16_t devAddr);
92
99HAL_StatusTypeDef MPL31152A_getStatus(uint8_t *data);
100
107HAL_StatusTypeDef MPL3115A2_ReadPressure(float *pressure_inHg);
108
115HAL_StatusTypeDef MPL3115A2_ReadTemperature(float *celsius);
116
117
118
119#endif /* MPL31152A_H_ */
: 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