PU2CLR SI4844 Arduino Library 1.1.8
Arduino Library for Si4844 Devices - By Ricardo Lima Caratti
Loading...
Searching...
No Matches
Helper Functions

Functions

void SI4844::convertToChar (uint32_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.
 
bool SI4844::detectDevice ()
 Checks communication with SI4844 via I2C.
 
char * SI4844::getFormattedFrequency (uint8_t removeRightDigit=0, uint8_t thousandsSeparator=',')
 Gets Formatted Frequency.
 
uint8_t SI4844::scanI2CBus (uint8_t *device, uint8_t limit)
 Scans the I2C bus and returns the addresses of the devices found.
 

Detailed Description

Function Documentation

◆ convertToChar()

void SI4844::convertToChar ( uint32_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)

◆ detectDevice()

bool SI4844::detectDevice ( )

Checks communication with SI4844 via I2C.

Checks if the SI4844 is available on the I2C bus. Remember that the SI4844 responds to the address 0x11

Returns
true or false

◆ getFormattedFrequency()

char * SI4844::getFormattedFrequency ( uint8_t  removeRightDigit = 0,
uint8_t  thousandsSeparator = ',' 
)

Gets Formatted Frequency.

Gets the currente frequency of the receiver and return a point to char (string) with the formatted frequency

Parameters
removeRightDigitnumber of less significant digits to be removed (FM mode only)
Returns
point to char with the formatted current frequency

◆ scanI2CBus()

uint8_t SI4844::scanI2CBus ( uint8_t *  device,
uint8_t  limit 
)

Scans the I2C bus and returns the addresses of the devices found.

Searches for devices connected to the I2C bus. The addresses of the devices found are stored in the "device" array.

Parameters
devicearray of device addresses found.
Returns
uint8_t number of devices found or 0 if no device found or error.