\sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget/translations/zh_CN/iio/adxl345modnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/zh_TW/iio/adxl345modnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/it_IT/iio/adxl345modnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/ja_JP/iio/adxl345modnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/ko_KR/iio/adxl345modnameN classnameN refexplicituh1hhh ubh)}(hhh]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/pt_BR/iio/adxl345modnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/sp_SP/iio/adxl345modnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh9/var/lib/git/docbuild/linux/Documentation/iio/adxl345.rsthKubhsection)}(hhh](htitle)}(hADXL345 driverh]hADXL345 driver}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(h@This driver supports Analog Device's ADXL345/375 on SPI/I2C bus.h]hBThis driver supports Analog Device’s ADXL345/375 on SPI/I2C bus.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(h1. Supported Devicesh]h1. Supported Devices}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh bullet_list)}(hhh](h list_item)}(h+`ADXL345 `_h]h)}(hjh](h reference)}(hjh]hADXL345}(hjhhhNhNubah}(h]h ]h"]h$]h&]nameADXL345refurihttps://www.analog.com/ADXL345uh1j hj ubhtarget)}(h! h]h}(h]adxl345ah ]h"]adxl345ah$]h&]refurijuh1j referencedKhj ubeh}(h]h ]h"]h$]h&]uh1hhhhK hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h,`ADXL375 `_ h]h)}(h+`ADXL375 `_h](j )}(hjAh]hADXL375}(hjChhhNhNubah}(h]h ]h"]h$]h&]nameADXL375jhttps://www.analog.com/ADXL375uh1j hj?ubj )}(h! h]h}(h]adxl375ah ]h"]adxl375ah$]h&]refurijRuh1jj.Khj?ubeh}(h]h ]h"]h$]h&]uh1hhhhK hj;ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]bullet*uh1hhhhK hhhhubh)}(hThe ADXL345 is a general-purpose, low-power, 3-axis accelerometer with selectable measurement ranges. The ADXL345 supports the following ranges:h]hThe ADXL345 is a general-purpose, low-power, 3-axis accelerometer with selectable measurement ranges. The ADXL345 supports the following ranges:}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](j)}(h±2g (approx. ±19.61 m/s^2)h]h)}(hjh]h±2g (approx. ±19.61 m/s^2)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h±4g (approx. ±39.23 m/s^2)h]h)}(hjh]h±4g (approx. ±39.23 m/s^2)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h±8g (approx. ±78.45 m/s^2)h]h)}(hjh]h±8g (approx. ±78.45 m/s^2)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h±16g (approx. ±156.91 m/s^2) h]h)}(h±16g (approx. ±156.91 m/s^2)h]h±16g (approx. ±156.91 m/s^2)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]jr-uh1hhhhKhhhhubeh}(h]supported-devicesah ]h"]1. supported devicesah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(h2. Device Attributesh]h2. Device Attributes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXQEach IIO device has a device folder under ``/sys/bus/iio/devices/iio:deviceX``, where X is the IIO index of the device. Under these folders reside a set of device files, depending on the characteristics and features of the hardware device in question. These files are consistently generalized and documented in the IIO ABI documentation.h](h*Each IIO device has a device folder under }(hjhhhNhNubhliteral)}(h$``/sys/bus/iio/devices/iio:deviceX``h]h /sys/bus/iio/devices/iio:deviceX}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubhX, where X is the IIO index of the device. Under these folders reside a set of device files, depending on the characteristics and features of the hardware device in question. These files are consistently generalized and documented in the IIO ABI documentation.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe following table shows the ADXL345 related device files, found in the specific device folder path ``/sys/bus/iio/devices/iio:deviceX``.h](heThe following table shows the ADXL345 related device files, found in the specific device folder path }(hj$hhhNhNubj )}(h$``/sys/bus/iio/devices/iio:deviceX``h]h /sys/bus/iio/devices/iio:deviceX}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj$ubh.}(hj$hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hjhhubhtable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthK+uh1jNhjKubjO)}(hhh]h}(h]h ]h"]h$]h&]colwidthK:uh1jNhjKubhtbody)}(hhh](hrow)}(hhh](hentry)}(hhh]h)}(h)3-Axis Accelerometer related device filesh]h)3-Axis Accelerometer related device files}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK$hjpubah}(h]h ]h"]h$]h&]uh1jnhjkubjo)}(hhh]h)}(h Descriptionh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK$hjubah}(h]h ]h"]h$]h&]uh1jnhjkubeh}(h]h ]h"]h$]h&]uh1jihjfubjj)}(hhh](jo)}(hhh]h)}(hin_accel_sampling_frequencyh]hin_accel_sampling_frequency}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(hCurrently selected sample rate.h]hCurrently selected sample rate.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hjubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjfubjj)}(hhh](jo)}(hhh]h)}(h%in_accel_sampling_frequency_availableh]h%in_accel_sampling_frequency_available}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(h,Available sampling frequency configurations.h]h,Available sampling frequency configurations.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjfubjj)}(hhh](jo)}(hhh]h)}(hin_accel_scaleh]hin_accel_scale}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(h+Scale/range for the accelerometer channels.h]h+Scale/range for the accelerometer channels.}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hj,ubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjfubjj)}(hhh](jo)}(hhh]h)}(hin_accel_scale_availableh]hin_accel_scale_available}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK,hjLubah}(h]h ]h"]h$]h&]uh1jnhjIubjo)}(hhh]h)}(h5Available scale ranges for the accelerometer channel.h]h5Available scale ranges for the accelerometer channel.}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK,hjcubah}(h]h ]h"]h$]h&]uh1jnhjIubeh}(h]h ]h"]h$]h&]uh1jihjfubjj)}(hhh](jo)}(hhh]h)}(hin_accel_x_calibbiash]hin_accel_x_calibbias}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(h8Calibration offset for the X-axis accelerometer channel.h]h8Calibration offset for the X-axis accelerometer channel.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjfubjj)}(hhh](jo)}(hhh]h)}(hin_accel_x_rawh]hin_accel_x_raw}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(h'Raw X-axis accelerometer channel value.h]h'Raw X-axis accelerometer channel value.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hjubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjfubjj)}(hhh](jo)}(hhh]h)}(hin_accel_y_calibbiash]hin_accel_y_calibbias}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(h%Y-axis acceleration offset correctionh]h%Y-axis acceleration offset correction}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hjubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjfubjj)}(hhh](jo)}(hhh]h)}(hin_accel_y_rawh]hin_accel_y_raw}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hj(ubah}(h]h ]h"]h$]h&]uh1jnhj%ubjo)}(hhh]h)}(h'Raw Y-axis accelerometer channel value.h]h'Raw Y-axis accelerometer channel value.}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hj?ubah}(h]h ]h"]h$]h&]uh1jnhj%ubeh}(h]h ]h"]h$]h&]uh1jihjfubjj)}(hhh](jo)}(hhh]h)}(hin_accel_z_calibbiash]hin_accel_z_calibbias}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hj_ubah}(h]h ]h"]h$]h&]uh1jnhj\ubjo)}(hhh]h)}(h8Calibration offset for the Z-axis accelerometer channel.h]h8Calibration offset for the Z-axis accelerometer channel.}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjvubah}(h]h ]h"]h$]h&]uh1jnhj\ubeh}(h]h ]h"]h$]h&]uh1jihjfubjj)}(hhh](jo)}(hhh]h)}(hin_accel_z_rawh]hin_accel_z_raw}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(h'Raw Z-axis accelerometer channel value.h]h'Raw Z-axis accelerometer channel value.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjfubeh}(h]h ]h"]h$]h&]uh1jdhjKubeh}(h]h ]h"]h$]h&]colsKuh1jIhjFubah}(h]h ]h"]h$]h&]uh1jDhjhhhhhNubh)}(hhh](h)}(hChannel Processed Valuesh]hChannel Processed Values}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKhjhhubh literal_block)}(h+processed value = (_raw + _offset) * _scaleh]h+processed value = (_raw + _offset) * _scale}hjsbah}(h]h ]h"]h$]h&]hhƌforcelanguagebashhighlight_args}uh1jhhhKBhjhhubh)}(hqWhere _offset and _scale are device attributes. If no _offset attribute is present, simply assume its value is 0.h]hqWhere _offset and _scale are device attributes. If no _offset attribute is present, simply assume its value is 0.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjhhubjE)}(hhh]jJ)}(hhh](jO)}(hhh]h}(h]h ]h"]h$]h&]colwidthK%uh1jNhj"ubjO)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jNhj"ubje)}(hhh](jj)}(hhh](jo)}(hhh]h)}(h Channel typeh]h Channel type}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhj?ubah}(h]h ]h"]h$]h&]uh1jnhj<ubjo)}(hhh]h)}(hMeasurement unith]hMeasurement unit}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhjVubah}(h]h ]h"]h$]h&]uh1jnhj<ubeh}(h]h ]h"]h$]h&]uh1jihj9ubjj)}(hhh](jo)}(hhh]h)}(h Acceleration on X, Y, and Z axesh]h Acceleration on X, Y, and Z axes}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKLhjvubah}(h]h ]h"]h$]h&]uh1jnhjsubjo)}(hhh]h)}(hMeters per second squaredh]hMeters per second squared}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKLhjubah}(h]h ]h"]h$]h&]uh1jnhjsubeh}(h]h ]h"]h$]h&]uh1jihj9ubeh}(h]h ]h"]h$]h&]uh1jdhj"ubeh}(h]h ]h"]h$]h&]colsKuh1jIhjubah}(h]h ]h"]h$]h&]uh1jDhjhhhhhNubeh}(h]channel-processed-valuesah ]h"]channel processed valuesah$]h&]uh1hhjhhhhhKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK`hj;ubah}(h]h ]h"]h$]h&]uh1jnhj!ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(hin_accel_gesture_doubletap_enh]hin_accel_gesture_doubletap_en}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhj[ubah}(h]h ]h"]h$]h&]uh1jnhjXubjo)}(hhh]h)}(h'Enable double tap detection on all axesh]h'Enable double tap detection on all axes}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhjrubah}(h]h ]h"]h$]h&]uh1jnhjXubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(h(in_accel_gesture_doubletap_reset_timeouth]h(in_accel_gesture_doubletap_reset_timeout}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(hDouble tap window in [us]h]hDouble tap window in [us]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhjubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(h in_accel_gesture_doubletap_scaleh]h in_accel_gesture_doubletap_scale}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(h#Double tap gesture threshold scale.h]h#Double tap gesture threshold scale.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(h)in_accel_gesture_doubletap_tap2_min_delayh]h)in_accel_gesture_doubletap_tap2_min_delay}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(hDouble tap latency in [us]h]hDouble tap latency in [us]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhjubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(h in_accel_gesture_doubletap_valueh]h in_accel_gesture_doubletap_value}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhj7ubah}(h]h ]h"]h$]h&]uh1jnhj4ubjo)}(hhh]h)}(hDouble tap threshold valueh]hDouble tap threshold value}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjNubah}(h]h ]h"]h$]h&]uh1jnhj4ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(h in_accel_gesture_singletap_scaleh]h in_accel_gesture_singletap_scale}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKlhjnubah}(h]h ]h"]h$]h&]uh1jnhjkubjo)}(hhh]h)}(h#Single tap gesture threshold scale.h]h#Single tap gesture threshold scale.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKlhjubah}(h]h ]h"]h$]h&]uh1jnhjkubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(h"in_accel_gesture_singletap_timeouth]h"in_accel_gesture_singletap_timeout}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKnhjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(hSingle tap duration in [us]h]hSingle tap duration in [us]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKnhjubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(h in_accel_gesture_singletap_valueh]h in_accel_gesture_singletap_value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(hSingle tap threshold valueh]hSingle tap threshold value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphjubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(h$in_accel_mag_adaptive_falling_periodh]h$in_accel_mag_adaptive_falling_period}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKrhjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(h%AC coupled inactivity time in secondsh]h%AC coupled inactivity time in seconds}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKrhj*ubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(h#in_accel_mag_adaptive_falling_scaleh]h#in_accel_mag_adaptive_falling_scale}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKthjJubah}(h]h ]h"]h$]h&]uh1jnhjGubjo)}(hhh]h)}(h&AC coupled inactivity threshold scale.h]h&AC coupled inactivity threshold scale.}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKthjaubah}(h]h ]h"]h$]h&]uh1jnhjGubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(h#in_accel_mag_adaptive_falling_valueh]h#in_accel_mag_adaptive_falling_value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKvhjubah}(h]h ]h"]h$]h&]uh1jnhj~ubjo)}(hhh]h)}(hAC coupled inactivity thresholdh]hAC coupled inactivity threshold}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKvhjubah}(h]h ]h"]h$]h&]uh1jnhj~ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(hin_accel_mag_adaptive_rising_enh]hin_accel_mag_adaptive_rising_en}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKxhjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(h$Enable AC coupled activity on X axish]h$Enable AC coupled activity on X axis}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKxhjubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(h"in_accel_mag_adaptive_rising_scaleh]h"in_accel_mag_adaptive_rising_scale}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKzhjubah}(h]h ]h"]h$]h&]uh1jnhjubjo)}(hhh]h)}(h$AC coupled activity threshold scale.h]h$AC coupled activity threshold scale.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKzhj ubah}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(h"in_accel_mag_adaptive_rising_valueh]h"in_accel_mag_adaptive_rising_value}(hj) hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hj& ubah}(h]h ]h"]h$]h&]uh1jnhj# ubjo)}(hhh]h)}(hAC coupled activity thresholdh]hAC coupled activity threshold}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hj= ubah}(h]h ]h"]h$]h&]uh1jnhj# ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(hin_accel_mag_falling_periodh]hin_accel_mag_falling_period}(hj` hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hj] ubah}(h]h ]h"]h$]h&]uh1jnhjZ ubjo)}(hhh]h)}(hInactivity time in secondsh]hInactivity time in seconds}(hjw hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hjt ubah}(h]h ]h"]h$]h&]uh1jnhjZ ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(hin_accel_mag_falling_scaleh]hin_accel_mag_falling_scale}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhj ubjo)}(hhh]h)}(h&DC coupled inactivity threshold scale.h]h&DC coupled inactivity threshold scale.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhj ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(hin_accel_mag_falling_valueh]hin_accel_mag_falling_value}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhj ubjo)}(hhh]h)}(hInactivity threshold valueh]hInactivity threshold value}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhj ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(hin_accel_mag_rising_enh]hin_accel_mag_rising_en}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhj ubjo)}(hhh]h)}(h#Enable activity detection on X axish]h#Enable activity detection on X axis}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhj ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(hin_accel_mag_rising_scaleh]hin_accel_mag_rising_scale}(hj< hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj9 ubah}(h]h ]h"]h$]h&]uh1jnhj6 ubjo)}(hhh]h)}(h$DC coupled activity threshold scale.h]h$DC coupled activity threshold scale.}(hjS hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjP ubah}(h]h ]h"]h$]h&]uh1jnhj6 ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(hin_accel_mag_rising_valueh]hin_accel_mag_rising_value}(hjs hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjp ubah}(h]h ]h"]h$]h&]uh1jnhjm ubjo)}(hhh]h)}(hActivity threshold valueh]hActivity threshold value}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhjm ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(h&in_accel_x&y&z_mag_adaptive_falling_enh]h&in_accel_x&y&z_mag_adaptive_falling_en}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhj ubjo)}(hhh]h)}(h(Enable AC coupled inactivity on all axesh]h(Enable AC coupled inactivity on all axes}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhj ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(hin_accel_x&y&z_mag_falling_enh]hin_accel_x&y&z_mag_falling_en}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhj ubjo)}(hhh]h)}(h'Enable inactivity detection on all axesh]h'Enable inactivity detection on all axes}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhj ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(hin_accel_x_gesture_singletap_enh]hin_accel_x_gesture_singletap_en}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhj ubjo)}(hhh]h)}(h%Enable single tap detection on X axish]h%Enable single tap detection on X axis}(hj/ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj, ubah}(h]h ]h"]h$]h&]uh1jnhj ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(hin_accel_y_gesture_singletap_enh]hin_accel_y_gesture_singletap_en}(hjO hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjL ubah}(h]h ]h"]h$]h&]uh1jnhjI ubjo)}(hhh]h)}(h%Enable single tap detection on Y axish]h%Enable single tap detection on Y axis}(hjf hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjc ubah}(h]h ]h"]h$]h&]uh1jnhjI ubeh}(h]h ]h"]h$]h&]uh1jihjubjj)}(hhh](jo)}(hhh]h)}(hin_accel_z_gesture_singletap_enh]hin_accel_z_gesture_singletap_en}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhj ubjo)}(hhh]h)}(h%Enable single tap detection on Z axish]h%Enable single tap detection on Z axis}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jnhj ubeh}(h]h ]h"]h$]h&]uh1jihjubeh}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]colsKuh1jIhjubah}(h]h ]h"]h$]h&]uh1jDhjhhhhhNubh)}(hXPlease refer to the sensor's datasheet for a detailed description of this functionality.h]hZPlease refer to the sensor’s datasheet for a detailed description of this functionality.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXManually setting the **ODR** will cause the driver to estimate default values for inactivity detection timing, where higher ODR values correspond to longer default wait times, and lower ODR values to shorter ones. If these defaults do not meet your application’s needs, you can explicitly configure the inactivity wait time. Setting this value to 0 will revert to the default behavior.h](hManually setting the }(hj hhhNhNubhstrong)}(h**ODR**h]hODR}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubhXg will cause the driver to estimate default values for inactivity detection timing, where higher ODR values correspond to longer default wait times, and lower ODR values to shorter ones. If these defaults do not meet your application’s needs, you can explicitly configure the inactivity wait time. Setting this value to 0 will revert to the default behavior.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXWhen changing the **g range** configuration, the driver attempts to estimate appropriate activity and inactivity thresholds by scaling the default values based on the ratio of the previous range to the new one. The resulting threshold will never be zero and will always fall between 1 and 255, corresponding to up to 62.5 mg/LSB (0.612915 m/s^2/LSB) as specified in the datasheet. However, you can override these estimated thresholds by setting explicit values.h](hWhen changing the }(hj hhhNhNubj )}(h **g range**h]hg range}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubhX configuration, the driver attempts to estimate appropriate activity and inactivity thresholds by scaling the default values based on the ratio of the previous range to the new one. The resulting threshold will never be zero and will always fall between 1 and 255, corresponding to up to 62.5 mg/LSB (0.612915 m/s^2/LSB) as specified in the datasheet. However, you can override these estimated thresholds by setting explicit values.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXWhen **activity** and **inactivity** events are enabled, the driver automatically manages hysteresis behavior by setting the **link** and **auto-sleep** bits. The link bit connects the activity and inactivity functions, so that one follows the other. The auto-sleep function puts the sensor into sleep mode when inactivity is detected, reducing power consumption to the sub-12.5 Hz rate.h](hWhen }(hj hhhNhNubj )}(h **activity**h]hactivity}(hj" hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh and }(hj hhhNhNubj )}(h**inactivity**h]h inactivity}(hj4 hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubhY events are enabled, the driver automatically manages hysteresis behavior by setting the }(hj hhhNhNubj )}(h**link**h]hlink}(hjF hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh and }(hj hhhNhNubj )}(h**auto-sleep**h]h auto-sleep}(hjX hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh bits. The link bit connects the activity and inactivity functions, so that one follows the other. The auto-sleep function puts the sensor into sleep mode when inactivity is detected, reducing power consumption to the sub-12.5 Hz rate.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXKThe inactivity time is configurable between 1 and 255 seconds. In addition to inactivity detection, the sensor also supports free-fall detection, which, from the IIO perspective, is treated as a fall in magnitude across all axes. In sensor terms, free-fall is defined using an inactivity period ranging from 0.000 to 1.000 seconds.h]hXKThe inactivity time is configurable between 1 and 255 seconds. In addition to inactivity detection, the sensor also supports free-fall detection, which, from the IIO perspective, is treated as a fall in magnitude across all axes. In sensor terms, free-fall is defined using an inactivity period ranging from 0.000 to 1.000 seconds.}(hjp hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe driver behaves as follows:h]hThe driver behaves as follows:}(hj~ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](j)}(hIf the configured inactivity period is 1 second or more, the driver uses the sensor's inactivity register. This allows the event to be linked with activity detection, use auto-sleep, and be either AC- or DC-coupled. h]h)}(hIf the configured inactivity period is 1 second or more, the driver uses the sensor's inactivity register. This allows the event to be linked with activity detection, use auto-sleep, and be either AC- or DC-coupled.h]hIf the configured inactivity period is 1 second or more, the driver uses the sensor’s inactivity register. This allows the event to be linked with activity detection, use auto-sleep, and be either AC- or DC-coupled.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubj)}(hIf the inactivity period is less than 1 second, the event is treated as plain inactivity or free-fall detection. In this case, auto-sleep and coupling (AC/DC) are not applied. h]h)}(hIf the inactivity period is less than 1 second, the event is treated as plain inactivity or free-fall detection. In this case, auto-sleep and coupling (AC/DC) are not applied.h]hIf the inactivity period is less than 1 second, the event is treated as plain inactivity or free-fall detection. In this case, auto-sleep and coupling (AC/DC) are not applied.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubj)}(hIf an inactivity time of 0 seconds is configured, the driver selects a heuristically determined default period (greater than 1 second) to optimize power consumption. This also uses the inactivity register. h]h)}(hIf an inactivity time of 0 seconds is configured, the driver selects a heuristically determined default period (greater than 1 second) to optimize power consumption. This also uses the inactivity register.h]hIf an inactivity time of 0 seconds is configured, the driver selects a heuristically determined default period (greater than 1 second) to optimize power consumption. This also uses the inactivity register.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubeh}(h]h ]h"]h$]h&]jrjsuh1hhhhKhjhhubh)}(hXNote: According to the datasheet, the optimal ODR for detecting activity, or inactivity (or when operating with the free-fall register) should fall within the range of 12.5 Hz to 400 Hz. The recommended free-fall threshold is between 300 mg and 600 mg (register values 0x05 to 0x09).h]hXNote: According to the datasheet, the optimal ODR for detecting activity, or inactivity (or when operating with the free-fall register) should fall within the range of 12.5 Hz to 400 Hz. The recommended free-fall threshold is between 300 mg and 600 mg (register values 0x05 to 0x09).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXIn DC-coupled mode, the current acceleration magnitude is directly compared to the values in the THRESH_ACT and THRESH_INACT registers to determine activity or inactivity. In contrast, AC-coupled activity detection uses the acceleration value at the start of detection as a reference point, and subsequent samples are compared against this reference. While DC-coupling is the default mode-comparing live values to fixed thresholds-AC-coupling relies on an internal filter relative to the configured threshold.h]hXIn DC-coupled mode, the current acceleration magnitude is directly compared to the values in the THRESH_ACT and THRESH_INACT registers to determine activity or inactivity. In contrast, AC-coupled activity detection uses the acceleration value at the start of detection as a reference point, and subsequent samples are compared against this reference. While DC-coupling is the default mode-comparing live values to fixed thresholds-AC-coupling relies on an internal filter relative to the configured threshold.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXYAC and DC coupling modes are configured separately for activity and inactivity detection, but only one mode can be active at a time for each. For example, if AC-coupled activity detection is enabled and then DC-coupled mode is set, only DC-coupled activity detection will be active. In other words, only the most recent configuration is applied.h]hXYAC and DC coupling modes are configured separately for activity and inactivity detection, but only one mode can be active at a time for each. For example, if AC-coupled activity detection is enabled and then DC-coupled mode is set, only DC-coupled activity detection will be active. In other words, only the most recent configuration is applied.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hX**Single tap** detection can be configured per the datasheet by setting the threshold and duration parameters. When only single tap detection is enabled, the single tap interrupt triggers as soon as the acceleration exceeds the threshold (marking the start of the duration) and then falls below it, provided the duration limit is not exceeded. If both single tap and double tap detections are enabled, the single tap interrupt is triggered only after the double tap event has been either confirmed or dismissed.h](j )}(h**Single tap**h]h Single tap}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubhX detection can be configured per the datasheet by setting the threshold and duration parameters. When only single tap detection is enabled, the single tap interrupt triggers as soon as the acceleration exceeds the threshold (marking the start of the duration) and then falls below it, provided the duration limit is not exceeded. If both single tap and double tap detections are enabled, the single tap interrupt is triggered only after the double tap event has been either confirmed or dismissed.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXTo configure **double tap** detection, you must also set the window and latency parameters in microseconds (µs). The latency period begins once the single tap signal drops below the threshold and acts as a waiting time during which any spikes are ignored for double tap detection. After the latency period ends, the detection window starts. If the acceleration rises above the threshold and then falls below it again within this window, a double tap event is triggered upon the fall below the threshold.h](h To configure }(hj# hhhNhNubj )}(h**double tap**h]h double tap}(hj+ hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj# ubhX detection, you must also set the window and latency parameters in microseconds (µs). The latency period begins once the single tap signal drops below the threshold and acts as a waiting time during which any spikes are ignored for double tap detection. After the latency period ends, the detection window starts. If the acceleration rises above the threshold and then falls below it again within this window, a double tap event is triggered upon the fall below the threshold.}(hj# hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hDouble tap event detection is thoroughly explained in the datasheet. After a single tap event is detected, a double tap event may follow, provided the signal meets certain criteria. However, double tap detection can be invalidated for three reasons:h]hDouble tap event detection is thoroughly explained in the datasheet. After a single tap event is detected, a double tap event may follow, provided the signal meets certain criteria. However, double tap detection can be invalidated for three reasons:}(hjC hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](j)}(hIf the **suppress bit** is set, any acceleration spike above the tap threshold during the tap latency period immediately invalidates the double tap detection. In other words, no spikes are allowed during latency when the suppress bit is active. h]h)}(hIf the **suppress bit** is set, any acceleration spike above the tap threshold during the tap latency period immediately invalidates the double tap detection. In other words, no spikes are allowed during latency when the suppress bit is active.h](hIf the }(hjX hhhNhNubj )}(h**suppress bit**h]h suppress bit}(hj` hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjX ubh is set, any acceleration spike above the tap threshold during the tap latency period immediately invalidates the double tap detection. In other words, no spikes are allowed during latency when the suppress bit is active.}(hjX hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjT ubah}(h]h ]h"]h$]h&]uh1jhjQ hhhhhNubj)}(hrThe double tap event is invalid if the acceleration is above the threshold at the start of the double tap window. h]h)}(hqThe double tap event is invalid if the acceleration is above the threshold at the start of the double tap window.h]hqThe double tap event is invalid if the acceleration is above the threshold at the start of the double tap window.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj~ ubah}(h]h ]h"]h$]h&]uh1jhjQ hhhhhNubj)}(hvDouble tap detection is also invalidated if the acceleration duration exceeds the limit set by the duration register. h]h)}(huDouble tap detection is also invalidated if the acceleration duration exceeds the limit set by the duration register.h]huDouble tap detection is also invalidated if the acceleration duration exceeds the limit set by the duration register.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhjQ hhhhhNubeh}(h]h ]h"]h$]h&]jrjsuh1hhhhKhjhhubh)}(hXFor double tap detection, the same duration applies as for single tap: the acceleration must rise above the threshold and then fall below it within the specified duration. Note that the suppress bit is typically enabled when double tap detection is active.h]hXFor double tap detection, the same duration applies as for single tap: the acceleration must rise above the threshold and then fall below it within the specified duration. Note that the suppress bit is typically enabled when double tap detection is active.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] sensor-eventsah ]h"] sensor eventsah$]h&]uh1hhjhhhhhKPubh)}(hhh](h)}(hUsage Examplesh]hUsage Examples}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hShow device name:h]hShow device name:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(h7root:/sys/bus/iio/devices/iio:device0> cat name adxl345h]h7root:/sys/bus/iio/devices/iio:device0> cat name adxl345}hj sbah}(h]h ]h"]h$]h&]hhj j bashj}uh1jhhhKhj hhubh)}(h"Show accelerometer channels value:h]h"Show accelerometer channels value:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hroot:/sys/bus/iio/devices/iio:device0> cat in_accel_x_raw -1 root:/sys/bus/iio/devices/iio:device0> cat in_accel_y_raw 2 root:/sys/bus/iio/devices/iio:device0> cat in_accel_z_raw -253h]hroot:/sys/bus/iio/devices/iio:device0> cat in_accel_x_raw -1 root:/sys/bus/iio/devices/iio:device0> cat in_accel_y_raw 2 root:/sys/bus/iio/devices/iio:device0> cat in_accel_z_raw -253}hjsbah}(h]h ]h"]h$]h&]hhj j bashj}uh1jhhhMhj hhubh)}(h2Set calibration offset for accelerometer channels:h]h2Set calibration offset for accelerometer channels:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj hhubj)}(hroot:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias 0 root:/sys/bus/iio/devices/iio:device0> echo 50 > in_accel_x_calibbias root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias 50h]hroot:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias 0 root:/sys/bus/iio/devices/iio:device0> echo 50 > in_accel_x_calibbias root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias 50}hj%sbah}(h]h ]h"]h$]h&]hhj j bashj}uh1jhhhMhj hhubh)}(h_Given the 13-bit full resolution, the available ranges are calculated by the following formula:h]h_Given the 13-bit full resolution, the available ranges are calculated by the following formula:}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hA(g * 2 * 9.80665) / (2^(resolution) - 1) * 100; for g := 2|4|8|16h]hA(g * 2 * 9.80665) / (2^(resolution) - 1) * 100; for g := 2|4|8|16}hjCsbah}(h]h ]h"]h$]h&]hhj j bashj}uh1jhhhMhj hhubh)}(hScale range configuration:h]hScale range configuration:}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hX<root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale 0.004789 root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale_available 0.004789 0.009578 0.019156 0.038312 root:/sys/bus/iio/devices/iio:device0> echo 0.019156 > ./in_accel_scale root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale 0.019156h]hX<root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale 0.004789 root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale_available 0.004789 0.009578 0.019156 0.038312 root:/sys/bus/iio/devices/iio:device0> echo 0.019156 > ./in_accel_scale root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale 0.019156}hjasbah}(h]h ]h"]h$]h&]hhj j bashj}uh1jhhhM!hj hhubh)}(hSet output data rate (ODR):h]hSet output data rate (ODR):}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM,hj hhubj)}(hXroot:/sys/bus/iio/devices/iio:device0> cat ./in_accel_sampling_frequency 200.000000 root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_sampling_frequency_available 0.097000 0.195000 0.390000 0.781000 1.562000 3.125000 6.250000 12.500000 25.000000 50.000000 100.000000 200.000000 400.000000 800.000000 1600.000000 3200.000000 root:/sys/bus/iio/devices/iio:device0> echo 1.562000 > ./in_accel_sampling_frequency root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_sampling_frequency 1.562000h]hXroot:/sys/bus/iio/devices/iio:device0> cat ./in_accel_sampling_frequency 200.000000 root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_sampling_frequency_available 0.097000 0.195000 0.390000 0.781000 1.562000 3.125000 6.250000 12.500000 25.000000 50.000000 100.000000 200.000000 400.000000 800.000000 1600.000000 3200.000000 root:/sys/bus/iio/devices/iio:device0> echo 1.562000 > ./in_accel_sampling_frequency root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_sampling_frequency 1.562000}hjsbah}(h]h ]h"]h$]h&]hhj j bashj}uh1jhhhM.hj hhubh)}(h Configure one or several events:h]h Configure one or several events:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM:hj hhubj)}(hX root:> cd /sys/bus/iio/devices/iio:device0 root:/sys/bus/iio/devices/iio:device0> echo 1 > ./buffer0/in_accel_x_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./buffer0/in_accel_y_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./buffer0/in_accel_z_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./scan_elements/in_accel_x_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./scan_elements/in_accel_y_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./scan_elements/in_accel_z_en root:/sys/bus/iio/devices/iio:device0> echo 14 > ./in_accel_x_calibbias root:/sys/bus/iio/devices/iio:device0> echo 2 > ./in_accel_y_calibbias root:/sys/bus/iio/devices/iio:device0> echo -250 > ./in_accel_z_calibbias root:/sys/bus/iio/devices/iio:device0> echo 24 > ./buffer0/length ## Check the event scale factor (0.0625 * 9.80665) root:/sys/bus/iio/devices/iio:device0> cat ./events/in_accel_gesture_doubletap_scale 0.612915 ## AC coupled activity, threshold [0.612915 m/s^2/LSB] root:/sys/bus/iio/devices/iio:device0> echo 6 > ./events/in_accel_mag_adaptive_rising_value ## AC coupled inactivity, threshold, [0.612915 m/s^2/LSB] root:/sys/bus/iio/devices/iio:device0> echo 4 > ./events/in_accel_mag_adaptive_falling_value ## AC coupled inactivity, time [s] root:/sys/bus/iio/devices/iio:device0> echo 3 > ./events/in_accel_mag_adaptive_falling_period ## singletap, threshold root:/sys/bus/iio/devices/iio:device0> echo 35 > ./events/in_accel_gesture_singletap_value ## singletap, duration [us] root:/sys/bus/iio/devices/iio:device0> echo 0.001875 > ./events/in_accel_gesture_singletap_timeout ## doubletap, window [us] root:/sys/bus/iio/devices/iio:device0> echo 0.025 > ./events/in_accel_gesture_doubletap_reset_timeout ## doubletap, latency [us] root:/sys/bus/iio/devices/iio:device0> echo 0.025 > ./events/in_accel_gesture_doubletap_tap2_min_delay ## AC coupled activity, enable root:/sys/bus/iio/devices/iio:device0> echo 1 > ./events/in_accel_mag_adaptive_rising_en ## AC coupled inactivity, enable root:/sys/bus/iio/devices/iio:device0> echo 1 > ./events/in_accel_x\&y\&z_mag_adaptive_falling_en ## singletap, enable root:/sys/bus/iio/devices/iio:device0> echo 1 > ./events/in_accel_x_gesture_singletap_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./events/in_accel_y_gesture_singletap_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./events/in_accel_z_gesture_singletap_en ## doubletap, enable root:/sys/bus/iio/devices/iio:device0> echo 1 > ./events/in_accel_gesture_doubletap_enh]hX root:> cd /sys/bus/iio/devices/iio:device0 root:/sys/bus/iio/devices/iio:device0> echo 1 > ./buffer0/in_accel_x_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./buffer0/in_accel_y_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./buffer0/in_accel_z_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./scan_elements/in_accel_x_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./scan_elements/in_accel_y_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./scan_elements/in_accel_z_en root:/sys/bus/iio/devices/iio:device0> echo 14 > ./in_accel_x_calibbias root:/sys/bus/iio/devices/iio:device0> echo 2 > ./in_accel_y_calibbias root:/sys/bus/iio/devices/iio:device0> echo -250 > ./in_accel_z_calibbias root:/sys/bus/iio/devices/iio:device0> echo 24 > ./buffer0/length ## Check the event scale factor (0.0625 * 9.80665) root:/sys/bus/iio/devices/iio:device0> cat ./events/in_accel_gesture_doubletap_scale 0.612915 ## AC coupled activity, threshold [0.612915 m/s^2/LSB] root:/sys/bus/iio/devices/iio:device0> echo 6 > ./events/in_accel_mag_adaptive_rising_value ## AC coupled inactivity, threshold, [0.612915 m/s^2/LSB] root:/sys/bus/iio/devices/iio:device0> echo 4 > ./events/in_accel_mag_adaptive_falling_value ## AC coupled inactivity, time [s] root:/sys/bus/iio/devices/iio:device0> echo 3 > ./events/in_accel_mag_adaptive_falling_period ## singletap, threshold root:/sys/bus/iio/devices/iio:device0> echo 35 > ./events/in_accel_gesture_singletap_value ## singletap, duration [us] root:/sys/bus/iio/devices/iio:device0> echo 0.001875 > ./events/in_accel_gesture_singletap_timeout ## doubletap, window [us] root:/sys/bus/iio/devices/iio:device0> echo 0.025 > ./events/in_accel_gesture_doubletap_reset_timeout ## doubletap, latency [us] root:/sys/bus/iio/devices/iio:device0> echo 0.025 > ./events/in_accel_gesture_doubletap_tap2_min_delay ## AC coupled activity, enable root:/sys/bus/iio/devices/iio:device0> echo 1 > ./events/in_accel_mag_adaptive_rising_en ## AC coupled inactivity, enable root:/sys/bus/iio/devices/iio:device0> echo 1 > ./events/in_accel_x\&y\&z_mag_adaptive_falling_en ## singletap, enable root:/sys/bus/iio/devices/iio:device0> echo 1 > ./events/in_accel_x_gesture_singletap_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./events/in_accel_y_gesture_singletap_en root:/sys/bus/iio/devices/iio:device0> echo 1 > ./events/in_accel_z_gesture_singletap_en ## doubletap, enable root:/sys/bus/iio/devices/iio:device0> echo 1 > ./events/in_accel_gesture_doubletap_en}hjsbah}(h]h ]h"]h$]h&]hhj j bashj}uh1jhhhM<hj hhubh)}(hVerify incoming events:h]hVerify incoming events:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMuhj hhubj)}(hXroot:# iio_event_monitor adxl345 Found IIO device with name adxl345 with device number 0 Event: time: 1739063415957073383, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063415963770218, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063416002563061, type: accel(z), channel: 0, evtype: gesture, direction: singletap Event: time: 1739063426271128739, type: accel(x&y&z), channel: 0, evtype: mag, direction: falling Event: time: 1739063436539080713, type: accel(x&y&z), channel: 0, evtype: mag, direction: falling Event: time: 1739063438357970381, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063446726161586, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063446727892670, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063446743019768, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063446744650696, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063446763559386, type: accel(z), channel: 0, evtype: gesture, direction: singletap Event: time: 1739063448818126480, type: accel(x&y&z), channel: 0, evtype: mag, direction: falling ...h]hXroot:# iio_event_monitor adxl345 Found IIO device with name adxl345 with device number 0 Event: time: 1739063415957073383, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063415963770218, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063416002563061, type: accel(z), channel: 0, evtype: gesture, direction: singletap Event: time: 1739063426271128739, type: accel(x&y&z), channel: 0, evtype: mag, direction: falling Event: time: 1739063436539080713, type: accel(x&y&z), channel: 0, evtype: mag, direction: falling Event: time: 1739063438357970381, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063446726161586, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063446727892670, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063446743019768, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063446744650696, type: accel(z), channel: 0, evtype: mag, direction: rising Event: time: 1739063446763559386, type: accel(z), channel: 0, evtype: gesture, direction: singletap Event: time: 1739063448818126480, type: accel(x&y&z), channel: 0, evtype: mag, direction: falling ...}hjsbah}(h]h ]h"]h$]h&]hhj j bashj}uh1jhhhMwhj hhubh)}(hMActivity and inactivity belong together and indicate state changes as followsh]hMActivity and inactivity belong together and indicate state changes as follows}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hX=root:# iio_event_monitor adxl345 Found IIO device with name adxl345 with device number 0 Event: time: 1744648001133946293, type: accel(x), channel: 0, evtype: mag, direction: rising Event: time: 1744648057724775499, type: accel(x&y&z), channel: 0, evtype: mag, direction: falling ...h]hX=root:# iio_event_monitor adxl345 Found IIO device with name adxl345 with device number 0 Event: time: 1744648001133946293, type: accel(x), channel: 0, evtype: mag, direction: rising Event: time: 1744648057724775499, type: accel(x&y&z), channel: 0, evtype: mag, direction: falling ...}hjsbah}(h]h ]h"]h$]h&]hhj j bashj}uh1jhhhMhj hhubeh}(h]usage-examplesah ]h"]h$]usage examplesah&]uh1hhjhhhhhKj.Kubeh}(h]device-attributesah ]h"]2. device attributesah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h3. Device Buffersh]h3. Device Buffers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(h!This driver supports IIO buffers.h]h!This driver supports IIO buffers.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h_All devices support retrieving the raw acceleration and temperature measurements using buffers.h]h_All devices support retrieving the raw acceleration and temperature measurements using buffers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhh](h)}(hUsage examplesh]hUsage examples}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj&hhhhhMubh)}(h Select channels for buffer read:h]h Select channels for buffer read:}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj&hhubj)}(hroot:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_accel_x_en root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_accel_y_en root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_accel_z_enh]hroot:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_accel_x_en root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_accel_y_en root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_accel_z_en}hjEsbah}(h]h ]h"]h$]h&]hhj j bashj}uh1jhhhMhj&hhubh)}(h5Set the number of samples to be stored in the buffer:h]h5Set the number of samples to be stored in the buffer:}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj&hhubj)}(h>root:/sys/bus/iio/devices/iio:device0> echo 10 > buffer/lengthh]h>root:/sys/bus/iio/devices/iio:device0> echo 10 > buffer/length}hjcsbah}(h]h ]h"]h$]h&]hhj j bashj}uh1jhhhMhj&hhubh)}(hEnable buffer readings:h]hEnable buffer readings:}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj&hhubj)}(h=root:/sys/bus/iio/devices/iio:device0> echo 1 > buffer/enableh]h=root:/sys/bus/iio/devices/iio:device0> echo 1 > buffer/enable}hjsbah}(h]h ]h"]h$]h&]hhj j bashj}uh1jhhhMhj&hhubh)}(hObtain buffered data:h]hObtain buffered data:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj&hhubj)}(hXroot:> iio_readdev -b 16 -s 1024 adxl345 | hexdump -d WARNING: High-speed mode not enabled 0000000 00003 00012 00013 00005 00010 00011 00005 00011 0000010 00013 00004 00012 00011 00003 00012 00014 00007 0000020 00011 00013 00004 00013 00014 00003 00012 00013 0000030 00004 00012 00013 00005 00011 00011 00005 00012 0000040 00014 00005 00012 00014 00004 00010 00012 00004 0000050 00013 00011 00003 00011 00012 00005 00011 00013 0000060 00003 00012 00012 00003 00012 00012 00004 00012 0000070 00012 00003 00013 00013 00003 00013 00012 00005 0000080 00012 00013 00003 00011 00012 00005 00012 00013 0000090 00003 00013 00011 00005 00013 00014 00003 00012 00000a0 00012 00003 00012 00013 00004 00012 00015 00004 00000b0 00014 00011 00003 00014 00013 00004 00012 00011 00000c0 00004 00012 00013 00004 00014 00011 00004 00013 00000d0 00012 00002 00014 00012 00005 00012 00013 00005 00000e0 00013 00013 00003 00013 00013 00005 00012 00013 00000f0 00004 00014 00015 00005 00012 00011 00005 00012 ...h]hXroot:> iio_readdev -b 16 -s 1024 adxl345 | hexdump -d WARNING: High-speed mode not enabled 0000000 00003 00012 00013 00005 00010 00011 00005 00011 0000010 00013 00004 00012 00011 00003 00012 00014 00007 0000020 00011 00013 00004 00013 00014 00003 00012 00013 0000030 00004 00012 00013 00005 00011 00011 00005 00012 0000040 00014 00005 00012 00014 00004 00010 00012 00004 0000050 00013 00011 00003 00011 00012 00005 00011 00013 0000060 00003 00012 00012 00003 00012 00012 00004 00012 0000070 00012 00003 00013 00013 00003 00013 00012 00005 0000080 00012 00013 00003 00011 00012 00005 00012 00013 0000090 00003 00013 00011 00005 00013 00014 00003 00012 00000a0 00012 00003 00012 00013 00004 00012 00015 00004 00000b0 00014 00011 00003 00014 00013 00004 00012 00011 00000c0 00004 00012 00013 00004 00014 00011 00004 00013 00000d0 00012 00002 00014 00012 00005 00012 00013 00005 00000e0 00013 00013 00003 00013 00013 00005 00012 00013 00000f0 00004 00014 00015 00005 00012 00011 00005 00012 ...}hjsbah}(h]h ]h"]h$]h&]hhj j bashj}uh1jhhhMhj&hhubh)}(h`See Documentation/iio/iio_devbuf.rst for more information about how buffered data is structured. h]h`See Documentation/iio/iio_devbuf.rst for more information about how buffered data is structured.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj&hhubeh}(h]id1ah ]h"]h$]jah&]uh1hhjhhhhhMj.Kubeh}(h]device-buffersah ]h"]3. device buffersah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h4. IIO Interfacing Toolsh]h4. IIO Interfacing Tools}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(h_See Documentation/iio/iio_tools.rst for the description of the available IIO interfacing tools.h]h_See Documentation/iio/iio_tools.rst for the description of the available IIO interfacing tools.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]iio-interfacing-toolsah ]h"]4. iio interfacing toolsah$]h&]uh1hhhhhhhhMubeh}(h]adxl345-driverah ]h"]adxl345 driverah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjnfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourcehnj _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjjjj*j'j\jYjjjjj j usage examplesNjjjju nametypes}(jjj*j\jjj jajjuh}(jhjhj'j!jYjSjjjjj jjj jjjj&jju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}j+KsRparse_messages]hsystem_message)}(hhh]h)}(h1Duplicate implicit target name: "usage examples".h]h5Duplicate implicit target name: “usage examples”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]jalevelKtypeINFOsourcehnjlineMuh1jhj&hhhhhMubatransform_messages] transformerN include_log] decorationNhhub.