PU2CLR BK108X Arduino Library 1.0.2
This is an Arduino Library to control the BK108X device
|
Functions | |
char * | BK108X::getRdsProgramInformation (void) |
Gets the Program Information (RT - Radio Text) | |
char * | BK108X::getRdsStationInformation (void) |
Gets the Station Information. | |
char * | BK108X::getRdsStationName (void) |
Gets the Station Name. | |
void | BK108X::setRdsMode (uint8_t rds_mode=0) |
Sets the Rds Mode Standard or Verbose. | |
void | BK108X::setRds (bool value, bool interrupt_enable=false) |
Sets the RDS operation. | |
bool | BK108X::getRdsReady () |
Returns true if RDS Ready. | |
uint8_t | BK108X::getRdsFlagAB (void) |
Returns the current Text Flag A/B. | |
uint16_t | BK108X::getRdsGroupType () |
Return the group type - Gets the Group Type (extracted from the Block B) | |
uint8_t | BK108X::getRdsVersionCode (void) |
Gets the version code (extracted from the Block B) | |
uint8_t | BK108X::getRdsProgramType (void) |
Returns the Program Type (extracted from the Block B) | |
void | BK108X::getNext2Block (char *c) |
Process data received from group 2B - Station Name. | |
void | BK108X::getNext4Block (char *c) |
Processes data received from group 2A. | |
char * | BK108X::getRdsText (void) |
Gets the RDS Text when the message is of the Group Type 2 version A. | |
char * | BK108X::getRdsText0A (void) |
Gets the Station Name and other messages. | |
char * | BK108X::getRdsText2A (void) |
Gets the Text processed for the 2A group. | |
char * | BK108X::getRdsText2B (void) |
Gets the Text processed for the 2B group. | |
bool | BK108X::getRdsAllData (char **stationName, char **stationInformation, char **programInformation, char **utcTime) |
Gets Station Name, Station Information, Program Information and utcTime. | |
char * | BK108X::getRdsTime () |
Gets the RDS time and date when the Group type is 4. | |
char * | BK108X::getRdsLocalTime () |
Gets the RDS time converted to local time. | |
bool | BK108X::getRdsSync () |
Get the Rds Sync. | |
void | BK108X::clearRdsBuffer () |
Clear RDS Information (Station Name, Station Information, Program Information and Time) | |
|
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.
Definition at line 1158 of file BK108X.h.
References BK108X::getRdsText2A().
|
inline |
Gets the Station Information.
ATTENTION: You must call getRdsReady before calling this function.
Definition at line 1167 of file BK108X.h.
References BK108X::getRdsText2B().
|
inline |
Gets the Station Name.
Alias for getRdsText0A
ATTENTION: You must call getRdsReady before calling this function.
Definition at line 1177 of file BK108X.h.
References BK108X::getRdsText0A().
void BK108X::setRdsMode | ( | uint8_t | rds_mode = 0 | ) |
Sets the Rds Mode Standard or Verbose.
There is no information about it in the BK1088 documentation.
rds_mode | 0 = Standard (default); 1 = Verbose |
Definition at line 1091 of file BK108X.cpp.
void BK108X::setRds | ( | bool | value, |
bool | interrupt_enable = false |
||
) |
Sets the RDS operation.
Enable or Disable the RDS
You can setup interrupt via GPIO2. It is useful to avoid pulling during RDS queries.
When a new RDS data is available (new RDS information came) a 5ms low pulse will appear at GPIO2
true | = turns the RDS ON; false = turns the RDS OFF |
true | = enable interruot at GPIO2 when new RDS is available (default false). |
Definition at line 1105 of file BK108X.cpp.
Referenced by BK108X::setRDS().
bool BK108X::getRdsReady | ( | ) |
Returns true if RDS Ready.
Read addresses 0Ah, 0Ch, 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 must call this function before calling any RDS function to process data
Definition at line 1124 of file BK108X.cpp.
Referenced by BK108X::getRdsAllData().
uint8_t BK108X::getRdsFlagAB | ( | void | ) |
Returns the current Text Flag A/B.
You must call getRdsReady before calling this function
Definition at line 1143 of file BK108X.cpp.
uint16_t BK108X::getRdsGroupType | ( | ) |
Return the group type - Gets the Group Type (extracted from the Block B)
You must call getRdsReady before calling this function
Definition at line 1156 of file BK108X.cpp.
uint8_t BK108X::getRdsVersionCode | ( | void | ) |
Gets the version code (extracted from the Block B)
You must call getRdsReady before calling this function
Definition at line 1170 of file BK108X.cpp.
uint8_t BK108X::getRdsProgramType | ( | void | ) |
Returns the Program Type (extracted from the Block B)
You must call getRdsReady before calling this function
Definition at line 1184 of file BK108X.cpp.
|
inline |
Process data received from group 2B - Station Name.
It appears that the BK1088 device is typically pre-configured with RBDS setup instead of RDS by default.
Consequently, the Station Name is obtained from block E instead of block B.
The documentation from BEKEN used in this project does not provide instructions on how to switch from RBDS to RDS mode.
If anyone has access to this information, kindly share it with us.
c | char array reference to the "group 2B" text |
Definition at line 1200 of file BK108X.cpp.
Referenced by BK108X::getRdsText0A(), and BK108X::getRdsText2B().
|
inline |
Processes data received from group 2A.
decodes data received from block C and block D
c | char array reference to the "group 2A" text |
Definition at line 1213 of file BK108X.cpp.
Referenced by BK108X::getRdsText2A().
char * BK108X::getRdsText | ( | void | ) |
Gets the RDS Text when the message is of the Group Type 2 version A.
Definition at line 1227 of file BK108X.cpp.
char * BK108X::getRdsText0A | ( | void | ) |
Gets the Station Name and other messages.
Need to check Block B and Block E and RDS mode
RDS Dynamic PS or Scrolling PS support
Same getRdsStationName.
Definition at line 1241 of file BK108X.cpp.
References BK108X::getNext2Block(), and BK108X::rds_buffer0A.
Referenced by BK108X::getRdsAllData(), and BK108X::getRdsStationName().
char * BK108X::getRdsText2A | ( | void | ) |
Gets the Text processed for the 2A group.
@
Definition at line 1269 of file BK108X.cpp.
References BK108X::getNext4Block(), and BK108X::rds_buffer2A.
Referenced by BK108X::getRdsAllData(), and BK108X::getRdsProgramInformation().
char * BK108X::getRdsText2B | ( | void | ) |
Gets the Text processed for the 2B group.
Definition at line 1296 of file BK108X.cpp.
References BK108X::getNext2Block(), and BK108X::rds_buffer2B.
Referenced by BK108X::getRdsAllData(), and BK108X::getRdsStationInformation().
bool BK108X::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.
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) |
Definition at line 1340 of file BK108X.cpp.
References BK108X::getRdsReady(), BK108X::getRdsText0A(), BK108X::getRdsText2A(), BK108X::getRdsText2B(), and BK108X::getRdsTime().
char * BK108X::getRdsTime | ( | ) |
Gets the RDS time and date when the Group type is 4.
Definition at line 1358 of file BK108X.cpp.
References BK108X::rds_time.
Referenced by BK108X::getRdsAllData().
char * BK108X::getRdsLocalTime | ( | ) |
Gets the RDS time converted to local time.
ATTENTION: You must call getRdsReady before calling this function.
ATTENTION: Some stations broadcast wrong time.
Definition at line 1424 of file BK108X.cpp.
References BK108X::rds_time.
bool BK108X::getRdsSync | ( | ) |
Get the Rds Sync.
Returns true if RDS currently synchronized.
Definition at line 1487 of file BK108X.cpp.
void BK108X::clearRdsBuffer | ( | ) |
Clear RDS Information (Station Name, Station Information, Program Information and Time)
Clear the buffer with latest RDS information
Definition at line 1497 of file BK108X.cpp.
References BK108X::rds_buffer0A, BK108X::rds_buffer2A, BK108X::rds_buffer2B, and BK108X::rds_time.