mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2025-10-17 03:09:58 +02:00
lib: Add GPIO version of the bias tee configuration API
rtl_biast allows for non-default GPIO pins to be used. Add an API call which allows for that.
This commit is contained in:
committed by
Steve Markgraf
parent
9d05150a64
commit
5d0735f5df
@@ -2009,13 +2009,18 @@ 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)
|
||||
int rtlsdr_set_bias_tee_gpio(rtlsdr_dev_t *dev, int gpio, int on)
|
||||
{
|
||||
if (!dev)
|
||||
return -1;
|
||||
|
||||
rtlsdr_set_gpio_output(dev, 0);
|
||||
rtlsdr_set_gpio_bit(dev, 0, on);
|
||||
rtlsdr_set_gpio_output(dev, gpio);
|
||||
rtlsdr_set_gpio_bit(dev, gpio, on);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rtlsdr_set_bias_tee(rtlsdr_dev_t *dev, int on)
|
||||
{
|
||||
return rtlsdr_set_bias_tee_gpio(dev, 0, on);
|
||||
}
|
||||
|
Reference in New Issue
Block a user