adxl345_regs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Mesotic SAS
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 
19 #ifndef ADXL345_REGS_H
20 #define ADXL345_REGS_H
21 
22 #ifdef __cplusplus
23  extern "C" {
24 #endif
25 
29 #define ACCEL_ADXL345_CHIP_ID_REG (0x00)
30 #define ACCEL_ADXL345_THRESH_TAP (0x1D)
31 #define ACCEL_ADXL345_OFFSET_X (0x1E)
32 #define ACCEL_ADXL345_OFFSET_Y (0x1F)
33 #define ACCEL_ADXL345_OFFSET_Z (0x20)
34 #define ACCEL_ADXL345_TAP_DUR (0x21)
35 #define ACCEL_ADXL345_TAP_LAT (0x22)
36 #define ACCEL_ADXL345_TAP_WIN (0x23)
37 #define ACCEL_ADXL345_THRESH_ACT (0x24)
38 #define ACCEL_ADXL345_THRESH_INACT (0x25)
39 #define ACCEL_ADXL345_TIME_INACT (0x26)
40 #define ACCEL_ADXL345_ACT_INACT_CTL (0x27)
41 #define ACCEL_ADXL345_THRESH_FF (0x28)
42 #define ACCEL_ADXL345_TIME_FF (0x29)
43 #define ACCEL_ADXL345_TAP_AXES (0x2A)
44 #define ACCEL_ADXL345_ACT_TAP_STATUS (0x2B)
45 #define ACCEL_ADXL345_BW_RATE (0x2C)
46 #define ACCEL_ADXL345_POWER_CTL (0x2D)
47 #define ACCEL_ADXL345_INT_ENABLE (0x2E)
48 #define ACCEL_ADXL345_INT_MAP (0x2F)
49 #define ACCEL_ADXL345_INT_SOURCE (0x30)
50 #define ACCEL_ADXL345_DATA_FORMAT (0x31)
51 #define ACCEL_ADXL345_DATA_X0 (0x32)
52 #define ACCEL_ADXL345_DATA_X1 (0x33)
53 #define ACCEL_ADXL345_DATA_Y0 (0x34)
54 #define ACCEL_ADXL345_DATA_Y1 (0x35)
55 #define ACCEL_ADXL345_DATA_Z0 (0x36)
56 #define ACCEL_ADXL345_DATA_Z1 (0x37)
57 #define ACCEL_ADXL345_FIFO_CTL (0x38)
58 #define ACCEL_ADXL345_FIFO_STATUS (0x39)
65 #define ACCEL_ADXL345_CHIP_ID (0xE5)
66 
72 #define RES_10_BITS (0x03FF)
73 #define RES_11_BITS (0x07FF)
74 #define RES_12_BITS (0x0FFF)
75 #define RES_13_BITS (0x1FFF)
76 
82 #define INACT_Z_ENABLE (1 << 0)
83 #define INACT_Y_ENABLE (1 << 1)
84 #define INACT_X_ENABLE (1 << 2)
85 #define INACT_ACDC (1 << 3)
86 #define ACT_Z_ENABLE (1 << 4)
87 #define ACT_Y_ENABLE (1 << 5)
88 #define ACT_X_ENABLE (1 << 6)
89 #define ACT_ACDC (1 << 7)
90 
96 #define TAP_Z_ENABLE (1 << 0)
97 #define TAP_Y_ENABLE (1 << 1)
98 #define TAP_X_ENABLE (1 << 2)
99 #define SUPPRESS (1 << 3)
100 #define TAP_ALL_ENABLE (TAP_Z_ENABLE|TAP_Y_ENABLE|TAP_X_ENABLE)
101 
107 #define TAP_Z_SRC (1 << 0)
108 #define TAP_Y_SRC (1 << 1)
109 #define TAP_X_SRC (1 << 2)
110 #define ASLEEP (1 << 3)
111 #define ACT_Z_SRC (1 << 4)
112 #define ACT_Y_SRC (1 << 5)
113 #define ACT_X_SRC (1 << 6)
114 
120 #define RATE_MASK (0x0F)
121 #define LOWPOWER (1 << 4)
122 
128 #define WAKEUP_8HZ (0x00)
129 #define WAKEUP_4HZ (0x01)
130 #define WAKEUP_2HZ (0x02)
131 #define WAKEUP_1HZ (0x03)
132 #define SLEEP_BIT (1 << 2)
133 #define MEASURE_BIT (1 << 3)
134 #define AUTOSLEEP_BIT (1 << 4)
135 #define LINK_BIT (1 << 5)
136 
143 #define OVERRUN (1 << 0)
144 #define WATERMARK (1 << 1)
145 #define FREEFALL (1 << 2)
146 #define INACTIVITY (1 << 3)
147 #define ACTIVITY (1 << 4)
148 #define DOUBLE_TAP (1 << 5)
149 #define SINGLE_TAP (1 << 6)
150 #define DATA_READY (1 << 7)
151 
157 #define RANGE_MASK (0x03)
158 #define JUSTIFY (1 << 2)
159 #define FULL_RES (1 << 3)
160 #define INT_INVERT (1 << 5)
161 #define SPI_BIT (1 << 6)
162 #define SELF_TEST (1 << 7)
163 
169 #define SAMPLES_MASK (0x0F)
170 #define FIFO_TRIGGER_POS (4)
171 #define FIFO_TRIGGER (1 << FIFO_TRIGGER_POS)
172 #define FIFO_MODE_POS (6)
173 #define FIFO_MODE_MASK (0xC0)
174 
180 #define FIFO_ENTRIES_MASK (0x3F)
181 #define FIFO_TRIG (1 << 7)
182 
184 #ifdef __cplusplus
185 }
186 #endif
187 
188 #endif /* ADXL345_REGS_H */
189