Device

Members

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

Contains the representation of an IIO device.

property attrs

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

property buffer_attrs

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

property channels

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

property context

Context for the device. type: iio.Context

property 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

property id

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

property label

The label of this device. type=str

property 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

property 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

property 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.

property filename

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

property name

The name of this attribute. type=str

property value

Current value of this attribute. type=str

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

Represents a buffer attribute of an IIO device.

property filename

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

property name

The name of this attribute. type=str

property value

Current value of this attribute. type=str