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

QN8066 Class. More...

#include <QN8066.h>

Public Member Functions

bool detectDevice ()
 Checks communication with QN8066 via I2C.
 
uint8_t scanI2CBus (uint8_t *device)
 Scans the I2C bus and returns the addresses of the devices found.
 
uint8_t getRegister (uint8_t registerNumber)
 Gets register information.
 
void setRegister (uint8_t registerNumber, uint8_t value)
 Stores a velue to a given register.
 
qn8066_cid1 getDeviceProductID ()
 
qn8066_cid2 getDeviceProductFamily ()
 
qn8066_status1 getStatus1 ()
 Gets the current device Status stored in STATUS1 register.
 
qn8066_status2 getStatus2 ()
 Gets the current device Status stored in STATUS2 register.
 
qn8066_status3 getStatus3 ()
 Gets the current device Status stored in STATUS3 register.
 
void setRX (uint16_t frequency)
 SYSTEM1 SETUP.
 
void setRxFrequency (uint16_t frequency)
 sets the receiver frequency
 
void setRxFrequencyUp ()
 Increments the current receiver frequency.
 
void setRxFrequencyDown ()
 Decrements the current receiver frequency.
 
void setRxFrequencyStep (uint8_t value)
 Sets the current Step frequency.
 
uint16_t getRxCurrentFrequency ()
 
void rdsEnableRX (bool value)
 Enables RDS for RX.
 
void setAudioMuteRX (bool value)
 Mute or unmute the audio in receiver mode.
 
uint8_t getRxSNR ()
 Gets the current SNR (Estimated RF input)
 
uint8_t getRxRSSI ()
 Gets the current RSSI.
 
void setRxFrequencyRange (uint16_t min=640, uint16_t max=1080)
 Sets the frequency range of the receiver.
 
bool isValidRxChannel ()
 Gets a valid or no valid rx channel.
 
bool isRxReceiving ()
 Receiver status.
 
bool isRxAgcStable ()
 RX AGC Status.
 
bool isRxStereo ()
 Stereo receiving status.
 
void scanRxStation (uint16_t startFrequency, uint16_t stopFrequyency, uint8_t frequencyStep)
 Scans a station.
 
void rdsRxEnable (bool value)
 
char * rdsRxGetPS (char *ps)
 
char * rdsRxGetRT (char *rt)
 
char * rdsRxGetTime (char *time)
 
void setTX (uint16_t frequency)
 Sets the TX mode.
 
void setTxStereo (bool value=true)
 Set TX Stereo or Mono.
 
void setTxMono (uint8_t value=0)
 Set TX Stereo or Mono (Same setTxStereo )
 
uint8_t getTxMono ()
 Gets TX Stereo or Mono setup.
 
void setTxPreEmphasis (uint8_t value=75)
 Pre-emphasis and de-emphasis time constant.
 
void setPreEmphasis (uint8_t value=1)
 Pre-emphasis and de-emphasis time constant - Same setTxPreEmphasis.
 
void setTxOffAfterOneMinuteNoAudio (bool value)
 Set of 1 minute time for PA off when no audio.
 
void setTxOffAfterOneMinute (uint8_t value)
 Sets PA Off after 1 minute time when no audio.
 
void setTxPilotGain (uint8_t value)
 Gain of TX pilot to adjust pilot frequency deviation.
 
void setAudioAnalogGain (uint8_t value)
 Sets volume control gain of analog portion.
 
void setAudioDigitalGain (uint8_t value)
 Sets set digital volume gain.
 
void setAudioDacHold (bool value)
 DAC output control.
 
void setAudioTxDiff (bool value)
 Tx audio input mode selection.
 
void setTxInputImpedance (uint8_t value)
 TX mode input impedance for both L/R channels.
 
void setTxDigitalGain (uint8_t value)
 TX digital gain.
 
void setTxInputBufferGain (uint8_t value)
 TX input buffer gain.
 
void setTxSoftClippingEnable (bool value)
 TX soft clipping enable.
 
void setTxSoftClipThreshold (uint8_t value)
 TX soft clip threshold.
 
void setTxFrequencyDerivation (uint8_t value)
 Specify total TX frequency deviation.
 
void setResetDelay (uint16_t delayAfterReset)
 
void begin ()
 Device initial configuration.
 
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.
 
void updateTxSetup ()
 Reset the system kepping the TX current STATUS.
 
void setTxMode (uint8_t value)
 Set transmission request.
 
void stopTransmitting ()
 Stops transmitting.
 
void startTransmitting ()
 Starts transmitting.
 
void setXtal (uint16_t divider, uint8_t xtalInj, uint8_t imageRejection)
 QN8066 initial configuration of the of reference clock source.
 
void setPAC (uint8_t PA_TRGT)
 PA output power target control.
 
void setToggleTxPdClear ()
 TX Audio peak clear signal.
 
void resetAudioPeak ()
 TX Audio peak clear signal.
 
