aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorrtlsdrblog <rtlsdrblog@gmail.com>2023-09-20 12:10:13 +1200
committerSteve Markgraf <steve@steve-m.de>2023-11-02 12:28:34 +0100
commit138cd052f5345990507de630001421dc49937b20 (patch)
tree2f236ff269578a4ee6c5d1b36badceca5fe5ad1d /src
parent178267c3990bd780b14639d66423a4952df6f8bc (diff)
add blog v4 upconverter gpio switch
In future blog v4 production batches (out in several months time), it will be possible to turn off the upconverter when tuned outside of the HF bands. The code controls the GPIOs to turn off the upconverter when it is not in use.
Diffstat (limited to 'src')
-rw-r--r--src/tuner_r82xx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tuner_r82xx.c b/src/tuner_r82xx.c
index 1510fc3..38d4802 100644
--- a/src/tuner_r82xx.c
+++ b/src/tuner_r82xx.c
@@ -1154,6 +1154,12 @@ int r82xx_set_freq(struct r82xx_priv *priv, uint32_t freq)
if (rc < 0)
goto err;
+ /* Control upconverter GPIO switch on newer batches */
+ rc = rtlsdr_set_bias_tee_gpio(priv->rtl_dev, 5, !cable_2_in);
+
+ if (rc < 0)
+ goto err;
+
/* activate cable 1 (VHF input) */
cable_1_in = (band == VHF) ? 0x40 : 0x00;
rc = r82xx_write_reg_mask(priv, 0x05, cable_1_in, 0x40);