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 depends on I2C || SPI 9 help 10 Enable driver for ADXL372 Three-Axis Digital Accelerometers. 11 12if ADXL372 13 14choice ADXL372_BUS_TYPE 15 prompt "Interface type" 16 help 17 Select interface the digital interface type for the ADXL372 18 19config ADXL372_I2C 20 depends on I2C 21 bool "I2C Interface" 22 23config ADXL372_SPI 24 depends on SPI 25 bool "SPI Interface" 26 27endchoice 28 29choice 30 prompt "Operating mode" 31 default ADXL372_PEAK_DETECT_MODE 32 33config ADXL372_PEAK_DETECT_MODE 34 bool "Max Peak detect mode" 35 help 36 In most high-g applications, a single (3-axis) acceleration sample at 37 the peak of an impact event contains sufficient information 38 about the event, and the full acceleration history is not required. 39 In this mode the device returns only the over threshold 40 Peak Acceleration between two consecutive sample fetches. 41 42config ADXL372_MEASUREMENT_MODE 43 bool "Measurement Mode" 44 help 45 In this mode, acceleration data is provided continuously at the 46 output data rate (ODR). 47 48endchoice 49 50choice 51 prompt "Accelerometer sampling frequency (ODR)" 52 default ADXL372_ODR_6400HZ if ADXL372_PEAK_DETECT_MODE 53 default ADXL372_ODR_400HZ if ADXL372_MEASUREMENT_MODE 54 55config ADXL372_ODR_400HZ 56 bool "400 Hz" 57 58config ADXL372_ODR_800HZ 59 bool "800 Hz" 60 61config ADXL372_ODR_1600HZ 62 bool "1600 Hz" 63 64config ADXL372_ODR_3200HZ 65 bool "3200 Hz" 66 67config ADXL372_ODR_6400HZ 68 bool "6400 Hz" 69 70endchoice 71 72choice 73 prompt "Low-Pass (Antialiasing) Filter corner frequency" 74 default ADXL372_BW_200HZ if ADXL372_ODR_400HZ 75 default ADXL372_BW_400HZ if ADXL372_ODR_800HZ 76 default ADXL372_BW_800HZ if ADXL372_ODR_1600HZ 77 default ADXL372_BW_1600HZ if ADXL372_ODR_3200HZ 78 default ADXL372_BW_3200HZ if ADXL372_ODR_6400HZ 79 help 80 High g events often include acceleration content over a wide range 81 of frequencies. The ADC of the ADXL372 samples the input acceleration 82 at the user selected ODR. 83 In the absence of antialiasing filters, input signals whose frequency 84 is more than half the ODR alias or fold into the measurement bandwidth 85 can lead to inaccurate measurements. 86 87config ADXL372_LPF_DISABLE 88 bool "Disabled" 89 90config ADXL372_BW_200HZ 91 bool "200 Hz" 92 93config ADXL372_BW_400HZ 94 bool "400 Hz" 95 96config ADXL372_BW_800HZ 97 bool "800 Hz" 98 99config ADXL372_BW_1600HZ 100 bool "1600 Hz" 101 102config ADXL372_BW_3200HZ 103 bool "3200 Hz" 104 105endchoice 106 107choice 108 prompt "High-Pass Filter corner frequency" 109 default ADXL372_HPF_CORNER0 110 help 111 The ADXL372 offers a one-pole, high-pass filter with a user 112 selectable −3 dB frequency. Applications that do not require dc 113 acceleration measurements can use the high-pass filter to minimize 114 constant or slow varying offset errors including initial bias, 115 bias drift due to temperature, and bias drift due to supply voltage 116 117config ADXL372_HPF_DISABLE 118 bool "Disabled" 119 120config ADXL372_HPF_CORNER0 121 bool "ODR/210" 122 123config ADXL372_HPF_CORNER1 124 bool "ODR/411" 125 126config ADXL372_HPF_CORNER2 127 bool "ODR/812" 128 129config ADXL372_HPF_CORNER3 130 bool "ODR/1616" 131 132endchoice 133 134 135config ADXL372_ACTIVITY_THRESHOLD 136 int "Activity threshold in mg" 137 range 0 200000 138 default 500 139 help 140 Threshold for activity detection. 141 142config ADXL372_INACTIVITY_THRESHOLD 143 int "In-activity threshold in mg" 144 range 0 200000 145 default 400 146 help 147 Threshold for in-activity detection. 148 149config ADXL372_ACTIVITY_TIME 150 int "Activity time" 151 range 0 255 152 default 1 153 help 154 The activity timer implements a robust activity detection that 155 minimizes false positive motion triggers. When the timer is used, 156 only sustained motion can trigger activity detection. 157 Number of multiples of 3.3 ms activity timer for which above threshold 158 acceleration is required to detect activity. It is 3.3 ms per code 159 for 6400 Hz ODR, and it is 6.6 ms per code for 3200 Hz ODR and below. 160 161config ADXL372_INACTIVITY_TIME 162 int "In-activity time" 163 range 0 255 164 default 2 165 help 166 The time that all enabled axes must be lower than the inactivity 167 threshold for an inactivity event to be detected. Number of multiples 168 of 26 ms inactivity timer for which below threshold acceleration is 169 required to detect inactivity. It is 26 ms per code for 3200 Hz ODR 170 and below, and it is 13 ms per code for 6400 Hz ODR. 171 172config ADXL372_REFERENCED_ACTIVITY_DETECTION_MODE 173 bool "Use referenced activity/in-activity detection" 174 default y 175 help 176 Activity detection can be configured as referenced or absolute. 177 When using absolute activity detection, acceleration samples are 178 compared directly to a user set threshold to determine whether 179 motion is present. In many applications, it is advantageous for 180 activity detection to be based not on an absolute threshold, 181 but on a deviation from a reference point or orientation. 182 183choice 184 prompt "Trigger mode" 185 default ADXL372_TRIGGER_NONE 186 help 187 Specify the type of triggering used by the driver. 188 189config ADXL372_TRIGGER_NONE 190 bool "No trigger" 191 192config ADXL372_TRIGGER_GLOBAL_THREAD 193 bool "Use global thread" 194 depends on GPIO 195 select ADXL372_TRIGGER 196 197config ADXL372_TRIGGER_OWN_THREAD 198 bool "Use own thread" 199 depends on GPIO 200 select ADXL372_TRIGGER 201 202endchoice 203 204config ADXL372_TRIGGER 205 bool 206 207config ADXL372_THREAD_PRIORITY 208 int "Thread priority" 209 depends on ADXL372_TRIGGER_OWN_THREAD && ADXL372_TRIGGER 210 default 10 211 help 212 Priority of thread used by the driver to handle interrupts. 213 214config ADXL372_THREAD_STACK_SIZE 215 int "Thread stack size" 216 depends on ADXL372_TRIGGER_OWN_THREAD && ADXL372_TRIGGER 217 default 1024 218 help 219 Stack size of thread used by the driver to handle interrupts. 220 221endif # ADXL372 222