mirror of https://github.com/drowe67/librtlsdr.git
fixed usage for '-O ifm=' (VGA gain) and default value for that register
* before having possibility to set VGA from outside, it was set to 0x8 (=16.3 dB) for manual, but it was set to 0xb (=26.5 dB) for automatic (LNA/Mixer) gain. erroneously it was initialized to 0x0 in r82xx_init_array[] * also fixed parsing/processing of ifm value * might fix https://github.com/librtlsdr/librtlsdr/issues/81 Signed-off-by: hayati ayguen <h_ayguen@web.de>development
parent
656a5b5d86
commit
6efb9de24d
|
@ -3871,9 +3871,10 @@ const char * rtlsdr_get_opt_help(int longInfo)
|
|||
"\t\t 'U' or '1' for upper side band. default for R820T/2: 'L'\n"
|
||||
"\t\tagc=<tuner_gain_mode> activates tuner agc with '1'. deactivates with '0'\n"
|
||||
"\t\tgain=<tenth_dB> set tuner gain. 400 for 40.0 dB\n"
|
||||
"\t\tifm=<tuner_if_mode> set R820T/2 tuner's variable-gain-amplifier (VGA):\n"
|
||||
"\t\tifm=<tuner_if_mode> set R820T/2 tuner's variable-gain-amplifier (VGA). default: 10011\n"
|
||||
"\t\t 0: activate agc controlled from RTL2832's feedback\n"
|
||||
"\t\t 5000+gain: set gain in 10th dB. 5408 for +40.8 dB, 4953 for -4.7 dB\n"
|
||||
"\t\t around 0: set gain in 10th dB. 408 for +40.8 dB\n"
|
||||
"\t\t 5000+val: set gain to val in 10th dB. 5408 for +40.8 dB\n"
|
||||
"\t\t 10000+idx: set gain idx 0 .. 15: 10015 for maximum gain\n"
|
||||
"\t\tdagc=<rtl_agc> set RTL2832's digital agc (after ADC). 1 to activate. 0 to deactivate\n"
|
||||
"\t\tds=<direct_sampling> deactivate/bypass tuner with 1\n"
|
||||
|
|
|
@ -278,7 +278,10 @@ static const uint8_t r82xx_init_array[] = {
|
|||
0xdb, /* Reg 0x0a */
|
||||
0x6b, /* Reg 0x0b */
|
||||
|
||||
0xf0, /* Reg 0x0c */
|
||||
/* Reg 0x0c:
|
||||
* for manual gain was: set fixed VGA gain for now (16.3 dB): 0x08
|
||||
* with active agc was: set fixed VGA gain for now (26.5 dB): 0x0b */
|
||||
0xfb, /* Reg 0x0c */
|
||||
0x53, /* Reg 0x0d */
|
||||
0x75, /* Reg 0x0e */
|
||||
0x68, /* Reg 0x0f */
|
||||
|
@ -1162,9 +1165,12 @@ int r82xx_set_if_mode(struct r82xx_priv *priv, int if_mode, int *rtl_vga_control
|
|||
if ( 0 == if_mode || 10016 == if_mode ) {
|
||||
vga_gain_idx = 0x10;
|
||||
}
|
||||
else if ( -5000 <= if_mode && if_mode < 5000 ) {
|
||||
else if ( -2500 <= if_mode && if_mode <= 2500 ) {
|
||||
vga_gain_idx = r82xx_get_if_gain_index(if_mode);
|
||||
}
|
||||
else if ( 2500 < if_mode && if_mode < 10000 ) {
|
||||
vga_gain_idx = r82xx_get_if_gain_index(if_mode - 5000);
|
||||
}
|
||||
else if ( 10000 <= if_mode && if_mode < 10016 ) {
|
||||
vga_gain_idx = if_mode -10000;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue