PU2CLR SI470X Arduino Library  1.0.1
Arduino Library for Si470X Devices - By Ricardo Lima Caratti
Union, Structure and Defined Data Types


More...

Data Structures

union  si470x_reg00
 Device ID. More...
 
struct  si470x_reg00.refined
 
union  si470x_reg01
 Chip ID. More...
 
struct  si470x_reg01.refined
 
union  si470x_reg02
 Power Configuratio. More...
 
struct  si470x_reg02.refined
 
union  si470x_reg03
 Channe. More...
 
struct  si470x_reg03.refined
 
union  si470x_reg04
 System Configuration 1. More...
 
struct  si470x_reg04.refined
 
union  si470x_reg05
 System Configuration 2. More...
 
struct  si470x_reg05.refined
 
union  si470x_reg06
 System Configuration 3. More...
 
struct  si470x_reg06.refined
 
union  si470x_reg07
 Test 1. More...
 
struct  si470x_reg07.refined
 
union  si470x_reg08
 Test 2. More...
 
struct  si470x_reg08.refined
 
union  si470x_reg09
 Boot Configuration. More...
 
struct  si470x_reg09.refined
 
union  si470x_reg0a
 Status RSSI. More...
 
struct  si470x_reg0a.refined
 
union  si470x_reg0b
 Read Channel. More...
 
struct  si470x_reg0b.refined
 
union  si47x_rds_blockb
 RDS Block B data type. More...
 
struct  si47x_rds_blockb.group0
 
struct  si47x_rds_blockb.group2
 
struct  si47x_rds_blockb.refined
 
union  si47x_rds_date_time
 
struct  si47x_rds_date_time.refined
 
union  word16_to_bytes
 Converts 16 bits word to two bytes. More...
 
struct  word16_to_bytes.refined
 
class  SI470X
 KT0915 Class. More...
 

Typedefs

typedef uint16_t si470x_reg0c
 RDS Block A. More...
 
typedef uint16_t si470x_reg0d
 RDS Block B. More...
 
typedef uint16_t si470x_reg0e
 RDS Block C. More...
 
typedef uint16_t si470x_reg0f
 RDS Block D. More...
 

Detailed Description


SI470X Defined Data Types

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

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

The information shown here was extracted from Datasheet:

SI470X 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


Data Structure Documentation

◆ si470x_reg00

union si470x_reg00

Device ID.

Data Fields
struct si470x_reg00 refined
uint16_t raw

◆ si470x_reg00.refined

struct si470x_reg00.refined
Data Fields
uint16_t MFGID: 12 Manufacturer ID.
uint16_t PN: 4 Part Number.

◆ si470x_reg01

union si470x_reg01

Chip ID.

Data Fields
struct si470x_reg01 refined
uint16_t raw

◆ si470x_reg01.refined

struct si470x_reg01.refined
Data Fields
uint16_t FIRMWARE: 6 Firmware Version.
uint16_t DEV: 4 0 before powerup; 0001 after powerup = Si4702; 1000 before powerup = Si4703; 1001 after powerup = Si4703.
uint16_t REV: 6 Chip Version; 0x04 = Rev C.

◆ si470x_reg02

union si470x_reg02

Power Configuratio.

Data Fields
struct si470x_reg02 refined
uint16_t raw

◆ si470x_reg02.refined

struct si470x_reg02.refined
Data Fields
uint8_t ENABLE: 1 Powerup Enable; Refer to “4.9. Reset, Powerup, and Powerdown”; Default = 0.
uint8_t RESERVED1: 5 Reserved; Always write to 0.
uint8_t DISABLE: 1 Powerup Disable; Refer to “4.9. Reset, Powerup, and Powerdown”; Default = 0.
uint8_t RESERVED2: 1 Reserved; Always write to 0.
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 RDSM: 1 RDS Mode; 0 = Standard (default); 1 = Verbose; Refer to “4.4. RDS/RBDS Processor and Functionality”.
uint8_t RESERVED3: 1 Reserved; Always write to 0.
uint8_t MONO: 1 Mono Select; 0 = Stereo (default); 1 = Force mono.
uint8_t DMUTE: 1 Mute Disable; 0 = Mute enable (default); 1 = Mute disable.
uint8_t DSMUTE: 1 Softmute Disable; 0 = Softmute enable (default); 1 = Softmute disable.

