€•XŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ"/translations/zh_CN/iio/iio_devbuf”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/zh_TW/iio/iio_devbuf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/it_IT/iio/iio_devbuf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/ja_JP/iio/iio_devbuf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/ko_KR/iio/iio_devbuf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/pt_BR/iio/iio_devbuf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/sp_SP/iio/iio_devbuf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œ>shift], where:”h]”hŒÚRead-only attribute containing the description of the scan element data storage within the buffer and hence the form in which it is read from userspace. Format is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift], where:”…””}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KThjLh²hubhŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒ0**be** or **le** specifies big or little-endian.”h]”hï)”}”(hjåh]”(jp)”}”(hŒ**be**”h]”hŒbe”…””}”(hjêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1johjçubhŒ or ”…””}”(hjçh²hh³Nh´Nubjp)”}”(hŒ**le**”h]”hŒle”…””}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1johjçubhŒ specifies big or little-endian.”…””}”(hjçh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KXhjãubah}”(h]”h ]”h"]”h$]”h&]”uh1jáhjÞh²hh³hÇh´Nubjâ)”}”(hŒ@**s** or **u** specifies if signed (2's complement) or unsigned.”h]”hï)”}”(hjh]”(jp)”}”(hŒ**s**”h]”hŒs”…””}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1johjubhŒ or ”…””}”(hjh²hh³Nh´Nubjp)”}”(hŒ**u**”h]”hŒu”…””}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1johjubhŒ4 specifies if signed (2’s complement) or unsigned.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KYhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jáhjÞh²hh³hÇh´Nubjâ)”}”(hŒ***bits** is the number of valid data bits.”h]”hï)”}”(hjSh]”(jp)”}”(hŒ**bits**”h]”hŒbits”…””}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1johjUubhŒ" is the number of valid data bits.”…””}”(hjUh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KZhjQubah}”(h]”h ]”h"]”h$]”h&]”uh1jáhjÞh²hh³hÇh´Nubjâ)”}”(hŒU**storagebits** is the number of bits (after padding) that it occupies in the buffer.”h]”hï)”}”(hŒU**storagebits** is the number of bits (after padding) that it occupies in the buffer.”h]”(jp)”}”(hŒ**storagebits**”h]”hŒ storagebits”…””}”(hj~h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1johjzubhŒF is the number of bits (after padding) that it occupies in the buffer.”…””}”(hjzh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K[hjvubah}”(h]”h ]”h"]”h$]”h&]”uh1jáhjÞh²hh³hÇh´Nubjâ)”}”(hŒ…**repeat** specifies the number of bits/storagebits repetitions. When the repeat element is 0 or 1, then the repeat value is omitted.”h]”hï)”}”(hŒ…**repeat** specifies the number of bits/storagebits repetitions. When the repeat element is 0 or 1, then the repeat value is omitted.”h]”(jp)”}”(hŒ **repeat**”h]”hŒrepeat”…””}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1johj ubhŒ{ specifies the number of bits/storagebits repetitions. When the repeat element is 0 or 1, then the repeat value is omitted.”…””}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K]hjœubah}”(h]”h ]”h"]”h$]”h&]”uh1jáhjÞh²hh³hÇh´Nubjâ)”}”(hŒ`**shift** if specified, is the shift that needs to be applied prior to masking out unused bits. ”h]”hï)”}”(hŒ_**shift** if specified, is the shift that needs to be applied prior to masking out unused bits.”h]”(jp)”}”(hŒ **shift**”h]”hŒshift”…””}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1johjÆubhŒV if specified, is the shift that needs to be applied prior to masking out unused bits.”…””}”(hjÆh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K_hjÂubah}”(h]”h ]”h"]”h$]”h&]”uh1jáhjÞh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jÜh³hÇh´KXhjLh²hubhï)”}”(hŒƒFor example, a driver for a 3-axis accelerometer with 12-bit resolution where data is stored in two 8-bit registers is as follows::”h]”hŒ‚For example, a driver for a 3-axis accelerometer with 12-bit resolution where data is stored in two 8-bit registers is as follows:”…””}”(hjðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KbhjLh²hubhŒ literal_block”“”)”}”(hX? 7 6 5 4 3 2 1 0 +---+---+---+---+---+---+---+---+ |D3 |D2 |D1 |D0 | X | X | X | X | (LOW byte, address 0x06) +---+---+---+---+---+---+---+---+ 7 6 5 4 3 2 1 0 +---+---+---+---+---+---+---+---+ |D11|D10|D9 |D8 |D7 |D6 |D5 |D4 | (HIGH byte, address 0x07) +---+---+---+---+---+---+---+---+”h]”hX? 7 6 5 4 3 2 1 0 +---+---+---+---+---+---+---+---+ |D3 |D2 |D1 |D0 | X | X | X | X | (LOW byte, address 0x06) +---+---+---+---+---+---+---+---+ 7 6 5 4 3 2 1 0 +---+---+---+---+---+---+---+---+ |D11|D10|D9 |D8 |D7 |D6 |D5 |D4 | (HIGH byte, address 0x07) +---+---+---+---+---+---+---+---+”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jþh³hÇh´KehjLh²hubhï)”}”(hŒ8will have the following scan element type for each axis:”h]”hŒ8will have the following scan element type for each axis:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KohjLh²hubjÿ)”}”(hŒK$ cat /sys/bus/iio/devices/iio:device0/buffer0/in_accel_y_type le:s12/16>>4”h]”hŒK$ cat /sys/bus/iio/devices/iio:device0/buffer0/in_accel_y_type le:s12/16>>4”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆŒforce”‰Œlanguage”Œbash”Œhighlight_args”}”uh1jþh³hÇh´KqhjLh²hubhï)”}”(hŒ½A userspace application will interpret data samples read from the buffer as two-byte little-endian signed data, that needs a 4 bits right shift before masking out the 12 valid bits of data.”h]”hŒ½A userspace application will interpret data samples read from the buffer as two-byte little-endian signed data, that needs a 4 bits right shift before masking out the 12 valid bits of data.”…””}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KvhjLh²hubhï)”}”(hŒ–It is also worth mentioning that the data in the buffer will be naturally aligned, so the userspace application has to handle the buffers accordingly.”h]”hŒ–It is also worth mentioning that the data in the buffer will be naturally aligned, so the userspace application has to handle the buffers accordingly.”…””}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KzhjLh²hubhï)”}”(hŒñTake for example, a driver with four channels with the following description: - channel0: index: 0, type: be:u16/16>>0 - channel1: index: 1, type: be:u32/32>>0 - channel2: index: 2, type: be:u32/32>>0 - channel3: index: 3, type: be:u64/64>>0”h]”hŒñTake for example, a driver with four channels with the following description: - channel0: index: 0, type: be:u16/16>>0 - channel1: index: 1, type: be:u32/32>>0 - channel2: index: 2, type: be:u32/32>>0 - channel3: index: 3, type: be:u64/64>>0”…””}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K}hjLh²hubhï)”}”(hŒPIf all channels are enabled, the data will be aligned in the buffer as follows::”h]”hŒOIf all channels are enabled, the data will be aligned in the buffer as follows:”…””}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KƒhjLh²hubjÿ)”}”(hŒñ 0-1 2 3 4-7 8-11 12 13 14 15 16-23 -> buffer byte number +-----+---+---+-----+-----+---+---+---+---+-----+ |CHN_0|PAD|PAD|CHN_1|CHN_2|PAD|PAD|PAD|PAD|CHN_3| -> buffer content +-----+---+---+-----+-----+---+---+---+---+-----+”h]”hŒñ 0-1 2 3 4-7 8-11 12 13 14 15 16-23 -> buffer byte number +-----+---+---+-----+-----+---+---+---+---+-----+ |CHN_0|PAD|PAD|CHN_1|CHN_2|PAD|PAD|PAD|PAD|CHN_3| -> buffer content +-----+---+---+-----+-----+---+---+---+---+-----+”…””}”hjgsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jþh³hÇh´K…hjLh²hubhï)”}”(hŒ^If only channel0 and channel3 are enabled, the data will be aligned in the buffer as follows::”h]”hŒ]If only channel0 and channel3 are enabled, the data will be aligned in the buffer as follows:”…””}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KŠhjLh²hubjÿ)”}”(hŒÁ 0-1 2 3 4 5 6 7 8-15 -> buffer byte number +-----+---+---+---+---+---+---+-----+ |CHN_0|PAD|PAD|PAD|PAD|PAD|PAD|CHN_3| -> buffer content +-----+---+---+---+---+---+---+-----+”h]”hŒÁ 0-1 2 3 4 5 6 7 8-15 -> buffer byte number +-----+---+---+---+---+---+---+-----+ |CHN_0|PAD|PAD|PAD|PAD|PAD|PAD|CHN_3| -> buffer content +-----+---+---+---+---+---+---+-----+”…””}”hjƒsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jþh³hÇh´KhjLh²hubhï)”}”(hŒþTypically the buffered data is found in raw format (unscaled with no offset applied), however there are corner cases in which the buffered data may be found in a processed form. Please note that these corner cases are not addressed by this documentation.”h]”hŒþTypically the buffered data is found in raw format (unscaled with no offset applied), however there are corner cases in which the buffered data may be found in a processed form. Please note that these corner cases are not addressed by this documentation.”…””}”(hj‘h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K’hjLh²hubhï)”}”(hŒ`Please see Documentation/ABI/testing/sysfs-bus-iio for a complete description of the attributes.”h]”hŒ`Please see Documentation/ABI/testing/sysfs-bus-iio for a complete description of the attributes.”…””}”(hjŸh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K—hjLh²hubeh}”(h]”Œ scan-elements”ah ]”h"]”Œ scan elements”ah$]”h&]”uh1hÈhj:h²hh³hÇh´K?ubeh}”(h]”Œbuffer-attributes”ah ]”h"]”Œ2. buffer attributes”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´Kubeh}”(h]”Œindustrial-iio-device-buffers”ah ]”h"]”Œindustrial iio device buffers”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jèŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jÂj¿j7j4jºj·j˜j•jÈjÅj"jjIjFj²j¯uŒ nametypes”}”(j‰j7‰jº‰j˜‰jȉj"‰jI‰j²‰uh}”(j¿hÊj4hÝj·j:j•jkjÅj›jjËjFj%j¯jLuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.