PU2CLR Si4735 Arduino Library 2.1.4
Arduino Library for Si47XX Devices - By Ricardo Lima Caratti
|
Functions | |
void | SI4735::clearRdsBuffer2A () |
Clear RDS buffer 2A (Radio Text / Program Information) | |
void | SI4735::clearRdsProgramInformation () |
Clear RDS buffer 2A (Radio Text / Program Information) | |
void | SI4735::clearRdsBuffer2B () |
Clear RDS buffer 2B (text / Station INformation 32 bytes) | |
void | SI4735::clearRdsStationInformation () |
Clear RDS buffer 2B (text / Station INformation 32 bytes) | |
void | SI4735::clearRdsBuffer0A () |
Clear RDS buffer 0A (text / Station Name) | |
void | SI4735::clearRdsStationName () |
Clear RDS buffer 0A (text / Station Name) | |
void | SI4735::clearRdsBuffer () |
Starts the control member variables for RDS. It is an alias to RdsInit (a better name to RdsInit) | |
void | SI4735::rdsBeginQuery () |
Retrieves the current RDS data to be utilized by other RDS functions. | |
bool | SI4735::getRdsReceived () |
Get the Rds Received FIFO. | |
bool | SI4735::getRdsSyncLost () |
Get the Rds Sync Lost object. | |
bool | SI4735::getRdsSyncFound () |
Get the Rds Sync Found. | |
bool | SI4735::getRdsNewBlockA () |
Get the Rds New Block A. | |
bool | SI4735::getRdsNewBlockB () |
Get the Rds New Block B. | |
bool | SI4735::getRdsSync () |
Get the Rds Sync. | |
bool | SI4735::getGroupLost () |
Get the Group Lost. | |
uint8_t | SI4735::getNumRdsFifoUsed () |
Get the Num Rds Fifo Used. | |
void | SI4735::setFifoCount (uint16_t value) |
Sets the minimum number of RDS groups stored in the RDS FIFO before RDSRECV is set. | |
bool | SI4735::getEndIndicatorGroupA () |
Check if 0xD or 0xA special characters were received for group A. | |
void | SI4735::resetEndIndicatorGroupA () |
Resets 0xD or 0xA special characters condition (makes it false) | |
bool | SI4735::getEndIndicatorGroupB () |
Check if 0xD or 0xA special characters were received for group B. | |
void | SI4735::resetEndIndicatorGroupB () |
Resets 0xD or 0xA special characters condition (makes it false) | |
void | SI4735::getRdsStatus () |
Gets RDS Status. | |
void | SI4735::rdsClearFifo () |
Empty FIFO. | |
void | SI4735::rdsClearInterrupt () |
Clears RDSINT. | |
char * | SI4735::getRdsStationName (void) |
Gets the Station Name. | |
char * | SI4735::getRdsProgramInformation (void) |
Gets the Program Information (RT - Radio Text) | |
char * | SI4735::getRdsStationInformation (void) |
Gets the Station Information. | |
void | SI4735::RdsInit () |
Starts the control member variables for RDS. | |
void | SI4735::setRdsConfig (uint8_t RDSEN, uint8_t BLETHA, uint8_t BLETHB, uint8_t BLETHC, uint8_t BLETHD) |
Sets RDS property. | |
void | SI4735::setRdsIntSource (uint8_t RDSRECV, uint8_t RDSSYNCLOST, uint8_t RDSSYNCFOUND, uint8_t RDSNEWBLOCKA, uint8_t RDSNEWBLOCKB) |
Configures interrupt related to RDS. | |
void | SI4735::getRdsStatus (uint8_t INTACK, uint8_t MTFIFO, uint8_t STATUSONLY) |
Gets the RDS status. Store the status in currentRdsStatus member. RDS COMMAND FM_RDS_STATUS. | |
uint16_t | SI4735::getRdsPI (void) |
Returns the programa type. | |
uint8_t | SI4735::getRdsGroupType (void) |
Returns the Group Type (extracted from the Block B) | |
uint8_t | SI4735::getRdsFlagAB (void) |
Returns the current Text Flag A/B | |
uint8_t | SI4735::getRdsTextSegmentAddress (void) |
Returns the address of the text segment. | |
uint8_t | SI4735::getRdsVersionCode (void) |
Gets the version code (extracted from the Block B) | |
uint8_t | SI4735::getRdsProgramType (void) |
Returns the Program Type (extracted from the Block B) | |
void | SI4735::getNext2Block (char *) |
Process data received from group 2B. | |
void | SI4735::getNext4Block (char *) |
Process data received from group 2A. | |
char * | SI4735::getRdsText (void) |
Gets the RDS Text when the message is of the Group Type 2 version A. | |
char * | SI4735::getRdsText0A (void) |
Gets the station name and other messages. | |
char * | SI4735::getRdsText2A (void) |
Gets the Text processed for the 2A group. | |
char * | SI4735::getRdsText2B (void) |
Gets the Text processed for the 2B group. | |
bool | SI4735::getRdsAllData (char **stationName, char **stationInformation, char **programInformation, char **utcTime) |
Gets Station Name, Station Information, Program Information and utcTime. | |
char * | SI4735::getRdsTime (void) |
Gets the RDS time and date when the Group type is 4. | |
void | SI4735::mjdConverter (uint32_t mjd, uint32_t *year, uint32_t *month, uint32_t *day) |
Converts the MJD number to integers Year, month and day. | |
bool | SI4735::getRdsDateTime (uint16_t *year, uint16_t *month, uint16_t *day, uint16_t *hour, uint16_t *minute) |
Decodes the RDS time to LOCAL Julian Day and time. | |
char * | SI4735::getRdsDateTime (void) |
Gets the RDS the Time and Date when the Group type is 4. | |
|
inlineprotected |
Clear RDS buffer 2A (Radio Text / Program Information)
same clearRdsProgramInformation
References SI4735::rds_buffer2A.
Referenced by SI4735::getRdsStatus(), and SI4735::RdsInit().
|
inlineprotected |
Clear RDS buffer 2A (Radio Text / Program Information)
same clearRdsBuffer2A
References SI4735::rds_buffer2A.
|
inlineprotected |
Clear RDS buffer 2B (text / Station INformation 32 bytes)
Same clearRdsStationInformation
References SI4735::rds_buffer2B.
Referenced by SI4735::getRdsStatus(), and SI4735::RdsInit().
|
inlineprotected |
Clear RDS buffer 2B (text / Station INformation 32 bytes)
Same clearRdsBuffer2B
References SI4735::rds_buffer2B.
|
inlineprotected |
Clear RDS buffer 0A (text / Station Name)
clearRdsStationName
References SI4735::rds_buffer0A.
Referenced by SI4735::getRdsStatus(), SI4735::getRdsText0A(), and SI4735::RdsInit().
|
inlineprotected |
|
inline |
Starts the control member variables for RDS. It is an alias to RdsInit (a better name to RdsInit)
This method is called by setRdsConfig()
References SI4735::RdsInit().
|
inline |
Retrieves the current RDS data to be utilized by other RDS functions.
Just another way to call getRdsStatus. Both do the same thing.
This function must be called before calling any RDS function.
References SI4735::getRdsStatus().
Referenced by SI4735::getRdsAllData().
|
inline |
Get the Rds Received FIFO.
if FIFO is 1, it means the minimum number of groups was filled
Referenced by SI4735::getRdsAllData(), SI4735::getRdsPI(), SI4735::getRdsText0A(), and SI4735::getRdsText2A().
|
inline |
Get the Rds Sync Lost object.
returns true (1) if Lost RDS synchronization is detected.
|
inline |
Get the Rds Sync Found.
return true if found RDS synchronization
|
inline |
Get the Rds New Block A.
Returns true if valid Block A data has been received.
Referenced by SI4735::getRdsPI().
|
inline |
Get the Rds New Block B.
Returns true if valid Block B data has been received.
|
inline |
Get the Rds Sync.
Returns true if RDS currently synchronized.
Referenced by SI4735::getRdsAllData().
|
inline |
Get the Group Lost.
Returns true if one or more RDS groups discarded due to FIFO overrun.
|
inline |
Get the Num Rds Fifo Used.
Return the number of RDS FIFO used
|
inline |
Sets the minimum number of RDS groups stored in the RDS FIFO before RDSRECV is set.
Return the number of RDS FIFO used
value | from 0 to 25. Default value is 0. |
|
inline |
Check if 0xD or 0xA special characters were received for group A.
References SI4735::rdsEndGroupA.
|
inline |
Resets 0xD or 0xA special characters condition (makes it false)
References SI4735::rdsEndGroupA.
|
inline |
Check if 0xD or 0xA special characters were received for group B.
References SI4735::rdsEndGroupB.
|
inline |
Resets 0xD or 0xA special characters condition (makes it false)
References SI4735::rdsEndGroupB.
|
inline |
Gets RDS Status.
Same result of calling getRdsStatus(0,0,0).
Please, call getRdsStatus(uint8_t INTACK, uint8_t MTFIFO, uint8_t STATUSONLY) instead getRdsStatus() if you want other behaviour.
References SI4735::getRdsStatus().
Referenced by SI4735::getRdsStatus(), SI4735::rdsBeginQuery(), SI4735::rdsClearFifo(), and SI4735::rdsClearInterrupt().
|
inline |
|
inline |
Clears RDSINT.
INTACK Interrupt Acknowledge; 0 = RDSINT status preserved. 1 = Clears RDSINT.
References SI4735::getRdsStatus().
|
inline |
Gets the Station Name.
Alias for getRdsText0A
ATTENTION: You must call getRdsReady before calling this function.
References SI4735::getRdsText0A().
|
inline |
Gets the Program Information (RT - Radio Text)
Process the program information data. Same getRdsText2A(). It is a alias for getRdsText2A.
ATTENTION: You must call getRdsReady before calling this function.
References SI4735::getRdsText2A().
|
inline |
Gets the Station Information.
ATTENTION: You must call getRdsReady before calling this function.
References SI4735::getRdsText2B().
void SI4735::RdsInit | ( | ) |
Starts the control member variables for RDS.
RDS implementation
This method is called by setRdsConfig()
References SI4735::clearRdsBuffer0A(), SI4735::clearRdsBuffer2A(), and SI4735::clearRdsBuffer2B().
Referenced by SI4735::clearRdsBuffer(), and SI4735::setRdsConfig().
void SI4735::setRdsConfig | ( | uint8_t | RDSEN, |
uint8_t | BLETHA, | ||
uint8_t | BLETHB, | ||
uint8_t | BLETHC, | ||
uint8_t | BLETHD | ||
) |
Sets RDS property.
Configures RDS settings to enable RDS processing (RDSEN) and set RDS block error thresholds.
When a RDS Group is received, all block errors must be less than or equal the associated block error threshold for the group to be stored in the RDS FIFO.
IMPORTANT: All block errors must be less than or equal the associated block error threshold for the group to be stored in the RDS FIFO.
Value | Description |
---|---|
0 | No errors |
1 | 1–2 bit errors detected and corrected |
2 | 3–5 bit errors detected and corrected |
3 | Uncorrectable |
Recommended Block Error Threshold options:
Exemples | Description |
---|---|
2,2,2,2 | No group stored if any errors are uncorrected |
3,3,3,3 | Group stored regardless of errors |
0,0,0,0 | No group stored containing corrected or uncorrected errors |
3,2,3,3 | Group stored with corrected errors on B, regardless of errors on A, C, or D |
uint8_t | RDSEN RDS Processing Enable; 1 = RDS processing enabled. |
uint8_t | BLETHA Block Error Threshold BLOCKA. |
uint8_t | BLETHB Block Error Threshold BLOCKB. |
uint8_t | BLETHC Block Error Threshold BLOCKC. |
uint8_t | BLETHD Block Error Threshold BLOCKD. |
References SI4735::RdsInit(), and SI4735::waitToSend().
void SI4735::setRdsIntSource | ( | uint8_t | RDSRECV, |
uint8_t | RDSSYNCLOST, | ||
uint8_t | RDSSYNCFOUND, | ||
uint8_t | RDSNEWBLOCKA, | ||
uint8_t | RDSNEWBLOCKB | ||
) |
Configures interrupt related to RDS.
Use this method if want to use interrupt
RDSRECV | If set, generate RDSINT when RDS FIFO has at least FM_RDS_INT_FIFO_COUNT entries. |
RDSSYNCLOST | If set, generate RDSINT when RDS loses synchronization. |
RDSSYNCFOUND | set, generate RDSINT when RDS gains synchronization. |
RDSNEWBLOCKA | If set, generate an interrupt when Block A data is found or subsequently changed |
RDSNEWBLOCKB | If set, generate an interrupt when Block B data is found or subsequently changed |
References SI4735::waitToSend().
void SI4735::getRdsStatus | ( | uint8_t | INTACK, |
uint8_t | MTFIFO, | ||
uint8_t | STATUSONLY | ||
) |
Gets the RDS status. Store the status in currentRdsStatus member. RDS COMMAND FM_RDS_STATUS.
INTACK | Interrupt Acknowledge; 0 = RDSINT status preserved. 1 = Clears RDSINT. |
MTFIFO | 0 = If FIFO not empty, read and remove oldest FIFO entry; 1 = Clear RDS Receive FIFO. |
STATUSONLY | Determines if data should be removed from the RDS FIFO. 0 = Data in BLOCKA, BLOCKB, BLOCKC, BLOCKD, and BLE contain the oldest data in the RDS FIFO. 1 = Data in BLOCKA will contain the last valid block A data received for the cur- rent station. Data in BLOCKB will contain the last valid block B data received for the current station. Data in BLE will describe the bit errors for the data in BLOCKA and BLOCKB. |
References SI4735::clearRdsBuffer0A(), SI4735::clearRdsBuffer2A(), SI4735::clearRdsBuffer2B(), and SI4735::waitToSend().
uint16_t SI4735::getRdsPI | ( | void | ) |
Returns the programa type.
Read the Block A content
References SI4735::getRdsNewBlockA(), and SI4735::getRdsReceived().
uint8_t SI4735::getRdsGroupType | ( | void | ) |
Returns the Group Type (extracted from the Block B)
uint8_t SI4735::getRdsFlagAB | ( | void | ) |
Returns the current Text Flag A/B
uint8_t SI4735::getRdsTextSegmentAddress | ( | void | ) |
Returns the address of the text segment.
2A - Each text segment in version 2A groups consists of four characters. A messages of this group can be have up to 64 characters.
2B - In version 2B groups, each text segment consists of only two characters. When the current RDS status is using this version, the maximum message length will be 32 characters.
uint8_t SI4735::getRdsVersionCode | ( | void | ) |
Gets the version code (extracted from the Block B)
uint8_t SI4735::getRdsProgramType | ( | void | ) |
Returns the Program Type (extracted from the Block B)
void SI4735::getNext2Block | ( | char * | c | ) |
Process data received from group 2B.
c | char array reference to the "group 2B" text |
Referenced by SI4735::getRdsText0A(), and SI4735::getRdsText2B().
void SI4735::getNext4Block | ( | char * | c | ) |
Process data received from group 2A.
c | char array reference to the "group 2A" text |
Referenced by SI4735::getRdsText(), and SI4735::getRdsText2A().
char * SI4735::getRdsText | ( | void | ) |
Gets the RDS Text when the message is of the Group Type 2 version A.
References SI4735::getNext4Block(), SI4735::rds_buffer2A, and SI4735::rdsTextAdress2A.
char * SI4735::getRdsText0A | ( | void | ) |
Gets the station name and other messages.
References SI4735::clearRdsBuffer0A(), SI4735::getNext2Block(), SI4735::getRdsReceived(), SI4735::rds_buffer0A, and SI4735::rdsTextAdress0A.
Referenced by SI4735::getRdsAllData(), and SI4735::getRdsStationName().
char * SI4735::getRdsText2A | ( | void | ) |
Gets the Text processed for the 2A group.
References SI4735::getNext4Block(), SI4735::getRdsReceived(), SI4735::rds_buffer2A, and SI4735::rdsTextAdress2A.
Referenced by SI4735::getRdsAllData(), and SI4735::getRdsProgramInformation().
char * SI4735::getRdsText2B | ( | void | ) |
Gets the Text processed for the 2B group.
References SI4735::getNext2Block(), SI4735::rds_buffer2B, and SI4735::rdsTextAdress2B.
Referenced by SI4735::getRdsAllData(), and SI4735::getRdsStationInformation().
bool SI4735::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: You don't need to call any additional function to obtain the RDS information; simply follow the steps outlined below.
ATTENTION: If no data is found for the given parameter, it is assigned a NULL value. Prior to using the pointers variable, make sure to check if it is null.
the right way to call this function is shown below.
ATTENTION: the parameters below are point to point to array of char.
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) |
References SI4735::getRdsReceived(), SI4735::getRdsSync(), SI4735::getRdsText0A(), SI4735::getRdsText2A(), SI4735::getRdsText2B(), SI4735::getRdsTime(), and SI4735::rdsBeginQuery().
char * SI4735::getRdsTime | ( | void | ) |
Gets the RDS time and date when the Group type is 4.
Returns theUTC Time and offset (to convert it to local time)
return examples:
12:31 +03:00
21:59 -02:30
References SI4735::rds_time.
Referenced by SI4735::getRdsAllData().
void SI4735::mjdConverter | ( | uint32_t | mjd, |
uint32_t * | year, | ||
uint32_t * | month, | ||
uint32_t * | day | ||
) |
Converts the MJD number to integers Year, month and day.
()
Calculates day, month and year based on MJD
This MJD algorithm is an adaptation of the javascript code found at http://www.csgnetwork.com/julianmodifdateconv.html
mjd | mjd number |
year | year variable reference |
month | month variable reference |
day | day variable reference |
bool SI4735::getRdsDateTime | ( | uint16_t * | rYear, |
uint16_t * | rMonth, | ||
uint16_t * | rDay, | ||
uint16_t * | rHour, | ||
uint16_t * | rMinute | ||
) |
Decodes the RDS time to LOCAL Julian Day and time.
This method gets the RDS date time massage and converts it from MJD to JD and UTC time to local time
The Date and Time service may not work correctly depending on the FM station that provides the service.
I have noticed that some FM stations do not use the service properly in my location.
Example:
rYear | year variable reference |
rMonth | month variable reference |
rDay | day variable reference |
rHour | local hour variable reference |
rMinute | local minute variable reference |
char * SI4735::getRdsDateTime | ( | void | ) |
Gets the RDS the Time and Date when the Group type is 4.
Returns the Date, UTC Time and offset (to convert it to local time)
return examples:
2021-07-29 12:31 +03:00
1964-05-09 21:59 -02:30
References SI4735::rds_time.