PU2CLR Si4735 Arduino Library  2.0.7
Arduino Library for Si47XX Devices - By Ricardo Lima Caratti
SI4735 Class Reference

SI4735 Class. More...

#include <SI4735.h>

Public Member Functions

 SI4735 ()
 Construct a new SI4735::SI4735. More...
 
void reset (void)
 Reset the SI473X
More...
 
void waitToSend (void)
 Wait for the si473x is ready (Clear to Send (CTS) status bit have to be 1).
More...
 
void setGpioCtl (uint8_t GPO1OEN, uint8_t GPO2OEN, uint8_t GPO3OEN)
 Enables output for GPO1, 2, and 3. More...
 
void setGpio (uint8_t GPO1LEVEL, uint8_t GPO2LEVEL, uint8_t GPO3LEVEL)
 Sets the output level (high or low) for GPO1, 2, and 3.
More...
 
void setGpioIen (uint8_t STCIEN, uint8_t RSQIEN, uint8_t ERRIEN, uint8_t CTSIEN, uint8_t STCREP, uint8_t RSQREP)
 Configures the sources for the GPO2/INT interrupt pin. More...
 
void setup (uint8_t resetPin, uint8_t defaultFunction)
 Starts the Si473X device.
More...
 
void setup (uint8_t resetPin, uint8_t ctsIntEnable, uint8_t defaultFunction, uint8_t audioMode=SI473X_ANALOG_AUDIO, uint8_t clockType=XOSCEN_CRYSTAL, uint8_t gpo2Enable=0)
 Starts the Si473X device. More...
 
void setRefClock (uint16_t refclk)
 Sets the frequency of the REFCLK from the output of the prescaler. More...
 
void setRefClockPrescaler (uint16_t prescale, uint8_t rclk_sel=0)
 Sets the number used by the prescaler to divide the external RCLK down to the internal REFCLK. More...
 
int32_t getProperty (uint16_t propertyValue)
 Gets a given property from the SI47XX. More...
 
void setProperty (uint16_t propertyNumber, uint16_t param)
 Sets a given SI47XX device property. More...
 
void sendCommand (uint8_t cmd, int parameter_size, const uint8_t *parameter)
 Sends a given command to the SI47XX devices. More...
 
void getCommandResponse (int num_of_bytes, uint8_t *response)
 Returns with the command response.
More...
 
si47x_status getStatusResponse ()
 Gets the first byte response. More...
 
void setPowerUp (uint8_t CTSIEN, uint8_t GPO2OEN, uint8_t PATCH, uint8_t XOSCEN, uint8_t FUNC, uint8_t OPMODE)
 Set the Power Up parameters for si473X. More...
 
void radioPowerUp (void)
 Powerup the Si47XX. More...
 
void analogPowerUp (void)
 You have to call setPowerUp method before. More...
 
void powerDown (void)
 Moves the device from powerup to powerdown mode. More...
 
void setFrequency (uint16_t)
 Set the frequency to the corrent function of the Si4735 (FM, AM or SSB) More...
 
void getStatus (uint8_t, uint8_t)
 Gets the current status of the Si4735 (AM or FM) More...
 
uint16_t getFrequency (void)
 Gets the current frequency of the Si4735 (AM or FM) More...
 
bool getSignalQualityInterrupt ()
 Get the Signal Quality Interrupt status. More...
 
bool getRadioDataSystemInterrupt ()
 Get the Radio Data System (RDS) Interrupt status. More...
 
bool getTuneCompleteTriggered ()
 Get the Tune Complete status. More...
 
bool getStatusError ()
 Get the Status Error. More...
 
bool getStatusCTS ()
 Gets the Error flag Clear to Send. More...
 
bool getACFIndicator ()
 Returns true if the AFC rails (AFC Rail Indicator). More...
 
bool getBandLimit ()
 Returns true if a seek hit the band limit. More...
 
bool getStatusValid ()
 Gets the channel status. More...
 
uint8_t getReceivedSignalStrengthIndicator ()
 Returns the value of Received Signal Strength Indicator (dBμV). More...
 
uint8_t getStatusSNR ()
 Gets the SNR metric when tune is complete (dB) More...
 
uint8_t getStatusMULT ()
 Get the Status the M U L T. More...
 
uint16_t getAntennaTuningCapacitor ()
 Get the Antenna Tuning Capacitor value. More...
 
void getAutomaticGainControl ()
 Queries Automatic Gain Control STATUS. More...
 
void setAvcAmMaxGain ()
 Sets the Avc Am Max Gain to maximum gain (0x7800) More...
 
void setAvcAmMinGain ()
 Sets the Avc Am Max Gain to minimal gain (0x1000) More...
 
void setAvcAmDefaultGain ()
 Sets the Avc Am Max Gain to default gain (0x2A80) More...
 
void setAvcAmMaxGain (uint8_t gain=90)
 Sets the maximum gain for automatic volume control. More...
 
uint8_t getCurrentAvcAmMaxGain ()
 Get the current Avc Am Max Gain. More...
 
void setAmSoftMuteMaxAttenuation (uint8_t smattn=0)
 Sets the Am Soft Mute Max Attenuation. More...
 
