Device

Members

class iio.Device(ctx, _device)[source]

Contains the representation of an IIO device.

attrs

List of attributes for this IIO device. type=dict of iio.DeviceAttr

buffer_attrs

List of buffer attributes for this IIO device. type=dict of iio.DeviceBufferAttr

channels

List of channels available with this IIO device. type=list of iio.Channel objects

context

Context for the device. type: iio.Context

debug_attrs

List of debug attributes for this IIO device. type=dict of iio.DeviceDebugAttr

find_channel(name_or_id, is_output=False)

Find a IIO channel by its name or ID.

Parameters:
  • name_or_id – type=str The name or ID of the channel to find
  • is_output – type=bool Set to True to search for an output channel
returns: type=iio.Device or type=iio.Trigger
The IIO Device
id

An identifier of this device, only valid in this IIO context. type=str

name

The name of this device. type=str

reg_read(reg)

Read the content of a register of this device.

Parameters:reg – type=int The register address
returns: type=int
The value of the register
reg_write(reg, value)

Set a value to one register of this device.

Parameters:
  • reg – type=int The register address
  • value – type=int The value that will be used for this register
sample_size

Sample size of this device. type: int

The sample size varies each time channels get enabled or disabled.

set_kernel_buffers_count(count)

Set the number of kernel buffers to use with the specified device.

Parameters:count – type=int The number of kernel buffers
trigger

Contains the configured trigger for this IIO device. type=iio.Trigger


Device attributes

class iio.DeviceDebugAttr(device, name)[source]

Represents a debug attribute of an IIO device.

filename

The filename in sysfs to which this attribute is bound. type=str

name

The name of this attribute. type=str

value

Current value of this attribute. type=str

class iio.DeviceBufferAttr(device, name)[source]

Represents a buffer attribute of an IIO device.

filename

The filename in sysfs to which this attribute is bound. type=str

name

The name of this attribute. type=str

value

Current value of this attribute. type=str