Post Go back to editing

IIO: How to differentiate between input and output channels with the same name

Category: Software
Product Number: ad9375
Software Version: 2022_R2

Hello

I am using the IIO device driver for the AD9375. I am using version 2022_R2 of the meta-adi layer for Petalinux.

I have hopefully a simple question.

I am trying to select a specific IIO channel on the AD9375. It has two output channels named voltage0 and voltage1 and three input channels named voltage0, voltage1 and voltage2.

To select a channel I have been using iio_device_find_channel() which uses the name ("voltage0", "voltage1", etc). 

How do  I choose whether I want to find / select the input channel or the output channel? I assume there must be a function but I am unable to find it.

Thank you.

Gavin