1# Micropower, 3-Axis, +/-200g Digital Accelerometer
2
3# Copyright (c) 2023 Analog Devices Inc.
4# SPDX-License-Identifier: Apache-2.0
5
6menuconfig ADXL367
7	bool "ADXL367 Three Axis High-g I2C/SPI accelerometer"
8	default y
9	depends on DT_HAS_ADI_ADXL367_ENABLED || DT_HAS_ADI_ADXL366_ENABLED
10	select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL367),i2c) || \
11				$(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL366),i2c)
12	select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL367),spi) || \
13				$(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL366),spi)
14	help
15	  Enable driver for ADXL367 Three-Axis Digital Accelerometers.
16
17if ADXL367
18
19choice ADXL367_OP_MODE
20	prompt "Operating mode"
21	default ADXL367_MEASUREMENT_MODE
22
23config ADXL367_MEASUREMENT_MODE
24	bool "Measurement Mode"
25	help
26	  In this mode, acceleration data is provided continuously at the
27	  output data rate (ODR).
28
29endchoice
30
31config ADXL367_ACTIVITY_THRESHOLD
32	int "Activity threshold in raw value"
33	range 0 8191
34	default 100
35	help
36	  Threshold for activity detection.
37
38config ADXL367_INACTIVITY_THRESHOLD
39	int "In-activity threshold in raw value"
40	range 0 8191
41	default 100
42	help
43	  Threshold for in-activity detection.
44
45config ADXL367_ACTIVITY_TIME
46	int "Activity time"
47	range 0 $(UINT8_MAX)
48	default 100
49	help
50	  The activity timer implements a robust activity detection that
51	  minimizes false positive motion triggers. When the timer is used,
52	  only sustained motion can trigger activity detection. Value is the
53	  number of samples. For example, at 100Hz ODR, 100 value translates
54	  to 1 second.
55
56config ADXL367_INACTIVITY_TIME
57	int "In-activity time"
58	range 0 $(UINT16_MAX)
59	default 100
60	help
61	  The time that all enabled axes must be lower than the inactivity
62	  threshold for an inactivity event to be detected. Value is the
63	  number of samples. For example, at 100Hz ODR, 100 value translates
64	  to 1 second.
65
66config ADXL367_ACTIVITY_DETECTION_MODE
67	bool "Use activity detection"
68	default y
69	help
70	  Enable Activity detection.
71
72config ADXL367_INACTIVITY_DETECTION_MODE
73	bool "Use inactivity detection"
74	default y
75	help
76	  Enable Inactivity detection.
77
78
79config ADXL367_REFERENCED_ACTIVITY_DETECTION_MODE
80	bool "Use referenced activity detection"
81	default y
82	help
83	  Activity detection can be configured as referenced or absolute.
84	  When using absolute activity detection, acceleration samples are
85	  compared directly to a user set threshold to determine whether
86	  motion is present.
87
88config ADXL367_REFERENCED_INACTIVITY_DETECTION_MODE
89	bool "Use referenced inactivity detection"
90	default y
91	help
92	  Inactivity detection can be configured as referenced or absolute.
93	  When using absolute inactivity detection, acceleration samples are
94	  compared directly to a user set threshold to determine whether
95	  motion is present.
96
97choice ADXL367_TRIGGER_MODE
98	prompt "Trigger mode"
99	default ADXL367_TRIGGER_NONE
100	help
101	  Specify the type of triggering used by the driver.
102
103config ADXL367_TRIGGER_NONE
104	bool "No trigger"
105
106config ADXL367_TRIGGER_GLOBAL_THREAD
107	bool "Use global thread"
108	depends on GPIO
109	depends on $(dt_compat_any_has_prop,$(DT_COMPAT_ADI_ADXL367),int1-gpios)
110	select ADXL367_TRIGGER
111
112config ADXL367_TRIGGER_OWN_THREAD
113	bool "Use own thread"
114	depends on GPIO
115	depends on $(dt_compat_any_has_prop,$(DT_COMPAT_ADI_ADXL367),int1-gpios)
116	select ADXL367_TRIGGER
117
118endchoice
119
120config ADXL367_STREAM
121	bool "Use FIFO to stream data"
122	select ADXL367_TRIGGER
123	default y
124	depends on SPI_RTIO
125	depends on SENSOR_ASYNC_API
126	help
127	  Use this configuration option to enable streaming sensor data via RTIO.
128
129config ADXL367_TRIGGER
130	bool
131
132config ADXL367_THREAD_PRIORITY
133	int "Thread priority"
134	depends on ADXL367_TRIGGER_OWN_THREAD && ADXL367_TRIGGER
135	default 10
136	help
137	  Priority of thread used by the driver to handle interrupts.
138
139config ADXL367_THREAD_STACK_SIZE
140	int "Thread stack size"
141	depends on ADXL367_TRIGGER_OWN_THREAD && ADXL367_TRIGGER
142	default 1024
143	help
144	  Stack size of thread used by the driver to handle interrupts.
145
146endif # ADXL367
147