◆ si470x_reg03

union si470x_reg03

Channe.

Channel value for tune operation. If BAND 05h[7:6] = 00, then Freq (MHz) = Spacing (MHz) x Channel + 87.5 MHz.

If BAND 05h[7:6] = 01, BAND 05h[7:6] = 10, then Freq (MHz) = Spacing (MHz) x Channel + 76 MHz.

CHAN[9:0] is not updated during a seek operation. READCHAN[9:0] provides the current tuned channel and is updated during a seek operation and after a seek or tune operation completes. Channel spacing is set with the bits SPACE 05h[5:4].

The tune operation begins when the TUNE bit is set high. The STC bit is set high when the tune operation completes. The STC bit must be set low by setting the TUNE bit low before the next tune or seek may begin.

Data Fields
struct si470x_reg03 refined
uint16_t raw

◆ si470x_reg03.refined

struct si470x_reg03.refined
Data Fields
uint16_t CHAN: 10 Channel Select;.
uint16_t RESERVED: 5 Reserved; Always write to 0;.
uint16_t TUNE: 1 Tune. 0 = Disable (default); 1 = Enable.

◆ si470x_reg04

union si470x_reg04

System Configuration 1.

Setting STCIEN = 1 will generate a 5 ms low pulse on GPIO2 when the STC 0Ah[14] bit is set.

Setting RDSIEN = 1 will generate a 5 ms low pulse on GPIO2 when the RDSR 0Ah[15] bit is set.

Setting STCIEN = 1 and GPIO2[1:0] = 01 will generate a 5 ms low pulse on GPIO2 when the STC 0Ah[14] bit is set.

BLNDADJ value Description
0 31–49 RSSI dBμV (default)
1 37–55 RSSI dBμV (+6 dB)
2 19–37 RSSI dBμV (–12 dB)
3 25–43 RSSI dBμV (–6 dB)
Data Fields
struct si470x_reg04 refined
uint16_t raw

◆ si470x_reg04.refined

struct si470x_reg04.refined
Data Fields
uint8_t GPIO1: 2 General Purpose I/O 1; 00 = High impedance (default); 01 = Reserved; 10 = Low; 11 = High.
uint8_t GPIO2: 2 General Purpose I/O 2. 00 = High impedance (default); 01 = Reserved; 10 = Low; 11 = High.
uint8_t GPIO3: 2 General Purpose I/O 2. 00 = High impedance (default); 01 = Reserved; 10 = Low; 11 = High.
uint8_t BLNDADJ: 2 Stereo/Mono Blend Level Adjustment. Sets the RSSI range for stereo/mono blend. See table above.
uint8_t RESERVED1: 2 Reserved; Always write to 0.
uint8_t AGCD: 1 AGC Disable; 0 = AGC enable (default); 1 = AGC disable.
uint8_t DE: 1 De-emphasis; 0 = 75 μs. Used in USA (default); 1 = 50 μs. Used in Europe, Australia, Japan.
uint8_t RDS: 1 RDS Enable; 0 = Disable (default); 1 = Enable.
uint8_t RESERVED2: 1 Reserved; Always write to 0.
uint8_t STCIEN: 1 Seek/Tune Complete Interrupt Enable; 0 = Disable Interrupt (default); 1 = Enable Interrupt.
uint8_t RDSIEN: 1 RDS Interrupt Enable; 0 = Disable Interrupt (default); 1 = Enable Interrupt.

◆ si470x_reg05

union si470x_reg05

System Configuration 2.

SEEKTH presents the logarithmic RSSI threshold for the seek operation. The Si4702/03-C19 will not validate channels with RSSI below the SEEKTH value. SEEKTH is one of multiple parameters that can be used to validate channels. For more information, see "AN284: Si4700/01 Firmware 15 Seek Adjustability and Set- tings."

