greatscottgadgets / hackrf

low cost software radio platform
https://greatscottgadgets.com/hackrf/
GNU General Public License v2.0
6.46k stars 1.52k forks source link

Feature request: gpio control via usb #95

Open mogorman opened 11 years ago

mogorman commented 11 years ago

It would be nice if hackrf driver exposed sysct for some of the gpio on the board for turning on or off the upconverter, or other filters and antennas. mentioned this as a feature request to you in irc mossmann

┆Issue is synchronized with this Basecamp todo by Unito

KC5CQW commented 9 years ago

Hmm, possible project for use with the PortaPack H1 as well...

kmikeru commented 4 years ago

@mossmann Could you please kindly advice, what kind of enhancements are required to make this happen? It seems that there is no support for GPIO controls in the libhackrf and even no type in the enum for transfer type, so looks like a firmware change is needed too? I wanted to control an external PA and bandpass filters from HackRF directly without resorting to the additional USB device.

mossmann commented 4 years ago

We're planning to port the HackRF firmware onto libgreat which will give us GPIO control for free, but it is possible to add the capability to current firmware if you like. Take a look at how hackrf_set_antenna_enable() is implemented in libhackrf and in firmware. (You might skip the added complexity of the rf_path stuff in firmware, but if your goal is to switch things on and off when the RF path changes, then sticking to that method would probably be best.)

Additionally, if you only need to control one external GPIO pin and you have an RF choke around, hackrf_set_antenna_enable() might meet your needs without modification. It switches on/off a DC bias on the RF port.

kmikeru commented 4 years ago

Thank you very much. It seems that using the antenna DC bias control as the GPIO solves most of my needs.