PU2CLR BK108X Arduino Library 1.0.2
This is an Arduino Library to control the BK108X device
Loading...
Searching...
No Matches
Union, Structure and Defined Data Types <br>

BK108X Defined Data Types. More...

Classes

union  bk_reg00
 Device ID. More...
 
union  bk_reg01
 Chip ID. More...
 
union  bk_reg02
 Power Configuratio. More...
 
union  bk_reg03
 Channe. More...
 
union  bk_reg04
 Register 04h. System Configuration1 (0x1180) More...
 
union  bk_reg05
 Register 05h. System Configuration2 (0x3ddf) More...
 
union  bk_reg06
 Register 06h. System Configuration3 (0x01ef) More...
 
union  bk_reg07
 Register 07h. Test1 (0x0900) More...
 
union  bk_reg08
 Test 2. More...
 
union  bk_reg09
 Register 09h. Status1 (0x0000) More...
 
union  bk_reg0a
 Register 0Ah. Status2 (0x0000) More...
 
union  bk_reg0b
 Register 0Bh. Read Channel (0x0000) More...
 
union  bk_reg0c
 Register 0Ch. RDS1 (0x0000) More...
 
union  bk_reg0d
 Register 0Dh. RDS2 (0x0000) More...
 
union  bk_reg0e
 Register 0Eh. RDS2 (0x0000) More...
 
union  bk_reg0f
 Register 0Fh. RDS4 (0x0000) More...
 
union  bk_reg10
 Register 10h. Boot Configuration1 (0x7b11) More...
 
union  bk_reg11
 Register 11h. Boot Configuration2 (0x0080) More...
 
union  bk_reg12
 Register 12h. Boot Configuration3 (0x4000) More...
 
union  bk_reg13
 Register 13h. Boot Configuration4 (0x3e00) More...
 
union  bk_reg14
 Register 14h. Boot Configuration5 (0x0000) More...
 
union  bk_reg15
 15h. Boot Configuration6 (0x0000) More...
 
union  bk_reg16
 Register 16h. Boot Configuration7 (0x0400) More...
 
union  bk_reg17
 Register 17h. Boot Configuration8 (0x0001) More...
 
union  bk_reg18
 Register 18h. Boot Configuration9 (0x143c) More...
 
union  bk_reg19
 Register 19h. Boot Configuration10 (0x4351) More...
 
union  bk_reg1A
 Register 1Ah. Boot Configuration11 (0x0000) More...
 
union  bk_reg1B
 Register 1Bh. Analog Configuration1 (0x0000) More...
 
union  bk_reg1C
 Register 1Ch. Analog Configuration2 (0x0000) More...
 
union  bk_reg1D
 Register 1Dh. Analog Configuration2 (0x0000) More...
 
union  bk_rds_blockb
 RDS Block B data type. More...
 
union  bk_rds_date_time
 
union  word16_to_bytes
 Converts 16 bits word to two bytes. More...
 
class  BK108X
 KT0915 Class. More...
 
struct  bk_reg00.refined
 
struct  bk_reg01.refined
 
struct  bk_reg02.refined
 
struct  bk_reg03.refined
 
struct  bk_reg04.refined
 
struct  bk_reg05.refined
 
struct  bk_reg06.refined
 
struct  bk_reg07.refined
 
struct  bk_reg08.refined
 
struct  bk_reg09.refined
 
struct  bk_reg0a.refined
 
struct  bk_reg0b.refined
 
struct  bk_reg0c.rds_status
 
struct  bk_reg0c.refined
 
struct  bk_reg0d.refined
 
struct  bk_reg0e.refined
 
struct  bk_reg0f.refined
 
struct  bk_reg10.refined
 
struct  bk_reg11.refined
 
struct  bk_reg12.refined
 
struct  bk_reg13.refined
 
struct  bk_reg14.refined
 
struct  bk_reg15.refined
 
struct  bk_reg16.refined
 
struct  bk_reg17.refined
 
struct  bk_reg18.refined
 
struct  bk_reg19.refined
 
struct  bk_reg1A.refined
 
struct  bk_reg1B.refined
 
struct  bk_reg1C.refined
 
struct  bk_reg1D.refined
 
struct  bk_rds_blockb.group0
 
struct  bk_rds_blockb.group2
 
struct  bk_rds_blockb.refined
 
struct  bk_rds_date_time.refined
 
struct  word16_to_bytes.refined
 

Detailed Description

BK108X Defined Data Types.

Defined Data Types is a way to represent the BK108X registers information

Some information appears to be inaccurate due to translation problems from Chinese to English.

The information shown here was extracted from Datasheet:

BK108X stereo FM digital tuning radio documentation.

Other information seems incomplete even in the original Chinese Datasheet.

For example: Reg 10 (0x0A). There is no information about it. The Reg11 and 12 seem wrong


Class Documentation

◆ bk_reg00

union bk_reg00

Device ID.

Definition at line 103 of file BK108X.h.

Class Members
struct bk_reg00.refined refined
uint16_t deviceId

◆ bk_reg01

union bk_reg01

Chip ID.

Definition at line 118 of file BK108X.h.

Class Members
struct bk_reg01.refined refined
uint16_t chipId

◆ bk_reg02

union bk_reg02

Power Configuratio.