BAND value Description
0 00 = 87.5–108 MHz (USA, Europe) (Default)
1 01 = 76–108 MHz (Japan wide band)
2 10 = 76–90 MHz (Japan)
3 11 = Reserved
Data Fields
struct si470x_reg05 refined
uint16_t raw

◆ si470x_reg05.refined

struct si470x_reg05.refined
Data Fields
uint8_t VOLUME: 4 Relative value of volume is shifted –30 dBFS with the VOLEXT 06h[8] bit; 0000 = mute (default);.
uint8_t SPACE: 2 Channel Spacing; 00 = 200 kHz (USA, Australia) (default); 01 = 100 kHz (Europe, Japan); 10 = 50 kHz.
uint8_t BAND: 2 Band Select. See table above.
uint8_t SEEKTH RSSI Seek Threshold. 0x00 = min RSSI (default); 0x7F = max RSSI.

◆ si470x_reg06

union si470x_reg06

System Configuration 3.

The VOLEXT bit attenuates the output by 30 dB. With the bit set to 0, the 15 volume settings adjust the volume between 0 and –28 dBFS. With the bit set to 1, the 15 volume set- tings adjust the volume between –30 and –58 dBFS.

Refer to 4.5. "Stereo Audio Processing" on page 16.

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

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

Data Fields
struct si470x_reg06 refined
uint16_t raw

◆ si470x_reg06.refined

struct si470x_reg06.refined
Data Fields
uint8_t SKCNT: 4 Seek FM Impulse Detection Threshold; 0000 = disabled (default); 0001 = max (most stops); 1111 = min (fewest stops). Allowable number of FM impulses for a valid seek channel.
uint8_t SKSNR: 4 Seek SNR Threshold; 0000 = disabled (default); 0001 = min (most stops); 0111 = max (fewest stops); Required channel SNR for a valid seek channel.
uint8_t VOLEXT: 1 Extended Volume Range; 0 = disabled (default); 1 = enabled.
uint8_t RESERVED: 3 Reserved; Always write to zero.
uint8_t SMUTEA: 2 Softmute Attenuation; See table above.
uint8_t SMUTER: 2 Softmute Attack/Recover Rate; See table above.

◆ si470x_reg07

union si470x_reg07

Test 1.

Setting AHIZEN maintains a dc bias of 0.5 x VIO on the LOUT and ROUT pins to pre- vent the ESD diodes from clamping to the VIO or GND rail in response to the output swing of another device.

Register 07h containing the AHIZEN bit must not be written during the powerup sequence and high-Z only takes effect when in powerdown and VIO is supplied. Bits 13:0 of register 07h must be preserved as 0x0100 while in pow- erdown and as 0x3C04 while in powerup.

The internal crystal oscillator requires an external 32.768 kHz crystal as shown in "Typical Application Schematic" on page 14.

The oscillator must be enabled before powerup (ENABLE = 1) as shown in Figure 9, “Initialization Sequence,” on page 21. It should only be disabled after powerdown (ENABLE = 0).

Bits 13:0 of register 07h must be preserved as 0x0100 while in powerdown and as 0x3C04 while in powerup. Refer to Si4702/03 Internal Crystal Oscillator Errata.

Data Fields
struct si470x_reg07 refined
uint16_t raw

◆ si470x_reg07.refined

struct si470x_reg07.refined
Data Fields
uint16_t RESERVED: 14 Reserved; If written, these bits should be read first and then written with their pre-existing val- ues. Do not write during powerup.
uint16_t AHIZEN: 1 Audio High-Z Enable; 0 = Disable (default); 1 = Enable.
uint16_t XOSCEN: 1 Crystal Oscillator Enable; 0 = Disable (default); 1 = Enable.

◆ si470x_reg08

union si470x_reg08

Test 2.

If written, these bits should be read first and then written with their pre-existing val- ues. Do not write during powerup.

Data Fields
struct si470x_reg08 refined
uint16_t raw

◆ si470x_reg08.refined