void setSsbSoftMuteMaxAttenuation (uint8_t smattn=0)
 Sets the SSB Soft Mute Max Attenuation object. More...
 
void setSsbIfAgcReleaseRate (uint8_t param=140)
 Sets the number of milliseconds the low IF peak detector. More...
 
void setSsbIfAgcAttackRate (uint8_t param=4)
 Sets the IF AGC attack rate. More...
 
bool isAgcEnabled ()
 Checks if the AGC is enabled. More...
 
uint8_t getAgcGainIndex ()
 Gets the current AGC gain index. More...
 
void setAutomaticGainControl (uint8_t AGCDIS, uint8_t AGCIDX)
 Automatic Gain Control setup. More...
 
void setSsbAgcOverrite (uint8_t SSBAGCDIS, uint8_t SSBAGCNDX, uint8_t reserved=0)
 Automatic Gain Control setup. More...
 
void getCurrentReceivedSignalQuality (uint8_t INTACK)
 Queries the status of the Received Signal Quality (RSQ) of the current channel. More...
 
void getCurrentReceivedSignalQuality (void)
 Queries the status of the Received Signal Quality (RSQ) of the current channel (FM_RSQ_STATUS) More...
 
uint8_t getCurrentRSSI ()
 Get the current receive signal strength (0–127 dBμV) More...
 
uint8_t getCurrentSNR ()
 Gets the current SNR metric (0–127 dB). More...
 
bool getCurrentRssiDetectLow ()
 Checks if RSSI detected is LOW. More...
 
bool getCurrentRssiDetectHigh ()
 Checks if RSSI detected is high. More...
 
bool getCurrentSnrDetectLow ()
 Checks if SNR detect is low. More...
 
bool getCurrentSnrDetectHigh ()
 Checks if SNR detect is high. More...
 
bool getCurrentValidChannel ()
 Checks if the current channel is valid. More...
 
bool getCurrentAfcRailIndicator ()
 AFC Rail Indicator. More...
 
bool getCurrentSoftMuteIndicator ()
 Soft Mute Indicator. More...
 
uint8_t getCurrentStereoBlend ()
 Gets the value of the amount of stereo blend in % (100 = full stereo, 0 = full mono). More...
 
bool getCurrentPilot ()
 Checks the current pilot. More...
 
uint8_t getCurrentMultipath ()
 Gets the current Multipath. More...
 
uint8_t getCurrentSignedFrequencyOffset ()
 Gets the Signed frequency offset (kHz). More...
 
bool getCurrentMultipathDetectLow ()
 Get Multipath Detect Low. More...
 
bool getCurrentMultipathDetectHigh ()
 Gets the Current Multipath Detect High. More...
 
bool getCurrentBlendDetectInterrupt ()
 Gets the Current Blend Detect Interrupt. More...
 
uint8_t getFirmwarePN ()
 Returns the Firmware Part Number. More...
 
uint8_t getFirmwareFWMAJOR ()
 Returns the Firmware F W M A J O R. More...
 
uint8_t getFirmwareFWMINOR ()
 Returns the Firmware F W M I N O R. More...
 
uint8_t getFirmwarePATCHH ()
 Returns the Firmware P A T C H HIGH. More...
 
uint8_t getFirmwarePATCHL ()
 Returns the Firmware P A T C H LOW. More...
 
uint8_t getFirmwareCMPMAJOR ()
 Get the Firmware C M P M A J O R object. More...
 
uint8_t getFirmwareCMPMINOR ()
 RESP6 - Returns the Component Major Revision (ASCII). More...
 
uint8_t getFirmwareCHIPREV ()
 RESP8 - Returns the Chip Revision (ASCII) More...
 
void setVolume (uint8_t volume)
 Sets volume level (0 to 63) More...
 
uint8_t getVolume ()
 Gets the current volume level. More...
 
void volumeDown ()
 Set sound volume level Down
More...
 
void volumeUp ()
 Set sound volume level Up
More...
 
uint8_t getCurrentVolume ()
 Get the Current Volume. More...
 
void setVolumeUp ()
 Set the Volume Up. More...
 
void setVolumeDown ()
 Set the Volume Down. More...
 
void setAudioMode (uint8_t audioMode)
 Sets the Audio Mode. See table below. More...
 
void setAmDelayNB (uint16_t value)
 Sets the delay before applying impulse blanking. More...
 
void digitalOutputFormat (uint8_t OSIZE, uint8_t OMONO, uint8_t OMODE, uint8_t OFALL)
 Configures the digital audio output format. More...
 
void digitalOutputSampleRate (uint16_t DOSR)
 Enables digital audio output and configures digital audio output sample rate in samples per second (sps). More...
 
void setAudioMute (bool off)
 Sets the audio on or off. More...
 
void setAM ()
 Sets the radio to AM function. It means: LW MW and SW. More...
 
void setFM ()
 Sets the radio to FM function. More...
 
void setAM (uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step)
 Sets the radio to AM (LW/MW/SW) function. More...
 
void setFM (uint16_t fromFreq, uint16_t toFreq, uint16_t initialFreq, uint16_t step)
 Sets the radio to FM function. More...
 
