Exemple #1
0
// Get crystal oscillator frequencies used for the RTL2832 and the tuner IC.
//
// Usually both ICs use the same clock.
// Frequency values are in Hz.
//
// int rtlsdr_get_xtal_freq(rtlsdr_dev_t *dev, uint32_t *rtl_freq, uint32_t *tuner_freq);
// rtlsdr_get_xtal_freq returns 0 on success
func (c *Context) GetXtalFreq() (rtl_freq, tuner_freq, err int) {
	err = int(C.rtlsdr_get_xtal_freq((*C.rtlsdr_dev_t)(c.dev),
		(*C.uint32_t)(unsafe.Pointer(&rtl_freq)),
		(*C.uint32_t)(unsafe.Pointer(&tuner_freq))))
	return
}
Exemple #2
0
// GetXtalFreq returns the crystal oscillator frequencies.
// Typically both ICs use the same clock.
func (dev *Context) GetXtalFreq() (rtlFreqHz, tunerFreqHz int, err error) {
	i := int(C.rtlsdr_get_xtal_freq((*C.rtlsdr_dev_t)(dev),
		(*C.uint32_t)(unsafe.Pointer(&rtlFreqHz)),
		(*C.uint32_t)(unsafe.Pointer(&tunerFreqHz))))
	return rtlFreqHz, tunerFreqHz, libError(i)
}