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