1# ADXL362 Three-Axis Digital Accelerometers
2
3# Copyright (c) 2017 IpTronix S.r.l.
4# SPDX-License-Identifier: Apache-2.0
5
6menuconfig ADXL362
7	bool "ADXL362 sensor"
8	default y
9	depends on DT_HAS_ADI_ADXL362_ENABLED
10	select SPI
11	select RTIO_WORKQ if SENSOR_ASYNC_API
12	help
13	  Enable driver for ADXL362 Three-Axis Digital Accelerometers.
14
15if ADXL362
16
17choice
18	prompt "Accelerometer range setting"
19	default ADXL362_ACCEL_RANGE_RUNTIME
20
21config ADXL362_ACCEL_RANGE_RUNTIME
22	bool "Set at runtime."
23
24config ADXL362_ACCEL_RANGE_2G
25	bool "2G"
26
27config ADXL362_ACCEL_RANGE_4G
28	bool "4G"
29
30config ADXL362_ACCEL_RANGE_8G
31	bool "8G"
32
33endchoice
34
35choice
36	prompt "Accelerometer sampling frequency."
37	default ADXL362_ACCEL_ODR_RUNTIME
38
39config ADXL362_ACCEL_ODR_RUNTIME
40	bool "Set at runtime."
41
42config ADXL362_ACCEL_ODR_12_5
43	bool "12.5 Hz"
44
45config ADXL362_ACCEL_ODR_25
46	bool "25 Hz"
47
48config ADXL362_ACCEL_ODR_50
49	bool "50 Hz"
50
51config ADXL362_ACCEL_ODR_100
52	bool "100 Hz"
53
54config ADXL362_ACCEL_ODR_200
55	bool "200 Hz"
56
57config ADXL362_ACCEL_ODR_400
58	bool "400 Hz"
59
60endchoice
61
62choice
63	prompt "Trigger mode"
64	default ADXL362_TRIGGER_NONE
65	help
66	  Specify the type of triggering used by the driver.
67
68config ADXL362_TRIGGER_NONE
69	bool "No trigger"
70
71config ADXL362_TRIGGER_GLOBAL_THREAD
72	bool "Use global thread"
73	depends on GPIO
74	depends on $(dt_compat_any_has_prop,$(DT_COMPAT_ADI_ADXL362),int1-gpios)
75	select ADXL362_TRIGGER
76
77config ADXL362_TRIGGER_OWN_THREAD
78	bool "Use own thread"
79	depends on GPIO
80	depends on $(dt_compat_any_has_prop,$(DT_COMPAT_ADI_ADXL362),int1-gpios)
81	select ADXL362_TRIGGER
82
83endchoice
84
85config ADXL362_STREAM
86	bool "Use FIFO to stream data"
87	select ADXL362_TRIGGER
88	default y
89	depends on SPI_RTIO
90	depends on SENSOR_ASYNC_API
91	help
92	  Use this configuration option to enable streaming sensor data via RTIO.
93
94config ADXL362_TRIGGER
95	bool
96
97config ADXL362_THREAD_PRIORITY
98	int "Thread priority"
99	depends on ADXL362_TRIGGER_OWN_THREAD && ADXL362_TRIGGER
100	default 10
101	help
102	  Priority of thread used by the driver to handle interrupts.
103
104config ADXL362_THREAD_STACK_SIZE
105	int "Thread stack size"
106	depends on ADXL362_TRIGGER_OWN_THREAD && ADXL362_TRIGGER
107	default 1024
108	help
109	  Stack size of thread used by the driver to handle interrupts.
110
111config ADXL362_ACTIVITY_THRESHOLD
112	int "Upper threshold value"
113	default 1000
114	help
115	  Unsigned value that the adxl362 samples are
116	  compared to in activity trigger mode.
117
118config ADXL362_ACTIVITY_TIME
119       int "Upper threshold time"
120       default 1
121       help
122         8 bit value written to the activity timer register
123         0 to 254, seconds is this value div by ODR
124
125config ADXL362_INACTIVITY_THRESHOLD
126	int "Lower threshold value"
127	default 100
128	help
129	  Unsigned value that the adxl362 samples are
130	  compared to in inactivity trigger mode.
131
132config ADXL362_INACTIVITY_TIME
133  int "Lower threshold time"
134  default 1
135  help
136    16 bit value written to the activity timer register
137    0 to 65535, seconds is this value div by ODR
138
139config ADXL362_INTERRUPT_MODE
140	int "Activity and inactivity interrupt mode"
141	default 0
142	help
143	  Unsigned value that sets the ADXL362 in different
144	  interrupt modes.
145	  0 - Default mode
146	  1 - Linked mode
147	  3 - Loop mode
148
149config ADXL362_ABS_REF_MODE
150	int "Absolute or referenced interrupt"
151	default 0
152	help
153	  Unsigned value that sets the ADXL362 interrupt
154	  mode in either absolute or referenced mode.
155	  0 - Absolute mode
156	  1 - Referenced mode
157
158endif # ADXL362
159