Post Go back to editing

Using AD7124 with Pyadi-iio in bipolar mode

Category: Software
Product Number: AD7124-8
Software Version: Pyadi-iio version 0.0.13

Using a temporary workaround proposed by    in response to an earlier question ad7124_simple_capture.py does not find ad7124 device  I now have my EVAL-AD7124-8-PMDZ  board working with Python using the Pyadi-iio library.

As far as I  know, the examples for this library only demonstrate using this particular chip in single-ended mode, meaning the ADC output values are in straight binary from 0 to (2^24 -1).  Now in my case, I have a true differential A-B signal: both A and B inputs are biased to converter midscale (1.25 V) but the difference (A-B) is centered at zero. So I want to use the AD7124 chip in its bipolar mode of operation. I just need to set the correct value in the correct register to enable this mode. 

Specifically, I need to set bit 11 ("Bipolar") of Register 0x19 ("CONFIG_0") to enable the AD7124 bipolar conversion output for Channel 0. Is there a facility to directly write chip registers, using the Pyadi-iio library?  I understand the driver might not have been intended for use in bipolar mode, but due to the above-mentioned workaround, for now I am reading the ADC result as a straight 4-byte binary word and doing my own conversion. So the Pyadi-iio library is not involved in interpreting the raw ADC output anyway. Thanks for any assistance!