@@ -360,9 +360,13 @@ void QN8066::setRX(uint16_t frequency) {
360360 this ->setRegister (QN_GPLT, this ->gplt .raw ); // GPLT => 00111001 => Tx_sftclpth = 00 (12’d2051 - 3db back off from 0.5v); t1m_sel = 11 (Infinity); GAIN_TXPLT = 1001 (9% 75 kHz)
361361
362362 int16_t auxFreq = (frequency - 600 ) * 2 ;
363- this ->int_ctrl .raw = 0B00100000 | auxFreq >> 8 ;
364- this ->setRegister (QN_INT_CTRL,this ->int_ctrl .raw );
365- this ->setRegister (QN_TXCH, 0B11111111 & auxFreq);
363+ qn8066_rx_ch rxch;
364+ qn8066_ch_step ch_step;
365+ ch_step.raw = this ->getRegister (QN_CH_STEP);
366+ ch_step.arg .RXCH = 0B0000000000000011 & (auxFreq >> 8 );
367+ rxch.RXCH = 0B0000000011111111 & auxFreq;
368+ this ->setRegister (QN_CH_STEP, ch_step.raw );
369+ this ->setRegister (QN_RX_CH,rxch.RXCH );
366370
367371 // Checking unkown registers
368372 // this->setRegister(0x49, 0B11101000);
@@ -382,9 +386,14 @@ void QN8066::setRX(uint16_t frequency) {
382386 */
383387void QN8066::setRxFrequency (uint16_t frequency) {
384388 int16_t auxFreq = (frequency - 600 ) * 2 ;
385- this ->int_ctrl .raw = 0B00100000 | auxFreq >> 8 ;
386- this ->setRegister (QN_INT_CTRL,this ->int_ctrl .raw );
387- this ->setRegister (QN_TXCH, 0B11111111 & auxFreq);
389+ qn8066_rx_ch rxch;
390+ qn8066_ch_step ch_step;
391+ ch_step.raw = this ->getRegister (QN_CH_STEP);
392+ ch_step.arg .RXCH = 0B0000000000000011 & (auxFreq >> 8 );
393+ rxch.RXCH = 0B0000000011111111 & auxFreq;
394+ this ->setRegister (QN_CH_STEP, ch_step.raw );
395+ this ->setRegister (QN_RX_CH,rxch.RXCH );
396+
388397}
389398
390399
0 commit comments