PU2CLR QN8066 Arduino Library 1.3.0
Arduino Library for QN8066Devices - By Ricardo Lima Caratti
Loading...
Searching...
No Matches
Helper and Tools functions

Functions

void QN8066::setI2CLowSpeedMode (void)
 Sets I2C bus to 10kHz.
 
void QN8066::setI2CStandardMode (void)
 Sets I2C bus to 100kHz.
 
void QN8066::setI2CFastMode (void)
 Sets I2C bus to 400kHz.
 
void QN8066::setI2CFastModeCustom (long value=500000)
 Sets the I2C bus to a given value. ATTENTION: use this function with caution.
 
void QN8066::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 * QN8066::formatCurrentFrequency (char decimalSeparator=',')
 Convert the current frequency to a formated string (char *) frequency.
 

Detailed Description

Function Documentation

◆ setI2CLowSpeedMode()

void QN8066::setI2CLowSpeedMode ( void  )
inline

Sets I2C bus to 10kHz.

The functions below modify the clock frequency for I2C communication. 100kHz is usually the baseline. Use one of these funcition if you have a problem on the default configuration.

◆ setI2CStandardMode()

void QN8066::setI2CStandardMode ( void  )
inline

Sets I2C bus to 100kHz.

◆ setI2CFastMode()

void QN8066::setI2CFastMode ( void  )
inline

Sets I2C bus to 400kHz.

◆ setI2CFastModeCustom()

void QN8066::setI2CFastModeCustom ( long  value = 500000)
inline

Sets the I2C bus to a given value. ATTENTION: use this function with caution.

Parameters
valuein Hz. For example: The values 500000 sets the bus to 500kHz.

◆ convertToChar()

void QN8066::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.

It is useful to mitigate memory space used by functions like sprintf or other generic similar functions

You can use it to format frequency using decimal or thousand separator and also to convert small numbers.

Parameters
valuevalue to be converted
strValuechar array that will be receive the converted value
lenfinal string size (in bytes)
dotthe decimal or thousand separator position
separatorsymbol "." or ","
remove_leading_zerosif true removes up to two leading zeros (default is true)
#include <QN8066.h>
QN8066 tx;
char strFrequency[7];
uint16_t txFrequency = 1069;
void setup() {
char strFrequency[7];
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.convertToChar(txFrequency, strFrequency, 5, 3, ','); // Convert 1069 to a array of char "106.9"
}
void loop() {
}
QN8066 Class.
Definition: QN8066.h:846
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 setTX(uint16_t frequency)
Sets the TX mode.
Definition: QN8066.cpp:659
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.
Definition: QN8066.cpp:2065

◆ formatCurrentFrequency()

char * QN8066::formatCurrentFrequency ( char  decimalSeparator = ',')

Convert the current frequency to a formated string (char *) frequency.

The current frequency is the latest setted frequency by setFrequency, seek, setFrequencyUp and setFrequencyDown.

Parameters
chardecimalSeparator - the symbol that separates the decimal part (Exe: . or ,)
Returns
point char string strFrequency (member variable)
See also
setFrequency, seek, setFrequencyUp and setFrequencyDown