void setFMDeEmphasis (uint8_t parameter)
 Sets the FM Receive de-emphasis to 50 or 75 μs. More...
 
void setFmSoftMuteMaxAttenuation (uint8_t smattn=0)
 Sets the Fm Soft Mute Max Attenuation. More...
 
void setFmNoiseBlankThreshold (uint16_t parameter)
 Set the Fm Noise Blank Threshold. More...
 
void setFmNoiseBlank (uint16_t nb_rate=64, uint16_t nb_interval=55, uint16_t nb_irr_filter=300)
 Set the Fm Noise Blank. More...
 
void setFmNoiseBlankInterval (uint16_t parameter)
 Set the Fm Noise Blank Interval. More...
 
void setFmNoiseBlankRate (uint16_t parameter)
 Set the Fm Noise Blank Rate. More...
 
void setFmNoiseBlankDelay (uint16_t parameter)
 Set the Fm Noise Blank Delay. More...
 
void setFmNoiseBlank_IIR_Filter (uint16_t parameter)
 Set the FmNoiseBlank IIR Filter. More...
 
void setAMDeEmphasis (uint8_t parameter)
 Sets the AM Receive de-emphasis to 50 or disable. More...
 
void setAMSoftMuteSlop (uint8_t parameter)
 Sets the AM attenuation slope during soft mute. More...
 
void setAMSoftMuteRate (uint8_t parameter)
 Sets the attack and decay rates when entering or leaving soft mute. More...
 
void setAMSoftMuteSnrThreshold (uint8_t parameter)
 Sets the SNR threshold to engage soft mute. More...
 
void setAMSoftMuteReleaseRate (uint8_t parameter)
 Sets the soft mute release rate. More...
 
void setAMSoftMuteAttackRate (uint16_t parameter)
 Sets the soft mute attack rate. More...
 
void setAmAgcAttackRate (uint16_t parameter)
 Sets the AGC attack rate. More...
 
void setAmAgcReleaseRate (uint16_t parameter)
 Sets the AGC release rate. More...
 
void setSsbAgcAttackRate (uint16_t parameter)
 Sets the AGC attack rate on SSB mode. More...
 
void setSsbAgcReleaseRate (uint16_t parameter)
 Sets the AGC Release rate on SSB mode. More...
 
void setAMFrontEndAgcControl (uint8_t MIN_GAIN_INDEX, uint8_t ATTN_BACKUP)
 Adjusts the AM AGC for external front-end attenuator and external front-end cascode LNA. More...
 
void setAmNoiseBlank (uint16_t nb_rate=64, uint16_t nb_interval=55, uint16_t nb_irr_filter=300)
 Set the Am Noise Blank. More...
 
bool isCurrentTuneFM ()
 
bool isCurrentTuneAM ()
 Returns true if the current function is AM (AM_TUNE_FREQ). More...
 
bool isCurrentTuneSSB ()
 Returns true if the current function is SSB (SSB_TUNE_FREQ). More...
 
void setBandwidth (uint8_t AMCHFLT, uint8_t AMPLFLT)
 Selects the bandwidth of the channel filter for AM reception. More...
 
void setFmBandwidth (uint8_t filter_value=0)
 Sets the Bandwith on FM mode. More...
 
uint8_t getTuneFrequecyFast ()
 Returns the FAST tuning status. More...
 
void setTuneFrequencyFast (uint8_t FAST)
 Sets the FAST Tuning.
More...
 
uint8_t getTuneFrequecyFreeze ()
 Returns the FREEZE status. More...
 
void setTuneFrequencyFreze (uint8_t FREEZE)
 Sets Freeze Metrics During Alternate Frequency Jum. More...
 
void setTuneFrequencyAntennaCapacitor (uint16_t capacitor)
 Selects the tuning capacitor value. More...
 
void frequencyUp ()
 Increments the current frequency on current band/function by using the current step. More...
 
void frequencyDown ()
 Decrements the current frequency on current band/function by using the current step. More...
 
void setFrequencyUp ()
 Set the FrequencyUp. More...
 
void setFrequencyDown ()
 Set the Frequency Down. More...
 
void getFirmware (void)
 Gets firmware information. More...
 
void seekStation (uint8_t SEEKUP, uint8_t WRAP)
 Look for a station (Automatic tune) More...
 
void setMaxSeekTime (long time_in_ms)
 Sets the maximum time in milliseconds for seeking. The default value is 8000ms (8s). More...
 
void seekStationUp ()
 Search for the next station. More...
 
void seekStationDown ()
 Search the previous station. More...
 
void seekNextStation ()
 Search for the next station. More...
 
void seekPreviousStation ()
 Search the previous station. More...
 
void seekStationProgress (void(*showFunc)(uint16_t f), uint8_t up_down)
 Seeks a station up or down. More...
 
void seekStationProgress (void(*showFunc)(uint16_t f), bool(*stopSeking)(), uint8_t up_down)
 Seeks a station up or down. More...
 
void setSeekAmLimits (uint16_t bottom, uint16_t top)
 Sets the bottom frequency and top frequency of the AM band for seek. Default is 520 to 1710. More...
 
void setSeekAmSpacing (uint16_t spacing)
 Selects frequency spacingfor AM seek. Default is 10 kHz spacing. More...
 
