File tree Expand file tree Collapse file tree 4 files changed +65
-6
lines changed
drivers/sensor/adi/adxl367
include/zephyr/dt-bindings/sensor Expand file tree Collapse file tree 4 files changed +65
-6
lines changed Original file line number Diff line number Diff line change @@ -1097,7 +1097,7 @@ static int adxl367_init(const struct device *dev)
1097
1097
#define ADXL367_CFG_IRQ (inst )
1098
1098
#endif /* CONFIG_ADXL367_TRIGGER */
1099
1099
1100
- #define ADXL367_CONFIG (inst , chipid ) \
1100
+ #define ADXL367_CONFIG (inst , chipid ) \
1101
1101
.odr = DT_INST_PROP(inst, odr), \
1102
1102
.autosleep = false, \
1103
1103
.low_noise = false, \
@@ -1115,7 +1115,8 @@ static int adxl367_init(const struct device *dev)
1115
1115
.inactivity_th.enable = \
1116
1116
IS_ENABLED(CONFIG_ADXL367_INACTIVITY_DETECTION_MODE), \
1117
1117
.inactivity_time = CONFIG_ADXL367_INACTIVITY_TIME, \
1118
- .fifo_config.fifo_mode = ADXL367_FIFO_DISABLED, \
1118
+ .fifo_config.fifo_mode = \
1119
+ DT_INST_PROP_OR(inst, fifo_mode, ADXL367_FIFO_DISABLED), \
1119
1120
.fifo_config.fifo_format = ADXL367_FIFO_FORMAT_XYZ, \
1120
1121
.fifo_config.fifo_samples = 128, \
1121
1122
.fifo_config.fifo_read_mode = ADXL367_14B_CHID, \
Original file line number Diff line number Diff line change 13
13
#include <zephyr/drivers/gpio.h>
14
14
#include <zephyr/kernel.h>
15
15
#include <zephyr/sys/util.h>
16
+ #include <zephyr/dt-bindings/sensor/adxl367.h>
16
17
17
18
#define DT_DRV_COMPAT adi_adxl367
18
19
#if DT_ANY_INST_ON_BUS_STATUS_OKAY (spi )
@@ -280,10 +281,10 @@ enum adxl367_fifo_format {
280
281
};
281
282
282
283
enum adxl367_fifo_mode {
283
- ADXL367_FIFO_DISABLED ,
284
- ADXL367_OLDEST_SAVED ,
285
- ADXL367_STREAM_MODE ,
286
- ADXL367_TRIGGERED_MODE
284
+ ADXL367_FIFO_DISABLED = ADXL367_FIFO_MODE_DISABLED ,
285
+ ADXL367_OLDEST_SAVED = ADXL367_FIFO_MODE_OLDEST_SAVED ,
286
+ ADXL367_STREAM_MODE = ADXL367_FIFO_MODE_STREAM ,
287
+ ADXL367_TRIGGERED_MODE = ADXL367_FIFO_MODE_TRIGGERED
287
288
};
288
289
289
290
enum adxl367_fifo_read_mode {
Original file line number Diff line number Diff line change 1
1
# Copyright (c) 2023 Analog Devices Inc.
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
+ description : |
5
+ ADXL367 3-axis accelerometer
6
+ When setting the accelerometer DTS properties and want to use
7
+ streaming funcionality, make sure to include adxl367.h and
8
+ use the macros defined there for fifo-mode property.
9
+
10
+ Example:
11
+ #include <zephyr/dt-bindings/sensor/adxl367.h>
12
+
13
+ adxl367: adxl367@0 {
14
+ ...
15
+
16
+ fifo-mode = <ADXL367_FIFO_MODE_STREAM>;
17
+ };
18
+
19
+
4
20
include : sensor-device.yaml
5
21
6
22
properties :
@@ -29,3 +45,17 @@ properties:
29
45
The INT1 signal defaults to active high as produced by the
30
46
sensor. The property value should ensure the flags properly
31
47
describe the signal that is presented to the driver.
48
+
49
+ fifo-mode :
50
+ type : int
51
+ description : |
52
+ Accelerometer FIFO Mode.
53
+ 0 # ADXL367_FIFO_MODE_DISABLED
54
+ 1 # ADXL367_FIFO_MODE_OLDEST_SAVED
55
+ 2 # ADXL367_FIFO_MODE_STREAM
56
+ 3 # ADXL367_FIFO_MODE_TRIGGERED
57
+ enum :
58
+ - 0
59
+ - 1
60
+ - 2
61
+ - 3
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2025 Analog Devices Inc.
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ #ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADI_ADX367_H_
7
+ #define ZEPHYR_INCLUDE_DT_BINDINGS_ADI_ADX367_H_
8
+
9
+ /**
10
+ * @defgroup ADXL367 ADI DT Options
11
+ * @ingroup sensor_interface
12
+ * @{
13
+ */
14
+
15
+ /**
16
+ * @defgroup ADXL367_FIFO_MODE FIFO mode options
17
+ * @{
18
+ */
19
+ #define ADXL367_FIFO_MODE_DISABLED 0x0
20
+ #define ADXL367_FIFO_MODE_OLDEST_SAVED 0x1
21
+ #define ADXL367_FIFO_MODE_STREAM 0x2
22
+ #define ADXL367_FIFO_MODE_TRIGGERED 0x3
23
+ /** @} */
24
+
25
+ /** @} */
26
+
27
+ #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADI_ADX367_H_ */
You can’t perform that action at this time.
0 commit comments