aboutsummaryrefslogtreecommitdiffstats
path: root/src/librtlsdr.c
diff options
context:
space:
mode:
authorLucas Teske <lucas@teske.net.br>2016-08-17 10:14:57 -0300
committerSteve Markgraf <steve@steve-m.de>2017-06-09 15:06:23 +0200
commit2be1612e604f950ba21ef6ff12488eab62e66ad5 (patch)
tree47ff8dc73e66b165495509020c708c728ab11855 /src/librtlsdr.c
parentba64a7459a43652354990855176a7d8dad5b9d54 (diff)
lib: Use GPIO P0 to toggle an (optional) bias-t
At least one distributor of rtl-sdr dongles (rtl-sdr.com) added a bias-t to their dongles which could be toggled via GPIO P0 of the RTL2832U chip. source: http://www.rtl-sdr.com/rtl-sdr-blog-v-3-dongles-user-guide/ Signed-off-by: Steve Markgraf <steve@steve-m.de>
Diffstat (limited to 'src/librtlsdr.c')
-rw-r--r--src/librtlsdr.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/librtlsdr.c b/src/librtlsdr.c
index e2c3c73..b369a5d 100644
--- a/src/librtlsdr.c
+++ b/src/librtlsdr.c
@@ -1937,3 +1937,14 @@ int rtlsdr_i2c_read_fn(void *dev, uint8_t addr, uint8_t *buf, int len)
return -1;
}
+
+int rtlsdr_set_bias_tee(rtlsdr_dev_t *dev, int on)
+{
+ if (!dev)
+ return -1;
+
+ rtlsdr_set_gpio_output(dev, 0);
+ rtlsdr_set_gpio_bit(dev, 0, on);
+
+ return 0;
+}