1# Micropower, 3-Axis, +/-200g Digital Accelerometer
2
3# Copyright (c) 2018 Analog Devices Inc.
4# SPDX-License-Identifier: Apache-2.0
5
6menuconfig ADXL372
7	bool "ADXL372 Three Axis High-g I2C/SPI accelerometer"
8	default y
9	depends on DT_HAS_ADI_ADXL372_ENABLED
10	select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL372),i2c)
11	select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL372),spi)
12	help
13	  Enable driver for ADXL372 Three-Axis Digital Accelerometers.
14
15if ADXL372
16
17choice ADXL372_OP_MODE
18	prompt "Operating mode"
19	default ADXL372_PEAK_DETECT_MODE
20
21config ADXL372_PEAK_DETECT_MODE
22	bool "Max Peak detect mode"
23	help
24	  In most high-g applications, a single (3-axis) acceleration sample at
25	  the peak of an impact event contains sufficient information
26	  about the event, and the full acceleration history is not required.
27	  In this mode the device returns only the over threshold
28	  Peak Acceleration between two consecutive sample fetches.
29
30config ADXL372_MEASUREMENT_MODE
31	bool "Measurement Mode"
32	help
33	  In this mode, acceleration data is provided continuously at the
34	  output data rate (ODR).
35
36endchoice
37
38config ADXL372_ACTIVITY_THRESHOLD
39	int "Activity threshold in mg"
40	range 0 200000
41	default 500
42	help
43	  Threshold for activity detection.
44
45config ADXL372_INACTIVITY_THRESHOLD
46	int "In-activity threshold in mg"
47	range 0 200000
48	default 400
49	help
50	  Threshold for in-activity detection.
51
52config ADXL372_ACTIVITY_TIME
53	int "Activity time"
54	range 0 255
55	default 1
56	help
57	  The activity timer implements a robust activity detection that
58	  minimizes false positive motion triggers. When the timer is used,
59	  only sustained motion can trigger activity detection.
60	  Number of multiples of 3.3 ms activity timer for which above threshold
61	  acceleration is required to detect activity. It is 3.3 ms per code
62	  for 6400 Hz ODR, and it is 6.6 ms per code for 3200 Hz ODR and below.
63
64config ADXL372_INACTIVITY_TIME
65	int "In-activity time"
66	range 0 255
67	default 2
68	help
69	  The time that all enabled axes must be lower than the inactivity
70	  threshold for an inactivity event to be detected. Number of multiples
71	  of 26 ms inactivity timer for which below threshold acceleration is
72	  required to detect inactivity. It is 26 ms per code for 3200 Hz ODR
73	  and below, and it is 13 ms per code for 6400 Hz ODR.
74
75config ADXL372_REFERENCED_ACTIVITY_DETECTION_MODE
76	bool "Use referenced activity/in-activity detection"
77	default y
78	help
79	  Activity detection can be configured as referenced or absolute.
80	  When using absolute activity detection, acceleration samples are
81	  compared directly to a user set threshold to determine whether
82	  motion is present. In many applications, it is advantageous for
83	  activity detection to be based not on an absolute threshold,
84	  but on a deviation from a reference point or orientation.
85
86choice ADXL372_TRIGGER_MODE
87	prompt "Trigger mode"
88	default ADXL372_TRIGGER_NONE
89	help
90	  Specify the type of triggering used by the driver.
91
92config ADXL372_TRIGGER_NONE
93	bool "No trigger"
94
95config ADXL372_TRIGGER_GLOBAL_THREAD
96	bool "Use global thread"
97	depends on GPIO
98	select ADXL372_TRIGGER
99
100config ADXL372_TRIGGER_OWN_THREAD
101	bool "Use own thread"
102	depends on GPIO
103	select ADXL372_TRIGGER
104
105endchoice
106
107config ADXL372_TRIGGER
108	bool
109
110config ADXL372_THREAD_PRIORITY
111	int "Thread priority"
112	depends on ADXL372_TRIGGER_OWN_THREAD && ADXL372_TRIGGER
113	default 10
114	help
115	  Priority of thread used by the driver to handle interrupts.
116
117config ADXL372_THREAD_STACK_SIZE
118	int "Thread stack size"
119	depends on ADXL372_TRIGGER_OWN_THREAD && ADXL372_TRIGGER
120	default 1024
121	help
122	  Stack size of thread used by the driver to handle interrupts.
123
124endif # ADXL372
125