void setSeekAmSrnThreshold (uint16_t value)
 Sets the SNR threshold for a valid AM Seek/Tune. More...
 
void setSeekAmRssiThreshold (uint16_t value)
 Sets the RSSI threshold for a valid AM Seek/Tune. More...
 
void setSeekFmLimits (uint16_t bottom, uint16_t top)
 Sets the bottom frequency and top frequency of the FM band for seek. Default is 8750 to 10790. More...
 
void setSeekFmSpacing (uint16_t spacing)
 Selects frequency spacingfor FM seek. Default is 100 kHz (value 10) spacing. There are only 3 valid values: 5, 10, and 20. More...
 
void setSeekFmSrnThreshold (uint16_t value)
 Sets the SNR threshold for a valid FM Seek/Tune. More...
 
void setSeekFmRssiThreshold (uint16_t value)
 Sets the RSSI threshold for a valid FM Seek/Tune. More...
 
void setFmBlendStereoThreshold (uint8_t parameter)
 Sets RSSI threshold for stereo blend (Full stereo above threshold, blend below threshold). More...
 
void setFmBlendMonoThreshold (uint8_t parameter)
 Sets RSSI threshold for mono blend (Full mono below threshold, blend above threshold). More...
 
void setFmBlendRssiStereoThreshold (uint8_t parameter)
 Sets RSSI threshold for stereo blend. (Full stereo above threshold, blend below threshold.) More...
 
void setFmBLendRssiMonoThreshold (uint8_t parameter)
 Sets RSSI threshold for mono blend (Full mono below threshold, blend above threshold). More...
 
void setFmBlendSnrStereoThreshold (uint8_t parameter)
 Sets SNR threshold for stereo blend (Full stereo above threshold, blend below threshold). More...
 
void setFmBLendSnrMonoThreshold (uint8_t parameter)
 Sets SNR threshold for mono blend (Full mono below threshold, blend above threshold). More...
 
void setFmBlendMultiPathStereoThreshold (uint8_t parameter)
 Sets multipath threshold for stereo blend (Full stereo below threshold, blend above threshold). More...
 
void setFmBlendMultiPathMonoThreshold (uint8_t parameter)
 Sets Multipath threshold for mono blend (Full mono above threshold, blend below threshold). More...
 
void setFmStereoOn ()
 Turn Off Stereo operation. More...
 
void setFmStereoOff ()
 Turn Off Stereo operation. More...
 
void RdsInit ()
 Starts the control member variables for RDS. More...
 
void setRdsIntSource (uint8_t RDSRECV, uint8_t RDSSYNCLOST, uint8_t RDSSYNCFOUND, uint8_t RDSNEWBLOCKA, uint8_t RDSNEWBLOCKB)
 Configures interrupt related to RDS. More...
 
void 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...
 
bool getRdsReceived ()
 Get the Rds Received FIFO. More...
 
bool getRdsSyncLost ()
 Get the Rds Sync Lost object. More...
 
bool getRdsSyncFound ()
 Get the Rds Sync Found. More...
 
bool getRdsNewBlockA ()
 Get the Rds New Block A. More...
 
bool getRdsNewBlockB ()
 Get the Rds New Block B. More...
 
bool getRdsSync ()
 Get the Rds Sync. More...
 
bool getGroupLost ()
 Get the Group Lost. More...
 
uint8_t getNumRdsFifoUsed ()
 Get the Num Rds Fifo Used. More...
 
void setFifoCount (uint16_t value)
 Sets the minimum number of RDS groups stored in the RDS FIFO before RDSRECV is set. More...
 
bool getEndIndicatorGroupA ()
 Check if 0xD or 0xA special characters were received for group A. More...
 
void resetEndIndicatorGroupA ()
 Resets 0xD or 0xA special characters condition (makes it false) More...
 
bool getEndIndicatorGroupB ()
 Check if 0xD or 0xA special characters were received for group B. More...
 
void resetEndIndicatorGroupB ()
 Resets 0xD or 0xA special characters condition (makes it false) More...
 
void getRdsStatus ()
 Gets RDS Status. More...
 
void rdsClearFifo ()
 Empty FIFO. More...
 
void rdsClearInterrupt ()
 Clears RDSINT. More...
 
void setRdsConfig (uint8_t RDSEN, uint8_t BLETHA, uint8_t BLETHB, uint8_t BLETHC, uint8_t BLETHD)
 Sets RDS property. More...
 
uint16_t getRdsPI (void)
 Returns the programa type. More...
 
uint8_t getRdsGroupType (void)
 Returns the Group Type (extracted from the Block B) More...
 
uint8_t getRdsFlagAB (void)
 Returns the current Text Flag A/B
More...
 
uint8_t getRdsVersionCode (void)
 Gets the version code (extracted from the Block B) More...
 
uint8_t getRdsProgramType (void)
 Returns the Program Type (extracted from the Block B) More...
 
uint8_t getRdsTextSegmentAddress (void)
 Returns the address of the text segment. More...
 
char * getRdsText (void)
 Gets the RDS Text when the message is of the Group Type 2 version A. More...
 
