Channels

Members

class iio.Channel(_channel)[source]

Represents a channel of an IIO device.

attrs

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

convert(dst, src)[source]

Convert src and saves the result in dst, using current channel’s data format.

Parameters:
  • dst – type=list The variable where the result is stored.
  • src – type=list Data to be converted.
convert_inverse(dst, src)[source]

Convert the sample from host format to hardware format.

Parameters:
  • dst – type=list The variable where the result is stored.
  • src – type=list Data to be converted.
data_format

Channel data format. type: iio.DataFormat

device

Corresponding device for the channel. type: iio.Device

enabled

Configured state of the channel type=bool

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

index

Index for the channel.

modifier

Channel modifier. type: iio.ChannelModifier(Enum)

name

The name of this channel. type=str

output

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

read(buf, raw=False)[source]

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

Parameters:
  • buf – type=iio.Buffer A valid instance of the iio.Buffer 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
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

type

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

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

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

Parameters:
  • buf – type=iio.Buffer A valid instance of the iio.Buffer 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[source]

Contains the modifier type of an IIO channel.

class iio.ChannelType[source]

Contains the type of an IIO channel.