See also
BEKEN - BK1086/88 - BROADCAST AM/FM/SW/LW RADIO RECEIVER; pages 13 and 14

Definition at line 133 of file BK108X.h.

Class Members
struct bk_reg02.refined refined
uint16_t raw

◆ bk_reg03

union bk_reg03

Channe.

The tuned Frequency = Band + CHAN * SPACE

See also
BEKEN - BK1086/88 - BROADCAST AM/FM/SW/LW RADIO RECEIVER; page 14

Definition at line 159 of file BK108X.h.

Class Members
struct bk_reg03.refined refined
uint16_t raw

◆ bk_reg04

union bk_reg04

Register 04h. System Configuration1 (0x1180)

When register GPIO2[1:0]=2’b01 and seek or tune finish, a 5ms low pulse will appear at GPIO2 .Both RDSIEN and STCIEN can be high;

When register GPIO2[1:0]=2’b01 and new RDS come, a 5ms low pulse will appear at GPIO2.

Definition at line 176 of file BK108X.h.

Class Members
struct bk_reg04.refined refined
uint16_t raw

◆ bk_reg05

union bk_reg05

Register 05h. System Configuration2 (0x3ddf)

LW and SW Band are only defined at BK1088

AM and Fm Band table ()

BAND value AM band KHz FM band MHz
0 00: LW 153~279 FULL 64~108
1 10: MW 520~1710 East Europe 64~76
2 10: SW 2.3~21.85 Japan 76~91
3 11: MW 522~1710 Europe 87~108

AM and FM Channel Space

BAND value AM Space KHz FM Space KHz
0 1 10
1 5 50
2 9 100
3 10 200
See also
bk_reg07

Definition at line 218 of file BK108X.h.

Class Members
struct bk_reg05.refined refined
uint16_t raw

◆ bk_reg06

union bk_reg06

Register 06h. System Configuration3 (0x01ef)

SKCNT - Seek Impulse Detection Threshold Allowable number of impulse for a valid seek channel while setting all zeros means not use Impulse number to judge the channel’s validity.

SMUTEA table

Softmute Attenuation Description
0 16 dB (default)
1 14 dB
2 12 dB
3 10 dB

SMUTER table

Softmute Attack/Recover Rate Description
0 fastest (default)
1 fast
2 slow
3 slowest

Definition at line 255 of file BK108X.h.

Class Members
struct bk_reg06.refined refined
uint16_t raw

◆ bk_reg07

union bk_reg07

Register 07h. Test1 (0x0900)

Definition at line 272 of file BK108X.h.

Class Members
struct bk_reg07.refined refined
uint16_t raw

◆ bk_reg08

union bk_reg08

Test 2.

RSSI Threshold for Instant AFC updating; AFC Average Range; Variation Threshold for average AFC calculation;

AFC Average; AFCRL Threshold; AFC/RSSI/SNR Calculate Rate; AFC Enable

Definition at line 298 of file BK108X.h.

Class Members
struct bk_reg08.refined refined
uint16_t raw

◆ bk_reg09

union bk_reg09

Register 09h. Status1 (0x0000)

Definition at line 317 of file BK108X.h.

Class Members
struct bk_reg09.refined refined
uint16_t raw

◆ bk_reg0a

union bk_reg0a

Register 0Ah. Status2 (0x0000)

Definition at line 331 of file BK108X.h.

Class Members
struct bk_reg0a.refined refined
uint16_t raw

◆ bk_reg0b

union bk_reg0b

Register 0Bh. Read Channel (0x0000)

Definition at line 351 of file BK108X.h.

Class Members
struct bk_reg0b.refined refined
uint16_t raw

◆ bk_reg0c

union bk_reg0c

Register 0Ch. RDS1 (0x0000)

RDS Block A - The First Register of RDS Received

Definition at line 366 of file BK108X.h.

Class Members
struct bk_reg0c.rds_status rds_status
struct bk_reg0c.refined refined
uint16_t raw

◆ bk_reg0d

union bk_reg0d

Register 0Dh. RDS2 (0x0000)

RDS Block B - The second register of RDS received

Definition at line 391 of file BK108X.h.

Class Members
struct bk_reg0d.refined refined
uint16_t raw

◆ bk_reg0e

union bk_reg0e

Register 0Eh. RDS2 (0x0000)

RDS Block C - The third register of RDS received

Definition at line 406 of file BK108X.h.

Class Members
struct bk_reg0e.refined refined
uint16_t raw

◆ bk_reg0f

union bk_reg0f

Register 0Fh. RDS4 (0x0000)

RDS Block D - The fourth register of RDS received when read

Definition at line 421 of file BK108X.h.

Class Members
struct bk_reg0f.refined refined
uint16_t raw

◆ bk_reg10

union bk_reg10

Register 10h. Boot Configuration1 (0x7b11)

Definition at line 435 of file BK108X.h.

Class Members
struct bk_reg10.refined refined
uint16_t raw

◆ bk_reg11

union bk_reg11

Register 11h. Boot Configuration2 (0x0080)

Definition at line 449 of file BK108X.h.

Class Members
struct bk_reg11.refined refined
uint16_t raw

◆ bk_reg12

union bk_reg12

Register 12h. Boot Configuration3 (0x4000)

Definition at line 463 of file BK108X.h.

Class Members
struct bk_reg12.refined refined
uint16_t raw

◆ bk_reg13

