Closed drom closed 5 years ago
Not really, general GPIO control is outside the scope of libIIO in general. Unless an IIO driver internally uses one like the FMComms5 components. The attribute "calibration_switch_control" is essentially mapped to some GPIOs.
I am finding some traces of information about AD9361 GPO being supported:
But all my attempts are failing for now. https://observablehq.com/@drom/plutosdr-gpio
See if this helps:
https://wiki.analog.com/university/tools/pluto/hacking/power_amp
It uses the GPO on the Pluto for Rx/Tx (controlling LNA or power amp).
Thank you @rgetz now it works. I just have to do iio_device_debug_attr_write_bool(dev, "initialize", 1);
in the end.
The AD936x driver in our current master branch supports GPO manual control from debugfs please see updated docs here: https://wiki.analog.com/resources/tools-software/linux-drivers/iio-transceiver/ad9361#gpo_manual_control
I have seen this instruction, but the latest PlutoSDR FW v0.31 doesn't have gpo_set
utility?
No - it'll be in v0.32 ...
@mhennerich Looking forward to getting v0.32 then!
This will take a few months - we're on a biannual release schedule. However you can use (untested) attached snapshot. plutosdr-fw-v0.31-dirty.zip
How badly untested it is? :thinking:
There shouldn't be any issues - Everything except the kernel version should be v0.31. It's basically the version I used to implement gpo_set support.
Works for me:
# pwd
/sys/kernel/debug/iio/iio:device1
# echo 1 > adi,gpo-manual-mode-enable
# echo 0 1 > gpo_set
# uname -a
Linux pluto 4.14.0-42808-g570aada #303 SMP PREEMPT Mon Aug 5 09:25:56 CEST 2019 armv7l GNU/Linux
# whoami
root
#
It works. Thank you @mhennerich
Does this library provide a way to control General-Purpose Outputs: GPO_3 to GPO_0?