Skip to content

Commit 95e0519

Browse files
committed
Doc
1 parent 41a48be commit 95e0519

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <QN8066.h>
2+
3+
QN8066 rx;
4+
5+
void setup() {
6+
Serial.begin(9600);
7+
rx.begin();
8+
Serial.println("\nTuning at 107.9Mhz");
9+
rx.setRX(1079); // Tuning at 107.9MHz
10+
delay(10000);
11+
Serial.println("\nTuning at 93.9Mhz");
12+
rx.setRxFrequency(939); // 93.9 MHz
13+
14+
}
15+
16+
void loop() {
17+
delay(5);
18+
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=QN8066
2-
version=1.2.9
2+
version=1.3.0
33
author=Ricardo Lima Caratti, pu2clr@gmail.com
44
maintainer=Ricardo Lima Caratti
55
sentence=Control your TX/RX QN8066 device

src/QN8066.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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
*/
383387
void 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

Comments
 (0)