int getAudioPeakValue ()
 Audio peak value at ADC input.
 
void setStnby (bool value)
 Request Immediately enter Standby mode whatever state chip is in.
 
void rdsSetMode (uint8_t mode)
 Sets RDS Mode Selection.
 
void rdsSet4KMode (uint8_t value)
 Sets RDS 4K Mode .
 
void rdsInitTx (uint8_t countryId=0, uint8_t programId=0, uint8_t reference=0, uint8_t pty=1, uint8_t rdsSyncTime=60, uint8_t rdsRepeatGroup=5)
 Sets some RDS parameters.
 
void rdsSetInterrupt (uint8_t value)
 Sets RDS interrupt.
 
void rdsTxEnable (bool value)
 Transmitter RDS enable.
 
uint8_t rdsSetTxToggle ()
 RDS transmitting ready.
 
bool rdsGetTxUpdated ()
 RDS TX Updated.
 
void rdsSetFrequencyDerivation (uint8_t freq=6)
 Sets RDS frequency deviation.
 
void rdsSetTxLineIn (bool value=0)
 Audio Line-in enable control.
 
void rdsSendGroup (RDS_BLOCK1 blockA, RDS_BLOCK2 blockB, RDS_BLOCK3 blockC, RDS_BLOCK4 blockD)
 Sends a RDS group (four blocks) to the QN8066.
 
void rdsSendPS (char *ps=NULL)
 Sends the Program Service Message.
 
void rdsSetStationName (char *stationName)
 Sets the station name.
 
void rdsSendRTMessage (char *rt)
 Sends RDS Radio Text Message (group 2A)
 
void rdsSendRT (char *rt)
 Sends RDS Radio Text Message (group 2A)
 
int32_t calculateMJD (uint16_t year, uint8_t month, uint8_t day)
 Calculates the Modified Julian Date.
 
void rdsSendDateTime (uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, int8_t offset)
 Sends the RDS Date Time information.
 
void rdsSetPI (uint16_t pi)
 Sets the Program Identification (PI)
 
void rdsSetPI (uint8_t countryId, uint8_t programId, uint8_t reference=0)
 Sets the Program Identification (PI)
 
uint8_t rdsGetPI ()
 Gets the Program Identification (PI)
 
void rdsSetPTY (uint16_t pty)
 Sets the Program Type (PTY)
 
uint8_t rdsGetPTY ()
 Gets the Program Type (PTY)
 
void rdsSetTP (uint16_t tp)
 Sets the Traffic Program.
 
uint8_t rdsGetTP ()
 Sets the Traffic Program.
 
char * rdsGetPS ()
 Gets the Program Station (Station Name).
 
uint8_t rdsGetError ()
 Gets TX RDS error setup.
 
void rdsClearBuffer ()
 Clear RDS register (Buffer)
 
void rdsSetSyncTime (uint8_t syncTime)
 Sets the wait time for the QN8066 to be available to send the next RDS block.
 
void rdsSetRepeatSendGroup (uint8_t count)
 Sets the number of time that a group will be sent at once.
 
void resetFsm ()
 Resets the state to initial states and recalibrate all blocks.
 
uint8_t getFsmStateCode ()
 Get the FSM State Code.
 
void convertToChar (uint16_t value, char *strValue, uint8_t len, uint8_t dot, uint8_t separator='.', bool remove_leading_zeros=true)
 Converts a number to a char array.
 
char * formatCurrentFrequency (char decimalSeparator=',')
 Convert the current frequency to a formated string (char *) frequency.
 
void setI2CLowSpeedMode (void)
 Sets I2C bus to 10kHz.
 
void setI2CStandardMode (void)
 Sets I2C bus to 100kHz.
 
void setI2CFastMode (void)
 Sets I2C bus to 400kHz.
 
void setI2CFastModeCustom (long value=500000)
 Sets the I2C bus to a given value. ATTENTION: use this function with caution.
 

Detailed Description

QN8066 Class.

This class implements all functions that will help you to control the QN8066 devices.

Author
PU2CLR - Ricardo Lima Caratti

Member Function Documentation

◆ getDeviceProductID()

qn8066_cid1 QN8066::getDeviceProductID ( )
inline

◆ getDeviceProductFamily()

qn8066_cid2 QN8066::getDeviceProductFamily ( )
inline

◆ getRxCurrentFrequency()

uint16_t QN8066::getRxCurrentFrequency ( )
inline

◆ rdsRxEnable()

void QN8066::rdsRxEnable ( bool  value)

◆ rdsRxGetPS()

char * QN8066::rdsRxGetPS ( char *  ps)

◆ rdsRxGetRT()

char * QN8066::rdsRxGetRT ( char *  rt)

◆ rdsRxGetTime()

char * QN8066::rdsRxGetTime ( char *  time)

◆ setResetDelay()

void QN8066::setResetDelay ( uint16_t  delayAfterReset)
inline

The documentation for this class was generated from the following files: