1 .. SPDX-License-Identifier: GPL-2.0 1 .. SPDX-License-Identifier: GPL-2.0 2 2 3 =============== 3 =============== 4 ADXL380 driver 4 ADXL380 driver 5 =============== 5 =============== 6 6 7 This driver supports Analog Device's ADXL380/3 7 This driver supports Analog Device's ADXL380/382 on SPI/I2C bus. 8 8 9 1. Supported devices 9 1. Supported devices 10 ==================== 10 ==================== 11 11 12 * `ADXL380 <https://www.analog.com/ADXL380>`_ 12 * `ADXL380 <https://www.analog.com/ADXL380>`_ 13 * `ADXL382 <https://www.analog.com/ADXL382>`_ 13 * `ADXL382 <https://www.analog.com/ADXL382>`_ 14 14 15 The ADXL380/ADXL382 is a low noise density, lo 15 The ADXL380/ADXL382 is a low noise density, low power, 3-axis accelerometer with 16 selectable measurement ranges. The ADXL380 sup 16 selectable measurement ranges. The ADXL380 supports the ±4 g, ±8 g, and ±16 g 17 ranges, and the ADXL382 supports ±15 g, ±30 17 ranges, and the ADXL382 supports ±15 g, ±30 g, and ±60 g ranges. 18 18 19 2. Device attributes 19 2. Device attributes 20 ==================== 20 ==================== 21 21 22 Accelerometer measurements are always provided 22 Accelerometer measurements are always provided. 23 23 24 Temperature data are also provided. This data 24 Temperature data are also provided. This data can be used to monitor the 25 internal system temperature or to improve the 25 internal system temperature or to improve the temperature stability of the 26 device via calibration. 26 device via calibration. 27 27 28 Each IIO device, has a device folder under ``/ 28 Each IIO device, has a device folder under ``/sys/bus/iio/devices/iio:deviceX``, 29 where X is the IIO index of the device. Under 29 where X is the IIO index of the device. Under these folders reside a set of 30 device files, depending on the characteristics 30 device files, depending on the characteristics and features of the hardware 31 device in questions. These files are consisten 31 device in questions. These files are consistently generalized and documented in 32 the IIO ABI documentation. 32 the IIO ABI documentation. 33 33 34 The following tables show the adxl380 related 34 The following tables show the adxl380 related device files, found in the 35 specific device folder path ``/sys/bus/iio/dev 35 specific device folder path ``/sys/bus/iio/devices/iio:deviceX``. 36 36 37 +--------------------------------------------- 37 +---------------------------------------------------+----------------------------------------------------------+ 38 | 3-Axis Accelerometer related device files 38 | 3-Axis Accelerometer related device files | Description | 39 +--------------------------------------------- 39 +---------------------------------------------------+----------------------------------------------------------+ 40 | in_accel_scale 40 | in_accel_scale | Scale for the accelerometer channels. | 41 +--------------------------------------------- 41 +---------------------------------------------------+----------------------------------------------------------+ 42 | in_accel_filter_high_pass_3db_frequency 42 | in_accel_filter_high_pass_3db_frequency | Low pass filter bandwidth. | 43 +--------------------------------------------- 43 +---------------------------------------------------+----------------------------------------------------------+ 44 | in_accel_filter_high_pass_3db_frequency_avai 44 | in_accel_filter_high_pass_3db_frequency_available | Available low pass filter bandwidth configurations. | 45 +--------------------------------------------- 45 +---------------------------------------------------+----------------------------------------------------------+ 46 | in_accel_filter_low_pass_3db_frequency 46 | in_accel_filter_low_pass_3db_frequency | High pass filter bandwidth. | 47 +--------------------------------------------- 47 +---------------------------------------------------+----------------------------------------------------------+ 48 | in_accel_filter_low_pass_3db_frequency_avail 48 | in_accel_filter_low_pass_3db_frequency_available | Available high pass filter bandwidth configurations. | 49 +--------------------------------------------- 49 +---------------------------------------------------+----------------------------------------------------------+ 50 | in_accel_x_calibbias 50 | in_accel_x_calibbias | Calibration offset for the X-axis accelerometer channel. | 51 +--------------------------------------------- 51 +---------------------------------------------------+----------------------------------------------------------+ 52 | in_accel_x_raw 52 | in_accel_x_raw | Raw X-axis accelerometer channel value. | 53 +--------------------------------------------- 53 +---------------------------------------------------+----------------------------------------------------------+ 54 | in_accel_y_calibbias 54 | in_accel_y_calibbias | y-axis acceleration offset correction | 55 +--------------------------------------------- 55 +---------------------------------------------------+----------------------------------------------------------+ 56 | in_accel_y_raw 56 | in_accel_y_raw | Raw Y-axis accelerometer channel value. | 57 +--------------------------------------------- 57 +---------------------------------------------------+----------------------------------------------------------+ 58 | in_accel_z_calibbias 58 | in_accel_z_calibbias | Calibration offset for the Z-axis accelerometer channel. | 59 +--------------------------------------------- 59 +---------------------------------------------------+----------------------------------------------------------+ 60 | in_accel_z_raw 60 | in_accel_z_raw | Raw Z-axis accelerometer channel value. | 61 +--------------------------------------------- 61 +---------------------------------------------------+----------------------------------------------------------+ 62 62 63 +----------------------------------+---------- 63 +----------------------------------+--------------------------------------------+ 64 | Temperature sensor related files | Descripti 64 | Temperature sensor related files | Description | 65 +----------------------------------+---------- 65 +----------------------------------+--------------------------------------------+ 66 | in_temp_raw | Raw tempe 66 | in_temp_raw | Raw temperature channel value. | 67 +----------------------------------+---------- 67 +----------------------------------+--------------------------------------------+ 68 | in_temp_offset | Offset fo 68 | in_temp_offset | Offset for the temperature sensor channel. | 69 +----------------------------------+---------- 69 +----------------------------------+--------------------------------------------+ 70 | in_temp_scale | Scale for 70 | in_temp_scale | Scale for the temperature sensor channel. | 71 +----------------------------------+---------- 71 +----------------------------------+--------------------------------------------+ 72 72 73 +------------------------------+-------------- 73 +------------------------------+----------------------------------------------+ 74 | Miscellaneous device files | Description 74 | Miscellaneous device files | Description | 75 +------------------------------+-------------- 75 +------------------------------+----------------------------------------------+ 76 | name | Name of the I 76 | name | Name of the IIO device. | 77 +------------------------------+-------------- 77 +------------------------------+----------------------------------------------+ 78 | sampling_frequency | Currently sel 78 | sampling_frequency | Currently selected sample rate. | 79 +------------------------------+-------------- 79 +------------------------------+----------------------------------------------+ 80 | sampling_frequency_available | Available sam 80 | sampling_frequency_available | Available sampling frequency configurations. | 81 +------------------------------+-------------- 81 +------------------------------+----------------------------------------------+ 82 82 83 Channels processed values 83 Channels processed values 84 ------------------------- 84 ------------------------- 85 85 86 A channel value can be read from its _raw attr 86 A channel value can be read from its _raw attribute. The value returned is the 87 raw value as reported by the devices. To get t 87 raw value as reported by the devices. To get the processed value of the channel, 88 apply the following formula: 88 apply the following formula: 89 89 90 .. code-block:: bash 90 .. code-block:: bash 91 91 92 processed value = (_raw + _offset) * _ 92 processed value = (_raw + _offset) * _scale 93 93 94 Where _offset and _scale are device attributes 94 Where _offset and _scale are device attributes. If no _offset attribute is 95 present, simply assume its value is 0. 95 present, simply assume its value is 0. 96 96 97 The adis16475 driver offers data for 2 types o 97 The adis16475 driver offers data for 2 types of channels, the table below shows 98 the measurement units for the processed value, 98 the measurement units for the processed value, which are defined by the IIO 99 framework: 99 framework: 100 100 101 +-------------------------------------+------- 101 +-------------------------------------+---------------------------+ 102 | Channel type | Measur 102 | Channel type | Measurement unit | 103 +-------------------------------------+------- 103 +-------------------------------------+---------------------------+ 104 | Acceleration on X, Y, and Z axis | Meters 104 | Acceleration on X, Y, and Z axis | Meters per Second squared | 105 +-------------------------------------+------- 105 +-------------------------------------+---------------------------+ 106 | Temperature | Millid 106 | Temperature | Millidegrees Celsius | 107 +-------------------------------------+------- 107 +-------------------------------------+---------------------------+ 108 108 109 Usage examples 109 Usage examples 110 -------------- 110 -------------- 111 111 112 Show device name: 112 Show device name: 113 113 114 .. code-block:: bash 114 .. code-block:: bash 115 115 116 root:/sys/bus/iio/devices/iio:device0> 116 root:/sys/bus/iio/devices/iio:device0> cat name 117 adxl382 117 adxl382 118 118 119 Show accelerometer channels value: 119 Show accelerometer channels value: 120 120 121 .. code-block:: bash 121 .. code-block:: bash 122 122 123 root:/sys/bus/iio/devices/iio:device0> 123 root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_raw 124 -1771 124 -1771 125 root:/sys/bus/iio/devices/iio:device0> 125 root:/sys/bus/iio/devices/iio:device0> cat in_accel_y_raw 126 282 126 282 127 root:/sys/bus/iio/devices/iio:device0> 127 root:/sys/bus/iio/devices/iio:device0> cat in_accel_z_raw 128 -1523 128 -1523 129 root:/sys/bus/iio/devices/iio:device0> 129 root:/sys/bus/iio/devices/iio:device0> cat in_accel_scale 130 0.004903325 130 0.004903325 131 131 132 - X-axis acceleration = in_accel_x_raw * in_ac 132 - X-axis acceleration = in_accel_x_raw * in_accel_scale = −8.683788575 m/s^2 133 - Y-axis acceleration = in_accel_y_raw * in_ac 133 - Y-axis acceleration = in_accel_y_raw * in_accel_scale = 1.38273765 m/s^2 134 - Z-axis acceleration = in_accel_z_raw * in_ac 134 - Z-axis acceleration = in_accel_z_raw * in_accel_scale = -7.467763975 m/s^2 135 135 136 Set calibration offset for accelerometer chann 136 Set calibration offset for accelerometer channels: 137 137 138 .. code-block:: bash 138 .. code-block:: bash 139 139 140 root:/sys/bus/iio/devices/iio:device0> 140 root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias 141 0 141 0 142 142 143 root:/sys/bus/iio/devices/iio:device0> 143 root:/sys/bus/iio/devices/iio:device0> echo 50 > in_accel_x_calibbias 144 root:/sys/bus/iio/devices/iio:device0> 144 root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias 145 50 145 50 146 146 147 Set sampling frequency: 147 Set sampling frequency: 148 148 149 .. code-block:: bash 149 .. code-block:: bash 150 150 151 root:/sys/bus/iio/devices/iio:device0> 151 root:/sys/bus/iio/devices/iio:device0> cat sampling_frequency 152 16000 152 16000 153 root:/sys/bus/iio/devices/iio:device0> 153 root:/sys/bus/iio/devices/iio:device0> cat sampling_frequency_available 154 16000 32000 64000 154 16000 32000 64000 155 155 156 root:/sys/bus/iio/devices/iio:device0> 156 root:/sys/bus/iio/devices/iio:device0> echo 32000 > sampling_frequency 157 root:/sys/bus/iio/devices/iio:device0> 157 root:/sys/bus/iio/devices/iio:device0> cat sampling_frequency 158 32000 158 32000 159 159 160 Set low pass filter bandwidth for acceleromete 160 Set low pass filter bandwidth for accelerometer channels: 161 161 162 .. code-block:: bash 162 .. code-block:: bash 163 163 164 root:/sys/bus/iio/devices/iio:device0> 164 root:/sys/bus/iio/devices/iio:device0> cat in_accel_filter_low_pass_3db_frequency 165 32000 165 32000 166 root:/sys/bus/iio/devices/iio:device0> 166 root:/sys/bus/iio/devices/iio:device0> cat in_accel_filter_low_pass_3db_frequency_available 167 32000 8000 4000 2000 167 32000 8000 4000 2000 168 168 169 root:/sys/bus/iio/devices/iio:device0> 169 root:/sys/bus/iio/devices/iio:device0> echo 2000 > in_accel_filter_low_pass_3db_frequency 170 root:/sys/bus/iio/devices/iio:device0> 170 root:/sys/bus/iio/devices/iio:device0> cat in_accel_filter_low_pass_3db_frequency 171 2000 171 2000 172 172 173 3. Device buffers 173 3. Device buffers 174 ================= 174 ================= 175 175 176 This driver supports IIO buffers. 176 This driver supports IIO buffers. 177 177 178 All devices support retrieving the raw acceler 178 All devices support retrieving the raw acceleration and temperature measurements 179 using buffers. 179 using buffers. 180 180 181 Usage examples 181 Usage examples 182 -------------- 182 -------------- 183 183 184 Select channels for buffer read: 184 Select channels for buffer read: 185 185 186 .. code-block:: bash 186 .. code-block:: bash 187 187 188 root:/sys/bus/iio/devices/iio:device0> 188 root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_accel_x_en 189 root:/sys/bus/iio/devices/iio:device0> 189 root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_accel_y_en 190 root:/sys/bus/iio/devices/iio:device0> 190 root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_accel_z_en 191 root:/sys/bus/iio/devices/iio:device0> 191 root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_temp_en 192 192 193 Set the number of samples to be stored in the 193 Set the number of samples to be stored in the buffer: 194 194 195 .. code-block:: bash 195 .. code-block:: bash 196 196 197 root:/sys/bus/iio/devices/iio:device0> 197 root:/sys/bus/iio/devices/iio:device0> echo 10 > buffer/length 198 198 199 Enable buffer readings: 199 Enable buffer readings: 200 200 201 .. code-block:: bash 201 .. code-block:: bash 202 202 203 root:/sys/bus/iio/devices/iio:device0> 203 root:/sys/bus/iio/devices/iio:device0> echo 1 > buffer/enable 204 204 205 Obtain buffered data: 205 Obtain buffered data: 206 206 207 .. code-block:: bash 207 .. code-block:: bash 208 208 209 root:/sys/bus/iio/devices/iio:device0> 209 root:/sys/bus/iio/devices/iio:device0> hexdump -C /dev/iio\:device0 210 ... 210 ... 211 002bc300 f7 e7 00 a8 fb c5 24 80 f7 211 002bc300 f7 e7 00 a8 fb c5 24 80 f7 e7 01 04 fb d6 24 80 |......$.......$.| 212 002bc310 f7 f9 00 ab fb dc 24 80 f7 212 002bc310 f7 f9 00 ab fb dc 24 80 f7 c3 00 b8 fb e2 24 80 |......$.......$.| 213 002bc320 f7 fb 00 bb fb d1 24 80 f7 213 002bc320 f7 fb 00 bb fb d1 24 80 f7 b1 00 5f fb d1 24 80 |......$...._..$.| 214 002bc330 f7 c4 00 c6 fb a6 24 80 f7 214 002bc330 f7 c4 00 c6 fb a6 24 80 f7 a6 00 68 fb f1 24 80 |......$....h..$.| 215 002bc340 f7 b8 00 a3 fb e7 24 80 f7 215 002bc340 f7 b8 00 a3 fb e7 24 80 f7 9a 00 b1 fb af 24 80 |......$.......$.| 216 002bc350 f7 b1 00 67 fb ee 24 80 f7 216 002bc350 f7 b1 00 67 fb ee 24 80 f7 96 00 be fb 92 24 80 |...g..$.......$.| 217 002bc360 f7 ab 00 7a fc 1b 24 80 f7 217 002bc360 f7 ab 00 7a fc 1b 24 80 f7 b6 00 ae fb 76 24 80 |...z..$......v$.| 218 002bc370 f7 ce 00 a3 fc 02 24 80 f7 218 002bc370 f7 ce 00 a3 fc 02 24 80 f7 c0 00 be fb 8b 24 80 |......$.......$.| 219 002bc380 f7 c3 00 93 fb d0 24 80 f7 219 002bc380 f7 c3 00 93 fb d0 24 80 f7 ce 00 d8 fb c8 24 80 |......$.......$.| 220 002bc390 f7 bd 00 c0 fb 82 24 80 f8 220 002bc390 f7 bd 00 c0 fb 82 24 80 f8 00 00 e8 fb db 24 80 |......$.......$.| 221 002bc3a0 f7 d8 00 d3 fb b4 24 80 f8 221 002bc3a0 f7 d8 00 d3 fb b4 24 80 f8 0b 00 e5 fb c3 24 80 |......$.......$.| 222 002bc3b0 f7 eb 00 c8 fb 92 24 80 f7 222 002bc3b0 f7 eb 00 c8 fb 92 24 80 f7 e7 00 ea fb cb 24 80 |......$.......$.| 223 002bc3c0 f7 fd 00 cb fb 94 24 80 f7 223 002bc3c0 f7 fd 00 cb fb 94 24 80 f7 e3 00 f2 fb b8 24 80 |......$.......$.| 224 ... 224 ... 225 225 226 See ``Documentation/iio/iio_devbuf.rst`` for m 226 See ``Documentation/iio/iio_devbuf.rst`` for more information about how buffered 227 data is structured. 227 data is structured. 228 228 229 4. IIO Interfacing Tools 229 4. IIO Interfacing Tools 230 ======================== 230 ======================== 231 231 232 See ``Documentation/iio/iio_tools.rst`` for th 232 See ``Documentation/iio/iio_tools.rst`` for the description of the available IIO 233 interfacing tools. 233 interfacing tools.
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.