Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
mpl3115a2_reg.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2014 PHYTEC Messtechnik GmbH
3
*
4
* This file is subject to the terms and conditions of the GNU Lesser
5
* General Public License v2.1. See the file LICENSE in the top level
6
* directory for more details.
7
*
8
*/
9
10
#pragma once
11
23
#ifdef __cplusplus
24
extern
"C"
25
{
26
#endif
27
28
#define MPL3115A2_STATUS 0x00
29
#define MPL3115A2_OUT_P_MSB 0x01
30
#define MPL3115A2_OUT_P_CSB 0x02
31
#define MPL3115A2_OUT_P_LSB 0x03
32
#define MPL3115A2_OUT_T_MSB 0x04
33
#define MPL3115A2_OUT_T_LSB 0x05
34
#define MPL3115A2_DR_STATUS 0x06
35
#define MPL3115A2_OUT_P_DELTA MSB 0x07
36
#define MPL3115A2_OUT_P_DELTA_CSB 0x08
37
#define MPL3115A2_OUT_P_DELTA_LSB 0x09
38
#define MPL3115A2_OUT_T_DELTA_MSB 0x0A
39
#define MPL3115A2_OUT_T_DELTA_LSB 0x0B
40
#define MPL3115A2_WHO_AM_I 0x0C
41
#define MPL3115A2_F_STATUS 0x0D
42
#define MPL3115A2_F_DATA 0x0E
43
#define MPL3115A2_F_SETUP 0x0F
44
#define MPL3115A2_TIME_DLY 0x10
45
#define MPL3115A2_SYSMOD 0x11
46
#define MPL3115A2_INT_SOURCE 0x12
47
#define MPL3115A2_PT_DATA_CFG 0x13
48
#define MPL3115A2_BAR_IN_MSB 0x14
49
#define MPL3115A2_BAR_IN_LSB 0x15
50
#define MPL3115A2_P_TGT_MSB 0x16
51
#define MPL3115A2_P_TGT_LSB 0x17
52
#define MPL3115A2_T_TGT 0x18
53
#define MPL3115A2_P_WND_MSB 0x19
54
#define MPL3115A2_P_WND_LSB 0x1A
55
#define MPL3115A2_T_WND 0x1B
56
#define MPL3115A2_P_MIN_MSB 0x1C
57
#define MPL3115A2_P_MIN_CSB 0x1D
58
#define MPL3115A2_P_MIN_LSB 0x1E
59
#define MPL3115A2_T_MIN_MSB 0x1F
60
#define MPL3115A2_T_MIN_LSB 0x20
61
#define MPL3115A2_P_MAX_MSB 0x21
62
#define MPL3115A2_P_MAX_CSB 0x22
63
#define MPL3115A2_P_MAX_LSB 0x23
64
#define MPL3115A2_T_MAX_MSB 0x24
65
#define MPL3115A2_T_MAX_LSB 0x25
66
#define MPL3115A2_CTRL_REG1 0x26
67
#define MPL3115A2_CTRL_REG2 0x27
68
#define MPL3115A2_CTRL_REG3 0x28
69
#define MPL3115A2_CTRL_REG4 0x29
70
#define MPL3115A2_CTRL_REG5 0x2A
71
#define MPL3115A2_OFF_P 0x2B
72
#define MPL3115A2_OFF_T 0x2C
73
#define MPL3115A2_OFF_H 0x2D
75
#define MPL3115A2_STATUS_TDR (1 << 1)
76
#define MPL3115A2_STATUS_PDR (1 << 2)
77
#define MPL3115A2_STATUS_PTDR (1 << 3)
78
#define MPL3115A2_STATUS_TOW (1 << 5)
79
#define MPL3115A2_STATUS_POW (1 << 6)
80
#define MPL3115A2_STATUS_PTOW (1 << 7)
81
82
#define MPL3115A2_PT_DATA_CFG_TDEFE (1 << 0)
83
#define MPL3115A2_PT_DATA_CFG_PDEFE (1 << 1)
84
#define MPL3115A2_PT_DATA_CFG_DREM (1 << 2)
85
86
#define MPL3115A2_CTRL_REG1_SBYB (1 << 0)
87
#define MPL3115A2_CTRL_REG1_OST (1 << 1)
88
#define MPL3115A2_CTRL_REG1_RST (1 << 2)
89
#define MPL3115A2_CTRL_REG1_OS_SHIFT 3
90
#define MPL3115A2_CTRL_REG1_OS_MASK 0x38
91
#define MPL3115A2_CTRL_REG1_OS(x) (((uint8_t)(((uint8_t)(x))<<MPL3115A2_CTRL_REG1_OS_SHIFT))\
92
&MPL3115A2_CTRL_REG1_OS_MASK)
93
#define MPL3115A2_CTRL_REG1_RAW (1 << 6)
94
#define MPL3115A2_CTRL_REG1_ALT (1 << 7)
95
96
#define MPL3115A2_CTRL_REG2_ST_SHIFT 0
97
#define MPL3115A2_CTRL_REG2_ST_MASK 0xF
98
#define MPL3115A2_CTRL_REG2_ST(x) (((uint8_t)(((uint8_t)(x))<<MPL3115A2_CTRL_REG2_ST_SHIFT))\
99
&MPL3115A2_CTRL_REG2_ST_MASK)
100
#define MPL3115A2_CTRL_REG2_ALARM_SEL (1 << 4)
101
#define MPL3115A2_CTRL_REG2_LOAD_OPUT (1 << 5)
102
103
#define MPL3115A2_CTRL_REG3_PP_OD2 (1 << 0)
104
#define MPL3115A2_CTRL_REG3_IPOL2 (1 << 1)
105
#define MPL3115A2_CTRL_REG3_PP_OD1 (1 << 4)
106
#define MPL3115A2_CTRL_REG3_IPOL1 (1 << 5)
107
108
#define MPL3115A2_CTRL_REG4_INT_EN_TCHG (1 << 0)
109
#define MPL3115A2_CTRL_REG4_INT_EN_PCHG (1 << 1)
110
#define MPL3115A2_CTRL_REG4_INT_EN_TTH (1 << 2)
111
#define MPL3115A2_CTRL_REG4_INT_EN_PTH (1 << 3)
112
#define MPL3115A2_CTRL_REG4_INT_EN_TW (1 << 4)
113
#define MPL3115A2_CTRL_REG4_INT_EN_PW (1 << 5)
114
#define MPL3115A2_CTRL_REG4_INT_EN_FIFO (1 << 6)
115
#define MPL3115A2_CTRL_REG4_INT_EN_DRDY (1 << 7)
116
117
#define MPL3115A2_CTRL_REG5_INT_TCHG (1 << 0)
118
#define MPL3115A2_CTRL_REG5_INT_PCHG (1 << 1)
119
#define MPL3115A2_CTRL_REG5_INT_TTH (1 << 2)
120
#define MPL3115A2_CTRL_REG5_INT_PTH (1 << 3)
121
#define MPL3115A2_CTRL_REG5_INT_TW (1 << 4)
122
#define MPL3115A2_CTRL_REG5_INT_PW (1 << 5)
123
#define MPL3115A2_CTRL_REG5_INT_FIFO (1 << 6)
124
#define MPL3115A2_CTRL_REG5_INT_DRDY (1 << 7)
125
126
#define MPL3115A2_ID 0xC4
128
#ifdef __cplusplus
129
}
130
#endif
131
Generated on Fri Jun 20 2025 21:02:36 by
1.9.1