Commit Graph

64 Commits (07370a3a2234e4a29df9f9e943dbbf9da75bfd47)

Author SHA1 Message Date
hayati ayguen a500314933 rtlsdr_set_tuner_if_mode() further simplified
* modified API mode values/ranges

Signed-off-by: hayati ayguen <h_ayguen@web.de>
2019-08-20 20:45:46 +00:00
hayati ayguen bc15b17dd0 rtlsdr_set_tuner_agc_mode() -> rtlsdr_set_tuner_if_mode() and simplified
* renamed API
* renamed TCP command enum to SET_TUNER_IF_MODE
* simplified interface
* if_mode/gain is now applied independent of AGC

Signed-off-by: hayati ayguen <h_ayguen@web.de>
2019-08-18 22:39:56 +00:00
hayati ayguen 9825bcefe5 additional agc_variant modes for rtlsdr_set_tuner_agc_mode()
set VGA explicitly with active AGC on LNA/Mixer

Signed-off-by: hayati ayguen <h_ayguen@web.de>
2019-08-05 06:40:30 +00:00
hayati ayguen ab50557d89 added agc_variant = -2 for rtlsdr_set_tuner_agc_mode()
Signed-off-by: hayati ayguen <h_ayguen@web.de>
2019-07-30 23:59:12 +02:00
hayati ayguen 22a920d0a6 merge of great additions, e.g. rtlsdr_set_tuner_sideband()
* rtlsdr_set_tuner_sideband():
- "HF-Hase" Bernhard Kistinger (DB9PP) found out,
that one of the undocumented I2C register bits of R820T tuner
controls the used tuner/mixer lower or supper sideband.
That was by testing/playing with a special QIRX version,
showing and allowing change of all I2C registers.
- previous additions in rtl_tcp allowed control of I2C registers;
in addition register contents can be transmitted periodically (to QIRX)
- "Oldenburger" developed a first version controlling the sideband bit,
and additional spectral flipping (spectrum inversion) in the RTL2832
- i've merged Oldenburger's changes with my rtlsdr_set_tuner_band_center()
=> altogether, there's no spectrum inversion, the band center stays,
just the IF filters (steep lowpass and not-so-steep highpass) switch positions

* Oldenburger's changes for FC0012 tuner
* Oldenburger added description of R820T's I2C registers
* rtl_tcp's new response channel now occupies an additional port,
usally 1235, which is +1 of default control port.
this can be deactivated by command line

Signed-off-by: hayati ayguen <h_ayguen@web.de>
2019-07-28 01:31:03 +02:00
hayati ayguen 75f97e566d enhance version information, added API functions for version
distinguish between library version .. and program version

Signed-off-by: hayati ayguen <h_ayguen@web.de>
2019-07-28 00:15:34 +02:00
hayati ayguen fdaaed9580 cmake option WITH_RPC - defaulting to OFF
Signed-off-by: hayati ayguen <h_ayguen@web.de>
2019-07-20 04:12:28 +02:00
hayati ayguen d6d3be3952 added API rtlsdr_set_tuner_agc_mode(), updated r82xx_set_bandwidth()
* added TCP/UDP command SET_TUNER_AGC_VARIANT = 0x46
* updated r82xx_set_bandwidth()
* added several commands to UDP control server:
  f: set RF center frequency
  b: set tuner bandwidth
  c: set tuner bandwidth center in output
  a: set tuner AGC variant
  m: set manual tuner gain
  M: set gainMode
  h: print help

Signed-off-by: hayati ayguen <h_ayguen@web.de>
2019-07-20 00:37:03 +02:00
hayati ayguen cfc56ba7e6 add API rtlsdr_set_tuner_band_center() +rtl_tcp +rtl_udp
* use rtlsdr_get_opt_help() in usage of tools

Signed-off-by: hayati ayguen <h_ayguen@web.de>
2019-06-19 03:30:00 +02:00
hayati ayguen ce12ac0fd9 further changes/additions for udp server
* added API rtlsdr_set_tuner_i2c_override() to keep register contents
* added SET_I2C_TUNER_REGISTER and SET_I2C_TUNER_OVERRIDE commands
 to rtl_tcp for the R820T tuner
* moved udp server variables into struct rtlsdr_dev
* added hexadecimal and binary format at input for udp server
* start udp server optionally at rtlsdr_set_opt_string()
 with option '-O port='

Signed-off-by: hayati ayguen <h_ayguen@web.de>
2019-05-05 19:27:10 +02:00
hayati ayguen dd313f8d15 expose/permit hacking of Tuner-specific I2C registers
implemented for R820T tuner

Signed-off-by: hayati ayguen <h_ayguen@web.de>
2019-04-20 15:31:53 +02:00
hayati ayguen dc3c2dae0e new API function rtlsdr_set_opt_string()
* idea is, that CLI programs don't need to implement
  every single RTL option themselves