union bk_reg13

Register 13h. Boot Configuration4 (0x3e00)

Definition at line 477 of file BK108X.h.

Class Members
struct bk_reg13.refined refined
uint16_t raw

◆ bk_reg14

union bk_reg14

Register 14h. Boot Configuration5 (0x0000)

Definition at line 491 of file BK108X.h.

Class Members
struct bk_reg14.refined refined
uint16_t raw

◆ bk_reg15

union bk_reg15

15h. Boot Configuration6 (0x0000)

Definition at line 507 of file BK108X.h.

Class Members
struct bk_reg15.refined refined
uint16_t raw

◆ bk_reg16

union bk_reg16

Register 16h. Boot Configuration7 (0x0400)

Definition at line 521 of file BK108X.h.

Class Members
struct bk_reg16.refined refined
uint16_t raw

◆ bk_reg17

union bk_reg17

Register 17h. Boot Configuration8 (0x0001)

Definition at line 535 of file BK108X.h.

Class Members
struct bk_reg17.refined refined
uint16_t raw

◆ bk_reg18

union bk_reg18

Register 18h. Boot Configuration9 (0x143c)

Definition at line 549 of file BK108X.h.

Class Members
struct bk_reg18.refined refined
uint16_t raw

◆ bk_reg19

union bk_reg19

Register 19h. Boot Configuration10 (0x4351)

Definition at line 563 of file BK108X.h.

Class Members
struct bk_reg19.refined refined
uint16_t raw

◆ bk_reg1A

union bk_reg1A

Register 1Ah. Boot Configuration11 (0x0000)

Definition at line 577 of file BK108X.h.

Class Members
struct bk_reg1A.refined refined
uint16_t raw

◆ bk_reg1B

union bk_reg1B

Register 1Bh. Analog Configuration1 (0x0000)

Definition at line 592 of file BK108X.h.

Class Members
struct bk_reg1B.refined refined
uint16_t raw

◆ bk_reg1C

union bk_reg1C

Register 1Ch. Analog Configuration2 (0x0000)

Definition at line 604 of file BK108X.h.

Class Members
struct bk_reg1C.refined refined
uint16_t raw

◆ bk_reg1D

union bk_reg1D

Register 1Dh. Analog Configuration2 (0x0000)

Definition at line 618 of file BK108X.h.

Class Members
struct bk_reg1D.refined refined
uint16_t raw //!< Reference clock divider control , FREQ_SEL[17:0] = HEX | Ref Frequency/512+0.5 | Default 16 for 32.768kHz reference.

◆ bk_rds_blockb

union bk_rds_blockb

RDS Block B data type.

For GCC on System-V ABI on 386-compatible (32-bit processors), the following stands:

1) Bit-fields are allocated from right to left (least to most significant). 2) A bit-field must entirely reside in a storage unit appropriate for its declared type. Thus a bit-field never crosses its unit boundary. 3) Bit-fields may share a storage unit with other struct/union members, including members that are not bit-fields. Of course, struct members occupy different parts of the storage unit. 4) Unnamed bit-fields' types do not affect the alignment of a structure or union, although individual bit-fields' member offsets obey the alignment constraints.

See also
also https://en.wikipedia.org/wiki/Radio_Data_System

Definition at line 652 of file BK108X.h.

Class Members
struct bk_rds_blockb.group0 group0
struct bk_rds_blockb.group2 group2
struct bk_rds_blockb.refined refined
uint16_t blockB

◆ bk_rds_date_time

union bk_rds_date_time

Group RDS type 4A ( RDS Date and Time) When group type 4A is used by the station, it shall be transmitted every minute according to EN 50067. This Structure uses blocks 2,3 and 5 (B,C,D)

ATTENTION: To make it compatible with 8, 16 and 32 bits platforms and avoid Crosses boundary, it was necessary to split minute and hour representation.

Definition at line 696 of file BK108X.h.

Class Members
struct bk_rds_date_time.refined refined
uint8_t raw[6]

◆ word16_to_bytes

union word16_to_bytes

Converts 16 bits word to two bytes.

Definition at line 713 of file BK108X.h.

Class Members
struct word16_to_bytes.refined refined
uint16_t raw

◆ BK108X

class BK108X

KT0915 Class.

<>

This class implements all functions that will help you to control the KT0915 devices.

Author
PU2CLR - Ricardo Lima Caratti

Definition at line 732 of file BK108X.h.

Public Member Functions

void setI2C (uint8_t i2c_addr=I2C_DEVICE_ADDR)
 Sets I2C bus address.
 
void i2cInit (int pin_sdio, int pin_sclk)
 Sets the MCU pins connected to the I2C bus.
 
void i2cBeginTransaction ()
 Starts the I2C bus transaction.
 
void i2cEndTransaction ()
 Finish the I2C bus transaction.
 
void i2cAck ()
 Sends Acknowledge (ACK)
 
void i2cNack ()
 Sends Not Acknowledge (ACK)
 
uint8_t i2cReceiveAck ()
 Gets Acknowledge (ACK)
 
void i2cWriteByte (uint8_t data)
 Sends a Byte to the slave device.
 
uint8_t i2cReadByte ()
 Gets a Byte from the slave device.
 
void writeRegister (uint8_t reg, uint16_t vakue)
 Sends an array of values to a BK108X given register.
 
