Commit Graph

59 Commits

Author SHA1 Message Date
Adrian Chadd
5d0735f5df 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.
2019-11-12 20:32:35 +01: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
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
Jiří Pinkava
d892279085 Allow setting bandwidth for R820T
This improves SDR performence for nearby channel interference.
As a sideeffect also improves dynamic range becase ADC is not overloaded
by onwanted singlas.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2015-05-16 00:37:17 +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
ae6a72c586 build: make build with automake work again
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-11-04 22:15:44 +01:00
Steve Markgraf
015c78a4ca remove e4k-specific I2C functions from library
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-11-04 21:53:41 +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
230930e975 use new driver for R8XX tuners
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-11-04 21:50:02 +01:00
Steve Markgraf
84f0a9084b lib: enable standby mode of e4k and r820t on exit
Since the R820T is a power hog and gets quite hot,
this makes sense, especially when being battery-
powered.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-01-16 01:43:45 +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
25789493c6 tuner_r820t: add manual RF gain setting
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-10-19 01:17:28 +02: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
d64c969bd6 tuner_r820t: improve tuning accuracy, allow freq correction
We now use Hz instead of KHz for calculating the PLL
parameters, and use the actual crystal frequency in Hz,
which allows to correct the frequency error in ppm.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-10-07 02:32:14 +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
143b103061 tuner_fc0013: fix and improve manual LNA gain
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-09-20 00:47:11 +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
9f3f44e03b autotools: add missing header
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-09-08 21:42:58 +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
Steve Markgraf
4e2a0ea0c4 tuner_e4k: update license in header
Changing the license of the header as well,
which had been forgotten in commit
6aec27c6d0
- "tuner_e4k: relicense driver under GPLv2+"

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-07-30 23:29:41 +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
Steve Markgraf
4031d6ed04 tuner_fc0012: use new cleaned-up driver
The driver was taken from http://git.linuxtv.org/ and adapted
for librtlsdr. Manual gain will be added in a follow-up commit.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-05-29 03:31:49 +02:00
Steve Markgraf
75548c8bf3 tuner_fc0013: improve tuning resolution
We now use Hz instead of kHz for the internal
calculations, and thus improve the tuning resolution
to ~50 Hz (tested with DAB).

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-05-27 15:33:11 +02:00
Steve Markgraf
6d34b04b42 tuner_fc0013: use new cleaned-up driver
The driver was taken from http://git.linuxtv.org/ and adapted
for librtlsdr. Also, fc0013_set_gain() was added.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-05-25 17:25:13 +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
Steve Markgraf
2ed8375f39 tuner_e4k: allow frequencies above INT_MAX
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-05-10 21:07:25 +02:00
Dimitri Stolnikov
9167a01248 consolidate program arguments 2012-05-06 00:34:13 +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
Dimitri Stolnikov
e4fef23874 rtlsdr_read_async: buffer length must be multiple of 512 2012-04-22 21:47:00 +02:00
Dimitri Stolnikov
1eb1c3e191 new api: rtlsdr_read_async function allows to specify buffer size
this commit deprecates rtlsdr_wait_async function
various small fixes are included in this commit
2012-04-08 23:02:42 +02:00
Steve Markgraf
cdd6c488a3 rtlsdr_callback: use correct pointer type for buffer
Silences a clang warning.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-04-04 17:46:19 +02:00
Dimitri Stolnikov
f13cf0e56c adjust project slogan
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-04-03 20:18:20 +02:00
Dimitri Stolnikov
b38414c15a add copyright notices
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-04-03 20:18:08 +02:00
Dimitri Stolnikov
01775f0e85 use unique libusb context per rtl
device

this commit breaks rtlsdr_open()
interface
2012-04-03 00:50:47 +02:00
Dimitri Stolnikov
39482fee74 introduce asynchronous streaming interface
this is an experimental feature
2012-04-02 23:09:14 +02:00
Dimitri Stolnikov
030c787cfa cmake & autotools fixes from previous commit 2012-04-02 21:42:24 +02:00
Hoernchen
229ebd2ff2 add win32 compatibility
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-04-02 21:00:26 +02:00
Dimitri Stolnikov
4c3a5f7397 consolidated function defs and impls 2012-04-01 22:44:07 +02:00