struct si470x_reg08.refined
Data Fields
uint8_t lowByte Reserved.
uint8_t highByte Reserved.

◆ si470x_reg09

union si470x_reg09

Boot Configuration.

If written, these bits should be read first and then written with their pre-existing val- ues. Do not write during powerup.

Data Fields
struct si470x_reg09 refined
uint16_t raw

◆ si470x_reg09.refined

struct si470x_reg09.refined
Data Fields
uint8_t lowByte Reserved.
uint8_t highByte Reserved.

◆ si470x_reg0a

union si470x_reg0a

Status RSSI.

RSSI is measured units of dBμV in 1 dB increments with a maximum of approximately 75 dBμV. Si4702/03-C19 does not report RSSI levels greater than 75 dBuV.

AFCRL is updated after a tune or seek operation completes and indicates a valid or invalid channel. During normal operation, AFCRL is updated to reflect changing RF envi- ronments.

The SF/BL flag is set high when SKMODE 02h[10] = 0 and the seek operation fails to find a channel qualified as valid according to the seek parameters.

The SF/BL flag is set high when SKMODE 02h[10] = 1 and the upper or lower band limit has been reached. The SEEK 02h[8] bit must be set low to clear SF/BL.

The seek/tune complete flag is set when the seek or tune operation completes. Setting the SEEK 02h[8] or TUNE 03h[15] bit low will clear STC.

RDS Block A Errors Description
0 0 errors requiring correction
1 1–2 errors requiring correction
2 3–5 errors requiring correction
3 6+ errors or error in checkword, correction not possible
Data Fields
struct si470x_reg0a refined
uint16_t raw

◆ si470x_reg0a.refined

struct si470x_reg0a.refined
Data Fields
uint8_t RSSI RSSI (Received Signal Strength Indicator).
uint8_t ST: 1 Stereo Indicator; 0 = Mono; 1 = Stereo.
uint8_t BLERA: 2 RDS Block A Errors; See table above.
uint8_t RDSS: 1 RDS Synchronized; 0 = RDS decoder not synchronized (default); 1 = RDS decoder synchronized.
uint8_t AFCRL: 1 AFC Rail; 0 = AFC not railed; 1 = AFC railed, indicating an invalid channel. Audio output is softmuted when set.
uint8_t SF_BL: 1 Seek Fail/Band Limit; 0 = Seek successful; 1 = Seek failure/Band limit reached.
uint8_t STC: 1 Seek/Tune Complete; 0 = Not complete (default); 1 = Complete.
uint8_t RDSR: 1 RDS Ready; 0 = No RDS group ready (default); 1 = New RDS group ready.

◆ si470x_reg0b

union si470x_reg0b

Read Channel.

If BAND 05h[7:6] = 00, then Freq (MHz) = Spacing (MHz) x Channel + 87.5 MHz. If BAND 05h[7:6] = 01, BAND 05h[7:6] = 10, then Freq (MHz) = Spacing (MHz) x Channel + 76 MHz.

READCHAN[9:0] provides the current tuned channel and is updated during a seek operation and after a seek or tune operation completes. Spacing and channel are set with the bits SPACE 05h[5:4] and CHAN 03h[9:0].

RDS block Errors Description
0 0 errors requiring correction
1 1–2 errors requiring correction
2 3–5 errors requiring correction
3 6+ errors or error in checkword, correction not possible
Data Fields
struct si470x_reg0b refined
uint16_t raw

◆ si470x_reg0b.refined

struct si470x_reg0b.refined
Data Fields
uint16_t READCHAN: 10 Read Channel.
uint16_t BLERD: 2 RDS Block D Errors. See table above.
uint16_t BLERC: 2 RDS Block C Errors. See table above.
uint16_t BLERB: 2 RDS Block B Errors. See table above.

◆ si47x_rds_blockb

union si47x_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
Data Fields
struct si47x_rds_blockb group0
struct si47x_rds_blockb group2
struct si47x_rds_blockb refined
si470x_reg0d blockB

◆ si47x_rds_blockb.group0