uint16_t readRegister (uint8_t reg)
 Gets an array of values from a BK108X given register.
 
void reset ()
 Resets the device.
 
void powerUp ()
 Powers the receiver on.
 
void powerDown ()
 Powers the receiver off.
 
void waitAndFinishTune ()
 Wait STC (Seek/Tune Complete) status becomes 0.
 
void setI2CAddress (int bus_addr)
 Sets the I2C bus address.
 
void setDelayAfterCrystalOn (uint8_t ms_value)
 Set the Delay After Crystal On (default 500ms)
 
uint16_t getRegister (uint8_t reg)
 Gets a givens current register content of the device.
 
void setRegister (uint8_t reg, uint16_t value)
 Sets a given value to the device registers.
 
bk_reg0a getStatus ()
 Gets the current status (register 0x0A) content.
 
uint16_t getShadownRegister (uint8_t register_number)
 Get the Shadown Register object.
 
void setShadownRegister (uint8_t register_number, uint16_t value)
 Sets a given value to the Shadown Register.
 
uint16_t getDeviceId ()
 Returns the Device Indentifiction.
 
uint16_t getChipId ()
 Returns the Chip Indentifiction.
 
void setup (int sda_pin, int sclk_pin, uint8_t oscillator_type=OSCILLATOR_TYPE_CRYSTAL, uint32_t oscillator_frequency=32768)
 Starts the device.
 
void setFM (uint16_t minimum_frequency, uint16_t maximum_frequency, uint16_t default_frequency, uint16_t step)
 Sets the receiver to FM mode.
 
void setAM (uint16_t minimum_frequency, uint16_t maximum_frequency, uint16_t default_frequency, uint16_t step, uint16_t am_space=0)
 Sets the receiver to AM mode.
 
void setFMGain (uint8_t value=0)
 set the FM gain.
 
uint8_t getCurrentMode ()
 Get the Current Mode (AM or FM)
 
void setStereoThresholdPilotStrength (uint8_t value)
 Sets the Stereo Threshold of Pilotto Strength.
 
void setFmDeemphasis (uint8_t de)
 Sets De-emphasis.
 
void setTimeCallStrengthPilot (uint8_t value)
 Sets the time used to call the strength of pilot.
 
void setGpio2 (uint8_t value)
 Sets the Gpio2.
 
void setGpio3 (uint8_t value)
 Sets the Gpio3.
 
void setAfc (bool value)
 Enables or Disables AFC.
 
void AfcRail (bool value)
 Sets AFC Rail.
 
void setAfcRssiSnrCalculateRate (uint8_t value)
 Sets AFC/RSSI/SNR Calculate Rate.
 
void setAfcThreshold (uint8_t value)
 Sets AFCRL Threshold.
 
void setAfcAve (uint8_t value)
 Sets AFC Average.
 
void setAfcVar (uint8_t value)
 Sets Variation Threshold for average AFC calculation.
 
void setAfcRange (uint8_t value)
 Sets AFC range.
 
void setAfcRssiThreshold (uint8_t value)
 Sets RSSI Threshold for Instant AFC updating.
 
void setFrequency (uint16_t frequency)
 Sets the FM frequency.
 
void setFrequencyUp ()
 Increments the current frequency.
 
void setFrequencyDown ()
 Decrements the current frequency.
 
uint16_t getFrequency ()
 Gets the current frequency.
 
uint16_t getChannel ()
 Gets the current channel.
 
uint16_t getRealFrequency ()
 Gets the frequency based on READCHAN register (0x0B)
 
uint16_t getRealChannel ()
 Gets the current channel stored in register 0x0B.
 
void setChannel (uint16_t channel)
 Sets the channel.
 
void seekHardware (uint8_t seek_mode, uint8_t direction, void(*showFunc)()=NULL)
 Seeks a station via hardware functionality.
 
void seekSoftware (uint8_t seek_mode, uint8_t direction, void(*showFunc)()=NULL)
 Seeks a station via Software.
 
void seek (uint8_t seek_mode, uint8_t direction, void(*showFunc)()=NULL)
 
void setSeekThreshold (uint8_t rssiValue, uint8_t snrValue)
 Sets RSSI and SNR Seek Threshold.
 
void setBand (uint8_t band=1)
 Sets the current band for AM or FM.
 
void setSpace (uint8_t space=0)
 Sets the Space channel for AM or FM.
 
int getRssi ()
 Gets the current Rssi.
 
int getSnr ()
 Gets the current SNR.
 
void setSoftMute (bool value)
 Sets the Softmute true or false.
 
void setSoftMuteAttack (uint8_t value)
 Sets Softmute Attack/Recover Rate.
 
void setSoftMuteAttenuation (uint8_t value)
 Sets Softmute Attenuation.
 
void setMuteThreshold (uint8_t rssi, uint8_t snr)
 Set the Mute Threshold based on RSSI and SNR.
 
void setSeekMute (bool value)
 Disable or Enable soft mute when seeking.
 
void setAfcMute (bool value)
 Disable or Enable soft mute when AFCRL is high.
 
void setMono (bool value)
 Sets the Mono true or false (stereo)
 
bool isStereo ()
 Checks stereo / mono status.
 
void setAudioMute (bool left, bool right)
 Sets the Mute true or false.
 
void setAudioMute (bool value)
 Sets the Mute true or false.
 
