PU2CLR QN8066 Arduino Library 1.3.0
Arduino Library for QN8066Devices - By Ricardo Lima Caratti
|
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. | |
|
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.
|
inline |
Sets I2C bus to 100kHz.
|
inline |
Sets I2C bus to 400kHz.
|
inline |
Sets the I2C bus to a given value. ATTENTION: use this function with caution.
value | in Hz. For example: The values 500000 sets the bus to 500kHz. |
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.
value | value to be converted |
strValue | char array that will be receive the converted value |
len | final string size (in bytes) |
dot | the decimal or thousand separator position |
separator | symbol "." or "," |
remove_leading_zeros | if 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
}
void loop() {
}
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 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 |
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.
char | decimalSeparator - the symbol that separates the decimal part (Exe: . or ,) |