struct si47x_rds_blockb.group0
Data Fields
uint8_t address: 2
uint8_t DI: 1
uint8_t MS: 1
uint8_t TA: 1
uint8_t programType: 5
uint8_t trafficProgramCode: 1
uint8_t versionCode: 1
uint8_t groupType: 4

◆ si47x_rds_blockb.group2

struct si47x_rds_blockb.group2
Data Fields
uint8_t address: 4
uint8_t textABFlag: 1
uint8_t programType: 5
uint8_t trafficProgramCode: 1
uint8_t versionCode: 1
uint8_t groupType: 4

◆ si47x_rds_blockb.refined

struct si47x_rds_blockb.refined
Data Fields
uint8_t content: 4
uint8_t textABFlag: 1
uint8_t programType: 5
uint8_t trafficProgramCode: 1
uint8_t versionCode: 1
uint8_t groupType: 4

◆ si47x_rds_date_time

union si47x_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.

Data Fields
struct si47x_rds_date_time refined
uint8_t raw[6]

◆ si47x_rds_date_time.refined

struct si47x_rds_date_time.refined
Data Fields
uint8_t offset: 5
uint8_t offset_sense: 1
uint8_t minute1: 2
uint8_t minute2: 4
uint8_t hour1: 4
uint8_t hour2: 1
uint32_t mjd: 17

◆ word16_to_bytes

union word16_to_bytes

Converts 16 bits word to two bytes.

Data Fields
struct word16_to_bytes refined
uint16_t raw

◆ word16_to_bytes.refined

struct word16_to_bytes.refined
Data Fields
uint8_t lowByte
uint8_t highByte

◆ SI470X

class SI470X

KT0915 Class.


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

Author
PU2CLR - Ricardo Lima Caratti

Public Member Functions

void setDelayAfterCrystalOn (uint8_t ms_value)
 Set the Delay After Crystal On (default 500ms) More...
 
void getAllRegisters ()
 PU2CLR SI470X Arduino Library. More...
 
void setAllRegisters (uint8_t limit=0x07)
 Sets values to the device registers from 0x02 to 0x07. More...
 
void getStatus ()
 Gets the value of the 0x0A register. More...
 
void waitAndFinishTune ()
 Wait STC (Seek/Tune Complete) status becomes 0. More...
 
void reset ()
 Resets the device. More...
 
void powerUp ()
 Powers the receiver on. More...
 
void powerDown ()
 Powers the receiver off. More...
 
void setup (int resetPin, int rdsInterruptPin=-1, int seekInterruptPin=-1, uint8_t oscillator_type=OSCILLATOR_TYPE_CRYSTAL)
 Starts the device. More...
 
void setup (int resetPin, uint8_t oscillator_type)
 Starts the device. More...
 
void setFrequency (uint16_t frequency)
 Sets the frequency. More...
 
uint16_t getFrequency ()
 Gets the current frequency. More...
 
uint16_t getRealFrequency ()
 Gets the frequency based on READCHAN register (0x0B) More...
 
uint16_t getRealChannel ()
 Gets the current channel stored in register 0x0B. More...
 
void setChannel (uint16_t channel)
 Sets the channel. More...
 
void seek (uint8_t seek_mode, uint8_t direction)
 Seek function. More...
 
void setBand (uint8_t band=1)
 Sets the FM Band
More...
 
void setSpace (uint8_t space=0)
 Sets the FM Space
More...
 
int getRssi ()
 Gets the Rssi. More...
 
void setSoftmute (bool value)
 Sets the Softmute true or false. More...
 
void setMute (bool value)
 Sets the Mute true or false. More...
 
void setMono (bool value)
 Sets the Mono true or false (stereo) More...
 
void setRdsMode (uint8_t rds_mode=0)
 Sets the Rds Mode Standard or Verbose. More...
 
uint8_t getPartNumber ()
 Gets the Part Number. More...
 
uint16_t getManufacturerId ()
 Gets the Manufacturer ID. More...
 
uint8_t getFirmwareVersion ()
 Gets the Firmware Version. More...
 