void setVolume (uint8_t value)
 Sets the audio volume level.
 
uint8_t getVolume ()
 Gets the current audio volume level.
 
void setVolumeUp ()
 Increments the audio volume.
 
void setVolumeDown ()
 Decrements the audio volume.
 
void setRdsMode (uint8_t rds_mode=0)
 Sets the Rds Mode Standard or Verbose.
 
void setRds (bool value, bool interrupt_enable=false)
 Sets the RDS operation.
 
void setRDS (bool value, bool interrupt_enable=false)
 
bool getRdsReady ()
 Returns true if RDS Ready.
 
uint8_t getRdsFlagAB (void)
 Returns the current Text Flag A/B.
 
uint8_t getRdsVersionCode (void)
 Gets the version code (extracted from the Block B)
 
uint16_t getRdsGroupType ()
 Return the group type - Gets the Group Type (extracted from the Block B)
 
uint8_t getRdsProgramType (void)
 Returns the Program Type (extracted from the Block B)
 
void getNext2Block (char *c)
 Process data received from group 2B - Station Name.
 
void getNext4Block (char *c)
 Processes data received from group 2A.
 
char * getRdsText (void)
 Gets the RDS Text when the message is of the Group Type 2 version A.
 
char * getRdsText0A (void)
 Gets the Station Name and other messages.
 
char * getRdsText2A (void)
 Gets the Text processed for the 2A group.
 
char * getRdsText2B (void)
 Gets the Text processed for the 2B group.
 
bool getRdsAllData (char **stationName, char **stationInformation, char **programInformation, char **utcTime)
 Gets Station Name, Station Information, Program Information and utcTime.
 
char * getRdsTime ()
 Gets the RDS time and date when the Group type is 4.
 
char * getRdsLocalTime ()
 Gets the RDS time converted to local time.
 
bool getRdsSync ()
 Get the Rds Sync.
 
char * getRdsProgramInformation (void)
 Gets the Program Information (RT - Radio Text)
 
char * getRdsStationInformation (void)
 Gets the Station Information.
 
char * getRdsStationName (void)
 Gets the Station Name.
 
void clearRdsBuffer ()
 Clear RDS Information (Station Name, Station Information, Program Information and Time)
 
int checkI2C (uint8_t *addressArray)
 Check the I2C bus address.
 
