示例#1
0
// Set crystal oscillator frequencies used for the RTL2832 and the tuner IC.
//
// Usually both 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.
//
// NOTE: Call this function only if you fully understand the implications.
// Values are in Hz.
//
// int rtlsdr_set_xtal_freq(rtlsdr_dev_t *dev, uint32_t rtl_freq, uint32_t tuner_freq);
// rtlsdr_set_xtal_freq returns 0 on success
func (c *Context) SetXtalFreq(rtl_freq, tuner_freq int) (err int) {
	return int(C.rtlsdr_set_xtal_freq((*C.rtlsdr_dev_t)(c.dev),
		C.uint32_t(rtl_freq),
		C.uint32_t(tuner_freq)))
}
示例#2
0
文件: rtlsdr.go 项目: cyoung/gortlsdr
// SetXtalFreq sets the crystal oscillator frequencies.
//
// Typically both 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 sample rate) error caused by the original (cheap) crystal.
//
// Note, call this function only if you fully understand the implications.
func (dev *Context) SetXtalFreq(rtlFreqHz, tunerFreqHz int) (err error) {
	i := int(C.rtlsdr_set_xtal_freq((*C.rtlsdr_dev_t)(dev),
		C.uint32_t(rtlFreqHz),
		C.uint32_t(tunerFreqHz)))
	return libError(i)
}