Buffer

Members

class iio.Buffer(device, samples_count, cyclic=False)[source]

The class used for all I/O operations.

cancel()[source]

Cancel the current buffer.

property device

Device for the buffer. type: iio.Device

property poll_fd

Poll_fd for the buffer. type: int

push(samples_count=None)[source]

Submit the samples contained in this buffer to the hardware.

Parameters:

samples_count – type=int The number of samples to submit, default = full buffer

read()[source]

Retrieve the samples contained inside the Buffer object.

returns: type=bytearray

An array containing the samples

refill()[source]

Fetch a new set of samples from the hardware.

set_blocking_mode(blocking)[source]

Set the buffer’s blocking mode.

Parameters:

blocking – type=boolean True if in blocking_mode else False.

returns: type=int

Return code from the C layer.

property step

Step size for the buffer. type: int

write(array)[source]

Copy the given array of samples inside the Buffer object.

Parameters:

array – type=bytearray The array containing the samples to copy

returns: type=int

The number of bytes written into the buffer