Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
dps310_regs.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 OpenUAS
3 *
4 * This file is part of paparazzi.
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef DPS310_REGS_H
23#define DPS310_REGS_H
24
31#include "std.h"
32
33/* Default I2C address */
34#define DPS310_I2C_ADDR 0xEE // 0x77 << 1
35#define DPS310_I2C_ADDR_ALT 0xEC // 0x76 << 1
36
37#define DPS310_CHIP_ID 0x10
38
39/* Registers */
40#define DPS310_REG_PSR_B2 0x00
41#define DPS310_REG_PSR_B1 0x01
42#define DPS310_REG_PSR_B0 0x02
43#define DPS310_REG_TMP_B2 0x03
44#define DPS310_REG_TMP_B1 0x04
45#define DPS310_REG_TMP_B0 0x05
46#define DPS310_REG_PRS_CFG 0x06
47#define DPS310_REG_TMP_CFG 0x07
48#define DPS310_REG_MEAS_CFG 0x08
49#define DPS310_REG_CFG_REG 0x09
50#define DPS310_REG_INT_STS 0x0A
51#define DPS310_REG_FIFO_STS 0x0B
52#define DPS310_REG_RESET 0x0C
53#define DPS310_REG_ID 0x0D
54
55#define DPS310_REG_COEF 0x10
56#define DPS310_REG_COEF_SRCE 0x28
57
58#define DPS310_RESET_CMD 0x09
59
60#define DPS310_MEAS_CFG_COEF_RDY (1 << 7)
61#define DPS310_MEAS_CFG_SENSOR_RDY (1 << 6)
62#define DPS310_MEAS_CFG_TMP_RDY (1 << 5)
63#define DPS310_MEAS_CFG_PRS_RDY (1 << 4)
64
65/* Measurement rates and oversampling */
66#define DPS310_PRS_CFG_PM_RATE_32HZ (5 << 4)
67#define DPS310_PRS_CFG_PM_RATE_16HZ (4 << 4)
68#define DPS310_PRS_CFG_PM_RATE_8HZ (3 << 4)
69#define DPS310_PRS_CFG_PM_PRC_16 (4 << 0)
70#define DPS310_TMP_CFG_TMP_EXT (1 << 7)
71#define DPS310_TMP_CFG_TMP_RATE_32HZ (5 << 4)
72#define DPS310_TMP_CFG_TMP_RATE_16HZ (4 << 4)
73#define DPS310_TMP_CFG_TMP_RATE_8HZ (3 << 4)
74#define DPS310_TMP_CFG_TMP_PRC_16 (4 << 0)
75
76#define DPS310_CFG_REG_P_SHIFT (1 << 2)
77#define DPS310_CFG_REG_T_SHIFT (1 << 3)
78
79#define DPS310_MEAS_CTRL_CONT 0x07
80#define DPS310_COEF_SRCE_BIT_TMP_COEF_SRCE 0x80
81
83 int16_t c0; // 12bit
84 int16_t c1; // 12bit
85
86 int32_t c00; // 20bit
87 int32_t c10; // 20bit
88
89 int16_t c01; // 16bit
90 int16_t c11; // 16bit
91 int16_t c20; // 16bit
92 int16_t c21; // 16bit
93 int16_t c30; // 16bit
94
95 int16_t c31; // 12bit
96 int16_t c40; // 12bit
97};
98
99#endif /* DPS310_REGS_H */
int int32_t
Typedef defining 32 bit int type.
short int16_t
Typedef defining 16 bit short type.