summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDimitri Stolnikov <horiz0n@gmx.net>2012-06-02 01:11:47 +0200
committerDimitri Stolnikov <horiz0n@gmx.net>2012-06-02 01:36:42 +0200
commit7bd3933c41b251a841915fd13107ec8391530998 (patch)
treef5983410ddd5a969c41efe2bd4bf8e10d3961ed7 /include
parentd5bfa3867f451d2e452cd17053688963fac67979 (diff)
introduce getters for tuner parameters (gain, type)
Diffstat (limited to 'include')
-rw-r--r--include/rtl-sdr.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/rtl-sdr.h b/include/rtl-sdr.h
index 804334d..1b0d82f 100644
--- a/include/rtl-sdr.h
+++ b/include/rtl-sdr.h
@@ -113,6 +113,34 @@ RTLSDR_API int rtlsdr_set_freq_correction(rtlsdr_dev_t *dev, int ppm);
RTLSDR_API int rtlsdr_get_freq_correction(rtlsdr_dev_t *dev);
+enum rtlsdr_tuner {
+ RTLSDR_TUNER_UNKNOWN = 0,
+ RTLSDR_TUNER_E4000,
+ RTLSDR_TUNER_FC0012,
+ RTLSDR_TUNER_FC0013,
+ RTLSDR_TUNER_FC2580
+};
+
+/*!
+ * Get the tuner type.
+ *
+ * \param dev the device handle given by rtlsdr_open()
+ * \return <= 0 on error, tuner type otherwise
+ */
+RTLSDR_API enum rtlsdr_tuner rtlsdr_get_tuner_type(rtlsdr_dev_t *dev);
+
+/*!
+ * Get a list of gains supported by the tuner.
+ *
+ * NOTE: The gains argument must be preallocated by the caller. If NULL is
+ * being given instead, the number of available gain values will be returned.
+ *
+ * \param dev the device handle given by rtlsdr_open()
+ * \param gains array of gain values. In tenths of a dB, 115 means 11.5 dB.
+ * \return <= 0 on error, number of available (returned) gain values otherwise
+ */
+RTLSDR_API int rtlsdr_get_tuner_gains(rtlsdr_dev_t *dev, int *gains);
+
/*!
* Set the gain for the device.
* Manual gain mode must be enabled for this to work.
@@ -121,6 +149,8 @@ RTLSDR_API int rtlsdr_get_freq_correction(rtlsdr_dev_t *dev);
* -10, 15, 40, 65, 90, 115, 140, 165, 190,
* 215, 240, 290, 340, 420, 430, 450, 470, 490
*
+ * Valid gain values may be queried with \ref rtlsdr_get_tuner_gains function.
+ *
* \param dev the device handle given by rtlsdr_open()
* \param gain in tenths of a dB, 115 means 11.5 dB.
* \return 0 on success