char * getRdsText0A (void)
 Gets the station name and other messages. More...
 
char * getRdsText2A (void)
 Gets the Text processed for the 2A group. More...
 
char * getRdsText2B (void)
 Gets the Text processed for the 2B group. More...
 
void mjdConverter (uint32_t mjd, uint32_t *year, uint32_t *month, uint32_t *day)
 Converts the MJD number to integers Year, month and day. More...
 
char * getRdsTime (void)
 Gets the RDS time and date when the Group type is 4. More...
 
char * getRdsDateTime (void)
 Gets the RDS the Time and Date when the Group type is 4. More...
 
bool 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...
 
void getNext2Block (char *)
 Process data received from group 2B. More...
 
void getNext4Block (char *)
 Process data received from group 2A. More...
 
void setSSBBfo (int offset)
 Sets the SSB Beat Frequency Offset (BFO). More...
 
void setSSBConfig (uint8_t AUDIOBW, uint8_t SBCUTFLT, uint8_t AVC_DIVIDER, uint8_t AVCEN, uint8_t SMUTESEL, uint8_t DSP_AFCDIS)
 Sets the SSB receiver mode. More...
 
void setSSB (uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step, uint8_t usblsb)
 
void setSSB (uint8_t usblsb)
 Set the radio to AM function. More...
 
void setSSBAudioBandwidth (uint8_t AUDIOBW)
 SSB Audio Bandwidth for SSB mode. More...
 
void setSSBAutomaticVolumeControl (uint8_t AVCEN)
 Sets SSB Automatic Volume Control (AVC) for SSB mode. More...
 
void setSBBSidebandCutoffFilter (uint8_t SBCUTFLT)
 Sets SBB Sideband Cutoff Filter for band pass and low pass filters. More...
 
void setSSBAvcDivider (uint8_t AVC_DIVIDER)
 Sets AVC Divider. More...
 
void setSSBDspAfc (uint8_t DSP_AFCDIS)
 Sets DSP AFC disable or enable. More...
 
void setSSBSoftMute (uint8_t SMUTESEL)
 Sets SSB Soft-mute Based on RSSI or SNR Selection: More...
 
void setNBFM ()
 Set the radio to FM function. More...
 
void setNBFM (uint16_t fromFreq, uint16_t toFreq, uint16_t initialFreq, uint16_t step)
 
void patchPowerUpNBFM ()
 This method can be used to prepare the device to apply NBFM patch. More...
 
void loadPatchNBFM (const uint8_t *patch_content, const uint16_t patch_content_size)
 Loads a given NBFM patch content. More...
 
void setFrequencyNBFM (uint16_t freq)
 Set the frequency to the corrent function of the Si4735 on NBFM mode. More...
 
si47x_firmware_query_library queryLibraryId ()
 Query the library information of the Si47XX device. More...
 
void patchPowerUp ()
 This method can be used to prepare the device to apply SSBRX patch. More...
 
bool downloadPatch (const uint8_t *ssb_patch_content, const uint16_t ssb_patch_content_size)
 Transfers the content of a patch stored in a array of bytes to the SI4735 device. More...
 
bool downloadCompressedPatch (const uint8_t *ssb_patch_content, const uint16_t ssb_patch_content_size, const uint16_t *cmd_0x15, const int16_t cmd_0x15_size)
 Same downloadPatch. More...
 
void loadPatch (const uint8_t *ssb_patch_content, const uint16_t ssb_patch_content_size, uint8_t ssb_audiobw=1)
 Loads a given SSB patch content. More...
 
si4735_eeprom_patch_header downloadPatchFromEeprom (int eeprom_i2c_address)
 Transfers the content of a patch stored in an eeprom to the SI4735 device. More...
 
void ssbPowerUp ()
 This function can be useful for debug and test. More...
 
void setMaxDelayPowerUp (uint16_t ms)
 Set the Max Delay Power Up. More...
 
void setMaxDelaySetFrequency (uint16_t ms)
 Set the Max Delay after Set Frequency. More...
 
void setFrequencyStep (uint16_t step)
 Sets the current step value. More...
 
uint16_t getCurrentFrequency ()
 Gets the current frequency saved in memory. More...
 
void getStatus ()
 Gets the current status of the Si47XX (AM, FM or SSB) More...
 
void setDeviceI2CAddress (uint8_t senPin)
 Sets the I2C Bus Address. More...
 
int16_t getDeviceI2CAddress (uint8_t resetPin)
 I2C bus address setup. More...
 
void setDeviceOtherI2CAddress (uint8_t i2cAddr)
 Sets the onther I2C Bus Address (for Si470X) More...
 
void setI2CLowSpeedMode (void)
 Sets I2C bus to 10kHz. More...
 
void setI2CStandardMode (void)
 Sets I2C bus to 100kHz. More...
 
void setI2CFastMode (void)
 Sets I2C bus to 400kHz. More...
 
void setI2CFastModeCustom (long value=500000)
 Sets the I2C bus to a given value. ATTENTION: use this function with cation. More...
 
void setAudioMuteMcuPin (int8_t pin)
 Sets the Audio Mute Mcu Pin. More...
 
void setHardwareAudioMute (bool on)
 Sets the Hardware Audio Mute. More...
 
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. More...
 

