PU2CLR SI470X Arduino Library 1.0.1
Arduino Library for Si470X Devices - By Ricardo Lima Caratti
Loading...
Searching...
No Matches
RDS Functions

Functions

void SI470X::getRdsStatus ()
 Gets the RDS registers information.
 
void SI470X::setRdsMode (uint8_t rds_mode=0)
 Sets the Rds Mode Standard or Verbose.
 
void SI470X::setRds (bool value)
 Sets the RDS operation.
 
bool SI470X::getRdsReady ()
 Returns true if RDS Ready.
 
uint8_t SI470X::getRdsFlagAB (void)
 Returns the current Text Flag A/B

 
uint16_t SI470X::getRdsGroupType ()
 Return the group type.
 
uint8_t SI470X::getRdsVersionCode (void)
 Gets the version code (extracted from the Block B)
 
uint8_t SI470X::getRdsProgramType (void)
 Returns the Program Type (extracted from the Block B)
 
void SI470X::getNext2Block (char *c)
 Process data received from group 2B.
 
void SI470X::getNext4Block (char *c)
 Process data received from group 2A.
 
char * SI470X::getRdsText (void)
 Gets the RDS Text when the message is of the Group Type 2 version A.
 
char * SI470X::getRdsText0A (void)
 Gets the station name and other messages.
 
char * SI470X::getRdsText2A (void)
 Gets the Text processed for the 2A group.
 
char * SI470X::getRdsText2B (void)
 Gets the Text processed for the 2B group.
 
char * SI470X::getRdsTime ()
 Gets the RDS time and date when the Group type is 4.
 
char * SI470X::getRdsLocalTime ()
 Gets the RDS time converted to local time.
 
bool SI470X::getRdsAllData (char **stationName, char **stationInformation, char **programInformation, char **utcTime)
 Gets Station Name, Station Information, Program Information and utcTime.
 
void SI470X::clearRdsBuffer ()
 Clear RDS Information (Station Name, Station Information, Program Information and Time)
 
bool SI470X::getRdsSync ()
 Get the Rds Sync.
 

Detailed Description

RDS/RBDS

Function Documentation

◆ getRdsStatus()

void SI470X::getRdsStatus ( )

Gets the RDS registers information.

Gets the value of the registers from 0x0A to 0x0F

This function also updates the value of shadowRegisters[0];

Returns
si470x_reg0a

Referenced by SI470X::getRdsLocalTime(), SI470X::getRdsText(), SI470X::getRdsText0A(), SI470X::getRdsText2A(), SI470X::getRdsText2B(), and SI470X::getRdsTime().

◆ setRdsMode()

void SI470X::setRdsMode ( uint8_t  rds_mode = 0)

Sets the Rds Mode Standard or Verbose.

Parameters
rds_mode0 = Standard (default); 1 = Verbose

◆ setRds()

void SI470X::setRds ( bool  value)

Sets the RDS operation.

Enable or Disable the RDS

Parameters
true= turns the RDS ON; false = turns the RDS OFF

Referenced by SI470X::setRDS().

◆ getRdsReady()

bool SI470X::getRdsReady ( )

Returns true if RDS Ready.

Read address 0Ah and check the bit RDSR.

If in verbose mode, the BLERA bits indicate how many errors were corrected in block A. If BLERA indicates 6 or more errors, the data in RDSA should be discarded.

When using the polling method, it is best not to poll continuously. The data will appear in intervals of ~88 ms and the RDSR indicator will be available for at least 40 ms, so a polling rate of 40 ms or less should be sufficient.

ATTENTION: You most call this function before quering other RDS functions. Call it before calling a set of RDS functions.

Returns
true or false

References SI470X::getStatus().

Referenced by SI470X::getRdsAllData().

◆ getRdsFlagAB()

uint8_t SI470X::getRdsFlagAB ( void  )

Returns the current Text Flag A/B

It is useful to check the flag A/B switching.

Returns
uint8_t current Text Flag A/B

◆ getRdsGroupType()

uint16_t SI470X::getRdsGroupType ( )

Return the group type.

Please, check if getRdsReady was called before.

See also
getRdsReady
Returns
uint16_t

◆ getRdsVersionCode()

uint8_t SI470X::getRdsVersionCode ( void  )

Gets the version code (extracted from the Block B)

Please, check if getRdsReady was called before.

Returns
0=A or 1=B

◆ getRdsProgramType()

uint8_t SI470X::getRdsProgramType ( void  )

Returns the Program Type (extracted from the Block B)

<>

Please, check if getRdsReady was called before.

See also
https://en.wikipedia.org/wiki/Radio_Data_System
Returns
program type (an integer betwenn 0 and 31)

◆ getNext2Block()

