jbrzusto / librtlsdr

Software to turn the RTL2832U into an SDR (version for sensorgnomes)
GNU General Public License v2.0
0 stars 0 forks source link

support bias_t option #2

Open jbrzusto opened 7 years ago

jbrzusto commented 7 years ago

some newer rtlsdr dongles include an antenna bias voltage. e.g. here

This one is controlled by setting / clearing gpio 0 in librtlsdr.c:

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 1;
}

and then adding a call to force it off from rtlsdr_close:

    // Turn off the bias tee
    //rtlsdr_set_gpio_output(dev, 0);
            rtlsdr_set_gpio_bit(dev, 0, 0);

Implementation for SG:

jbrzusto commented 6 years ago

a patch is in testing, but I have confirmed it works with the rtl-sdr.com dongles sold by compudata.ca