uint8_t getDeviceId ()
 Gets the Device identification. More...
 
uint8_t getChipVersion ()
 Gets the Chip Version. More...
 
void setVolume (uint8_t value)
 Sets the audio volume level. More...
 
uint8_t getVolume ()
 Gets the current audio volume level. More...
 
void setVolumeUp ()
 Increments the audio volume. More...
 
void setVolumeDown ()
 Decrements the audio volume. More...
 

Protected Attributes

int deviceAddress = I2C_DEVICE_ADDR
 
int resetPin
 
uint16_t currentFrequency
 
uint8_t currentFMBand = 0
 
uint8_t currentFMSpace = 0
 
uint8_t currentVolume = 0
 
int rdsInterruptPin = -1
 
int seekInterruptPin = -1
 
int oscillatorType = OSCILLATOR_TYPE_CRYSTAL
 
uint16_t maxDelayAftarCrystalOn = MAX_DELAY_AFTER_OSCILLATOR
 

Member Function Documentation

◆ setDelayAfterCrystalOn()

void SI470X::setDelayAfterCrystalOn ( uint8_t  ms_value)
inline

Set the Delay After Crystal On (default 500ms)

Parameters
ms_valueValue in milliseconds

◆ getAllRegisters()

void SI470X::getAllRegisters ( )

PU2CLR SI470X Arduino Library.

SI470X Arduino Library implementation. This is an Arduino library for the SI470X, BROADCAST RECEIVER.

It works with I2C protocol and can provide an easier interface to control the SI470X device.

This library was built based on "AN230 - Si4700/01/02/03 PROGRAMMING GUIDE" and "Si4702/03-C19 - BROADCAST FM RADIO TUNER FOR PORTABLE APPLICATIONS"

This library can be freely distributed using the MIT Free Software model.

Author
Ricardo LIma Caratti (pu2cl.nosp@m.r@gm.nosp@m.ail.c.nosp@m.om)

Basic

Low level functions used to operate with the SI470X registers

Gets all current register content of the device

For read operations, the device acknowledge is followed by an eight bit data word shifted out on falling SCLK edges. An internal address counter automatically increments to allow continuous data byte reads, starting with the upper byte of register 0Ah, followed by the lower byte of register 0Ah, and onward until the lower byte of the last register is reached. The internal address counter then automatically wraps around to the upper byte of register 00h and proceeds from there until continuous reads cease.

See also
BROADCAST FM RADIO TUNER FOR PORTABLE APPLICATIONS; page 19.
shadowRegisters;

Referenced by getRealChannel(), powerDown(), powerUp(), seek(), and waitAndFinishTune().

◆ setAllRegisters()

void SI470X::setAllRegisters ( uint8_t  limit = 0x07)

Sets values to the device registers from 0x02 to 0x07.

For write operations, the device acknowledge is followed by an eight bit data word latched internally on rising edges of SCLK. The device acknowledges each byte of data written by driving SDIO low after the next falling SCLK edge, for 1 cycle.

An internal address counter automatically increments to allow continuous data byte writes, starting with the upper byte of register 02h, followed by the lower byte of register 02h, and onward until the lower byte of the last register is reached. The internal address counter then automatically wraps around to the upper byte of register 00h and proceeds from there until continuous writes end.

The registers from 0x2 to 0x07 are used to setup the device. This method writes the array shadowRegisters, elements 8 to 14 (corresponding the registers 0x2 to 0x7 respectively) into the device. See Device registers map in SI470X.h file.

To implement this, a register maping was created to deal with each register structure. For each type of register, there is a reference to the array element.

See also
BROADCAST FM RADIO TUNER FOR PORTABLE APPLICATIONS; pages 18 and 19.
shadowRegisters;

◆ getStatus()

void SI470X::getStatus ( )

Gets the value of the 0x0A register.

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

Returns
si470x_reg0a

Referenced by getRssi().

◆ waitAndFinishTune()

void SI470X::waitAndFinishTune ( )

Wait STC (Seek/Tune Complete) status becomes 0.

Should be used before processing Tune or Seek.

