Skip to content

Commit

Permalink
add blog v4 upconverter gpio switch
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rtlsdrblog authored and steve-m committed Nov 2, 2023
1 parent 178267c commit 138cd05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/rtlsdr_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define __I2C_H

int rtlsdr_check_dongle_model(void *dev, char *manufact_check, char *product_check);
int rtlsdr_set_bias_tee_gpio(void *dev, int gpio, int on);
uint32_t rtlsdr_get_tuner_clock(void *dev);
int rtlsdr_i2c_write_fn(void *dev, uint8_t addr, uint8_t *buf, int len);
int rtlsdr_i2c_read_fn(void *dev, uint8_t addr, uint8_t *buf, int len);
Expand Down
6 changes: 6 additions & 0 deletions src/tuner_r82xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,12 @@ int r82xx_set_freq(struct r82xx_priv *priv, uint32_t freq)
cable_2_in = (band == HF) ? 0x08 : 0x00;
rc = r82xx_write_reg_mask(priv, 0x06, cable_2_in, 0x08);

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;

Expand Down

0 comments on commit 138cd05

Please sign in to comment.