adis16480.rst 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ================
  3. ADIS16480 driver
  4. ================
  5. This driver supports Analog Device's IMUs on SPI bus.
  6. 1. Supported devices
  7. ====================
  8. * `ADIS16375 <https://www.analog.com/ADIS16375>`_
  9. * `ADIS16480 <https://www.analog.com/ADIS16480>`_
  10. * `ADIS16485 <https://www.analog.com/ADIS16485>`_
  11. * `ADIS16488 <https://www.analog.com/ADIS16488>`_
  12. * `ADIS16490 <https://www.analog.com/ADIS16490>`_
  13. * `ADIS16495 <https://www.analog.com/ADIS16495>`_
  14. * `ADIS16497 <https://www.analog.com/ADIS16497>`_
  15. * `ADIS16545 <https://www.analog.com/ADIS16545>`_
  16. * `ADIS16547 <https://www.analog.com/ADIS16547>`_
  17. Each supported device is a complete inertial system that includes a triaxial
  18. gyroscope and a triaxial accelerometer. Each inertial sensor in device combines
  19. with signal conditioning that optimizes dynamic performance. The factory
  20. calibration characterizes each sensor for sensitivity, bias, and alignment. As
  21. a result, each sensor has its own dynamic compensation formulas that provide
  22. accurate sensor measurements.
  23. 2. Device attributes
  24. ====================
  25. Accelerometer, gyroscope measurements are always provided. Furthermore, the
  26. driver offers the capability to retrieve the delta angle and the delta velocity
  27. measurements computed by the device.
  28. The delta angle measurements represent a calculation of angular displacement
  29. between each sample update, while the delta velocity measurements represent a
  30. calculation of linear velocity change between each sample update.
  31. Finally, temperature data are provided which show a coarse measurement of
  32. the temperature inside of the IMU device. This data is most useful for
  33. monitoring relative changes in the thermal environment.
  34. ADIS16480 and ADIS16488 also provide access to barometric pressure data and
  35. triaxial magnetometer measurements.
  36. Each IIO device, has a device folder under ``/sys/bus/iio/devices/iio:deviceX``,
  37. where X is the IIO index of the device. Under these folders reside a set of
  38. device files, depending on the characteristics and features of the hardware
  39. device in questions. These files are consistently generalized and documented in
  40. the IIO ABI documentation.
  41. The following tables show the adis16480 related device files, found in the
  42. specific device folder path ``/sys/bus/iio/devices/iio:deviceX``.
  43. **Available only for ADIS16480 and ADIS16488:**
  44. +------------------------------------------+---------------------------------------------------------+
  45. | 3-Axis Magnetometer related device files | Description |
  46. +------------------------------------------+---------------------------------------------------------+
  47. | in_magn_scale | Scale for the magnetometer channels. |
  48. +------------------------------------------+---------------------------------------------------------+
  49. | in_magn_x_calibbias | Calibration offset for the X-axis magnetometer channel. |
  50. +------------------------------------------+---------------------------------------------------------+
  51. | in_magn_x_filter_low_pass_3db_frequency | Bandwidth for the X-axis magnetometer channel. |
  52. +------------------------------------------+---------------------------------------------------------+
  53. | in_magn_x_raw | Raw X-axis magnetometer channel value. |
  54. +------------------------------------------+---------------------------------------------------------+
  55. | in_magn_y_calibbias | Calibration offset for the Y-axis magnetometer channel. |
  56. +------------------------------------------+---------------------------------------------------------+
  57. | in_magn_y_filter_low_pass_3db_frequency | Bandwidth for the Y-axis magnetometer channel. |
  58. +------------------------------------------+---------------------------------------------------------+
  59. | in_magn_y_raw | Raw Y-axis magnetometer channel value. |
  60. +------------------------------------------+---------------------------------------------------------+
  61. | in_magn_z_calibbias | Calibration offset for the Z-axis magnetometer channel. |
  62. +------------------------------------------+---------------------------------------------------------+
  63. | in_magn_z_filter_low_pass_3db_frequency | Bandwidth for the Z-axis magnetometer channel. |
  64. +------------------------------------------+---------------------------------------------------------+
  65. | in_magn_z_raw | Raw Z-axis magnetometer channel value. |
  66. +------------------------------------------+---------------------------------------------------------+
  67. +------------------------------------------+-----------------------------------------------------+
  68. | Barometric pressure sensor related files | Description |
  69. +------------------------------------------+-----------------------------------------------------+
  70. | in_pressure0_calibbias | Calibration offset for barometric pressure channel. |
  71. +------------------------------------------+-----------------------------------------------------+
  72. | in_pressure0_raw | Raw barometric pressure channel value. |
  73. +------------------------------------------+-----------------------------------------------------+
  74. | in_pressure0_scale | Scale for the barometric pressure sensor channel. |
  75. +------------------------------------------+-----------------------------------------------------+
  76. **Available for all supported devices:**
  77. +-------------------------------------------+----------------------------------------------------------+
  78. | 3-Axis Accelerometer related device files | Description |
  79. +-------------------------------------------+----------------------------------------------------------+
  80. | in_accel_scale | Scale for the accelerometer channels. |
  81. +-------------------------------------------+----------------------------------------------------------+
  82. | in_accel_x_calibbias | Calibration offset for the X-axis accelerometer channel. |
  83. +-------------------------------------------+----------------------------------------------------------+
  84. | in_accel_x_calibscale | Calibration scale for the X-axis accelerometer channel. |
  85. +-------------------------------------------+----------------------------------------------------------+
  86. | in_accel_x_filter_low_pass_3db_frequency | Bandwidth for the X-axis accelerometer channel. |
  87. +-------------------------------------------+----------------------------------------------------------+
  88. | in_accel_x_raw | Raw X-axis accelerometer channel value. |
  89. +-------------------------------------------+----------------------------------------------------------+
  90. | in_accel_y_calibbias | Calibration offset for the Y-axis accelerometer channel. |
  91. +-------------------------------------------+----------------------------------------------------------+
  92. | in_accel_y_calibscale | Calibration scale for the Y-axis accelerometer channel. |
  93. +-------------------------------------------+----------------------------------------------------------+
  94. | in_accel_y_filter_low_pass_3db_frequency | Bandwidth for the Y-axis accelerometer channel. |
  95. +-------------------------------------------+----------------------------------------------------------+
  96. | in_accel_y_raw | Raw Y-axis accelerometer channel value. |
  97. +-------------------------------------------+----------------------------------------------------------+
  98. | in_accel_z_calibbias | Calibration offset for the Z-axis accelerometer channel. |
  99. +-------------------------------------------+----------------------------------------------------------+
  100. | in_accel_z_calibscale | Calibration scale for the Z-axis accelerometer channel. |
  101. +-------------------------------------------+----------------------------------------------------------+
  102. | in_accel_z_filter_low_pass_3db_frequency | Bandwidth for the Z-axis accelerometer channel. |
  103. +-------------------------------------------+----------------------------------------------------------+
  104. | in_accel_z_raw | Raw Z-axis accelerometer channel value. |
  105. +-------------------------------------------+----------------------------------------------------------+
  106. | in_deltavelocity_scale | Scale for delta velocity channels. |
  107. +-------------------------------------------+----------------------------------------------------------+
  108. | in_deltavelocity_x_raw | Raw X-axis delta velocity channel value. |
  109. +-------------------------------------------+----------------------------------------------------------+
  110. | in_deltavelocity_y_raw | Raw Y-axis delta velocity channel value. |
  111. +-------------------------------------------+----------------------------------------------------------+
  112. | in_deltavelocity_z_raw | Raw Z-axis delta velocity channel value. |
  113. +-------------------------------------------+----------------------------------------------------------+
  114. +--------------------------------------------+------------------------------------------------------+
  115. | 3-Axis Gyroscope related device files | Description |
  116. +--------------------------------------------+------------------------------------------------------+
  117. | in_anglvel_scale | Scale for the gyroscope channels. |
  118. +--------------------------------------------+------------------------------------------------------+
  119. | in_anglvel_x_calibbias | Calibration offset for the X-axis gyroscope channel. |
  120. +--------------------------------------------+------------------------------------------------------+
  121. | in_anglvel_x_calibscale | Calibration scale for the X-axis gyroscope channel. |
  122. +--------------------------------------------+------------------------------------------------------+
  123. | in_anglvel_x_filter_low_pass_3db_frequency | Bandwidth for the X-axis gyroscope channel. |
  124. +--------------------------------------------+------------------------------------------------------+
  125. | in_anglvel_x_raw | Raw X-axis gyroscope channel value. |
  126. +--------------------------------------------+------------------------------------------------------+
  127. | in_anglvel_y_calibbias | Calibration offset for the Y-axis gyroscope channel. |
  128. +--------------------------------------------+------------------------------------------------------+
  129. | in_anglvel_y_calibscale | Calibration scale for the Y-axis gyroscope channel. |
  130. +--------------------------------------------+------------------------------------------------------+
  131. | in_anglvel_y_filter_low_pass_3db_frequency | Bandwidth for the Y-axis gyroscope channel. |
  132. +--------------------------------------------+------------------------------------------------------+
  133. | in_anglvel_y_raw | Raw Y-axis gyroscope channel value. |
  134. +--------------------------------------------+------------------------------------------------------+
  135. | in_anglvel_z_calibbias | Calibration offset for the Z-axis gyroscope channel. |
  136. +--------------------------------------------+------------------------------------------------------+
  137. | in_anglvel_z_calibscale | Calibration scale for the Z-axis gyroscope channel. |
  138. +--------------------------------------------+------------------------------------------------------+
  139. | in_anglvel_z_filter_low_pass_3db_frequency | Bandwidth for the Z-axis gyroscope channel. |
  140. +--------------------------------------------+------------------------------------------------------+
  141. | in_anglvel_z_raw | Raw Z-axis gyroscope channel value. |
  142. +--------------------------------------------+------------------------------------------------------+
  143. | in_deltaangl_scale | Scale for delta angle channels. |
  144. +--------------------------------------------+------------------------------------------------------+
  145. | in_deltaangl_x_raw | Raw X-axis delta angle channel value. |
  146. +--------------------------------------------+------------------------------------------------------+
  147. | in_deltaangl_y_raw | Raw Y-axis delta angle channel value. |
  148. +--------------------------------------------+------------------------------------------------------+
  149. | in_deltaangl_z_raw | Raw Z-axis delta angle channel value. |
  150. +--------------------------------------------+------------------------------------------------------+
  151. +----------------------------------+-------------------------------------------+
  152. | Temperature sensor related files | Description |
  153. +----------------------------------+-------------------------------------------+
  154. | in_temp0_raw | Raw temperature channel value. |
  155. +----------------------------------+-------------------------------------------+
  156. | in_temp0_offset | Offset for the temperature sensor channel.|
  157. +----------------------------------+-------------------------------------------+
  158. | in_temp0_scale | Scale for the temperature sensor channel. |
  159. +----------------------------------+-------------------------------------------+
  160. +-------------------------------+---------------------------------------------------------+
  161. | Miscellaneous device files | Description |
  162. +-------------------------------+---------------------------------------------------------+
  163. | name | Name of the IIO device. |
  164. +-------------------------------+---------------------------------------------------------+
  165. | sampling_frequency | Currently selected sample rate. |
  166. +-------------------------------+---------------------------------------------------------+
  167. The following table shows the adis16480 related device debug files, found in the
  168. specific device debug folder path ``/sys/kernel/debug/iio/iio:deviceX``.
  169. +----------------------+-------------------------------------------------------------------------+
  170. | Debugfs device files | Description |
  171. +----------------------+-------------------------------------------------------------------------+
  172. | serial_number | The serial number of the chip in hexadecimal format. |
  173. +----------------------+-------------------------------------------------------------------------+
  174. | product_id | Chip specific product id (e.g. 16480, 16488, 16545, etc.). |
  175. +----------------------+-------------------------------------------------------------------------+
  176. | flash_count | The number of flash writes performed on the device. |
  177. +----------------------+-------------------------------------------------------------------------+
  178. | firmware_revision | String containing the firmware revision in the following format ##.##. |
  179. +----------------------+-------------------------------------------------------------------------+
  180. | firmware_date | String containing the firmware date in the following format mm-dd-yyyy. |
  181. +----------------------+-------------------------------------------------------------------------+
  182. Channels processed values
  183. -------------------------
  184. A channel value can be read from its _raw attribute. The value returned is the
  185. raw value as reported by the devices. To get the processed value of the channel,
  186. apply the following formula:
  187. .. code-block:: bash
  188. processed value = (_raw + _offset) * _scale
  189. Where _offset and _scale are device attributes. If no _offset attribute is
  190. present, simply assume its value is 0.
  191. The adis16480 driver offers data for 7 types of channels, the table below shows
  192. the measurement units for the processed value, which are defined by the IIO
  193. framework:
  194. +--------------------------------------+---------------------------+
  195. | Channel type | Measurement unit |
  196. +--------------------------------------+---------------------------+
  197. | Acceleration on X, Y, and Z axis | Meters per Second squared |
  198. +--------------------------------------+---------------------------+
  199. | Angular velocity on X, Y and Z axis | Radians per second |
  200. +--------------------------------------+---------------------------+
  201. | Delta velocity on X. Y, and Z axis | Meters per Second |
  202. +--------------------------------------+---------------------------+
  203. | Delta angle on X, Y, and Z axis | Radians |
  204. +--------------------------------------+---------------------------+
  205. | Temperature | Millidegrees Celsius |
  206. +--------------------------------------+---------------------------+
  207. | Magnetic field along X, Y and Z axis | Gauss |
  208. +--------------------------------------+---------------------------+
  209. | Barometric pressure | kilo Pascal |
  210. +--------------------------------------+---------------------------+
  211. Usage examples
  212. --------------
  213. Show device name:
  214. .. code-block:: bash
  215. root:/sys/bus/iio/devices/iio:device0> cat name
  216. adis16545-1
  217. Show accelerometer channels value:
  218. .. code-block:: bash
  219. root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_raw
  220. 1376728
  221. root:/sys/bus/iio/devices/iio:device0> cat in_accel_y_raw
  222. 4487621
  223. root:/sys/bus/iio/devices/iio:device0> cat in_accel_z_raw
  224. 262773792
  225. root:/sys/bus/iio/devices/iio:device0> cat in_accel_scale
  226. 0.000000037
  227. - X-axis acceleration = in_accel_x_raw * in_accel_scale = 0.050938936 m/s^2
  228. - Y-axis acceleration = in_accel_y_raw * in_accel_scale = 0.166041977 m/s^2
  229. - Z-axis acceleration = in_accel_z_raw * in_accel_scale = 9.722630304 m/s^2
  230. Show gyroscope channels value:
  231. .. code-block:: bash
  232. root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_x_raw
  233. -1041702
  234. root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_y_raw
  235. -273013
  236. root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_z_raw
  237. 2745116
  238. root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_scale
  239. 0.000000001
  240. - X-axis angular velocity = in_anglvel_x_raw * in_anglvel_scale = −0.001041702 rad/s
  241. - Y-axis angular velocity = in_anglvel_y_raw * in_anglvel_scale = −0.000273013 rad/s
  242. - Z-axis angular velocity = in_anglvel_z_raw * in_anglvel_scale = 0.002745116 rad/s
  243. Set calibration offset for accelerometer channels:
  244. .. code-block:: bash
  245. root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias
  246. 0
  247. root:/sys/bus/iio/devices/iio:device0> echo 5000 > in_accel_x_calibbias
  248. root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias
  249. 5000
  250. Set calibration offset for gyroscope channels:
  251. .. code-block:: bash
  252. root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_y_calibbias
  253. 0
  254. root:/sys/bus/iio/devices/iio:device0> echo -5000 > in_anglvel_y_calibbias
  255. root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_y_calibbias
  256. -5000
  257. Set sampling frequency:
  258. .. code-block:: bash
  259. root:/sys/bus/iio/devices/iio:device0> cat sampling_frequency
  260. 4250.000000
  261. root:/sys/bus/iio/devices/iio:device0> echo 1000 > sampling_frequency
  262. 1062.500000
  263. Set bandwidth for accelerometer channels:
  264. .. code-block:: bash
  265. root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_filter_low_pass_3db_frequency
  266. 0
  267. root:/sys/bus/iio/devices/iio:device0> echo 300 > in_accel_x_filter_low_pass_3db_frequency
  268. root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_filter_low_pass_3db_frequency
  269. 300
  270. Show serial number:
  271. .. code-block:: bash
  272. root:/sys/kernel/debug/iio/iio:device0> cat serial_number
  273. 0x000c
  274. Show product id:
  275. .. code-block:: bash
  276. root:/sys/kernel/debug/iio/iio:device0> cat product_id
  277. 16545
  278. Show flash count:
  279. .. code-block:: bash
  280. root:/sys/kernel/debug/iio/iio:device0> cat flash_count
  281. 88
  282. Show firmware revision:
  283. .. code-block:: bash
  284. root:/sys/kernel/debug/iio/iio:device0> cat firmware_revision
  285. 1.4
  286. Show firmware date:
  287. .. code-block:: bash
  288. root:/sys/kernel/debug/iio/iio:device0> cat firmware_date
  289. 09-23-2023
  290. 3. Device buffers
  291. =================
  292. This driver supports IIO buffers.
  293. All devices support retrieving the raw acceleration, gyroscope and temperature
  294. measurements using buffers.
  295. The following device families also support retrieving the delta velocity, delta
  296. angle and temperature measurements using buffers:
  297. - ADIS16545
  298. - ADIS16547
  299. However, when retrieving acceleration or gyroscope data using buffers, delta
  300. readings will not be available and vice versa. This is because the device only
  301. allows to read either acceleration and gyroscope data or delta velocity and
  302. delta angle data at a time and switching between these two burst data selection
  303. modes is time consuming.
  304. Usage examples
  305. --------------
  306. Set device trigger in current_trigger, if not already set:
  307. .. code-block:: bash
  308. root:/sys/bus/iio/devices/iio:device0> cat trigger/current_trigger
  309. root:/sys/bus/iio/devices/iio:device0> echo adis16545-1-dev0 > trigger/current_trigger
  310. root:/sys/bus/iio/devices/iio:device0> cat trigger/current_trigger
  311. adis16545-1-dev0
  312. Select channels for buffer read:
  313. .. code-block:: bash
  314. root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_deltavelocity_x_en
  315. root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_deltavelocity_y_en
  316. root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_deltavelocity_z_en
  317. root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_temp0_en
  318. Set the number of samples to be stored in the buffer:
  319. .. code-block:: bash
  320. root:/sys/bus/iio/devices/iio:device0> echo 10 > buffer/length
  321. Enable buffer readings:
  322. .. code-block:: bash
  323. root:/sys/bus/iio/devices/iio:device0> echo 1 > buffer/enable
  324. Obtain buffered data::
  325. root:/sys/bus/iio/devices/iio:device0> hexdump -C /dev/iio\:device0
  326. ...
  327. 00006aa0 09 62 00 00 ff ff fc a4 00 00 01 69 00 03 3c 08 |.b.........i..<.|
  328. 00006ab0 09 61 00 00 00 00 02 96 00 00 02 8f 00 03 37 50 |.a............7P|
  329. 00006ac0 09 61 00 00 00 00 12 3d 00 00 0b 89 00 03 2c 0b |.a.....=......,.|
  330. 00006ad0 09 61 00 00 00 00 1e dc 00 00 16 dd 00 03 25 bf |.a............%.|
  331. 00006ae0 09 61 00 00 00 00 1e e3 00 00 1b bf 00 03 27 0b |.a............'.|
  332. 00006af0 09 61 00 00 00 00 15 50 00 00 19 44 00 03 30 fd |.a.....P...D..0.|
  333. 00006b00 09 61 00 00 00 00 09 0e 00 00 14 41 00 03 3d 7f |.a.........A..=.|
  334. 00006b10 09 61 00 00 ff ff ff f0 00 00 0e bc 00 03 48 d0 |.a............H.|
  335. 00006b20 09 63 00 00 00 00 00 9f 00 00 0f 37 00 03 4c fe |.c.........7..L.|
  336. 00006b30 09 64 00 00 00 00 0b f6 00 00 18 92 00 03 43 22 |.d............C"|
  337. 00006b40 09 64 00 00 00 00 18 df 00 00 22 33 00 03 33 ab |.d........"3..3.|
  338. 00006b50 09 63 00 00 00 00 1e 81 00 00 26 be 00 03 29 60 |.c........&...)`|
  339. 00006b60 09 63 00 00 00 00 1b 13 00 00 22 2f 00 03 23 91 |.c........"/..#.|
  340. ...
  341. See ``Documentation/iio/iio_devbuf.rst`` for more information about how buffered
  342. data is structured.
  343. 4. IIO Interfacing Tools
  344. ========================
  345. See ``Documentation/iio/iio_tools.rst`` for the description of the available IIO
  346. interfacing tools.