The STC bit being cleared indicates that the TUNE or SEEK bits may be set again to start another tune or seek operation. Do not set the TUNE or SEEK bits until the Si470x clears the STC bit.

References getAllRegisters().

Referenced by seek(), and setChannel().

◆ reset()

void SI470X::reset ( )

Resets the device.

Referenced by setup().

◆ powerUp()

void SI470X::powerUp ( )

Powers the receiver on.

Starts the receiver with some default configurations

References getAllRegisters().

Referenced by setup().

◆ powerDown()

void SI470X::powerDown ( )

Powers the receiver off.

References getAllRegisters().

◆ setup() [1/2]

void SI470X::setup ( int  resetPin,
int  rdsInterruptPin = -1,
int  seekInterruptPin = -1,
uint8_t  oscillator_type = OSCILLATOR_TYPE_CRYSTAL 
)

Starts the device.

sets the reset pin, interrupt pins and oscillator type you are using in your project.

Parameters
resetPin// Arduino pin used to reset control.
rdsInterruptPin// optional. Sets the Arduino pin used to RDS function control.
seekInterruptPin// optional. Sets the Arduino pin used to Seek function control.
oscillator_type// optional. Sets the Oscillator type used (Default Crystal or Ref. Clock).

References powerUp(), rdsInterruptPin, reset(), resetPin, and seekInterruptPin.

◆ setup() [2/2]

void SI470X::setup ( int  resetPin,
uint8_t  oscillator_type 
)

Starts the device.

Use this if you are not using interrupt pins in your project

Parameters
resetPin// Arduino pin used to reset control.
rdsInterruptPin// optional. Sets the Arduino pin used to RDS function control.
seekInterruptPin// optional. Sets the Arduino pin used to Seek function control.

◆ setFrequency()

void SI470X::setFrequency ( uint16_t  frequency)

Sets the frequency.

Parameters
frequency

◆ getFrequency()

uint16_t SI470X::getFrequency ( )

Gets the current frequency.

Returns
uint16_t

◆ getRealFrequency()

uint16_t SI470X::getRealFrequency ( )

Gets the frequency based on READCHAN register (0x0B)

Unlike getFrequency method, this method queries the device.

Returns
uint16_t

◆ getRealChannel()

uint16_t SI470X::getRealChannel ( )

Gets the current channel stored in register 0x0B.

This method is useful to query the current channel during the seek operations.

Returns
uint16_t

References getAllRegisters().

◆ setChannel()

void SI470X::setChannel ( uint16_t  channel)

Sets the channel.

Parameters
channel

References waitAndFinishTune().

◆ seek()

void SI470X::seek ( uint8_t  seek_mode,
uint8_t  direction 
)

Seek function.

Seek begins at the current channel, and goes in the direction specified with the SEEKUP bit. Seek operation stops when a channel is qualified as valid according to the seek parameters, the entire band has been searched (SKMODE = 0), or the upper or lower band limit has been reached (SKMODE = 1).

The STC bit is set high when the seek operation completes and/or the SF/BL bit is set high if the seek operation was unable to find a channel qualified as valid according to the seek parameters. The STC and SF/BL bits must be set low by setting the SEEK bit low before the next seek or tune may begin.

Seek performance for 50 kHz channel spacing varies according to RCLK tolerance. Silicon Laboratories recommends ±50 ppm RCLK crystal tolerance for 50 kHz seek performance.

A seek operation may be aborted by setting SEEK = 0.

Parameters
seek_modeSeek Mode; 0 = Wrap at the upper or lower band limit and continue seeking (default); 1 = Stop seeking at the upper or lower band limit.
directionSeek Direction; 0 = Seek down (default); 1 = Seek up.

References getAllRegisters(), and waitAndFinishTune().

◆ setBand()

void SI470X::setBand ( uint8_t  band = 1)

Sets the FM Band

BAND value Description
0 00 = 87.5–108 MHz (USA, Europe) (Default)
1 (default) 01 = 76–108 MHz (Japan wide band)
2 10 = 76–90 MHz (Japan)
3 11 = Reserved
Parameters
bandSee the table above. If you do not set a parameter, will be considered 1 (76-108MHz)

