![]() |
PU2CLR Si4735 Arduino Library 2.1.4
Arduino Library for Si47XX Devices - By Ricardo Lima Caratti
|
Functions | |
bool | SI4735::getRdsReceived () |
Get the Rds Received FIFO. More... | |
bool | SI4735::getRdsSyncLost () |
Get the Rds Sync Lost object. More... | |
bool | SI4735::getRdsSyncFound () |
Get the Rds Sync Found. More... | |
bool | SI4735::getRdsNewBlockA () |
Get the Rds New Block A. More... | |
bool | SI4735::getRdsNewBlockB () |
Get the Rds New Block B. More... | |
bool | SI4735::getRdsSync () |
Get the Rds Sync. More... | |
bool | SI4735::getGroupLost () |
Get the Group Lost. More... | |
uint8_t | SI4735::getNumRdsFifoUsed () |
Get the Num Rds Fifo Used. More... | |
void | SI4735::setFifoCount (uint16_t value) |
Sets the minimum number of RDS groups stored in the RDS FIFO before RDSRECV is set. More... | |
bool | SI4735::getEndIndicatorGroupA () |
Check if 0xD or 0xA special characters were received for group A. More... | |
void | SI4735::resetEndIndicatorGroupA () |
Resets 0xD or 0xA special characters condition (makes it false) More... | |
bool | SI4735::getEndIndicatorGroupB () |
Check if 0xD or 0xA special characters were received for group B. More... | |
void | SI4735::resetEndIndicatorGroupB () |
Resets 0xD or 0xA special characters condition (makes it false) More... | |
void | SI4735::getRdsStatus () |
Gets RDS Status. More... | |
void | SI4735::rdsClearFifo () |
Empty FIFO. More... | |
void | SI4735::rdsClearInterrupt () |
Clears RDSINT. More... | |
void | SI4735::RdsInit () |
Starts the control member variables for RDS. More... | |
void | SI4735::clearRdsBuffer2A () |
Clear RDS buffer 2A (text) More... | |
void | SI4735::clearRdsBuffer2B () |
Clear RDS buffer 2B (text) More... | |
void | SI4735::clearRdsBuffer0A () |
Clear RDS buffer 0A (text) More... | |
void | SI4735::setRdsConfig (uint8_t RDSEN, uint8_t BLETHA, uint8_t BLETHB, uint8_t BLETHC, uint8_t BLETHD) |
Sets RDS property. More... | |
void | SI4735::setRdsIntSource (uint8_t RDSRECV, uint8_t RDSSYNCLOST, uint8_t RDSSYNCFOUND, uint8_t RDSNEWBLOCKA, uint8_t RDSNEWBLOCKB) |
Configures interrupt related to RDS. More... | |
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. More... | |
uint16_t | SI4735::getRdsPI (void) |
Returns the programa type. More... | |
uint8_t | SI4735::getRdsGroupType (void) |
Returns the Group Type (extracted from the Block B) More... | |
uint8_t | SI4735::getRdsFlagAB (void) |
Returns the current Text Flag A/B. More... | |
uint8_t | SI4735::getRdsTextSegmentAddress (void) |
Returns the address of the text segment. More... | |
uint8_t | SI4735::getRdsVersionCode (void) |
Gets the version code (extracted from the Block B) More... | |
uint8_t | SI4735::getRdsProgramType (void) |
Returns the Program Type (extracted from the Block B) More... | |
void | SI4735::getNext2Block (char *) |
Process data received from group 2B. More... | |
void | SI4735::getNext4Block (char *) |
Process data received from group 2A. More... | |
char * | SI4735::getRdsText (void) |
Gets the RDS Text when the message is of the Group Type 2 version A. More... | |
char * | SI4735::getRdsText0A (void) |
Gets the station name and other messages. More... | |
char * | SI4735::getRdsText2A (void) |
Gets the Text processed for the 2A group. More... | |
char * | SI4735::getRdsText2B (void) |
Gets the Text processed for the 2B group. More... | |
char * | SI4735::getRdsTime (void) |
Gets the RDS time and date when the Group type is 4. More... | |
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. More... | |
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. More... | |
char * | SI4735::getRdsDateTime (void) |
Gets the RDS the Time and Date when the Group type is 4. More... | |
|
inline |
Get the Rds Received FIFO.
if FIFO is 1, it means the minimum number of groups was filled
Referenced by 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.
|
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::rdsClearFifo(), and SI4735::rdsClearInterrupt().
|
inline |
|
inline |
Clears RDSINT.
INTACK Interrupt Acknowledge; 0 = RDSINT status preserved. 1 = Clears RDSINT.
References SI4735::getRdsStatus().
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::setRdsConfig().
|
protected |
Clear RDS buffer 2A (text)
References SI4735::rds_buffer2A.
Referenced by SI4735::getRdsStatus(), and SI4735::RdsInit().
|
protected |
Clear RDS buffer 2B (text)
References SI4735::rds_buffer2B.
Referenced by SI4735::getRdsStatus(), and SI4735::RdsInit().
|
protected |
Clear RDS buffer 0A (text)
References SI4735::rds_buffer0A.
Referenced by SI4735::getRdsStatus(), and SI4735::RdsInit().
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. |
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 |
References SI4735::rdsEndGroupB.
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 |
References SI4735::rdsEndGroupA.
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::getNext2Block(), SI4735::getRdsReceived(), SI4735::rds_buffer0A, and SI4735::rdsTextAdress0A.
char * SI4735::getRdsText2A | ( | void | ) |
Gets the Text processed for the 2A group.
References SI4735::getNext4Block(), SI4735::getRdsReceived(), SI4735::rds_buffer2A, and SI4735::rdsTextAdress2A.
char * SI4735::getRdsText2B | ( | void | ) |
Gets the Text processed for the 2B group.
References SI4735::getNext2Block(), SI4735::rds_buffer2B, and SI4735::rdsTextAdress2B.
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.
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.