Loading...
Searching...
No Matches
bmx280_internals.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016 Kees Bakker, SODAQ
3 * 2017 Inria
4 *
5 * This file is subject to the terms and conditions of the GNU Lesser
6 * General Public License v2.1. See the file LICENSE in the top level
7 * directory for more details.
8 */
9
21#ifndef BMX280_INTERNALS_H
22#define BMX280_INTERNALS_H
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
32#if defined(MODULE_BME280_SPI) || defined(MODULE_BME280_I2C)
33#define BMX280_CHIP_ID_VAL (0x60)
34#else
35#define BMX280_CHIP_ID_VAL (0x58)
36#endif
43#define BMX280_CHIP_ID_REG (0xD0)
44#define BMEX80_RST_REG (0xE0) /* Softreset Reg */
45
46#define BMX280_DIG_T1_LSB_REG (0x88)
47#define BMX280_DIG_T1_MSB_REG (0x89)
48#define BMX280_DIG_T2_LSB_REG (0x8A)
49#define BMX280_DIG_T2_MSB_REG (0x8B)
50#define BMX280_DIG_T3_LSB_REG (0x8C)
51#define BMX280_DIG_T3_MSB_REG (0x8D)
52#define BMX280_DIG_P1_LSB_REG (0x8E)
53#define BMX280_DIG_P1_MSB_REG (0x8F)
54#define BMX280_DIG_P2_LSB_REG (0x90)
55#define BMX280_DIG_P2_MSB_REG (0x91)
56#define BMX280_DIG_P3_LSB_REG (0x92)
57#define BMX280_DIG_P3_MSB_REG (0x93)
58#define BMX280_DIG_P4_LSB_REG (0x94)
59#define BMX280_DIG_P4_MSB_REG (0x95)
60#define BMX280_DIG_P5_LSB_REG (0x96)
61#define BMX280_DIG_P5_MSB_REG (0x97)
62#define BMX280_DIG_P6_LSB_REG (0x98)
63#define BMX280_DIG_P6_MSB_REG (0x99)
64#define BMX280_DIG_P7_LSB_REG (0x9A)
65#define BMX280_DIG_P7_MSB_REG (0x9B)
66#define BMX280_DIG_P8_LSB_REG (0x9C)
67#define BMX280_DIG_P8_MSB_REG (0x9D)
68#define BMX280_DIG_P9_LSB_REG (0x9E)
69#define BMX280_DIG_P9_MSB_REG (0x9F)
70
71#define BME280_DIG_H1_REG (0xA1)
72#define BME280_DIG_H2_LSB_REG (0xE1)
73#define BME280_DIG_H2_MSB_REG (0xE2)
74#define BME280_DIG_H3_REG (0xE3)
75#define BME280_DIG_H4_MSB_REG (0xE4) /* H4[11:4] */
76#define BME280_DIG_H4_H5_REG (0xE5) /* H5[3:0] H4[3:0] */
77#define BME280_DIG_H5_MSB_REG (0xE6) /* H5[11:4] */
78#define BME280_DIG_H6_REG (0xE7)
79
80#define BMX280_STAT_REG (0xF3) /* Status Reg */
81#define BMX280_CTRL_MEAS_REG (0xF4) /* Ctrl Measure Reg */
82#define BMX280_CONFIG_REG (0xF5) /* Configuration Reg */
83#define BMX280_PRESSURE_MSB_REG (0xF7) /* Pressure MSB */
84#define BMX280_PRESSURE_LSB_REG (0xF8) /* Pressure LSB */
85#define BMX280_PRESSURE_XLSB_REG (0xF9) /* Pressure XLSB */
86#define BMX280_TEMPERATURE_MSB_REG (0xFA) /* Temperature MSB */
87#define BMX280_TEMPERATURE_LSB_REG (0xFB) /* Temperature LSB */
88#define BMX280_TEMPERATURE_XLSB_REG (0xFC) /* Temperature XLSB */
89#define BME280_CTRL_HUM_REG (0xF2) /* Ctrl Humidity Reg */
90#define BME280_HUMIDITY_MSB_REG (0xFD) /* Humidity MSB */
91#define BME280_HUMIDITY_LSB_REG (0xFE) /* Humidity LSB */
98#define MEAS_OSRS_T_POS (5U)
99#define MEAS_OSRS_P_POS (2U)
100#define STAT_MEASURING (1 << 3)
101#define RESET_WORD (0xB6)
108#define DATA_BASE BMX280_PRESSURE_MSB_REG
115#define CALIB_T_P_BASE (BMX280_DIG_T1_LSB_REG)
116#define CALIB_T_P_LEN (24U)
117#define OFFSET_T_P(x) (x - CALIB_T_P_BASE)
118#if defined(MODULE_BME280_SPI) || defined(MODULE_BME280_I2C)
119#define CALIB_H_BASE (BME280_DIG_H2_LSB_REG)
120#define CALIB_H_LEN (7U)
121#define OFFSET_H(x) (x - CALIB_H_BASE)
122#endif
125#ifdef __cplusplus
126}
127#endif
128
129#endif /* BMX280_INTERNALS_H */