aboutsummaryrefslogtreecommitdiffstats
path: root/src/tuner_fc0013.c
diff options
context:
space:
mode:
authorDimitri Stolnikov <horiz0n@gmx.net>2012-04-25 22:32:51 +0200
committerDimitri Stolnikov <horiz0n@gmx.net>2012-04-25 22:32:51 +0200
commitbad6fb080b774c680f6d1eda4e1a00dad5a8cd20 (patch)
tree66e4b25f5b3a2f374fbf81a51e4043dcb1d87926 /src/tuner_fc0013.c
parent8a1d6d69bdba90195468eb9c666e72e3eed3fe27 (diff)
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
Diffstat (limited to 'src/tuner_fc0013.c')
-rw-r--r--src/tuner_fc0013.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tuner_fc0013.c b/src/tuner_fc0013.c
index 22c8066..5251d61 100644
--- a/src/tuner_fc0013.c
+++ b/src/tuner_fc0013.c
@@ -21,7 +21,7 @@ int FC0013_Write(void *pTuner, unsigned char RegAddr, unsigned char Byte)
data[0] = RegAddr;
data[1] = Byte;
- if (rtlsdr_i2c_write((rtlsdr_dev_t *)pTuner, FC0013_I2C_ADDR, data, 2) < 0)
+ if (rtlsdr_i2c_write_fn(pTuner, FC0013_I2C_ADDR, data, 2) < 0)
return FC0013_I2C_ERROR;
return FC0013_I2C_SUCCESS;
@@ -31,10 +31,10 @@ int FC0013_Read(void *pTuner, unsigned char RegAddr, unsigned char *pByte)
{
uint8_t data = RegAddr;
- if (rtlsdr_i2c_write((rtlsdr_dev_t *)pTuner, FC0013_I2C_ADDR, &data, 1) < 0)
+ if (rtlsdr_i2c_write_fn(pTuner, FC0013_I2C_ADDR, &data, 1) < 0)
return FC0013_I2C_ERROR;
- if (rtlsdr_i2c_read((rtlsdr_dev_t *)pTuner, FC0013_I2C_ADDR, &data, 1) < 0)
+ if (rtlsdr_i2c_read_fn(pTuner, FC0013_I2C_ADDR, &data, 1) < 0)
return FC0013_I2C_ERROR;
*pByte = data;
@@ -189,7 +189,7 @@ int FC0013_SetFrequency(void *pTuner, unsigned long Frequency, unsigned short Ba
unsigned long CrystalFreqKhz;
- int CrystalFreqHz = CRYSTAL_FREQ;
+ int CrystalFreqHz = rtlsdr_get_tuner_clock(pTuner);
// Get tuner crystal frequency in KHz.
// Note: CrystalFreqKhz = round(CrystalFreqHz / 1000)