diff options
Diffstat (limited to 'src/devices/r820t.rs')
| -rw-r--r-- | src/devices/r820t.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/devices/r820t.rs b/src/devices/r820t.rs index fec572c..46046bc 100644 --- a/src/devices/r820t.rs +++ b/src/devices/r820t.rs @@ -1,4 +1,7 @@ use super::{DeviceInfo, Device}; +use usb::Usb; + +const R82XX_IF_FREQ: u32 = 3570000; pub struct R820T { pub device: DeviceInfo @@ -21,7 +24,18 @@ impl R820T { } impl Device for R820T { - fn init(&self) { - println!("Init {}", self.device.name); + fn init(&self, usb: &Usb) { + // disable Zero-IF mode + usb.demod_write_reg(1, 0xb1, 0x1a, 1); + + // only enable In-phase ADC input + usb.demod_write_reg(0, 0x08, 0x4d, 1); + + // the R82XX use 3.57 MHz IF for the DVB-T 6 MHz mode, and + // 4.57 MHz for the 8 MHz mode + usb.set_if_freq(R82XX_IF_FREQ); + + // enable spectrum inversion + usb.demod_write_reg(1, 0x15, 0x01, 1); } } |