◆ setSpace()

void SI470X::setSpace ( uint8_t  space = 0)

Sets the FM Space

The SI470x device supports 3 different settings as shown below

BAND value Description
0 00 - 200 kHz (US / Australia, Default)
1 (default) 01 - 100 kHz (Europe / Japan)
2 02 - 50 kHz
3 03 - Reserved (Do not use)

◆ getRssi()

int SI470X::getRssi ( )

Gets the Rssi.

Returns
int

References getStatus().

◆ setSoftmute()

void SI470X::setSoftmute ( bool  value)

Sets the Softmute true or false.

Parameters
valueTRUE or FALSE

◆ setMute()

void SI470X::setMute ( bool  value)

Sets the Mute true or false.

Parameters
valueTRUE or FALSE

◆ setMono()

void SI470X::setMono ( bool  value)

Sets the Mono true or false (stereo)

Parameters
valueTRUE or FALSE

◆ setRdsMode()

void SI470X::setRdsMode ( uint8_t  rds_mode = 0)

Sets the Rds Mode Standard or Verbose.

Parameters
rds_mode0 = Standard (default); 1 = Verbose

◆ getPartNumber()

uint8_t SI470X::getPartNumber ( )

Gets the Part Number.

If it returns 0x01, so the device is: Si4702/03

Returns
the part number

◆ getManufacturerId()

uint16_t SI470X::getManufacturerId ( )

Gets the Manufacturer ID.

Returns
number

◆ getFirmwareVersion()

uint8_t SI470X::getFirmwareVersion ( )

Gets the Firmware Version.

The return velue before powerup will be 0. After powerup should be 010011 (19)

Returns
number

◆ getDeviceId()

uint8_t SI470X::getDeviceId ( )

Gets the Device identification.

Returns
number

◆ getChipVersion()

uint8_t SI470X::getChipVersion ( )

Gets the Chip Version.

Returns
number

◆ setVolume()

void SI470X::setVolume ( uint8_t  value)

Sets the audio volume level.

Parameters
value0 to 15 (if 0, mutes the audio)

◆ getVolume()

uint8_t SI470X::getVolume ( )

Gets the current audio volume level.

Returns
uint8_t 0 to 15

◆ setVolumeUp()

void SI470X::setVolumeUp ( )

Increments the audio volume.

◆ setVolumeDown()

void SI470X::setVolumeDown ( )

Decrements the audio volume.

Field Documentation

◆ deviceAddress

int SI470X::deviceAddress = I2C_DEVICE_ADDR
protected

◆ resetPin

int SI470X::resetPin
protected

Referenced by setup().

◆ currentFrequency

uint16_t SI470X::currentFrequency
protected

◆ currentFMBand

uint8_t SI470X::currentFMBand = 0
protected

◆ currentFMSpace

uint8_t SI470X::currentFMSpace = 0
protected

◆ currentVolume

uint8_t SI470X::currentVolume = 0
protected

◆ rdsInterruptPin

int SI470X::rdsInterruptPin = -1
protected

Referenced by setup().

◆ seekInterruptPin

int SI470X::seekInterruptPin = -1
protected

Referenced by setup().

◆ oscillatorType

int SI470X::oscillatorType = OSCILLATOR_TYPE_CRYSTAL
protected

◆ maxDelayAftarCrystalOn

uint16_t SI470X::maxDelayAftarCrystalOn = MAX_DELAY_AFTER_OSCILLATOR
protected

Typedef Documentation

◆ si470x_reg0c

typedef uint16_t si470x_reg0c

RDS Block A.

RDS Block A Data.

◆ si470x_reg0d

typedef uint16_t si470x_reg0d

RDS Block B.

RDS Block B Data.

◆ si470x_reg0e

typedef uint16_t si470x_reg0e

RDS Block C.

RDS Block C Data.

◆ si470x_reg0f

typedef uint16_t si470x_reg0f

RDS Block D.

RDS Block D Data.