Protected Member Functions

void waitInterrupr (void)
 
si47x_status getInterruptStatus ()
 Updates bits 6:0 of the status byte. More...
 
void sendProperty (uint16_t propertyNumber, uint16_t param)
 Sends (sets) property to the SI47XX. More...
 
void sendSSBModeProperty ()
 Just send the property SSB_MOD to the device. Internal use (privete method). More...
 
void disableFmDebug ()
 There is a debug feature that remains active in Si4704/05/3x-D60 firmware which can create periodic noise in audio. More...
 
void clearRdsBuffer2A ()
 Clear RDS buffer 2A (text) More...
 
void clearRdsBuffer2B ()
 Clear RDS buffer 2B (text) More...
 
void clearRdsBuffer0A ()
 Clear RDS buffer 0A (text) More...
 
void getSsbAgcStatus ()
 Queries SSB Automatic Gain Control STATUS. More...
 

Protected Attributes

char rds_buffer2A [65]
 RDS Radio Text buffer - Program Information. More...
 
char rds_buffer2B [33]
 RDS Radio Text buffer - Station Informaation. More...
 
char rds_buffer0A [9]
 RDS Basic tuning and switching information (Type 0 groups) More...
 
char rds_time [25]
 RDS date time received information. More...
 
int rdsTextAdress2A
 rds_buffer2A current position More...
 
int rdsTextAdress2B
 rds_buffer2B current position More...
 
int rdsTextAdress0A
 rds_buffer0A current position More...
 
bool rdsEndGroupA = false
 
bool rdsEndGroupB = false
 
int16_t deviceAddress = SI473X_ADDR_SEN_LOW
 Stores the current I2C bus address. More...
 
uint16_t maxDelaySetFrequency = MAX_DELAY_AFTER_SET_FREQUENCY
 Stores the maximum delay after set frequency command (in ms). More...
 
uint16_t maxDelayAfterPouwerUp = MAX_DELAY_AFTER_POWERUP
 Stores the maximum delay you have to setup after a power up command (in ms). More...
 
unsigned long maxSeekTime = MAX_SEEK_TIME
 Stores the maximum time (ms) for a seeking process. Defines the maximum seeking time. More...
 
uint8_t lastTextFlagAB
 
uint8_t resetPin
 pin used on Arduino Board to RESET the Si47XX device More...
 
uint8_t currentTune
 tell the current tune (FM, AM or SSB) More...
 
uint16_t currentMinimumFrequency
 minimum frequency of the current band More...
 
uint16_t currentMaximumFrequency
 maximum frequency of the current band More...
 
uint16_t currentWorkFrequency
 current frequency More...
 
uint16_t currentStep
 Stores the current step used to increment or decrement the frequency. More...
 
uint8_t lastMode = -1
 Stores the last mode used. More...
 
uint8_t currentAvcAmMaxGain = DEFAULT_CURRENT_AVC_AM_MAX_GAIN
 Stores the current Automatic Volume Control Gain for AM. More...
 
uint8_t currentClockType = XOSCEN_CRYSTAL
 Stores the current clock type used (Crystal or REF CLOCK) More...
 
uint8_t ctsIntEnable = 0
 
uint8_t gpo2Enable = 0
 
uint16_t refClock = 32768
 Frequency of Reference Clock in Hz. More...
 
uint16_t refClockPrescale = 1
 Prescaler for Reference Clock (divider). More...
 
uint8_t refClockSourcePin = 0
 0 = RCLK pin is clock source; 1 = DCLK pin is clock source. More...
 
si47x_frequency currentFrequency
 data structure to get current frequency More...
 
si47x_set_frequency currentFrequencyParams
 
si47x_rqs_status currentRqsStatus
 current Radio SIgnal Quality status More...
 
si47x_response_status currentStatus
 current device status More...
 
si47x_firmware_information firmwareInfo
 firmware information More...
 
si47x_rds_status currentRdsStatus
 current RDS status More...
 
si47x_agc_status currentAgcStatus
 current AGC status More...
 
si47x_ssb_mode currentSSBMode
 indicates if USB or LSB More...
 
si473x_powerup powerUp
 
uint8_t volume = 32
 Stores the current vlume setup (0-63). More...
 
uint8_t currentAudioMode = SI473X_ANALOG_AUDIO
 Current audio mode used (ANALOG or DIGITAL or both) More...
 
uint8_t currentSsbStatus
 
int8_t audioMuteMcuPin = -1
 

Detailed Description

SI4735 Class.

SI4735 Class definition

This class implements all functions to help you to control the Si47XX devices. This library was built based on “Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0)”. It also can be used on all members of the SI473X family respecting, of course, the features available for each IC version. These functionalities can be seen in the comparison matrix shown in table 1 (Product Family Function); pages 2 and 3 of the programming guide.

Author
PU2CLR - Ricardo Lima Caratti

Constructor & Destructor Documentation

◆ SI4735()

SI4735::SI4735 ( )

Construct a new SI4735::SI4735.

This class has a set of functions that can help you to build your receiver based on Si47XX IC family.

