PU2CLR BK108X Arduino Library 1.0.2
This is an Arduino Library to control the BK108X device
Loading...
Searching...
No Matches
Tools

Functions

char * BK108X::formatFrequency (uint16_t value, char *strValue, char decimalSeparator=',', uint8_t decimalPosition=3)
 Convert a numeric frequency to a formated string (char *) frequency.
 
char * BK108X::formatCurrentFrequency (char decimalSeparator=',', uint8_t decimalPosition=3)
 Convert the current frequency to a formated string (char *) frequency.
 
int BK108X::checkI2C (uint8_t *addressArray)
 Check the I2C bus address.
 
uint16_t * BK108X::getRegisterValues ()
 Returns the point of uint16_t array (size 32)
 
void BK108X::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.
 

Detailed Description

Tools / Helper

Function Documentation

◆ formatFrequency()

char * BK108X::formatFrequency ( uint16_t  value,
char *  strValue,
char  decimalSeparator = ',',
uint8_t  decimalPosition = 3 
)
inline

Convert a numeric frequency to a formated string (char *) frequency.

Parameters
uint16_tvalue - A given frequency to be formated
char*strValue - Formated frequency (Exe: 103,90) - Array of char ( minimal 7 elements )
chardecimalSeparator - the symbol that separates the decimal part (Exe: . or ,)
Returns
point of strValue

Definition at line 1195 of file BK108X.h.

◆ formatCurrentFrequency()

char * BK108X::formatCurrentFrequency ( char  decimalSeparator = ',',
uint8_t  decimalPosition = 3 
)
inline

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

Definition at line 1208 of file BK108X.h.

◆ checkI2C()

int BK108X::checkI2C ( uint8_t *  addressArray)

Check the I2C bus address.

For some reason, the BK1088 device does not work with the standard Wire.h library of Arduino.

The checkI2C function is only used to test the circuit.

In practice, no function from the Wire.h library is utilized in a real application with the BK1088 in this project.

Parameters
uint8_taddress Array - this array will be populated with the I2C bus addresses found (minimum three elements)
Returns
0 if no i2c device is found; -1 if error is found or n > 0, where n is the number of I2C bus address found

Definition at line 1519 of file BK108X.cpp.

◆ getRegisterValues()

uint16_t * BK108X::getRegisterValues ( )

Returns the point of uint16_t array (size 32)

Useful to monitor the device internal registers

Returns
point of shadowRegisters

Definition at line 1547 of file BK108X.cpp.

◆ convertToChar()

void BK108X::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 othetr generic similar functions

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

Parameters
valuevalue to be converted
strValuechar array that will be receive the converted value
lenfinal string size (in bytes)
dotthe decimal or tousand separator position
separatorsymbol "." or ","
remove_leading_zerosif true removes up to two leading zeros (default is true)

Definition at line 1567 of file BK108X.cpp.