Channels

Members

class iio.Channel(dev, _channel)[source]

Represents a channel of an IIO device.

property attrs

List of attributes for this channel. type=dict of iio.ChannelAttr

property data_format

Channel data format. type: iio.DataFormat

property device

Corresponding device for the channel. type: iio.Device

property id

An identifier of this channel. Note that it is possible that two channels have the same ID, if one is an input channel and the other is an output channel. type=str

property index

Index for the channel.

property modifier

Channel modifier. type: iio.ChannelModifier(Enum)

property name

The name of this channel. type=str

property output

Contains True if the channel is an output channel, False otherwise. type=bool

read(block, raw=False)[source]

Extract the samples corresponding to this channel from the given iio.Block object.

Parameters:
  • block – type=iio.Block A valid instance of the iio.Block class

  • raw – type=bool If set to True, the samples are not converted from their native format to their host format

returns: type=bytearray

An array containing the samples for this channel

property scan_element

Contains True if the channel is a scan element, False otherwise. If a channel is a scan element, then it is possible to enable it and use it for I/O operations. type=bool

property type

Type for the channel. type: iio.ChannelType(Enum)

write(block, array, raw=False)[source]

Write the specified array of samples corresponding to this channel into the given iio.Block object.

Parameters:
  • buf – type=iio.Block A valid instance of the iio.Block class

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

  • raw – type=bool If set to True, the samples are not converted from their host format to their native format

returns: type=int

The number of bytes written


Channel attributes

class iio.DataFormat[source]

Represents the data format of an IIO channel.

class iio.ChannelModifier(value)[source]

Contains the modifier type of an IIO channel.

class iio.ChannelType(value)[source]

Contains the type of an IIO channel.