* option '-O' for test in rtl_test and rtl_fm

Signed-off-by: hayati ayguen <h_ayguen@web.de>
2019-01-13 16:03:32 +00:00
Karl Semich 3180dba9ff Merge commit '9573e68' from 'osmocom/master' 2018-10-03 20:32:19 +00:00
Lucas Teske 2be1612e60 lib: Use GPIO P0 to toggle an (optional) bias-t
At least one distributor of rtl-sdr dongles (rtl-sdr.com) added
a bias-t to their dongles which could be toggled via GPIO P0 of the
RTL2832U chip.

source: http://www.rtl-sdr.com/rtl-sdr-blog-v-3-dongles-user-guide/

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2017-06-09 15:06:23 +02:00
Lucas Teske 0c27010054
Fixed missing stddef.h in rtl-sdr.h 2016-12-04 14:21:19 -02:00
Lucas Teske 30a3216b2d
Moved include rtl_tcp.h from rtl-sdr.h to rtl_tcp.c (where it should be)
*	So @f4exb was right to include the rtl_tcp.h in CMakeLists install. If anyone is making a C program that communicates with rtl_tcp, it will probably use the enums. (See PR #22 and issue #21)
*	Added rtl_tcp.h to CMakeLists install script and moved rtl_tcp.h include to rtl_tcp.c file
*	Added Eclipse gitignore (for anyone that uses eclipse to compile)
*	Closes Issue #21
2016-11-27 22:22:25 -02:00
hayati ayguen 43c4028b00
direct sampling mode switching depending on center_frequency
added API function rtlsdr_set_ds_mode(dev, enum rtlsdr_ds_mode, freq_threshold)
added CLI option '-D' to rtl_(fm|power|tcp) for mode and threshold frequency

Signed-off-by: hayati ayguen <h_ayguen@web.de>
2016-11-27 22:22:25 -02:00
Lucas Teske 7fe3ba3835
Added Bias T Support from RTL-SDR Blog V3 Dongle 2016-11-27 22:21:46 -02:00
Lucas Teske f0c0e8a9ed
Disabling RPC in Windows builds. It uses POSIX calls and we should port it
in the future.
2016-08-17 10:44:02 -03:00
rxseger a577352932 Merge branch 'development' into ir
Change infrared wait time flag to -W to fix conflict with the
new development-branch -w flag for tuner bandwidth

Conflicts:
	src/rtl_tcp.c
2016-07-03 23:42:53 +00:00
rxseger 61d845e694 rtlsdr_ir_query() returns packed buffer, rtl_ir prints 2016-07-02 23:46:49 -07:00
rxseger ed6c2deb9a rtl_ir: query IR in a loop 2016-07-02 22:13:08 -07:00
rxseger 45abfbeb5b Fix rtl28xxu_wr_reg_mask return code, now <0 is error 2016-07-02 20:15:17 -07:00
Hayati Ayguen 240abf6076 use offset tuning when using bandwidth option
bandwidth filter are around center frequency
without offset tuning rtl_fm automatically uses the frequency -fs/4 for demodulation
  but this lies outside the bandwidth filter!
  switch on offset option to use the center frequency for demodulation

fixed/precised output texts
output available bandwidths in kHz for better readability
2016-03-25 16:58:36 +01:00
Hayati Ayguen af20337c93 added rtlsdr_set_and_get_tuner_bandwidth() to RTLSDR_API
this allows to return the configured/applied bandwidth to the caller
this also allows pre-determining all possible bandwidth values (with apply_bw=0)
  see rtl_fm with verbose flag, when using -w option
API does only work for R820T tuner. other tuner always return 0 (=unknown) bandwidth

Signed-off-by: Lucas Teske <lucas@teske.net.br>
2016-03-20 12:48:21 -03:00
Lucas Teske ba43a14e92 Updates on rtl_tcp
*	Added Bandwidth Parameter (-w) to rtl_tcp to set the device bandwidth through cmd args
*	Added Bandwidth Network Parameter (0x0E) to rtl_tcp to set the device bandwidth through network
*	Added RTL_TCP_COMMANDS enum to better organize the network commands
*	Added binary files to gitignore
2016-03-20 12:48:21 -03:00
Lucas Teske 25d0e8e673 Ported SDR# R820T Manual Gain Settings Plugin
*	Ported Manual Gain Settings for R820T from http://sourceforge.net/projects/sdrr820tmanualgainsettings/
2016-01-31 16:05:12 -02:00
Jiří Pinkava 92df068dc5 New functions rtlsdr_set_tuner_bandwidth()
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2015-05-16 00:38:01 +02:00
Steve Markgraf 89f73b183f lib: change default number of transfers to 15
So far we had 32 * 256KB which was a bit overkill,
15 are more than enough.

15 was chosen instead of 16 because at least on Linux
there seems to be a system-wide limit of 63 transfers
(when they are 256KB large), so 4 dongles can be used
on a single machine without lowering the default transfer
number.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2014-02-10 23:57:19 +01:00
Steve Markgraf 003bd51167 lib: check for validity of sample rates
Thanks to Joris van Rantwijk for finding what seems to be
a hardware limitation/bug (bit 28 of the rsamp register being
forced to the value of bit 27).

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2014-01-05 22:51:44 +01:00
Steve Markgraf e61731d230 add support for R828D tuner
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-11-04 21:51:35 +01:00
Steve Markgraf d3c9015d26 lib: add rtlsdr_get_index_by_serial()
This allows to open a device by a name (serial number string)
that has been programmed with rtl_eeprom -s.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-11-04 13:57:56 +01:00
Steve Markgraf b85ffcfea5 add library support for EEPROM access and tool for modification
rtl_eeprom can be used to modify the USB descriptor
strings etc.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-11-02 21:47:14 +01:00
Steve Markgraf 9b8b0e53f6 add getters for direct sampling and offset tuning mode
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-10-07 17:43:32 +02:00
Steve Markgraf b70c7d99f1 add function for offset tuning with zero-IF tuners
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-10-06 19:43:25 +02:00
Steve Markgraf 01d8d308fc disable second ADC in IF mode, make input selectable in DS-mode
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-09-16 16:24:58 +02:00
Steve Markgraf fc5881d4cd add support for direct sampling mode
This commit adds the function rtlsdr_set_direct_sampling()
which can be used to enable/disable a mode where the
RTL2832 acts as a direct sampling receiver.

This mode disables the tuner, and by attaching a long
wire, or better, a 50Ω to 200Ω transformer and a lowpass-
filter to the In-phase ADC input (pin 1 or 2 of the RTL2832,
whereas pin 1 is at the molded dot) it is possible to listen to
shortwave radio stations. The coupling capacitors can be
left in place, but for better results they should be removed.

Tuning in this mode is done with the DDC, and since the
ADC samples with 28.8 MHz, tuning is possible from 0 to
28.8 MHz.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-09-13 21:53:51 +02:00
Steve Markgraf 5a26bd51e7 add initial support for the R820T tuner
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-09-08 02:37:30 +02:00
Dimitri Stolnikov 88cd4b33cf return RTLSDR_TUNER_UNKNOWN (0) on failure of rtlsdr_get_tuner_type 2012-08-02 19:32:40 +02:00
Dimitri Stolnikov f9b5d7b0a6 apply frequency correction value on the xtal clock directly
by using this approach both, the tuning frequency and the sample rate
should be corrected at the same time.
2012-07-08 15:52:59 +02:00
Steve Markgraf f3cf83e3d7 disable DAGC by default, add control function
This adds rtlsdr_set_agc_mode() to enable/disable it.
Thanks to Leif Asbrink for finding this setting.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-07-07 21:06:38 +02:00
Dimitri Stolnikov 6ea029d92c add api function to control the IF gain for E4000 tuners 2012-07-05 00:28:52 +02:00
Dimitri Stolnikov 7bd3933c41 introduce getters for tuner parameters (gain, type) 2012-06-02 01:36:42 +02:00
Dimitri Stolnikov 505f40d9a0 introduce api function to read usb string descriptors
This API allows to read manufacturer and product names as well as the
serial number advertized by the device on the bus.
2012-05-20 16:41:15 +02:00
Steve Markgraf fdc7bc978b add an initial version of rtl_test
This tool allows to check for lost samples (and thus check the USB
connection), as well as benchmark the Elonics E4000 tunable range.
(-t switch)

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-05-17 23:51:59 +02:00
Dimitri Stolnikov e9251da6e2 reset internally cached gain/freq values on setter failure 2012-05-05 18:30:13 +02:00
Dimitri Stolnikov 259e61fb17 document gain api 2012-05-05 12:33:47 +02:00
Steve Markgraf 86c34428aa use new E4000 tuner driver, allow manual gain
Many thanks to Hoernchen for making the driver work properly
and adding manual gain!

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-05-04 23:02:29 +02:00
Dimitri Stolnikov bad6fb080b introduce api to configure crystal oscillator frequency
Usually both, the RTL and the tuner ICs use the same clock. Changing the
clock may make sense if you are applying an external clock to the tuner
or to compensate the frequency (and samplerate) error caused by the
original cheap crystal.

This commit covers all tuner drivers except of the Fitipower FC2580
2012-04-25 22:32:51 +02:00
Dimitri Stolnikov 5f70efd8d1 return frequency and sample rate as unsigned integers 2012-04-24 20:02:53 +02:00