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]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)}(hhh](h reference)}(hhh]hADXL345}(hhhhhNhNubah}(h]h ]h"]h$]h&]nameADXL345refurihttps://www.analog.com/ADXL345uh1hhhubhtarget)}(h! h]h}(h]adxl345ah ]h"]adxl345ah$]h&]refurij uh1j  referencedKhhubeh}(h]h ]h"]h$]h&]uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(h,`ADXL375 `_ h]h)}(h+`ADXL375 `_h](h)}(hj-h]hADXL375}(hj/hhhNhNubah}(h]h ]h"]h$]h&]nameADXL375j https://www.analog.com/ADXL375uh1hhj+ubj )}(h! h]h}(h]adxl375ah ]h"]adxl375ah$]h&]refurij>uh1j jKhj+ubeh}(h]h ]h"]h$]h&]uh1hhhhK hj'ubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubeh}(h]h ]h"]h$]h&]bullet*uh1hhhhK hhhhubh)}(hThe ADXL345 is a generic purpose low power, 3-axis accelerometer with selectable measurement ranges. The ADXL345 supports the ±2 g, ±4 g, ±8 g, and ±16 g ranges.h]hThe ADXL345 is a generic purpose low power, 3-axis accelerometer with selectable measurement ranges. The ADXL345 supports the ±2 g, ±4 g, ±8 g, and ±16 g ranges.}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h]supported-devicesah ]h"]1. supported devicesah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(h2. Device Attributesh]h2. Device Attributes}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjvhhhhhKubh)}(hXSEach 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 questions. 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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX, 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 questions. These files are consistently generalized and documented in the IIO ABI documentation.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjvhhubh)}(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 }(hjhhhNhNubj)}(h$``/sys/bus/iio/devices/iio:deviceX``h]h /sys/bus/iio/devices/iio:deviceX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjvhhubhtable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthK+uh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK:uh1jhjubhtbody)}(hhh](hrow)}(hhh](hentry)}(hhh]h)}(h)3-Axis Accelerometer related device filesh]h)3-Axis Accelerometer related device files}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h Descriptionh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_sampling_frequencyh]hin_accel_sampling_frequency}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hj,ubah}(h]h ]h"]h$]h&]uh1jhj)ubj)}(hhh]h)}(hCurrently selected sample rate.h]hCurrently selected sample rate.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hjCubah}(h]h ]h"]h$]h&]uh1jhj)ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h%in_accel_sampling_frequency_availableh]h%in_accel_sampling_frequency_available}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hjcubah}(h]h ]h"]h$]h&]uh1jhj`ubj)}(hhh]h)}(h,Available sampling frequency configurations.h]h,Available sampling frequency configurations.}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hjzubah}(h]h ]h"]h$]h&]uh1jhj`ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_scaleh]hin_accel_scale}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h+Scale/range for the accelerometer channels.h]h+Scale/range for the accelerometer channels.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_scale_availableh]hin_accel_scale_available}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h5Available scale ranges for the accelerometer channel.h]h5Available scale ranges for the accelerometer channel.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_x_calibbiash]hin_accel_x_calibbias}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h8Calibration offset for the X-axis accelerometer channel.h]h8Calibration offset for the X-axis accelerometer channel.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_x_rawh]hin_accel_x_raw}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hj?ubah}(h]h ]h"]h$]h&]uh1jhj<ubj)}(hhh]h)}(h'Raw X-axis accelerometer channel value.h]h'Raw X-axis accelerometer channel value.}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjVubah}(h]h ]h"]h$]h&]uh1jhj<ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_y_calibbiash]hin_accel_y_calibbias}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hjvubah}(h]h ]h"]h$]h&]uh1jhjsubj)}(hhh]h)}(h%y-axis acceleration offset correctionh]h%y-axis acceleration offset correction}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hjubah}(h]h ]h"]h$]h&]uh1jhjsubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_y_rawh]hin_accel_y_raw}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h'Raw Y-axis accelerometer channel value.h]h'Raw Y-axis accelerometer channel value.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_z_calibbiash]hin_accel_z_calibbias}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h8Calibration offset for the Z-axis accelerometer channel.h]h8Calibration offset for the Z-axis accelerometer channel.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_z_rawh]hin_accel_z_raw}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h'Raw Z-axis accelerometer channel value.h]h'Raw Z-axis accelerometer channel value.}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hj2ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjvhhhhhNubh)}(hhh](h)}(hChannel Processed Valuesh]hChannel Processed Values}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbhhhhhK7ubh)}(hA channel value can be read from its _raw attribute. The value returned is the raw value as reported by the devices. To get the processed value of the channel, apply the following formula:h]hA channel value can be read from its _raw attribute. The value returned is the raw value as reported by the devices. To get the processed value of the channel, apply the following formula:}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK9hjbhhubh literal_block)}(h+processed value = (_raw + _offset) * _scaleh]h+processed value = (_raw + _offset) * _scale}hjsbah}(h]h ]h"]h$]h&]hhforcelanguagebashhighlight_args}uh1jhhhK=hjbhhubh)}(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&]uh1hhhhKAhjbhhubj)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthK%uh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h Channel typeh]h Channel type}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hMeasurement unith]hMeasurement unit}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h Acceleration on X, Y, and Z axish]h Acceleration on X, Y, and Z axis}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hMeters per second squaredh]hMeters per second squared}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjbhhhhhNubeh}(h]channel-processed-valuesah ]h"]channel processed valuesah$]h&]uh1hhjvhhhhhK7ubh)}(hhh](h)}(h Sensor Eventsh]h Sensor Events}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjJhhhhhKKubh)}(hXSpecific IIO events are triggered by their corresponding interrupts. The sensor driver supports either none or a single active interrupt (INT) line, selectable from the two available options: INT1 or INT2. The active INT line should be specified in the device tree. If no INT line is configured, the sensor defaults to FIFO bypass mode, where event detection is disabled and only X, Y, and Z axis measurements are available.h]hXSpecific IIO events are triggered by their corresponding interrupts. The sensor driver supports either none or a single active interrupt (INT) line, selectable from the two available options: INT1 or INT2. The active INT line should be specified in the device tree. If no INT line is configured, the sensor defaults to FIFO bypass mode, where event detection is disabled and only X, Y, and Z axis measurements are available.}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKMhjJhhubh)}(hX$The table below lists the ADXL345-related device files located in the device-specific path: ``/sys/bus/iio/devices/iio:deviceX/events``. Note that activity and inactivity detection are DC-coupled by default; therefore, only the AC-coupled activity and inactivity events are explicitly listed.h](h\The table below lists the ADXL345-related device files located in the device-specific path: }(hjihhhNhNubj)}(h+``/sys/bus/iio/devices/iio:deviceX/events``h]h'/sys/bus/iio/devices/iio:deviceX/events}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjiubh. Note that activity and inactivity detection are DC-coupled by default; therefore, only the AC-coupled activity and inactivity events are explicitly listed.}(hjihhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKThjJhhubj)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthK-uh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK-uh1jhjubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h Event handleh]h Event handle}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK[hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h Descriptionh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK[hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_gesture_doubletap_enh]hin_accel_gesture_doubletap_en}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK]hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h'Enable double tap detection on all axish]h'Enable double tap detection on all axis}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK]hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h(in_accel_gesture_doubletap_reset_timeouth]h(in_accel_gesture_doubletap_reset_timeout}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK_hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hDouble tap window in [us]h]hDouble tap window in [us]}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK_hj.ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h)in_accel_gesture_doubletap_tap2_min_delayh]h)in_accel_gesture_doubletap_tap2_min_delay}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjNubah}(h]h ]h"]h$]h&]uh1jhjKubj)}(hhh]h)}(hDouble tap latent in [us]h]hDouble tap latent in [us]}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjeubah}(h]h ]h"]h$]h&]uh1jhjKubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h"in_accel_gesture_singletap_timeouth]h"in_accel_gesture_singletap_timeout}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKchjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hSingle tap duration in [us]h]hSingle tap duration in [us]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKchjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h in_accel_gesture_singletap_valueh]h in_accel_gesture_singletap_value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKehjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h&Single tap threshold value in 62.5/LSBh]h&Single tap threshold value in 62.5/LSB}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKehjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_mag_falling_periodh]hin_accel_mag_falling_period}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKghjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hInactivity time in secondsh]hInactivity time in seconds}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKghj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_mag_falling_valueh]hin_accel_mag_falling_value}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKihj*ubah}(h]h ]h"]h$]h&]uh1jhj'ubj)}(hhh]h)}(h&Inactivity threshold value in 62.5/LSBh]h&Inactivity threshold value in 62.5/LSB}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKihjAubah}(h]h ]h"]h$]h&]uh1jhj'ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_mag_adaptive_rising_enh]hin_accel_mag_adaptive_rising_en}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKkhjaubah}(h]h ]h"]h$]h&]uh1jhj^ubj)}(hhh]h)}(h$Enable AC coupled activity on X axish]h$Enable AC coupled activity on X axis}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKkhjxubah}(h]h ]h"]h$]h&]uh1jhj^ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h$in_accel_mag_adaptive_falling_periodh]h$in_accel_mag_adaptive_falling_period}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h%AC coupled inactivity time in secondsh]h%AC coupled inactivity time in seconds}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h#in_accel_mag_adaptive_falling_valueh]h#in_accel_mag_adaptive_falling_value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h+AC coupled inactivity threshold in 62.5/LSBh]h+AC coupled inactivity threshold in 62.5/LSB}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h"in_accel_mag_adaptive_rising_valueh]h"in_accel_mag_adaptive_rising_value}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h)AC coupled activity threshold in 62.5/LSBh]h)AC coupled activity threshold in 62.5/LSB}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_mag_rising_enh]hin_accel_mag_rising_en}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshj=ubah}(h]h ]h"]h$]h&]uh1jhj:ubj)}(hhh]h)}(h#Enable activity detection on X axish]h#Enable activity detection on X axis}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshjTubah}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_mag_rising_valueh]hin_accel_mag_rising_value}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKuhjtubah}(h]h ]h"]h$]h&]uh1jhjqubj)}(hhh]h)}(h$Activity threshold value in 62.5/LSBh]h$Activity threshold value in 62.5/LSB}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKuhjubah}(h]h ]h"]h$]h&]uh1jhjqubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_x_gesture_singletap_enh]hin_accel_x_gesture_singletap_en}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h%Enable single tap detection on X axish]h%Enable single tap detection on X axis}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_x&y&z_mag_falling_enh]hin_accel_x&y&z_mag_falling_en}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h'Enable inactivity detection on all axish]h'Enable inactivity detection on all axis}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(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&]uh1hhhhK{hj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h(Enable AC coupled inactivity on all axish]h(Enable AC coupled inactivity on all axis}(hj3 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK{hj0 ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hin_accel_y_gesture_singletap_enh]hin_accel_y_gesture_singletap_en}(hjS hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK}hjP ubah}(h]h ]h"]h$]h&]uh1jhjM ubj)}(hhh]h)}(h%Enable single tap detection on Y axish]h%Enable single tap detection on Y axis}(hjj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK}hjg ubah}(h]h ]h"]h$]h&]uh1jhjM ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(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&]uh1jhj ubj)}(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&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjJhhhhhNubh)}(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&]uh1hhhhKhjJhhubh)}(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&]uh1hhhhKhjJhhubh)}(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 g/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 g/LSB as specified in the datasheet. However, you can override these estimated thresholds by setting explicit values.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjJhhubh)}(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}(hj8 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}(hjJ hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh and }(hj hhhNhNubj )}(h**auto-sleep**h]h auto-sleep}(hj\ 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&]uh1hhhhKhjJhhubh)}(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.}(hjt hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjJhhubh)}(hThe driver behaves as follows:h]hThe driver behaves as follows:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjJhhubh)}(hhh](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]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&]uh1hhj hhhhhNubh)}(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&]uh1hhj hhhhhNubh)}(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&]uh1hhj hhhhhNubeh}(h]h ]h"]h$]h&]j^j_uh1hhhhKhjJhhubh)}(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&]uh1hhhhKhjJhhubh)}(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&]uh1hhhhKhjJhhubh)}(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&]uh1hhhhKhjJhhubh)}(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&]uh1hhhhKhjJhhubh)}(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&]uh1hhhhKhjJhhubh)}(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:}(hjG hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjJhhubh)}(hhh](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]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 }(hj\ hhhNhNubj )}(h**suppress bit**h]h suppress bit}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj\ 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.}(hj\ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjX ubah}(h]h ]h"]h$]h&]uh1hhjU hhhhhNubh)}(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&]uh1hhjU hhhhhNubh)}(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&]uh1hhjU hhhhhNubeh}(h]h ]h"]h$]h&]j^j_uh1hhhhKhjJhhubh)}(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&]uh1hhhhKhjJhhubeh}(h] sensor-eventsah ]h"] sensor eventsah$]h&]uh1hhjvhhhhhKKubh)}(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&]hhjjbashj}uh1jhhhKhj hhubh)}(h"Show accelerometer channels value:h]h"Show accelerometer channels value:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj 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}hj sbah}(h]h ]h"]h$]h&]hhjjbashj}uh1jhhhKhj hhubh)}(h2Set calibration offset for accelerometer channels:h]h2Set calibration offset for accelerometer channels:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj 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&]hhjjbashj}uh1jhhhKhj 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:}(hj9 hhhNhNubah}(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}hjG sbah}(h]h ]h"]h$]h&]hhjjbashj}uh1jhhhMhj hhubh)}(hScale range configuration:h]hScale range configuration:}(hjW hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj hhubj)}(hX<root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale 0.478899 root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale_available 0.478899 0.957798 1.915595 3.831190 root:/sys/bus/iio/devices/iio:device0> echo 1.915595 > ./in_accel_scale root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale 1.915595h]hX<root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale 0.478899 root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale_available 0.478899 0.957798 1.915595 3.831190 root:/sys/bus/iio/devices/iio:device0> echo 1.915595 > ./in_accel_scale root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale 1.915595}hje sbah}(h]h ]h"]h$]h&]hhjjbashj}uh1jhhhMhj hhubh)}(hSet output data rate (ODR):h]hSet output data rate (ODR):}(hju hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj 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}hj sbah}(h]h ]h"]h$]h&]hhjjbashj}uh1jhhhMhj hhubh)}(h Configure one or several events:h]h Configure one or several events:}(hj hhhNhNubah}(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 ## AC coupled activity, threshold [62.5/LSB] root:/sys/bus/iio/devices/iio:device0> echo 6 > ./events/in_accel_mag_adaptive_rising_value ## AC coupled inactivity, threshold, [62.5/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, latent [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 ## AC coupled activity, threshold [62.5/LSB] root:/sys/bus/iio/devices/iio:device0> echo 6 > ./events/in_accel_mag_adaptive_rising_value ## AC coupled inactivity, threshold, [62.5/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, latent [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}hj sbah}(h]h ]h"]h$]h&]hhjjbashj}uh1jhhhM)hj hhubh)}(hVerify incoming events:h]hVerify incoming events:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM^hj 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 ...}hj sbah}(h]h ]h"]h$]h&]hhjjbashj}uh1jhhhM`hj hhubh)}(hMActivity and inactivity belong together and indicate state changes as followsh]hMActivity and inactivity belong together and indicate state changes as follows}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMrhj 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 ...}hj sbah}(h]h ]h"]h$]h&]hhjjbashj}uh1jhhhMthj hhubeh}(h]usage-examplesah ]h"]h$]usage examplesah&]uh1hhjvhhhhhKjKubeh}(h]device-attributesah ]h"]2. device attributesah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h3. Device Buffersh]h3. Device Buffers}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhM~ubh)}(h!This driver supports IIO buffers.h]h!This driver supports IIO buffers.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(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.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(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:}(hj; hhhNhNubah}(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}hjI sbah}(h]h ]h"]h$]h&]hhjjbashj}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:}(hjY hhhNhNubah}(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}hjg sbah}(h]h ]h"]h$]h&]hhjjbashj}uh1jhhhMhj* hhubh)}(hEnable buffer readings:h]hEnable buffer readings:}(hjw hhhNhNubah}(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}hj sbah}(h]h ]h"]h$]h&]hhjjbashj}uh1jhhhMhj* hhubh)}(hObtain buffered data:h]hObtain buffered data:}(hj hhhNhNubah}(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 ...}hj sbah}(h]h ]h"]h$]h&]hhjjbashj}uh1jhhhMhj* hhubh)}(hdSee ``Documentation/iio/iio_devbuf.rst`` for more information about how buffered data is structured.h](hSee }(hj hhhNhNubj)}(h$``Documentation/iio/iio_devbuf.rst``h]h Documentation/iio/iio_devbuf.rst}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh< for more information about how buffered data is structured.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj* hhubeh}(h]id1ah ]h"]h$]j ah&]uh1hhj hhhhhMjKubeh}(h]device-buffersah ]h"]3. device buffersah$]h&]uh1hhhhhhhhM~ubh)}(hhh](h)}(h4. IIO Interfacing Toolsh]h4. IIO Interfacing Tools}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hcSee ``Documentation/iio/iio_tools.rst`` for the description of the available IIO interfacing tools.h](hSee }(hj hhhNhNubj)}(h#``Documentation/iio/iio_tools.rst``h]hDocumentation/iio/iio_tools.rst}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh< for the description of the available IIO interfacing tools.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(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_backlinksjfootnote_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_handlerjEerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _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}(j jjsjpjjjHjEj j jGjDj j usage examplesNj j jju nametypes}(j jsjjHj jGj jj juh}(jhjphjj jEj?j jvjDjbj jJj j j j j j* jj u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jSKsRparse_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&]j alevelKtypeINFOsourcehlineMuh1jhj* hhhhhMubatransform_messages] transformerN include_log] decorationNhhub.