void SI470X::getNext2Block ( char *  c)

Process data received from group 2B.

Please, check if getRdsReady was called before.

Parameters
cchar array reference to the "group 2B" text

Referenced by SI470X::getRdsText0A(), and SI470X::getRdsText2B().

◆ getNext4Block()

void SI470X::getNext4Block ( char *  c)

Process data received from group 2A.

Please, check if getRdsReady was called before.

Parameters
cchar array reference to the "group 2A" text

Referenced by SI470X::getRdsText(), and SI470X::getRdsText2A().

◆ getRdsText()

char * SI470X::getRdsText ( void  )

Gets the RDS Text when the message is of the Group Type 2 version A.

Please, check if getRdsReady was called before.

Returns
char* The string (char array) with the content (Text) received from group 2A

References SI470X::getNext4Block(), SI470X::getRdsStatus(), and SI470X::rds_buffer2A.

◆ getRdsText0A()

char * SI470X::getRdsText0A ( void  )

Gets the station name and other messages.

Todo:
RDS Dynamic PS or Scrolling PS support

Please, check if getRdsReady was called before.

Returns
char* should return a string with the station name. However, some stations send other kind of messages

References SI470X::getNext2Block(), SI470X::getRdsStatus(), and SI470X::rds_buffer0A.

Referenced by SI470X::getRdsAllData().

◆ getRdsText2A()

char * SI470X::getRdsText2A ( void  )

Gets the Text processed for the 2A group.

@

Returns
char* string with the Text of the group A2

References SI470X::getNext4Block(), SI470X::getRdsStatus(), and SI470X::rds_buffer2A.

Referenced by SI470X::getRdsAllData().

◆ getRdsText2B()

char * SI470X::getRdsText2B ( void  )

Gets the Text processed for the 2B group.

Returns
char* string with the Text of the group AB

References SI470X::getNext2Block(), SI470X::getRdsStatus(), and SI470X::rds_buffer2B.

Referenced by SI470X::getRdsAllData().

◆ getRdsTime()

char * SI470X::getRdsTime ( )

Gets the RDS time and date when the Group type is 4.

Returns
char* a string with hh:mm +/- offset

References SI470X::getRdsStatus(), and SI470X::rds_time.

Referenced by SI470X::getRdsAllData().

◆ getRdsLocalTime()

char * SI470X::getRdsLocalTime ( )

Gets the RDS time converted to local time.

ATTENTION: You must call getRdsReady before calling this function.

ATTENTION: Some stations broadcast wrong time.

Returns
char* a string with hh:mm
See also
getRdsReady

References SI470X::getRdsStatus(), and SI470X::rds_time.

◆ getRdsAllData()

bool SI470X::getRdsAllData ( char **  stationName,
char **  stationInformation,
char **  programInformation,
char **  utcTime 
)

Gets Station Name, Station Information, Program Information and utcTime.

This function populates four char pointer variable parameters with Station Name, Station Information, Programa Information and UTC time.

You must call setRDS(true), setRdsFifo(true) before calling getRdsAllData(...)

ATTENTION: the parameters below are point to point to array of char.

the right way to call this function is shown below.

char *stationName, *stationInfo, *programInfo, *rdsTime;
// The char pointers above will be populate by the call below. So, the char pointers need to be passed by reference (pointer to pointer).
if (rx.getRdsAllData(&stationName, &stationInfo , &programInfo, &rdsTime) ) {
showProgramaInfo(programInfo);
showStationName(stationName);
showStationInfo(stationInfo);
showUtcTime(rdsTime);
}
Parameters
stationName(reference) - if NOT NULL, point to Name of the Station (char array - 9 bytes)
stationInformation(reference) - if NOT NULL, point to Station information (char array - 33 bytes)
programInformation(reference) - if NOT NULL, point to program information (char array - 65 nytes)
utcTime(reference) - if NOT NULL, point to char array containing the current UTC time (format HH:MM:SS +HH:MM)
Returns
True if found at least one valid data
See also
setRDS, setRdsFifo, getRdsAllData

References SI470X::getRdsReady(), SI470X::getRdsText0A(), SI470X::getRdsText2A(), SI470X::getRdsText2B(), and SI470X::getRdsTime().

◆ clearRdsBuffer()

void SI470X::clearRdsBuffer ( )

Clear RDS Information (Station Name, Station Information, Program Information and Time)

Clear the buffer with latest RDS information

References SI470X::rds_buffer0A, SI470X::rds_buffer2A, SI470X::rds_buffer2B, and SI470X::rds_time.

◆ getRdsSync()

bool SI470X::getRdsSync ( )

Get the Rds Sync.

Returns true if RDS currently synchronized.

Returns
true or false

References SI470X::getStatus().