This library uses the I²C communication protocol and implements most of the functions offered by Si47XX (BROADCAST AM / FM / SW / LW RADIO RECEIVER) IC family from Silicon Labs.

Currently you have more than 120 functions implemented to control the Si47XX devices. These functions are listed and documented here.

Some methods were implemented using inline resource. Inline methods are implemented in SI4735.h

IMPORTANT: According to Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 207, "For write operations, the system controller next sends a data byte on SDIO, which is captured by the device on rising edges of SCLK. The device acknowledges each data byte by driving SDIO low for one cycle on the next falling edge of SCLK. The system controller may write up to 8 data bytes in a single 2-wire transaction. The first byte is a command, and the next seven bytes are arguments. Writing more than 8 bytes results in unpredictable device behavior". So, If you are extending this library, consider that restriction presented earlier.

Member Function Documentation

◆ waitInterrupr()

void SI4735::waitInterrupr ( void  )
protected

◆ setFmNoiseBlankThreshold()

void SI4735::setFmNoiseBlankThreshold ( uint16_t  parameter)
inline

Set the Fm Noise Blank Threshold.

Sets the threshold for detecting impulses in dB above the noise floor. The CTS bit (and optional interrupt) is set when it is safe to send the next command.

Parameters
parameter(from 0 to 90. default is 10)

◆ setFmNoiseBlank()

void SI4735::setFmNoiseBlank ( uint16_t  nb_rate = 64,
uint16_t  nb_interval = 55,
uint16_t  nb_irr_filter = 300 
)
inline

Set the Fm Noise Blank.

Sets Noise blanking rate in 100 Hz units

Sets the Interval in micro-seconds that original samples are replaced by sample-hold clean samples.

Sets the bandwidth of the noise floor estimator.

ATTENTION: It works on SI474X. It may not work on SI473X devices.

Parameters
nb_rateNoise blanking rate in 100 Hz units. Default value is 64.
nb_intervalInterval in micro-seconds that original samples are replaced by interpolated clean samples. Default value is 55 μs.
nb_irr_filterSets the bandwidth of the noise floor estimator. Default value is 300.

◆ setFmNoiseBlankInterval()

void SI4735::setFmNoiseBlankInterval ( uint16_t  parameter)
inline

Set the Fm Noise Blank Interval.

Interval in micro-seconds that original samples are replaced by interpolated clean samples.

Parameters
parameter( from 8 to 48. default value is 24)

◆ setFmNoiseBlankRate()

void SI4735::setFmNoiseBlankRate ( uint16_t  parameter)
inline

Set the Fm Noise Blank Rate.

Noise blanking rate in 100 Hz units.

Parameters
parameter( from 1 to 64. default value is 64)

◆ setFmNoiseBlankDelay()

void SI4735::setFmNoiseBlankDelay ( uint16_t  parameter)
inline

Set the Fm Noise Blank Delay.

Delay in micro-seconds before applying impulse blanking to the original samples.

Parameters
parameter( from 125 to 219. default value is 170)

◆ setFmNoiseBlank_IIR_Filter()

void SI4735::setFmNoiseBlank_IIR_Filter ( uint16_t  parameter)
inline

Set the FmNoiseBlank IIR Filter.

Sets the bandwidth of the noise floor estimator.

Parameters
parameter(from 300 to 1600. default value is 300)

◆ setAmNoiseBlank()

void SI4735::setAmNoiseBlank ( uint16_t  nb_rate = 64,
uint16_t  nb_interval = 55,
uint16_t  nb_irr_filter = 300 
)
inline

Set the Am Noise Blank.

Sets Noise blanking rate in 100 Hz units

Sets the Interval in micro-seconds that original samples are replaced by sample-hold clean samples.

Sets the bandwidth of the noise floor estimator.

ATTENTION: It works on SI474X. It may not work on SI473X devices.

Parameters
nb_rateNoise blanking rate in 100 Hz units. Default value is 64.
nb_intervalInterval in micro-seconds that original samples are replaced by interpolated clean samples. Default value is 55 μs.
nb_irr_filterSets the bandwidth of the noise floor estimator. Default value is 300.

◆ isCurrentTuneFM()

bool SI4735::isCurrentTuneFM ( )
inline

◆ setFmBandwidth()

void SI4735::setFmBandwidth ( uint8_t  filter_value = 0)
inline

Sets the Bandwith on FM mode.

Selects bandwidth of channel filter applied at the demodulation stage. Default is automatic which means the device automatically selects proper channel filter.

| Filter | Description |

| ----— | ----------—|

| 0 | Automatically select proper channel filter (Default) |

| 1 | Force wide (110 kHz) channel filter |

| 2 | Force narrow (84 kHz) channel filter |

| 3 | Force narrower (60 kHz) channel filter |

| 4 | Force narrowest (40 kHz) channel filter |

Parameters
filter_value

Field Documentation

◆ rds_buffer2A

char SI4735::rds_buffer2A[65]
protected

RDS Radio Text buffer - Program Information.

Referenced by clearRdsBuffer2A(), getRdsText(), and getRdsText2A().

◆ rds_buffer2B

char SI4735::rds_buffer2B[33]
protected

RDS Radio Text buffer - Station Informaation.

Referenced by clearRdsBuffer2B(), and getRdsText2B().