void convertToChar (uint16_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.
 
uint16_t * getRegisterValues ()
 Returns the point of uint16_t array (size 32)
 
char * formatFrequency (uint16_t value, char *strValue, char decimalSeparator=',', uint8_t decimalPosition=3)
 Convert a numeric frequency to a formated string (char *) frequency.
 
char * formatCurrentFrequency (char decimalSeparator=',', uint8_t decimalPosition=3)
 Convert the current frequency to a formated string (char *) frequency.
 

Protected Attributes

char rds_buffer2A [65]
 RDS Radio Text buffer - Program Information.
 
char rds_buffer2B [33]
 RDS Radio Text buffer - Station Informaation.
 
char rds_buffer0A [9]
 RDS Basic tuning and switching information (Type 0 groups)
 
char rds_time [20]
 RDS date time received information.
 
uint8_t rds_mode
 
int deviceAddress = I2C_DEVICE_ADDR
 
uint32_t currentFrequency
 
uint32_t minimumFrequency
 
uint32_t maximumFrequency
 
uint16_t currentChannel = 0
 
uint16_t currentStep = 1
 
uint8_t currentFMBand = 0
 
uint8_t currentAMBand = 1
 
uint8_t currentFMSpace = 0
 
uint8_t currentAMSpace = 0
 
uint8_t currentMode = BK_MODE_FM
 
uint8_t currentVolume = 0
 
int rdsInterruptPin = -1
 
int seekInterruptPin = -1
 
int oscillatorType = OSCILLATOR_TYPE_CRYSTAL
 
uint32_t oscillatorFrequency = 32768
 
uint16_t maxDelayAfterCrystalOn = MAX_DELAY_AFTER_OSCILLATOR
 

Member Function Documentation

◆ getDeviceId()

uint16_t BK108X::getDeviceId ( )

Returns the Device Indentifiction.

Returns
device id

Definition at line 307 of file BK108X.cpp.

◆ getChipId()

uint16_t BK108X::getChipId ( )

Returns the Chip Indentifiction.

Returns
IC id

Definition at line 317 of file BK108X.cpp.

◆ setAfcRange()

void BK108X::setAfcRange ( uint8_t  value)
inline

Sets AFC range.

0 = he most strict; 3 = the loosest

Parameters
value0,1,2 or 3

Definition at line 1070 of file BK108X.h.

◆ seek()

void BK108X::seek ( uint8_t  seek_mode,
uint8_t  direction,
void(*)()  showFunc = NULL 
)
inline

Definition at line 1101 of file BK108X.h.

◆ setRDS()

void BK108X::setRDS ( bool  value,
bool  interrupt_enable = false 
)
inline

Definition at line 1132 of file BK108X.h.

References setRds().

Member Data Documentation

◆ rds_buffer2A

char BK108X::rds_buffer2A[65]
protected

RDS Radio Text buffer - Program Information.

Definition at line 788 of file BK108X.h.

Referenced by clearRdsBuffer(), and getRdsText2A().

◆ rds_buffer2B

char BK108X::rds_buffer2B[33]
protected

RDS Radio Text buffer - Station Informaation.

Definition at line 789 of file BK108X.h.

Referenced by clearRdsBuffer(), and getRdsText2B().

◆ rds_buffer0A

char BK108X::rds_buffer0A[9]
protected

RDS Basic tuning and switching information (Type 0 groups)

Definition at line 790 of file BK108X.h.

Referenced by clearRdsBuffer(), and getRdsText0A().

◆ rds_time

char BK108X::rds_time[20]
protected

RDS date time received information.

Definition at line 791 of file BK108X.h.

Referenced by clearRdsBuffer(), getRdsLocalTime(), and getRdsTime().

◆ rds_mode

uint8_t BK108X::rds_mode
protected

Definition at line 793 of file BK108X.h.

◆ deviceAddress

int BK108X::deviceAddress = I2C_DEVICE_ADDR
protected

Definition at line 795 of file BK108X.h.

Referenced by readRegister(), setI2CAddress(), and writeRegister().

◆ currentFrequency

uint32_t BK108X::currentFrequency
protected

Definition at line 797 of file BK108X.h.

◆ minimumFrequency

uint32_t BK108X::minimumFrequency
protected

Definition at line 798 of file BK108X.h.

◆ maximumFrequency

uint32_t BK108X::maximumFrequency
protected

Definition at line 799 of file BK108X.h.

◆ currentChannel

uint16_t BK108X::currentChannel = 0
protected

Definition at line 801 of file BK108X.h.

◆ currentStep

uint16_t BK108X::currentStep = 1
protected

Definition at line 802 of file BK108X.h.

◆ currentFMBand

uint8_t BK108X::currentFMBand = 0
protected

Definition at line 803 of file BK108X.h.

◆ currentAMBand

uint8_t BK108X::currentAMBand = 1
protected

Definition at line 804 of file BK108X.h.

◆ currentFMSpace

uint8_t BK108X::currentFMSpace = 0
protected

Definition at line 805 of file BK108X.h.

◆ currentAMSpace

uint8_t BK108X::currentAMSpace = 0
protected

Definition at line 806 of file BK108X.h.

◆ currentMode

uint8_t BK108X::currentMode = BK_MODE_FM
protected

Definition at line 807 of file BK108X.h.

◆ currentVolume

uint8_t BK108X::currentVolume = 0
protected

Definition at line 809 of file BK108X.h.

◆ rdsInterruptPin

int BK108X::rdsInterruptPin = -1
protected

Definition at line 810 of file BK108X.h.

◆ seekInterruptPin

int BK108X::seekInterruptPin = -1
protected

Definition at line 811 of file BK108X.h.

◆ oscillatorType

int BK108X::oscillatorType = OSCILLATOR_TYPE_CRYSTAL
protected

Definition at line 812 of file BK108X.h.

◆ oscillatorFrequency

uint32_t BK108X::oscillatorFrequency = 32768
protected

Definition at line 813 of file BK108X.h.

◆ maxDelayAfterCrystalOn

uint16_t BK108X::maxDelayAfterCrystalOn = MAX_DELAY_AFTER_OSCILLATOR
protected

Definition at line 815 of file BK108X.h.

◆ bk_reg00.refined

struct bk_reg00.refined

Definition at line 105 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg01.refined

struct bk_reg01.refined

Definition at line 120 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg02.refined

struct bk_reg02.refined

Definition at line 135 of file BK108X.h.

Class Members
uint8_t ENABLE: 1 Powerup Enable;.
uint8_t SNR_REF: 5 Output SNR adjustment. Read SNR = SNR (calculated)
uint8_t DISABLE: 1 Powerup Disable;.
uint8_t SKAFCRL: 1 Seek with AFC Rail; 0 = During seeking, the channel is valid no matter whether AFCRL is high or low; 1 = During seeking, the channel is invalid if AFCRL is high.
uint8_t SEEK: 1 0 = Disable (default); 1 = Enable;
uint8_t SEEKUP: 1 Seek Direction; 0 = Seek down (default); 1 = Seek up.
uint8_t SKMODE: 1 Seek Mode; 0 = Wrap at the upper or lower band limit and continue seeking (default); 1 = Stop seeking at the upper or lower band limit.
uint8_t STEREO: 1 Stereo; 0 = Normal operation; 1 = Force stereo; MONO and STEREO cannot be set to 1 simultaneously.
uint8_t MONO: 1 Mono; 0 = Normal operation; 1 = Force mono.
uint8_t MUTER: 1 Mute R channel; 0 = R channel normal operation; 1 = R channel mute.
uint8_t MUTEL: 1 Mute L channel; 0 = L channel normal operation; 1 = L channel mute.
uint8_t DSMUTE: 1 Softmute Disable; 0 = Softmute enable (default); 1 = Softmute disable.

◆ bk_reg03.refined

struct bk_reg03.refined

Definition at line 161 of file BK108X.h.

Class Members
uint16_t CHAN: 15 Channel Select; The tuned Frequency = Band + CHAN * SPACE.
uint16_t TUNE: 1 Tune. 0 = Disable (default); 1 = Enable.

◆ bk_reg04.refined

struct bk_reg04.refined

Definition at line 178 of file BK108X.h.

Class Members
uint16_t DUMMY: 2 Not used / RESERVED General Purpose I/O 1; 00 = High impedance (default); 01 = CLK38MHz; 10 = Low; 11 = High.
uint16_t GPIO2: 2 General Purpose I/O 2. 00 = High impedance (default); 01 = STC/RDS interrupt; 10 = Low; 11 = High.
uint16_t GPIO3: 2 General Purpose I/O 2. 00 = High impedance (default); 01 = Mono/Stereo indicator (ST); 10 = Low; 11 = High.
uint16_t PILOTS: 3 Stereo/Mono Blend Level Adjustment. Sets the RSSI range for stereo/mono blend. See table above.
uint16_t TCPILOT: 2 The Time Used to Cal The Strength of Pilot.
uint16_t DE: 1 De-emphasis; 0 = 75 μs. Used in USA (default); 1 = 50 μs. Used in Europe, Australia, Japan.
uint16_t RDSEN: 1 RDS Enable; 0 = Disable (default); 1 = Enable.
uint16_t AFCINV: 1 AFC Invert; 0 = Normal AFC into mixer; 1 = Reverse AFC into mixer.
uint16_t STCIEN: 1 Seek/Tune Complete Interrupt Enable; 0 = Disable Interrupt (default); 1 = Enable Interrupt. See details above.
uint16_t RDSIEN: 1 RDS Interrupt Enable; 0 = Disable Interrupt (default); 1 = Enable Interrupt. See details above.

◆ bk_reg05.refined

struct bk_reg05.refined

Definition at line 220 of file BK108X.h.

Class Members
uint16_t VOLUME: 5 0x00 is the lowest and 0x1F is highest (0dBFS). 2dB each
uint16_t SPACE: 2 Channel Spacing; See AM and FM Channel Space table above.
uint16_t BAND: 2 Band Select. See AM and Fm Band table above.
uint16_t SEEKTH: 7 RSSI Seek Threshold. 0x00 = min RSSI (default); 0x7F = max RSSI.

◆ bk_reg06.refined

struct bk_reg06.refined

Definition at line 257 of file BK108X.h.

Class Members
uint16_t SKCNT: 4 See details above.
uint16_t SKSNR: 7 Seek SNR Threshold. Required channel SNR for a valid seek channel.
uint16_t CLKSEL: 1 Clock Select. 0 = External clock input; 1= Internal oscillator input.
uint16_t SMUTEA: 2 Softmute Attenuation; See table above.
uint16_t SMUTER: 2 Softmute Attack/Recover Rate; See table above.

◆ bk_reg07.refined

struct bk_reg07.refined

Definition at line 274 of file BK108X.h.

Class Members
uint16_t FMGAIN: 3 The gain of Frequency demodulated; 000 = 0dB ... 011= +18dB; 100= 0dB ... 111= -18dB.
uint16_t RESERVED:3
uint16_t STHYS_SEL: 1 ST/MONO Transition Hysterisis Select. 0 = 6dB; 1=2dB.
uint16_t DACCK_SEL: 1 DAC Clock Select.
uint16_t IMPTH: 2 Threshold of Impulse Detect. 00 = toughest; 11 = loosest.
uint16_t BPDE: 1 De-emphasis Bypass; 0 = Normal operation; 1 = Bypass de-emphasis.
uint16_t IMPEN: 1 Impulse Remove Enable; 0 = Disable; 1 = Enable.
uint16_t SIQ: 1 IF I/Q Signal switch; 0 = Normal operation; 1 = Reversed I/Q signal.
uint16_t MODE: 1 0 = FM receiver; 1 = AM receiver
uint16_t LINEIN_EN: 1 Audio Line in Enable; 0 = Disable (Receiver Mode)
uint16_t LINEIN_SEL: 1 Audio Line in Channel Select; 0 = Channel 1; 1=Channel 2 ((QFN24 only support one line in channel))

◆ bk_reg08.refined

struct bk_reg08.refined

Definition at line 300 of file BK108X.h.

Class Members
uint16_t AFCRSSIT: 7 RSSI Threshold for Instant AFC updating.
uint16_t RANGE: 2 AFC Average Range; 00 = the toughest; 11 = the loosest.
uint16_t VAR: 2 Variation Threshold for average AFC calculation; 00 = Disable; 01 = the toughest; 11 = the loosest.
uint16_t AVE: 1 AFC Average.
uint16_t SEL25K: 1 AFCRL Threshold; 0 = Channel space/2; 1 = 25kHz.
uint16_t TCSEL: 2 AFC/RSSI/SNR Calculate Rate; 00 = fastest; 11 = slowest. 4X times each.
uint16_t AFCEN: 1 AFC Enable; 0 = Disable; 1 = Enable.

◆ bk_reg09.refined

struct bk_reg09.refined

Definition at line 319 of file BK108X.h.

Class Members
uint16_t SNR:7 The AFC value.
uint16_t AFC:9 unit AM 0.15k Hz, FM 0.6k Hz

◆ bk_reg0a.refined

struct bk_reg0a.refined

Definition at line 333 of file BK108X.h.

Class Members
uint16_t RSSI: 7 RSSI (Received Signal Strength Indicator).
uint16_t ST: 1 Stereo Indicator; 0 = Mono; 1 = Stereo.
uint16_t STEN: 1 Impulse Number.
uint16_t DUMMY: 3
uint16_t AFCRL: 1 AFC Rail; 0 = AFC not railed; 1 = AFC railed.
uint16_t SF_BL: 1 Seek Fail/Band Limit; 0 = Seek successful; 1 = Seek failure/Band limit reached.
uint16_t STC: 1 Seek/Tune Complete; 0 = Not complete (default); 1 = Complete.
uint16_t RDSR: 1 RDS Ready; 0 = No RDS group ready (default); 1 = New RDS group ready. Keep high for 40ms after new RDS is received.

◆ bk_reg0b.refined

struct bk_reg0b.refined

Definition at line 353 of file BK108X.h.

Class Members
uint16_t READCHAN: 14 Read Channel. Provides the current working channel.
uint16_t RESERVED: 2

◆ bk_reg0c.rds_status

struct bk_reg0c.rds_status

Definition at line 368 of file BK108X.h.

Class Members
uint16_t BLERB: 2 Block Errors Level of RDS_DATA_1.
uint16_t BLERA: 2 Block Errors Level of RDS_DATA_0.
uint16_t ABCD_E: 1 1 = the block id of register 0cH,0dH,0eH,0fH is E; 0 = the block id of register 0cH, 0dH, 0eH,0fH is A, B, C, D
uint16_t DUMMY: 2
uint16_t FM_READY: 1 1=ready; 0=not ready.
uint16_t FM_TRUE: 1 1 = the current channel is a station; 0 = the current channel is not a station.
uint16_t RSSI: 7 RSSI; 000000 = min; 111111 = max; RSSI scale is logarithmic.

◆ bk_reg0c.refined

struct bk_reg0c.refined

Definition at line 378 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg0d.refined

struct bk_reg0d.refined

Definition at line 393 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg0e.refined

struct bk_reg0e.refined

Definition at line 408 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg0f.refined

struct bk_reg0f.refined

Definition at line 423 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg10.refined

struct bk_reg10.refined

Definition at line 437 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg11.refined

struct bk_reg11.refined

Definition at line 451 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg12.refined

struct bk_reg12.refined

Definition at line 465 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg13.refined

struct bk_reg13.refined

Definition at line 479 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg14.refined

struct bk_reg14.refined

Definition at line 493 of file BK108X.h.

Class Members
uint16_t RSSIMTH: 7 The Mute Threshold Based on RSSI.
uint16_t SNRMTH: 7 The Mute Threshold Based on SNR.
uint16_t AFCMUTE: 1 0: disable soft mute when AFCRL is high; 1: enable soft mute when AFCRL is high
uint16_t SKMUTE: 1 0: disable soft mute when seeking; 1: enable soft mute when seeking

◆ bk_reg15.refined

struct bk_reg15.refined

Definition at line 509 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg16.refined

struct bk_reg16.refined

Definition at line 523 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg17.refined

struct bk_reg17.refined

Definition at line 537 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg18.refined

struct bk_reg18.refined

Definition at line 551 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg19.refined

struct bk_reg19.refined

Definition at line 565 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte

◆ bk_reg1A.refined

struct bk_reg1A.refined

Definition at line 579 of file BK108X.h.

Class Members
uint16_t RESERVED1: 3
uint16_t ANT_SEL: 5 Antenna varactor tune.
uint16_t RESERVED2: 4

◆ bk_reg1B.refined

struct bk_reg1B.refined

Definition at line 594 of file BK108X.h.

Class Members
uint16_t RESERVED

◆ bk_reg1C.refined

struct bk_reg1C.refined

Definition at line 606 of file BK108X.h.

Class Members
uint16_t RESERVED: 14
uint16_t FREQ_SEL: 2 Reference clock divider control ,Refer to Reg1D Default 0 for 32.768kHz reference input.

◆ bk_reg1D.refined

struct bk_reg1D.refined

Definition at line 620 of file BK108X.h.

Class Members
uint16_t FREQ_SEL

◆ bk_rds_blockb.group0

struct bk_rds_blockb.group0

Definition at line 654 of file BK108X.h.

Class Members
uint16_t address: 2
uint16_t DI: 1
uint16_t MS: 1
uint16_t TA: 1
uint16_t programType: 5
uint16_t trafficProgramCode: 1
uint16_t versionCode: 1
uint16_t groupType: 4

◆ bk_rds_blockb.group2

struct bk_rds_blockb.group2

Definition at line 665 of file BK108X.h.

Class Members
uint16_t address: 4
uint16_t textABFlag: 1
uint16_t programType: 5
uint16_t trafficProgramCode: 1
uint16_t versionCode: 1
uint16_t groupType: 4

◆ bk_rds_blockb.refined

struct bk_rds_blockb.refined

Definition at line 674 of file BK108X.h.

Class Members
uint16_t content: 4
uint16_t textABFlag: 1
uint16_t programType: 5
uint16_t trafficProgramCode: 1
uint16_t versionCode: 1
uint16_t groupType: 4

◆ bk_rds_date_time.refined

struct bk_rds_date_time.refined

Definition at line 698 of file BK108X.h.

Class Members
uint32_t offset: 5
uint32_t offset_sense: 1
uint32_t minute: 6
uint32_t hour: 5
uint32_t mjd: 17

◆ word16_to_bytes.refined

struct word16_to_bytes.refined

Definition at line 715 of file BK108X.h.

Class Members
uint8_t lowByte
uint8_t highByte