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/driver-api/iio/buffersmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/zh_TW/driver-api/iio/buffersmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/it_IT/driver-api/iio/buffersmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/ja_JP/driver-api/iio/buffersmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/ko_KR/driver-api/iio/buffersmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/sp_SP/driver-api/iio/buffersmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hBuffersh]hBuffers}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhD/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers.rsthKubh bullet_list)}(hhh](h list_item)}(h.struct iio_buffer — general buffer structureh]h paragraph)}(hhh]h.struct iio_buffer — general buffer structure}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hZ:c:func:`iio_validate_scan_mask_onehot` — Validates that exactly one channel is selectedh]h)}(hZ:c:func:`iio_validate_scan_mask_onehot` — Validates that exactly one channel is selectedh](h)}(h':c:func:`iio_validate_scan_mask_onehot`h]hliteral)}(hhh]hiio_validate_scan_mask_onehot()}(hhhhhNhNubah}(h]h ](xrefcc-funceh"]h$]h&]uh1hhhubah}(h]h ]h"]h$]h&]refdocdriver-api/iio/buffers refdomainhreftypefunc refexplicitrefwarn reftargetiio_validate_scan_mask_onehotuh1hhhhKhhubh3 — Validates that exactly one channel is selected}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(h;:c:func:`iio_buffer_get` — Grab a reference to the bufferh]h)}(hjh](h)}(h:c:func:`iio_buffer_get`h]h)}(hjh]hiio_buffer_get()}(hjhhhNhNubah}(h]h ](hhc-funceh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypefunc refexplicitrefwarnjiio_buffer_getuh1hhhhKhjubh# — Grab a reference to the buffer}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hA:c:func:`iio_buffer_put` — Release the reference to the buffer h]h)}(h@:c:func:`iio_buffer_put` — Release the reference to the bufferh](h)}(h:c:func:`iio_buffer_put`h]h)}(hjTh]hiio_buffer_put()}(hjVhhhNhNubah}(h]h ](hhc-funceh"]h$]h&]uh1hhjRubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypefunc refexplicitrefwarnjiio_buffer_putuh1hhhhK hjNubh( — Release the reference to the buffer}(hjNhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hjJubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubeh}(h]h ]h"]h$]h&]bullet*uh1hhhhKhhhhubh)}(hThe Industrial I/O core offers a way for continuous data capture based on a trigger source. Multiple data channels can be read at once from :file:`/dev/iio:device{X}` character device node, thus reducing the CPU load.h](hThe Industrial I/O core offers a way for continuous data capture based on a trigger source. Multiple data channels can be read at once from }(hjhhhNhNubh)}(h:file:`/dev/iio:device{X}`h](h/dev/iio:device}(hjhhhNhNubhemphasis)}(hXh]hX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]fileah"]h$]h&]rolefileuh1hhjubh3 character device node, thus reducing the CPU load.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hhh](h)}(hIIO buffer sysfs interfaceh]hIIO buffer sysfs interface}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hAn IIO buffer has an associated attributes directory under :file:`/sys/bus/iio/devices/iio:device{X}/buffer/*`. Here are some of the existing attributes:h](h;An IIO buffer has an associated attributes directory under }(hjhhhNhNubh)}(h3:file:`/sys/bus/iio/devices/iio:device{X}/buffer/*`h](h/sys/bus/iio/devices/iio:device}(hjhhhNhNubj)}(hjh]hX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh /buffer/*}(hjhhhNhNubeh}(h]h ]fileah"]h$]h&]rolefileuh1hhjubh+. Here are some of the existing attributes:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](h)}(h]:file:`length`, the total number of data samples (capacity) that can be stored by the buffer.h]h)}(h]:file:`length`, the total number of data samples (capacity) that can be stored by the buffer.h](h)}(h:file:`length`h]hlength}(hj hhhNhNubah}(h]h ]fileah"]h$]h&]rolefileuh1hhjubhO, the total number of data samples (capacity) that can be stored by the buffer.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h):file:`enable`, activate buffer capture. h]h)}(h(:file:`enable`, activate buffer capture.h](h)}(h:file:`enable`h]henable}(hj5hhhNhNubah}(h]h ]fileah"]h$]h&]rolefileuh1hhj1ubh, activate buffer capture.}(hj1hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj-ubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhKhjhhubeh}(h]iio-buffer-sysfs-interfaceah ]h"]iio buffer sysfs interfaceah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hIIO buffer setuph]hIIO buffer setup}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhjdhhhhhKubh)}(hX=The meta information associated with a channel reading placed in a buffer is called a scan element. The important bits configuring scan elements are exposed to userspace applications via the :file:`/sys/bus/iio/devices/iio:device{X}/scan_elements/` directory. This directory contains attributes of the following form:h](hThe meta information associated with a channel reading placed in a buffer is called a scan element. The important bits configuring scan elements are exposed to userspace applications via the }(hjuhhhNhNubh)}(h9:file:`/sys/bus/iio/devices/iio:device{X}/scan_elements/`h](h/sys/bus/iio/devices/iio:device}(hj}hhhNhNubj)}(hjh]hX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj}ubh/scan_elements/}(hj}hhhNhNubeh}(h]h ]fileah"]h$]h&]rolefileuh1hhjuubhE directory. This directory contains attributes of the following form:}(hjuhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjdhhubh)}(hhh](h)}(h:file:`enable`, used for enabling a channel. If and only if its attribute is non *zero*, then a triggered capture will contain data samples for this channel.h]h)}(h:file:`enable`, used for enabling a channel. If and only if its attribute is non *zero*, then a triggered capture will contain data samples for this channel.h](h)}(h:file:`enable`h]henable}(hjhhhNhNubah}(h]h ]fileah"]h$]h&]rolefileuh1hhjubhC, used for enabling a channel. If and only if its attribute is non }(hjhhhNhNubj)}(h*zero*h]hzero}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhF, then a triggered capture will contain data samples for this channel.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK"hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h-:file:`index`, the scan_index of the channel.h]h)}(hjh](h)}(h :file:`index`h]hindex}(hjhhhNhNubah}(h]h ]fileah"]h$]h&]rolefileuh1hhjubh , the scan_index of the channel.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK%hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hX:file:`type`, description of the scan element data storage within the buffer and hence the form in which it is read from user space. Format is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift] . * *be* or *le*, specifies big or little endian. * *s* or *u*, specifies if signed (2's complement) or unsigned. * *bits*, is the number of valid data bits. * *storagebits*, is the number of bits (after padding) that it occupies in the buffer. * *repeat*, specifies the number of bits/storagebits repetitions. When the repeat element is 0 or 1, then the repeat value is omitted. * *shift*, if specified, is the shift that needs to be applied prior to masking out unused bits. h](h)}(h:file:`type`, description of the scan element data storage within the buffer and hence the form in which it is read from user space. Format is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift] .h](h)}(h :file:`type`h]htype}(hjhhhNhNubah}(h]h ]fileah"]h$]h&]rolefileuh1hhjubh, description of the scan element data storage within the buffer and hence the form in which it is read from user space. Format is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift] .}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK&hjubh)}(hhh](h)}(h-*be* or *le*, specifies big or little endian.h]h)}(hj7h](j)}(h*be*h]hbe}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh or }(hj9hhhNhNubj)}(h*le*h]hle}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh!, specifies big or little endian.}(hj9hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK*hj5ubah}(h]h ]h"]h$]h&]uh1hhj2ubh)}(h=*s* or *u*, specifies if signed (2's complement) or unsigned.h]h)}(hjnh](j)}(h*s*h]hs}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1jhjpubh or }(hjphhhNhNubj)}(h*u*h]hu}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjpubh5, specifies if signed (2’s complement) or unsigned.}(hjphhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK+hjlubah}(h]h ]h"]h$]h&]uh1hhj2ubh)}(h)*bits*, is the number of valid data bits.h]h)}(hjh](j)}(h*bits*h]hbits}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh#, is the number of valid data bits.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK,hjubah}(h]h ]h"]h$]h&]uh1hhj2ubh)}(hT*storagebits*, is the number of bits (after padding) that it occupies in the buffer.h]h)}(hT*storagebits*, is the number of bits (after padding) that it occupies in the buffer.h](j)}(h *storagebits*h]h storagebits}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhG, is the number of bits (after padding) that it occupies in the buffer.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK-hjubah}(h]h ]h"]h$]h&]uh1hhj2ubh)}(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](j)}(h*repeat*h]hrepeat}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh|, specifies the number of bits/storagebits repetitions. When the repeat element is 0 or 1, then the repeat value is omitted.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK/hjubah}(h]h ]h"]h$]h&]uh1hhj2ubh)}(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](j)}(h*shift*h]hshift}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhW, if specified, is the shift that needs to be applied prior to masking out unused bits.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK1hjubah}(h]h ]h"]h$]h&]uh1hhj2ubeh}(h]h ]h"]h$]h&]jjuh1hhhhK*hjubeh}(h]h ]h"]h$]h&]uh1hhjhhhNhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhK"hjdhhubh)}(hFor example, a driver for a 3-axis accelerometer with 12 bit resolution where data is stored in two 8-bits registers as follows::h]hFor example, a driver for a 3-axis accelerometer with 12 bit resolution where data is stored in two 8-bits registers as follows:}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjdhhubh 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) +---+---+---+---+---+---+---+---+}hj\sbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jZhhhK7hjdhhubh)}(h9will have the following scan element type for each axis::h]h8will have the following scan element type for each axis:}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjdhhubj[)}(hQ$ cat /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_y_type le:s12/16>>4h]hQ$ cat /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_y_type le:s12/16>>4}hjzsbah}(h]h ]h"]h$]h&]jjjkuh1jZhhhKChjdhhubh)}(hA user space 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]hA user space 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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjdhhubh)}(hmFor implementing buffer support a driver should initialize the following fields in iio_chan_spec definition::h]hlFor implementing buffer support a driver should initialize the following fields in iio_chan_spec definition:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhjdhhubj[)}(hX1struct iio_chan_spec { /* other members */ int scan_index struct { char sign; u8 realbits; u8 storagebits; u8 shift; u8 repeat; enum iio_endian endianness; } scan_type; };h]hX1struct iio_chan_spec { /* other members */ int scan_index struct { char sign; u8 realbits; u8 storagebits; u8 shift; u8 repeat; enum iio_endian endianness; } scan_type; };}hjsbah}(h]h ]h"]h$]h&]jjjkuh1jZhhhKMhjdhhubh)}(hfThe driver implementing the accelerometer described above will have the following channel definition::h]heThe driver implementing the accelerometer described above will have the following channel definition:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKZhjdhhubj[)}(hXstruct iio_chan_spec accel_channels[] = { { .type = IIO_ACCEL, .modified = 1, .channel2 = IIO_MOD_X, /* other stuff here */ .scan_index = 0, .scan_type = { .sign = 's', .realbits = 12, .storagebits = 16, .shift = 4, .endianness = IIO_LE, }, } /* similar for Y (with channel2 = IIO_MOD_Y, scan_index = 1) * and Z (with channel2 = IIO_MOD_Z, scan_index = 2) axis */ }h]hXstruct iio_chan_spec accel_channels[] = { { .type = IIO_ACCEL, .modified = 1, .channel2 = IIO_MOD_X, /* other stuff here */ .scan_index = 0, .scan_type = { .sign = 's', .realbits = 12, .storagebits = 16, .shift = 4, .endianness = IIO_LE, }, } /* similar for Y (with channel2 = IIO_MOD_Y, scan_index = 1) * and Z (with channel2 = IIO_MOD_Z, scan_index = 2) axis */ }}hjsbah}(h]h ]h"]h$]h&]jjjkuh1jZhhhK]hjdhhubh)}(hHere **scan_index** defines the order in which the enabled channels are placed inside the buffer. Channels with a lower **scan_index** will be placed before channels with a higher index. Each channel needs to have a unique **scan_index**.h](hHere }(hjhhhNhNubhstrong)}(h**scan_index**h]h scan_index}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhe defines the order in which the enabled channels are placed inside the buffer. Channels with a lower }(hjhhhNhNubj)}(h**scan_index**h]h scan_index}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhY will be placed before channels with a higher index. Each channel needs to have a unique }(hjhhhNhNubj)}(h**scan_index**h]h scan_index}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKqhjdhhubh)}(hSetting **scan_index** to -1 can be used to indicate that the specific channel does not support buffered capture. In this case no entries will be created for the channel in the scan_elements directory.h](hSetting }(hjhhhNhNubj)}(h**scan_index**h]h scan_index}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh to -1 can be used to indicate that the specific channel does not support buffered capture. In this case no entries will be created for the channel in the scan_elements directory.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKvhjdhhubeh}(h]iio-buffer-setupah ]h"]iio buffer setupah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h More detailsh]h More details}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj<hhhhhK{ubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](single/iio_push_to_buffers_with_timestamp (C function)$c.iio_push_to_buffers_with_timestamphNtauh1jMhj<hhhNhNubhdesc)}(hhh](hdesc_signature)}(haint iio_push_to_buffers_with_timestamp (struct iio_dev *indio_dev, void *data, int64_t timestamp)h]hdesc_signature_line)}(h`int iio_push_to_buffers_with_timestamp(struct iio_dev *indio_dev, void *data, int64_t timestamp)h](hdesc_sig_keyword_type)}(hinth]hint}(hjqhhhNhNubah}(h]h ]ktah"]h$]h&]uh1johjkhhhb/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:124: ./include/linux/iio/buffer.hhK%ubhdesc_sig_space)}(h h]h }(hjhhhNhNubah}(h]h ]wah"]h$]h&]uh1jhjkhhhjhK%ubh desc_name)}(h"iio_push_to_buffers_with_timestamph]h desc_sig_name)}(h"iio_push_to_buffers_with_timestamph]h"iio_push_to_buffers_with_timestamp}(hjhhhNhNubah}(h]h ]nah"]h$]h&]uh1jhjubah}(h]h ](sig-namedescnameeh"]h$]h&]jjjkuh1jhjkhhhjhK%ubhdesc_parameterlist)}(h:(struct iio_dev *indio_dev, void *data, int64_t timestamp)h](hdesc_parameter)}(hstruct iio_dev *indio_devh](hdesc_sig_keyword)}(hstructh]hstruct}(hjhhhNhNubah}(h]h ]kah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(hiio_devh]hiio_dev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftype identifier reftargetjmodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]j ASTIdentifier)}jjsb$c.iio_push_to_buffers_with_timestampasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubhdesc_sig_punctuation)}(hjh]h*}(hjhhhNhNubah}(h]h ]pah"]h$]h&]uh1jhjubj)}(h indio_devh]h indio_dev}(hj%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhjubj)}(h void *datah](jp)}(hvoidh]hvoid}(hj>hhhNhNubah}(h]h ]j|ah"]h$]h&]uh1johj:ubj)}(h h]h }(hjLhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj:ubj)}(hjh]h*}(hjZhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj:ubj)}(hdatah]hdata}(hjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhjubj)}(hint64_t timestamph](h)}(hhh]j)}(hint64_th]hint64_t}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftypej reftargetjmodnameN classnameNjj)}j]j$c.iio_push_to_buffers_with_timestampasbuh1hhj|ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj|ubj)}(h timestamph]h timestamp}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj|ubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhjubeh}(h]h ]h"]h$]h&]jjjkuh1jhjkhhhjhK%ubeh}(h]h ]h"]h$]h&]jjjk add_permalinkuh1jisphinx_line_type declaratorhjehhhjhK%ubah}(h]j\ah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1jchjhK%hj`hhubh desc_content)}(hhh]h)}(h"push data and timestamp to buffersh]h"push data and timestamp to buffers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:124: ./include/linux/iio/buffer.hhKhjhhubah}(h]h ]h"]h$]h&]uh1jhj`hhhjhK%ubeh}(h]h ](hfunctioneh"]h$]h&]domainhobjtypejdesctypejnoindex noindexentrynocontentsentryuh1j^hhhj<hNhNubh container)}(hXS**Parameters** ``struct iio_dev *indio_dev`` iio_dev structure for device. ``void *data`` sample data ``int64_t timestamp`` timestamp for the sample data **Description** Pushes data to the IIO device's buffers. If timestamps are enabled for the device the function will store the supplied timestamp as the last element in the sample data buffer before pushing it to the device buffers. The sample data buffer needs to be large enough to hold the additional timestamp (usually the buffer should be indio->scan_bytes bytes large). Returns 0 on success, a negative error code otherwise.h](h)}(h**Parameters**h]j)}(hj h]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:124: ./include/linux/iio/buffer.hhKhjubhdefinition_list)}(hhh](hdefinition_list_item)}(h<``struct iio_dev *indio_dev`` iio_dev structure for device. h](hterm)}(h``struct iio_dev *indio_dev``h]h)}(hj2h]hstruct iio_dev *indio_dev}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj0ubah}(h]h ]h"]h$]h&]uh1j.hb/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:124: ./include/linux/iio/buffer.hhKhj*ubh definition)}(hhh]h)}(hiio_dev structure for device.h]hiio_dev structure for device.}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGhKhjJubah}(h]h ]h"]h$]h&]uh1jHhj*ubeh}(h]h ]h"]h$]h&]uh1j(hjGhKhj%ubj))}(h``void *data`` sample data h](j/)}(h``void *data``h]h)}(hjmh]h void *data}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhjkubah}(h]h ]h"]h$]h&]uh1j.hb/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:124: ./include/linux/iio/buffer.hhKhjgubjI)}(hhh]h)}(h sample datah]h sample data}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jHhjgubeh}(h]h ]h"]h$]h&]uh1j(hjhKhj%ubj))}(h4``int64_t timestamp`` timestamp for the sample data h](j/)}(h``int64_t timestamp``h]h)}(hjh]hint64_t timestamp}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1j.hb/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:124: ./include/linux/iio/buffer.hhKhjubjI)}(hhh]h)}(htimestamp for the sample datah]htimestamp for the sample data}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jHhjubeh}(h]h ]h"]h$]h&]uh1j(hjhKhj%ubeh}(h]h ]h"]h$]h&]uh1j#hjubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:124: ./include/linux/iio/buffer.hhKhjubh)}(hXfPushes data to the IIO device's buffers. If timestamps are enabled for the device the function will store the supplied timestamp as the last element in the sample data buffer before pushing it to the device buffers. The sample data buffer needs to be large enough to hold the additional timestamp (usually the buffer should be indio->scan_bytes bytes large).h]hXhPushes data to the IIO device’s buffers. If timestamps are enabled for the device the function will store the supplied timestamp as the last element in the sample data buffer before pushing it to the device buffers. The sample data buffer needs to be large enough to hold the additional timestamp (usually the buffer should be indio->scan_bytes bytes large).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:124: ./include/linux/iio/buffer.hhKhjubh)}(h6Returns 0 on success, a negative error code otherwise.h]h6Returns 0 on success, a negative error code otherwise.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:124: ./include/linux/iio/buffer.hhK#hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj<hhhNhNubjN)}(hhh]h}(h]h ]h"]h$]h&]entries](jZ*iio_validate_scan_mask_onehot (C function)c.iio_validate_scan_mask_onehothNtauh1jMhj<hhhNhNubj_)}(hhh](jd)}(hYbool iio_validate_scan_mask_onehot (struct iio_dev *indio_dev, const unsigned long *mask)h]jj)}(hXbool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev, const unsigned long *mask)h](jp)}(hboolh]hbool}(hj5hhhNhNubah}(h]h ]j|ah"]h$]h&]uh1johj1hhhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM ubj)}(h h]h }(hjDhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj1hhhjChM ubj)}(hiio_validate_scan_mask_onehoth]j)}(hiio_validate_scan_mask_onehoth]hiio_validate_scan_mask_onehot}(hjVhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjRubah}(h]h ](jjeh"]h$]h&]jjjkuh1jhj1hhhjChM ubj)}(h6(struct iio_dev *indio_dev, const unsigned long *mask)h](j)}(hstruct iio_dev *indio_devh](j)}(hjh]hstruct}(hjrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjnubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjnubh)}(hhh]j)}(hiio_devh]hiio_dev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftypej reftargetjmodnameN classnameNjj)}j]j)}jjXsbc.iio_validate_scan_mask_onehotasbuh1hhjnubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjnubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjnubj)}(h indio_devh]h indio_dev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjnubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhjjubj)}(hconst unsigned long *maskh](j)}(hconsth]hconst}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjp)}(hunsignedh]hunsigned}(hj hhhNhNubah}(h]h ]j|ah"]h$]h&]uh1johjubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjp)}(hlongh]hlong}(hj hhhNhNubah}(h]h ]j|ah"]h$]h&]uh1johjubj)}(h h]h }(hj* hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hj8 hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubj)}(hmaskh]hmask}(hjE hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhjjubeh}(h]h ]h"]h$]h&]jjjkuh1jhj1hhhjChM ubeh}(h]h ]h"]h$]h&]jjjkjuh1jijjhj-hhhjChM ubah}(h]j(ah ](jjeh"]h$]h&]jj)jhuh1jchjChM hj*hhubj)}(hhh]h)}(h.Validates that exactly one channel is selectedh]h.Validates that exactly one channel is selected}(hjo hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hjl hhubah}(h]h ]h"]h$]h&]uh1jhj*hhhjChM ubeh}(h]h ](hfunctioneh"]h$]h&]jhjj jj jjjuh1j^hhhj<hNhNubj)}(hX***Parameters** ``struct iio_dev *indio_dev`` the iio device ``const unsigned long *mask`` scan mask to be checked **Description** Return true if exactly one bit is set in the scan mask, false otherwise. It can be used for devices where only one channel can be active for sampling at a time.h](h)}(h**Parameters**h]j)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hj ubj$)}(hhh](j))}(h-``struct iio_dev *indio_dev`` the iio device h](j/)}(h``struct iio_dev *indio_dev``h]h)}(hj h]hstruct iio_dev *indio_dev}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1j.hi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hj ubjI)}(hhh]h)}(hthe iio deviceh]hthe iio device}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hM hj ubah}(h]h ]h"]h$]h&]uh1jHhj ubeh}(h]h ]h"]h$]h&]uh1j(hj hM hj ubj))}(h6``const unsigned long *mask`` scan mask to be checked h](j/)}(h``const unsigned long *mask``h]h)}(hj h]hconst unsigned long *mask}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1j.hi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hj ubjI)}(hhh]h)}(hscan mask to be checkedh]hscan mask to be checked}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hM hj ubah}(h]h ]h"]h$]h&]uh1jHhj ubeh}(h]h ]h"]h$]h&]uh1j(hj hM hj ubeh}(h]h ]h"]h$]h&]uh1j#hj ubh)}(h**Description**h]j)}(hj$ h]h Description}(hj& hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj" ubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hj ubh)}(hReturn true if exactly one bit is set in the scan mask, false otherwise. It can be used for devices where only one channel can be active for sampling at a time.h]hReturn true if exactly one bit is set in the scan mask, false otherwise. It can be used for devices where only one channel can be active for sampling at a time.}(hj: hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hj ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj<hhhNhNubjN)}(hhh]h}(h]h ]h"]h$]h&]entries](jZ iio_push_to_buffers (C function)c.iio_push_to_buffershNtauh1jMhj<hhhNhNubj_)}(hhh](jd)}(hEint iio_push_to_buffers (struct iio_dev *indio_dev, const void *data)h]jj)}(hDint iio_push_to_buffers(struct iio_dev *indio_dev, const void *data)h](jp)}(hinth]hint}(hji hhhNhNubah}(h]h ]j|ah"]h$]h&]uh1johje hhhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chMH ubj)}(h h]h }(hjx hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhje hhhjw hMH ubj)}(hiio_push_to_buffersh]j)}(hiio_push_to_buffersh]hiio_push_to_buffers}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]jjjkuh1jhje hhhjw hMH ubj)}(h-(struct iio_dev *indio_dev, const void *data)h](j)}(hstruct iio_dev *indio_devh](j)}(hjh]hstruct}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubh)}(hhh]j)}(hiio_devh]hiio_dev}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&] refdomainhreftypej reftargetj modnameN classnameNjj)}j]j)}jj sbc.iio_push_to_buffersasbuh1hhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hjh]h*}(hj hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj ubj)}(h indio_devh]h indio_dev}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhj ubj)}(hconst void *datah](j)}(hjh]hconst}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj% hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubjp)}(hvoidh]hvoid}(hj3 hhhNhNubah}(h]h ]j|ah"]h$]h&]uh1johj ubj)}(h h]h }(hjA hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hjh]h*}(hjO hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj ubj)}(hdatah]hdata}(hj\ hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhj ubeh}(h]h ]h"]h$]h&]jjjkuh1jhje hhhjw hMH ubeh}(h]h ]h"]h$]h&]jjjkjuh1jijjhja hhhjw hMH ubah}(h]j\ ah ](jjeh"]h$]h&]jj)jhuh1jchjw hMH hj^ hhubj)}(hhh]h)}(hpush to a registered buffer.h]hpush to a registered buffer.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chMD hj hhubah}(h]h ]h"]h$]h&]uh1jhj^ hhhjw hMH ubeh}(h]h ](hfunctioneh"]h$]h&]jhjj jj jjjuh1j^hhhj<hNhNubj)}(hp**Parameters** ``struct iio_dev *indio_dev`` iio_dev structure for device. ``const void *data`` Full scan.h](h)}(h**Parameters**h]j)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chMH hj ubj$)}(hhh](j))}(h<``struct iio_dev *indio_dev`` iio_dev structure for device. h](j/)}(h``struct iio_dev *indio_dev``h]h)}(hj h]hstruct iio_dev *indio_dev}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1j.hi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chME hj ubjI)}(hhh]h)}(hiio_dev structure for device.h]hiio_dev structure for device.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hME hj ubah}(h]h ]h"]h$]h&]uh1jHhj ubeh}(h]h ]h"]h$]h&]uh1j(hj hME hj ubj))}(h``const void *data`` Full scan.h](j/)}(h``const void *data``h]h)}(hj h]hconst void *data}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1j.hi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chMG hj ubjI)}(hhh]h)}(h Full scan.h]h Full scan.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chMF hj ubah}(h]h ]h"]h$]h&]uh1jHhj ubeh}(h]h ]h"]h$]h&]uh1j(hj hMG hj ubeh}(h]h ]h"]h$]h&]uh1j#hj ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj<hhhNhNubjN)}(hhh]h}(h]h ]h"]h$]h&]entries](jZ2iio_push_to_buffers_with_ts_unaligned (C function)'c.iio_push_to_buffers_with_ts_unalignedhNtauh1jMhj<hhhNhNubj_)}(hhh](jd)}(hzint iio_push_to_buffers_with_ts_unaligned (struct iio_dev *indio_dev, const void *data, size_t data_sz, int64_t timestamp)h]jj)}(hyint iio_push_to_buffers_with_ts_unaligned(struct iio_dev *indio_dev, const void *data, size_t data_sz, int64_t timestamp)h](jp)}(hinth]hint}(hjZ hhhNhNubah}(h]h ]j|ah"]h$]h&]uh1johjV hhhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chMe ubj)}(h h]h }(hji hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjV hhhjh hMe ubj)}(h%iio_push_to_buffers_with_ts_unalignedh]j)}(h%iio_push_to_buffers_with_ts_unalignedh]h%iio_push_to_buffers_with_ts_unaligned}(hj{ hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjw ubah}(h]h ](jjeh"]h$]h&]jjjkuh1jhjV hhhjh hMe ubj)}(hP(struct iio_dev *indio_dev, const void *data, size_t data_sz, int64_t timestamp)h](j)}(hstruct iio_dev *indio_devh](j)}(hjh]hstruct}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubh)}(hhh]j)}(hiio_devh]hiio_dev}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&] refdomainhreftypej reftargetj modnameN classnameNjj)}j]j)}jj} sb'c.iio_push_to_buffers_with_ts_unalignedasbuh1hhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hjh]h*}(hj hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj ubj)}(h indio_devh]h indio_dev}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhj ubj)}(hconst void *datah](j)}(hjh]hconst}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubjp)}(hvoidh]hvoid}(hj$ hhhNhNubah}(h]h ]j|ah"]h$]h&]uh1johj ubj)}(h h]h }(hj2 hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hjh]h*}(hj@ hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj ubj)}(hdatah]hdata}(hjM hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhj ubj)}(hsize_t data_szh](h)}(hhh]j)}(hsize_th]hsize_t}(hji hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjf ubah}(h]h ]h"]h$]h&] refdomainhreftypej reftargetjk modnameN classnameNjj)}j]j 'c.iio_push_to_buffers_with_ts_unalignedasbuh1hhjb ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjb ubj)}(hdata_szh]hdata_sz}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjb ubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhj ubj)}(hint64_t timestamph](h)}(hhh]j)}(hint64_th]hint64_t}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&] refdomainhreftypej reftargetj modnameN classnameNjj)}j]j 'c.iio_push_to_buffers_with_ts_unalignedasbuh1hhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h timestamph]h timestamp}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhj ubeh}(h]h ]h"]h$]h&]jjjkuh1jhjV hhhjh hMe ubeh}(h]h ]h"]h$]h&]jjjkjuh1jijjhjR hhhjh hMe ubah}(h]jM ah ](jjeh"]h$]h&]jj)jhuh1jchjh hMe hjO hhubj)}(hhh]h)}(h>push to registered buffer, no alignment or space requirements.h]h>push to registered buffer, no alignment or space requirements.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chMY hjhhubah}(h]h ]h"]h$]h&]uh1jhjO hhhjh hMe ubeh}(h]h ](hfunctioneh"]h$]h&]jhjjjjjjjuh1j^hhhj<hNhNubj)}(hX**Parameters** ``struct iio_dev *indio_dev`` iio_dev structure for device. ``const void *data`` channel data excluding the timestamp. ``size_t data_sz`` size of data. ``int64_t timestamp`` timestamp for the sample data. **Description** This special variant of iio_push_to_buffers_with_timestamp() does not require space for the timestamp, or 8 byte alignment of data. It does however require an allocation on first call and additional copies on all calls, so should be avoided if possible.h](h)}(h**Parameters**h]j)}(hj)h]h Parameters}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj'ubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM] hj#ubj$)}(hhh](j))}(h<``struct iio_dev *indio_dev`` iio_dev structure for device. h](j/)}(h``struct iio_dev *indio_dev``h]h)}(hjHh]hstruct iio_dev *indio_dev}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjFubah}(h]h ]h"]h$]h&]uh1j.hi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM[ hjBubjI)}(hhh]h)}(hiio_dev structure for device.h]hiio_dev structure for device.}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhj]hM[ hj^ubah}(h]h ]h"]h$]h&]uh1jHhjBubeh}(h]h ]h"]h$]h&]uh1j(hj]hM[ hj?ubj))}(h;``const void *data`` channel data excluding the timestamp. h](j/)}(h``const void *data``h]h)}(hjh]hconst void *data}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1j.hi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM\ hj{ubjI)}(hhh]h)}(h%channel data excluding the timestamp.h]h%channel data excluding the timestamp.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM\ hjubah}(h]h ]h"]h$]h&]uh1jHhj{ubeh}(h]h ]h"]h$]h&]uh1j(hjhM\ hj?ubj))}(h!``size_t data_sz`` size of data. h](j/)}(h``size_t data_sz``h]h)}(hjh]hsize_t data_sz}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1j.hi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM] hjubjI)}(hhh]h)}(h size of data.h]h size of data.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM] hjubah}(h]h ]h"]h$]h&]uh1jHhjubeh}(h]h ]h"]h$]h&]uh1j(hjhM] hj?ubj))}(h5``int64_t timestamp`` timestamp for the sample data. h](j/)}(h``int64_t timestamp``h]h)}(hjh]hint64_t timestamp}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1j.hi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM^ hjubjI)}(hhh]h)}(htimestamp for the sample data.h]htimestamp for the sample data.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM^ hj ubah}(h]h ]h"]h$]h&]uh1jHhjubeh}(h]h ]h"]h$]h&]uh1j(hjhM^ hj?ubeh}(h]h ]h"]h$]h&]uh1j#hj#ubh)}(h**Description**h]j)}(hj.h]h Description}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj,ubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM` hj#ubh)}(hThis special variant of iio_push_to_buffers_with_timestamp() does not require space for the timestamp, or 8 byte alignment of data. It does however require an allocation on first call and additional copies on all calls, so should be avoided if possible.h]hThis special variant of iio_push_to_buffers_with_timestamp() does not require space for the timestamp, or 8 byte alignment of data. It does however require an allocation on first call and additional copies on all calls, so should be avoided if possible.}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM` hj#ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj<hhhNhNubjN)}(hhh]h}(h]h ]h"]h$]h&]entries](jZiio_buffer_get (C function)c.iio_buffer_gethNtauh1jMhj<hhhNhNubj_)}(hhh](jd)}(h>struct iio_buffer * iio_buffer_get (struct iio_buffer *buffer)h]jj)}(hhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj+hhhj=hM ubj)}(hiio_buffer_puth]j)}(hiio_buffer_puth]hiio_buffer_put}(hjPhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjLubah}(h]h ](jjeh"]h$]h&]jjjkuh1jhj+hhhj=hM ubj)}(h(struct iio_buffer *buffer)h]j)}(hstruct iio_buffer *bufferh](j)}(hjh]hstruct}(hjlhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhubj)}(h h]h }(hjyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhubh)}(hhh]j)}(h iio_bufferh]h iio_buffer}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftypej reftargetjmodnameN classnameNjj)}j]j)}jjRsbc.iio_buffer_putasbuh1hhjhubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjhubj)}(hbufferh]hbuffer}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhjdubah}(h]h ]h"]h$]h&]jjjkuh1jhj+hhhj=hM ubeh}(h]h ]h"]h$]h&]jjjkjuh1jijjhj'hhhj=hM ubah}(h]j"ah ](jjeh"]h$]h&]jj)jhuh1jchj=hM hj$hhubj)}(hhh]h)}(h#Release the reference to the bufferh]h#Release the reference to the buffer}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hjhhubah}(h]h ]h"]h$]h&]uh1jhj$hhhj=hM ubeh}(h]h ](hfunctioneh"]h$]h&]jhjjjjjjjuh1j^hhhj<hNhNubj)}(hd**Parameters** ``struct iio_buffer *buffer`` The buffer to release the reference for, may be NULLh](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hj ubj$)}(hhh]j))}(hR``struct iio_buffer *buffer`` The buffer to release the reference for, may be NULLh](j/)}(h``struct iio_buffer *buffer``h]h)}(hj0h]hstruct iio_buffer *buffer}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj.ubah}(h]h ]h"]h$]h&]uh1j.hi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hj*ubjI)}(hhh]h)}(h4The buffer to release the reference for, may be NULLh]h4The buffer to release the reference for, may be NULL}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hjFubah}(h]h ]h"]h$]h&]uh1jHhj*ubeh}(h]h ]h"]h$]h&]uh1j(hjEhM hj'ubah}(h]h ]h"]h$]h&]uh1j#hj ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj<hhhNhNubjN)}(hhh]h}(h]h ]h"]h$]h&]entries](jZ%iio_device_attach_buffer (C function)c.iio_device_attach_bufferhNtauh1jMhj<hhhNhNubj_)}(hhh](jd)}(hSint iio_device_attach_buffer (struct iio_dev *indio_dev, struct iio_buffer *buffer)h]jj)}(hRint iio_device_attach_buffer(struct iio_dev *indio_dev, struct iio_buffer *buffer)h](jp)}(hinth]hint}(hjhhhNhNubah}(h]h ]j|ah"]h$]h&]uh1johjhhhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhM ubj)}(hiio_device_attach_bufferh]j)}(hiio_device_attach_bufferh]hiio_device_attach_buffer}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjjkuh1jhjhhhjhM ubj)}(h6(struct iio_dev *indio_dev, struct iio_buffer *buffer)h](j)}(hstruct iio_dev *indio_devh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(hiio_devh]hiio_dev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftypej reftargetjmodnameN classnameNjj)}j]j)}jjsbc.iio_device_attach_bufferasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubj)}(h indio_devh]h indio_dev}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhjubj)}(hstruct iio_buffer *bufferh](j)}(hjh]hstruct}(hj9hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj5ubj)}(h h]h }(hjFhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj5ubh)}(hhh]j)}(h iio_bufferh]h iio_buffer}(hjWhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjTubah}(h]h ]h"]h$]h&] refdomainhreftypej reftargetjYmodnameN classnameNjj)}j]jc.iio_device_attach_bufferasbuh1hhj5ubj)}(h h]h }(hjuhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj5ubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj5ubj)}(hbufferh]hbuffer}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj5ubeh}(h]h ]h"]h$]h&]noemphjjjkuh1jhjubeh}(h]h ]h"]h$]h&]jjjkuh1jhjhhhjhM ubeh}(h]h ]h"]h$]h&]jjjkjuh1jijjhjhhhjhM ubah}(h]j}ah ](jjeh"]h$]h&]jj)jhuh1jchjhM hjhhubj)}(hhh]h)}(hAttach a buffer to a IIO deviceh]hAttach a buffer to a IIO device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhM ubeh}(h]h ](hfunctioneh"]h$]h&]jhjjjjjjjuh1j^hhhj<hNhNubj)}(hX***Parameters** ``struct iio_dev *indio_dev`` The device the buffer should be attached to ``struct iio_buffer *buffer`` The buffer to attach to the device **Description** Return 0 if successful, negative if error. This function attaches a buffer to a IIO device. The buffer stays attached to the device until the device is freed. For legacy reasons, the first attached buffer will also be assigned to 'indio_dev->buffer'. The array allocated here, will be free'd via the iio_device_detach_buffers() call which is handled by the iio_device_free().h](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hjubj$)}(hhh](j))}(hJ``struct iio_dev *indio_dev`` The device the buffer should be attached to h](j/)}(h``struct iio_dev *indio_dev``h]h)}(hjh]hstruct iio_dev *indio_dev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1j.hi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hjubjI)}(hhh]h)}(h+The device the buffer should be attached toh]h+The device the buffer should be attached to}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM hjubah}(h]h ]h"]h$]h&]uh1jHhjubeh}(h]h ]h"]h$]h&]uh1j(hjhM hjubj))}(hA``struct iio_buffer *buffer`` The buffer to attach to the device h](j/)}(h``struct iio_buffer *buffer``8h]h)}(hj4h]hstruct iio_buffer *buffer}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2ubah}(h]h ]h"]h$]h&]uh1j.hi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hj.ubjI)}(hhh]h)}(h"The buffer to attach to the deviceh]h"The buffer to attach to the device}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjIhM hjJubah}(h]h ]h"]h$]h&]uh1jHhj.ubeh}(h]h ]h"]h$]h&]uh1j(hjIhM hjubeh}(h]h ]h"]h$]h&]uh1j#hjubh)}(h**Description**h]j)}(hjoh]h Description}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjmubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hjubh)}(h*Return 0 if successful, negative if error.h]h*Return 0 if successful, negative if error.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hjubh)}(hXLThis function attaches a buffer to a IIO device. The buffer stays attached to the device until the device is freed. For legacy reasons, the first attached buffer will also be assigned to 'indio_dev->buffer'. The array allocated here, will be free'd via the iio_device_detach_buffers() call which is handled by the iio_device_free().h]hXRThis function attaches a buffer to a IIO device. The buffer stays attached to the device until the device is freed. For legacy reasons, the first attached buffer will also be assigned to ‘indio_dev->buffer’. The array allocated here, will be free’d via the iio_device_detach_buffers() call which is handled by the iio_device_free().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/driver-api/iio/buffers:125: ./drivers/iio/industrialio-buffer.chM hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj<hhhNhNubeh}(h] more-detailsah ]h"] more detailsah$]h&]uh1hhhhhhhhK{ubeh}(h]buffersah ]h"]buffersah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_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_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}(jjjaj^j9j6jju nametypes}(jjaj9juh}(jhj^jj6jdjj<j\jej(j-j\ ja jM jR jfjkj"j'j}ju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.