◆ rds_buffer0A

char SI4735::rds_buffer0A[9]
protected

RDS Basic tuning and switching information (Type 0 groups)

Referenced by clearRdsBuffer0A(), and getRdsText0A().

◆ rds_time

char SI4735::rds_time[25]
protected

RDS date time received information.

Referenced by getRdsDateTime(), and getRdsTime().

◆ rdsTextAdress2A

int SI4735::rdsTextAdress2A
protected

rds_buffer2A current position

Referenced by getRdsText(), and getRdsText2A().

◆ rdsTextAdress2B

int SI4735::rdsTextAdress2B
protected

rds_buffer2B current position

Referenced by getRdsText2B().

◆ rdsTextAdress0A

int SI4735::rdsTextAdress0A
protected

rds_buffer0A current position

Referenced by getRdsText0A().

◆ rdsEndGroupA

bool SI4735::rdsEndGroupA = false
protected

◆ rdsEndGroupB

bool SI4735::rdsEndGroupB = false
protected

◆ deviceAddress

int16_t SI4735::deviceAddress = SI473X_ADDR_SEN_LOW
protected

Stores the current I2C bus address.

◆ maxDelaySetFrequency

uint16_t SI4735::maxDelaySetFrequency = MAX_DELAY_AFTER_SET_FREQUENCY
protected

Stores the maximum delay after set frequency command (in ms).

◆ maxDelayAfterPouwerUp

uint16_t SI4735::maxDelayAfterPouwerUp = MAX_DELAY_AFTER_POWERUP
protected

Stores the maximum delay you have to setup after a power up command (in ms).

◆ maxSeekTime

unsigned long SI4735::maxSeekTime = MAX_SEEK_TIME
protected

Stores the maximum time (ms) for a seeking process. Defines the maximum seeking time.

Referenced by setMaxSeekTime().

◆ lastTextFlagAB

uint8_t SI4735::lastTextFlagAB
protected

◆ resetPin

uint8_t SI4735::resetPin
protected

pin used on Arduino Board to RESET the Si47XX device

◆ currentTune

uint8_t SI4735::currentTune
protected

tell the current tune (FM, AM or SSB)

◆ currentMinimumFrequency

uint16_t SI4735::currentMinimumFrequency
protected

minimum frequency of the current band

◆ currentMaximumFrequency

uint16_t SI4735::currentMaximumFrequency
protected

maximum frequency of the current band

◆ currentWorkFrequency

uint16_t SI4735::currentWorkFrequency
protected

current frequency

◆ currentStep

uint16_t SI4735::currentStep
protected

Stores the current step used to increment or decrement the frequency.

◆ lastMode

uint8_t SI4735::lastMode = -1
protected

Stores the last mode used.

◆ currentAvcAmMaxGain

uint8_t SI4735::currentAvcAmMaxGain = DEFAULT_CURRENT_AVC_AM_MAX_GAIN
protected

Stores the current Automatic Volume Control Gain for AM.

◆ currentClockType

uint8_t SI4735::currentClockType = XOSCEN_CRYSTAL
protected

Stores the current clock type used (Crystal or REF CLOCK)

◆ ctsIntEnable

uint8_t SI4735::ctsIntEnable = 0
protected

◆ gpo2Enable

uint8_t SI4735::gpo2Enable = 0
protected

◆ refClock

uint16_t SI4735::refClock = 32768
protected

Frequency of Reference Clock in Hz.

◆ refClockPrescale

uint16_t SI4735::refClockPrescale = 1
protected

Prescaler for Reference Clock (divider).

◆ refClockSourcePin

uint8_t SI4735::refClockSourcePin = 0
protected

0 = RCLK pin is clock source; 1 = DCLK pin is clock source.

◆ currentFrequency

si47x_frequency SI4735::currentFrequency
protected

data structure to get current frequency

◆ currentFrequencyParams

si47x_set_frequency SI4735::currentFrequencyParams
protected

◆ currentRqsStatus

si47x_rqs_status SI4735::currentRqsStatus
protected

current Radio SIgnal Quality status

◆ currentStatus

si47x_response_status SI4735::currentStatus
protected

current device status

◆ firmwareInfo

si47x_firmware_information SI4735::firmwareInfo
protected

firmware information

◆ currentRdsStatus

si47x_rds_status SI4735::currentRdsStatus
protected

current RDS status

◆ currentAgcStatus

si47x_agc_status SI4735::currentAgcStatus
protected

current AGC status

◆ currentSSBMode

si47x_ssb_mode SI4735::currentSSBMode
protected

indicates if USB or LSB

◆ powerUp

si473x_powerup SI4735::powerUp
protected

◆ volume

uint8_t SI4735::volume = 32
protected

Stores the current vlume setup (0-63).

◆ currentAudioMode

uint8_t SI4735::currentAudioMode = SI473X_ANALOG_AUDIO
protected

Current audio mode used (ANALOG or DIGITAL or both)

◆ currentSsbStatus

uint8_t SI4735::currentSsbStatus
protected

◆ audioMuteMcuPin

int8_t SI4735::audioMuteMcuPin = -1
protected

The documentation for this class was generated from the following files: