PU2CLR QN8066 Arduino Library 1.3.0
Arduino Library for QN8066Devices - By Ricardo Lima Caratti
Loading...
Searching...
No Matches
Basic Functions

Functions

uint8_t QN8066::getRegister (uint8_t registerNumber)
 Gets register information.
 
void QN8066::setRegister (uint8_t registerNumber, uint8_t value)
 Stores a velue to a given register.
 
qn8066_status1 QN8066::getStatus1 ()
 Gets the current device Status stored in STATUS1 register.
 
qn8066_status2 QN8066::getStatus2 ()
 Gets the current device Status stored in STATUS2 register.
 
qn8066_status3 QN8066::getStatus3 ()
 Gets the current device Status stored in STATUS3 register.
 
void QN8066::begin ()
 Device initial configuration.
 
void QN8066::setTxMode (uint8_t value)
 Set transmission request.
 
void QN8066::stopTransmitting ()
 Stops transmitting.
 
void QN8066::startTransmitting ()
 Starts transmitting.
 
void QN8066::setup (uint16_t xtalDiv=1000, bool mono=false, bool rds=false, uint8_t PreEmphasis=0, uint8_t xtalInj=0, uint8_t imageRejection=1, uint8_t txSoftClipThreshold=0, uint8_t oneMinutOff=3, uint8_t gainTxPLT=9, uint8_t txFreqDev=125, uint8_t rdsLineIn=0, uint8_t rdsFreqDev=60, uint8_t inImpedance=1, uint8_t txAgcDig=0, uint8_t txAgcBuffer=1, uint8_t txSoftClip=0)
 QN8066 initial configuration.
 
void QN8066::setXtal (uint16_t divider, uint8_t xtalInj, uint8_t imageRejection)
 QN8066 initial configuration of the of reference clock source.
 

Detailed Description

Function Documentation

◆ getRegister()

uint8_t QN8066::getRegister ( uint8_t  registerNumber)

Gets register information.

8066 commands. It provides a means to run commands that are not currently supported by the standard API.

Parameters
registerNumber
Returns
uint8_t Value of the register

◆ setRegister()

void QN8066::setRegister ( uint8_t  registerNumber,
uint8_t  value 
)

Stores a velue to a given register.

8066 commands. It provides a means to run commands that are not currently supported by the standard API.

Parameters
registerNumber
value

◆ getStatus1()

qn8066_status1 QN8066::getStatus1 ( )

Gets the current device Status stored in STATUS1 register.

Returns
qn8066_status1
See also
QUINTIC Datasheet - Rev 0.2, Page 24.

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
Serial.begin(9600);
tx.setup();
Serial.print("\nStarting the system...");
tx.setTX(1069); // Sets the transmitter to 106.9 MHz
tx.setTxStereo(true);
Serial.println(s1.arg.FSM); // Shows FSM state code - QUINTIC Datasheet - Rev 0.2, Page 24.
}
void loop() {
delay(5);
}
QN8066 Class.
Definition: QN8066.h:846
struct qn8066_status1::@6 arg
STATUS1 - System status ( Address: 0Ah - Read Only)
Definition: QN8066.h:283
qn8066_status1 getStatus1()
Gets the current device Status stored in STATUS1 register.
Definition: QN8066.cpp:122
void setup(uint16_t xtalDiv=1000, bool mono=false, bool rds=false, uint8_t PreEmphasis=0, uint8_t xtalInj=0, uint8_t imageRejection=1, uint8_t txSoftClipThreshold=0, uint8_t oneMinutOff=3, uint8_t gainTxPLT=9, uint8_t txFreqDev=125, uint8_t rdsLineIn=0, uint8_t rdsFreqDev=60, uint8_t inImpedance=1, uint8_t txAgcDig=0, uint8_t txAgcBuffer=1, uint8_t txSoftClip=0)
QN8066 initial configuration.
Definition: QN8066.cpp:291
void setTxStereo(bool value=true)
Set TX Stereo or Mono.
Definition: QN8066.cpp:754
void setTX(uint16_t frequency)
Sets the TX mode.
Definition: QN8066.cpp:659

◆ getStatus2()

qn8066_status2 QN8066::getStatus2 ( )

Gets the current device Status stored in STATUS2 register.

Returns
qn8066_status2
See also
QUINTIC Datasheet - Rev 0.2, Page 28.

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
Serial.begin(9600);
tx.setup();
Serial.print("\nStarting the system...");
tx.setTX(1069); // Sets the transmitter to 106.9 MHz
tx.setTxStereo(true);
Serial.println(s2.arg.RDSSYNC); // Shows RDS block synchronous indicator.
}
void loop() {
delay(5);
}
struct qn8066_status2::@9 arg
STATUS2 - Receiver RDS status indicators (Address: 17h - Read Only)
Definition: QN8066.h:403
qn8066_status2 getStatus2()
Gets the current device Status stored in STATUS2 register.
Definition: QN8066.cpp:151

◆ getStatus3()

qn8066_status3 QN8066::getStatus3 ( )

Gets the current device Status stored in STATUS3 register.

Returns
qn8066_status3
See also
QUINTIC Datasheet - Rev 0.2, Page 30.

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
Serial.begin(9600);
tx.setup();
Serial.print("\nStarting the system...");
tx.setTX(1069); // Sets the transmitter to 106.9 MHz
tx.setTxStereo(true);
...
Serial.println(s3.arg.RDS_TXUPD); // Checks RDS TX update
}
void loop() {
delay(5);
}
struct qn8066_status3::@12 arg
STATUS3 - Receiver audio peak level and AGC status (Address: 1Ah - Read Only)
Definition: QN8066.h:482

Referenced by QN8066::getAudioPeakValue(), and QN8066::rdsGetTxUpdated().

◆ begin()

void QN8066::begin ( )

Device initial configuration.

The functions described in this group are used to configure the QN8066.

Starts the QN8066 instance.

It is a minimalist code to initiate the QN8066 device. Use the function setup if you want more option during the start process.

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
// Call setup setting Divider = 1000, Stereo, RDS on and PreEmphasis (tc) 75us
tx.begin();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
}
void loop() {
}
void begin()
Device initial configuration.
Definition: QN8066.cpp:212

◆ setTxMode()

void QN8066::setTxMode ( uint8_t  value)
inline

Set transmission request.

This function enable or disable transmission

Parameters
value- 0 = disable; 1 = enable

◆ stopTransmitting()

void QN8066::stopTransmitting ( )

Stops transmitting.

◆ startTransmitting()

void QN8066::startTransmitting ( )

Starts transmitting.

◆ setup()

void QN8066::setup ( uint16_t  xtalDiv = 1000,
bool  mono = false,
bool  rds = false,
uint8_t  PreEmphasis = 0,
uint8_t  xtalInj = 0,
uint8_t  imageRejection = 1,
uint8_t  txSoftClipThreshold = 0,
uint8_t  oneMinutOff = 3,
uint8_t  gainTxPLT = 9,
uint8_t  txFreqDev = 125,
uint8_t  rdsLineIn = 0,
uint8_t  rdsFreqDev = 60,
uint8_t  inImpedance = 1,
uint8_t  txAgcDig = 0,
uint8_t  txAgcBuffer = 1,
uint8_t  txSoftClip = 0 
)

QN8066 initial configuration.

This function can be called without arguments (parameters). In this case, the default value will be assumed. See the following list of parameters.

Parameters
xtalDiv- Divider based on frequency select of reference clock source. Default 1000 (see Datasheet pag. 18 and 23).
mono- If false, the TX will start stereo mode. Default false.
rds- if true, TX will start with RDS on. Default false.
PreEmphasis- Valid values: 0 or 1 (0=50us; 1=75us). Default 0.
xtalInj- type of the reference clock source (0 = Inject sine-wave clock; 1 = Inject digital clock).
imageRejection- Image Rejection (0=LO<RF, image is in lower side; 1=LO>RF, image is in upper side).
txSoftClipThreshold- TX soft clip threshold. Default 0. See Datasheet page 34.
oneMinutOff- Selection of 1 minute time for PA off when no audio (3 = Infinity (never); 2=59s; 1=58s; 0=57s).
gainTxPLT- Gain of TX pilot to adjust pilot frequency deviation. See Datasheet page 34.
txFreqDev- Specify total TX frequency deviation. TX frequency deviation = 0.69KHz*TX_FEDV. Default 125.
rdsLineIn- Audio Line-in enable control. Default 0
rdsFreqDev- RDS frequency deviation. RDS frequency deviation = 0.35KHz*RDSFDEV in normal mode. Default 60
inImpedance- TX mode input impedance for both L/R channels (Default 1 => 20K )
txAgcDig- TX digital gain (Default 0)
txAgcBuffer- TX input buffer gain (Default 1)
txSoftClip- TX soft clipping enable (Default 0 - Disable)

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
// Call setup setting Divider = 1000, Stereo, RDS on and PreEmphasis (tc) 75us
tx.setup(1000, false, true, 1);
tx.setTX(1069); // Set the transmitter to 106.9 MHz
}
void loop() {
}

◆ setXtal()

void QN8066::setXtal ( uint16_t  divider,
uint8_t  xtalInj,
uint8_t  imageRejection 
)

QN8066 initial configuration of the of reference clock source.

Reference clock source based on the active crystal or signal generator you are using.

The table below shows some tested sources (active crystal or signal generator) and divider values

Source (kHz) Divider
32.768 1
< 1,310.720 did not work
1,310.720 40
1,638.400 50
3,276.800 100
13,107.200 400
16,384.000 500
32,768,000 1000
Parameters
xtalDiv- Divider based on frequency select of reference clock source. Default 1000 (see Datasheet pag. 18 and 23).
xtalInj- type of the reference clock source (0 = Inject sine-wave clock; 1 = Inject digital clock).
imageRejection- Image Rejection (0=LO<RF, image is in lower side; 1=LO>RF, image is in upper side).

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.begin();
tx.setXtal(1,1,1);
tx.setTX(1069); // Set the transmitter to 106.9 MHz
}
void loop() {
}
void setXtal(uint16_t divider, uint8_t xtalInj, uint8_t imageRejection)
QN8066 initial configuration of the of reference clock source.
Definition: QN8066.cpp:726