 |
PU2CLR Si4735 Arduino Library
1.1.9
Arduino Library for Si47XX Devices - By Ricardo Lima Caratti
|
Go to the documentation of this file.
25 #define POWER_PATCH 15
28 #define SI473X_ADDR_SEN_LOW 0x11
29 #define SI473X_ADDR_SEN_HIGH 0x63
33 #define POWER_DOWN 0x11
34 #define SET_PROPERTY 0x12
35 #define GET_PROPERTY 0x13
36 #define GET_INT_STATUS 0x14
39 #define FM_TUNE_FREQ 0x20
40 #define FM_SEEK_START 0x21
41 #define FM_TUNE_STATUS 0x22
42 #define FM_AGC_STATUS 0x27
43 #define FM_AGC_OVERRIDE 0x28
44 #define FM_RSQ_STATUS 0x23
45 #define FM_RDS_STATUS 0x24
48 #define FM_RDS_INT_SOURCE 0x1500
49 #define FM_RDS_INT_FIFO_COUNT 0x1501
50 #define FM_RDS_CONFIG 0x1502
51 #define FM_RDS_CONFIDENCE 0x1503
53 #define FM_BLEND_STEREO_THRESHOLD 0x1105
54 #define FM_BLEND_MONO_THRESHOLD 0x1106
55 #define FM_BLEND_RSSI_STEREO_THRESHOLD 0x1800
56 #define FM_BLEND_RSSI_MONO_THRESHOLD 0x1801
57 #define FM_BLEND_SNR_STEREO_THRESHOLD 0x1804
58 #define FM_BLEND_SNR_MONO_THRESHOLD 0x1805
59 #define FM_BLEND_MULTIPATH_STEREO_THRESHOLD 0x1808
60 #define FM_BLEND_MULTIPATH_MONO_THRESHOLD 0x1809
63 #define AM_TUNE_FREQ 0x40
64 #define AM_SEEK_START 0x41
65 #define AM_TUNE_STATUS 0x42
66 #define AM_RSQ_STATUS 0x43
67 #define AM_AGC_STATUS 0x47
68 #define AM_AGC_OVERRIDE 0x48
74 #define SSB_TUNE_FREQ 0x40
75 #define SSB_TUNE_STATUS 0x42
76 #define SSB_RSQ_STATUS 0x43
77 #define SSB_AGC_STATUS 0x47
78 #define SSB_AGC_OVERRIDE 0x48
82 #define DIGITAL_OUTPUT_FORMAT 0x0102
83 #define DIGITAL_OUTPUT_SAMPLE_RATE 0x0104
84 #define REFCLK_FREQ 0x0201
85 #define REFCLK_PRESCALE 0x0202
86 #define AM_DEEMPHASIS 0x3100
87 #define AM_CHANNEL_FILTER 0x3102
88 #define AM_AUTOMATIC_VOLUME_CONTROL_MAX_GAIN 0x3103
89 #define AM_MODE_AFC_SW_PULL_IN_RANGE 0x3104
90 #define AM_MODE_AFC_SW_LOCK_IN_RANGE 0x3105
91 #define AM_RSQ_INTERRUPTS 0x3200
92 #define AM_RSQ_SNR_HIGH_THRESHOLD 0x3201
93 #define AM_RSQ_SNR_LOW_THRESHOLD 0x3202
94 #define AM_RSQ_RSSI_HIGH_THRESHOLD 0x3203
95 #define AM_RSQ_RSSI_LOW_THRESHOLD 0x3204
96 #define AM_SOFT_MUTE_RATE 0x3300
97 #define AM_SOFT_MUTE_SLOPE 0x3301
98 #define AM_SOFT_MUTE_MAX_ATTENUATION 0x3302
99 #define AM_SOFT_MUTE_SNR_THRESHOLD 0x3303
100 #define AM_SOFT_MUTE_RELEASE_RATE 0x3304
101 #define AM_SOFT_MUTE_ATTACK_RATE 0x3305
102 #define AM_SEEK_BAND_BOTTOM 0x3400
103 #define AM_SEEK_BAND_TOP 0x3401
104 #define AM_SEEK_FREQ_SPACING 0x3402
105 #define AM_SEEK_SNR_THRESHOLD 0x3403
106 #define AM_SEEK_RSSI_THRESHOLD 0x3404
107 #define AM_AGC_ATTACK_RATE 0x3702
108 #define AM_AGC_RELEASE_RATE 0x3703
109 #define AM_FRONTEND_AGC_CONTROL 0x3705
110 #define AM_NB_DETECT_THRESHOLD 0x3900
111 #define AM_NB_INTERVAL 0x3901
112 #define AM_NB_RATE 0x3902
113 #define AM_NB_IIR_FILTER 0x3903
114 #define AM_NB_DELAY 0x3904
116 #define RX_VOLUME 0x4000
117 #define RX_HARD_MUTE 0x4001
122 #define GPO_IEN 0x0001
123 #define SSB_BFO 0x0100
124 #define SSB_MODE 0x0101
125 #define SSB_RSQ_INTERRUPTS 0x3200
126 #define SSB_RSQ_SNR_HI_THRESHOLD 0x3201
127 #define SSB_RSQ_SNR_LO_THRESHOLD 0x3202
128 #define SSB_RSQ_RSSI_HI_THRESHOLD 0x3203
129 #define SSB_RSQ_RSSI_LO_THRESHOLD 0x3204
130 #define SSB_SOFT_MUTE_RATE 0x3300
131 #define SSB_SOFT_MUTE_MAX_ATTENUATION 0x3302
132 #define SSB_SOFT_MUTE_SNR_THRESHOLD 0x3303
133 #define SSB_RF_AGC_ATTACK_RATE 0x3700
134 #define SSB_RF_AGC_RELEASE_RATE 0x3701
137 #define SSB_RF_IF_AGC_ATTACK_RATE 0x3702
138 #define SSB_RF_IF_AGC_RELEASE_RATE 0x3703
145 #define SI473X_RDS_OUTPUT_ONLY 0b00000000
146 #define SI473X_ANALOG_AUDIO 0b00000101
147 #define SI473X_DIGITAL_AUDIO1 0b00001011
148 #define SI473X_DIGITAL_AUDIO2 0b10110000
149 #define SI473X_ANALOG_DIGITAL_AUDIO 0b10110101
152 #define FM_CURRENT_MODE 0
153 #define AM_CURRENT_MODE 1
154 #define SSB_CURRENT_MODE 2
156 #define MAX_DELAY_AFTER_SET_FREQUENCY 30
157 #define MAX_DELAY_AFTER_POWERUP 10
158 #define MIN_DELAY_WAIT_SEND_LOOP 300
272 } si47x_antenna_capacitor;
294 } si47x_set_frequency;
306 uint8_t RESERVED1 : 2;
309 uint8_t RESERVED2 : 4;
374 } si47x_response_status;
407 } si47x_firmware_information;
442 } si47x_firmware_query_library;
458 uint8_t RESERVED2 : 6;
503 uint8_t RSSIILINT : 1;
504 uint8_t RSSIHINT : 1;
507 uint8_t MULTLINT : 1;
508 uint8_t MULTHINT : 1;
510 uint8_t BLENDINT : 1;
542 uint8_t STATUSONLY : 1;
568 uint8_t RDSSYNCLOST : 1;
569 uint8_t RDSSYNCFOUND : 1;
571 uint8_t RDSNEWBLOCKA : 1;
572 uint8_t RDSNEWBLOCKB : 1;
614 uint8_t RDSSYNCLOST : 1;
615 uint8_t RDSSYNCFOUND : 1;
617 uint8_t RDSNEWBLOCKA : 1;
618 uint8_t RDSNEWBLOCKB : 1;
623 } si47x_rds_int_source;
692 uint16_t address : 2;
696 uint16_t programType : 5;
697 uint16_t trafficProgramCode : 1;
698 uint16_t versionCode : 1;
699 uint16_t groupType : 4;
703 uint16_t address : 4;
704 uint16_t textABFlag : 1;
705 uint16_t programType : 5;
706 uint16_t trafficProgramCode : 1;
707 uint16_t versionCode : 1;
708 uint16_t groupType : 4;
712 uint16_t content : 4;
713 uint16_t textABFlag : 1;
714 uint16_t programType : 5;
715 uint16_t trafficProgramCode : 1;
716 uint16_t versionCode : 1;
717 uint16_t groupType : 4;
764 uint8_t offset_sense : 1;
772 } si47x_rds_date_time;
825 } si47x_agc_overrride;
851 } si47x_bandwidth_config;
864 uint8_t SBCUTFLT : 4;
865 uint8_t AVC_DIVIDER : 4;
867 uint8_t SMUTESEL : 1;
869 uint8_t DSP_AFCDIS : 1;
893 } si4735_digital_output_format;
907 } si4735_digital_output_sample_rate;
909 volatile static bool data_from_si4735;
920 static void interrupt_hundler()
922 data_from_si4735 =
true;
1000 void setGpioCtl(uint8_t GPO1OEN, uint8_t GPO2OEN, uint8_t GPO3OEN);
1001 void setGpio(uint8_t GPO1LEVEL, uint8_t GPO2LEVEL, uint8_t GPO3LEVEL);
1002 void setGpioIen(uint8_t STCIEN, uint8_t RSQIEN, uint8_t ERRIEN, uint8_t CTSIEN, uint8_t STCREP, uint8_t RSQREP);
1004 void sendProperty(uint16_t propertyNumber, uint16_t param);
1017 void setup(uint8_t resetPin, uint8_t defaultFunction);
1035 sendProperty(propertyNumber, param);
1039 void setPowerUp(uint8_t CTSIEN, uint8_t GPO2OEN, uint8_t PATCH, uint8_t XOSCEN, uint8_t FUNC, uint8_t OPMODE);
1063 return currentStatus.resp.RSQINT;
1073 return currentStatus.resp.RDSINT;
1083 return currentStatus.resp.STCINT;
1093 return currentStatus.resp.ERR;
1110 return currentStatus.resp.AFCRL;
1122 return currentStatus.resp.BLTF;
1135 return currentStatus.resp.VALID;
1145 return currentStatus.resp.RSSI;
1157 return currentStatus.resp.SNR;
1169 return currentStatus.resp.MULT;
1181 return currentStatus.resp.READANTCAP;
1204 return currentAvcAmMaxGain;
1242 return !currentAgcStatus.refined.AGCDIS;
1252 return currentAgcStatus.refined.AGCIDX;
1269 return currentRqsStatus.resp.RSSI;
1279 return currentRqsStatus.resp.SNR;
1289 return currentRqsStatus.resp.RSSIILINT;
1299 return currentRqsStatus.resp.RSSIHINT;
1309 return currentRqsStatus.resp.SNRLINT;
1319 return currentRqsStatus.resp.SNRHINT;
1329 return currentRqsStatus.resp.VALID;
1339 return currentRqsStatus.resp.AFCRL;
1351 return currentRqsStatus.resp.SMUTE;
1363 return currentRqsStatus.resp.STBLEND;
1375 return currentRqsStatus.resp.PILOT;
1387 return currentRqsStatus.resp.MULT;
1435 currentAudioMode = audioMode;
1446 void setAM(uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step);
1447 void setFM(uint16_t fromFreq, uint16_t toFreq, uint16_t initialFreq, uint16_t step);
1485 void setRdsIntSource(uint8_t RDSNEWBLOCKB, uint8_t RDSNEWBLOCKA, uint8_t RDSSYNCFOUND, uint8_t RDSSYNCLOST, uint8_t RDSRECV);
1486 void getRdsStatus(uint8_t INTACK, uint8_t MTFIFO, uint8_t STATUSONLY);
1496 return currentRdsStatus.resp.RDSRECV;
1506 return currentRdsStatus.resp.RDSSYNCLOST;
1516 return currentRdsStatus.resp.RDSSYNCFOUND;
1527 return currentRdsStatus.resp.RDSNEWBLOCKA;
1537 return currentRdsStatus.resp.RDSNEWBLOCKB;
1547 return currentRdsStatus.resp.RDSSYNC;
1557 return currentRdsStatus.resp.GRPLOST;
1567 return currentRdsStatus.resp.RDSFIFOUSED;
1570 void setRdsConfig(uint8_t RDSEN, uint8_t BLETHA, uint8_t BLETHB, uint8_t BLETHC, uint8_t BLETHD);
1590 void setSSBConfig(uint8_t AUDIOBW, uint8_t SBCUTFLT, uint8_t AVC_DIVIDER, uint8_t AVCEN, uint8_t SMUTESEL, uint8_t DSP_AFCDIS);
1591 void setSSB(uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step, uint8_t usblsb);
1592 void setSSB(uint8_t usblsb);
1602 bool downloadPatch(
const uint8_t *ssb_patch_content,
const uint16_t ssb_patch_content_size);
1618 this->maxDelayAfterPouwerUp = ms;
1634 this->maxDelaySetFrequency = ms;
1664 this->currentStep = step;
1680 return this->currentWorkFrequency;
1714 Wire.setClock(10000);
1731 Wire.setClock(400000);
1770 audioMuteMcuPin = pin;
1771 pinMode(audioMuteMcuPin, OUTPUT);
1785 digitalWrite(audioMuteMcuPin, on);
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.
Definition: SI4735.cpp:206
uint8_t getRdsProgramType(void)
Returns the Program Type (extracted from the Block B)
Definition: SI4735.cpp:1956
#define SSB_SOFT_MUTE_MAX_ATTENUATION
Definition: SI4735.h:131
uint8_t currentSsbStatus
Definition: SI4735.h:987
bool getCurrentSnrDetectHigh()
Checks if SNR detect is high.
Definition: SI4735.h:1317
#define FM_BLEND_RSSI_STEREO_THRESHOLD
Definition: SI4735.h:55
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.
Definition: SI4735.cpp:2680
si47x_frequency currentFrequency
data structure to get current frequency
Definition: SI4735.h:973
void setMaxDelayPowerUp(uint16_t ms)
Set the Max Delay Power Up.
Definition: SI4735.h:1616
bool isCurrentTuneFM()
Returns true if the current function is FM (FM_TUNE_FREQ).
Definition: SI4735.cpp:815
#define FM_TUNE_STATUS
Definition: SI4735.h:41
void patchPowerUp()
This method can be used to prepare the device to apply SSBRX patch.
Definition: SI4735.cpp:2592
uint8_t interruptPin
pin used on Arduino Board to control interrupt. If -1, interrupt is no used.
Definition: SI4735.h:959
uint8_t lastMode
Store the last mode used.
Definition: SI4735.h:969
uint8_t getAntennaTuningCapacitor()
Get the Antenna Tuning Capacitor value.
Definition: SI4735.h:1179
#define MAX_DELAY_AFTER_SET_FREQUENCY
Definition: SI4735.h:156
virtual void mcuWakeUp()
Sets the pin that controls some MCU features. You might do something with that.
Definition: SI4735.cpp:2851
void getAutomaticGainControl()
Queries Automatic Gain Control STATUS.
Definition: SI4735.cpp:1338
void setProperty(uint16_t propertyNumber, uint16_t param)
Sets the a given Property.
Definition: SI4735.h:1034
#define SSB_BFO
Definition: SI4735.h:123
bool isCurrentTuneAM()
Returns true if the current function is AM (AM_TUNE_FREQ).
Definition: SI4735.cpp:827
void setFmStereoOn()
Turn Off Stereo operation.
Definition: SI4735.cpp:1122
void setFmStereoOff()
Turn Off Stereo operation.
Definition: SI4735.cpp:1112
char rds_time[20]
RDS date time received information.
Definition: SI4735.h:946
void setFM(uint16_t fromFreq, uint16_t toFreq, uint16_t initialFreq, uint16_t step)
Sets the radio to FM function.
Definition: SI4735.cpp:793
void setTuneFrequencyFast(uint8_t FAST)
Returns the FAST tuning status.
Definition: SI4735.h:1452
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.
Definition: SI4735.cpp:1571
#define POWER_UP
Definition: SI4735.h:31
uint8_t getRdsGroupType(void)
Returns the Group Type (extracted from the Block B)
Definition: SI4735.cpp:1882
char * getRdsText0A(void)
Gets the station name and other messages.
Definition: SI4735.cpp:2066
#define GPO_IEN
Definition: SI4735.h:122
void setAvcAmMaxGain()
Sets the Avc Am Max Gain to 48dB.
Definition: SI4735.h:1190
#define AM_CURRENT_MODE
Definition: SI4735.h:153
uint8_t getTuneFrequencyFast()
Definition: SI4735.h:1451
uint8_t getVolume()
Gets the current volume level.
Definition: SI4735.cpp:1230
#define AM_TUNE_FREQ
Definition: SI4735.h:63
char rds_buffer2B[33]
RDS Radio Text buffer - Station Informaation.
Definition: SI4735.h:944
bool getRdsSyncLost()
Get the Rds Sync Lost object.
Definition: SI4735.h:1504
uint16_t getRdsPI(void)
Returns the programa type.
Definition: SI4735.cpp:1866
#define FM_AGC_STATUS
Definition: SI4735.h:42
si47x_response_status currentStatus
current device status
Definition: SI4735.h:976
void setGpio(uint8_t GPO1LEVEL, uint8_t GPO2LEVEL, uint8_t GPO3LEVEL)
Sets the output level (high or low) for GPO1, 2, and 3.
Definition: SI4735.cpp:169
uint8_t currentAvcAmMaxGain
Automatic Volume Control Gain for AM - Default 48.
Definition: SI4735.h:971
void seekStation(uint8_t SEEKUP, uint8_t WRAP)
Look for a station (Automatic tune)
Definition: SI4735.cpp:1503
bool getGroupLost()
Get the Group Lost.
Definition: SI4735.h:1555
uint8_t getAgcGainIndex()
Gets the current AGC gain index.
Definition: SI4735.h:1250
void setup(uint8_t resetPin, int interruptPin, uint8_t defaultFunction, uint8_t audioMode=SI473X_ANALOG_AUDIO)
Starts the Si473X device.
Definition: SI4735.cpp:504
virtual void setMcuWakeUpPin(uint8_t pin)
Sets pin used to wake the MCU up.
Definition: SI4735.cpp:2836
void setSsbSoftMuteMaxAttenuation(uint8_t smattn=0)
Sets the SSB Soft Mute Max Attenuation object.
Definition: SI4735.h:1230
void setI2CFastModeCustom(long value=500000)
Sets the I2C bus to a given value.
Definition: SI4735.h:1743
#define FM_RDS_STATUS
Definition: SI4735.h:45
void getStatus()
Gets the current status of the Si47XX (AM, FM or SSB)
Definition: SI4735.h:1690
uint8_t raw[5]
Definition: SI4735.h:293
si47x_rqs_status currentRqsStatus
current Radio SIgnal Quality status
Definition: SI4735.h:975
#define AM_AGC_OVERRIDE
Definition: SI4735.h:68
void radioPowerUp(void)
Powerup the Si47XX.
Definition: SI4735.cpp:406
bool isAgcEnabled()
Checks if the AGC is enabled.
Definition: SI4735.h:1240
void setFM()
Sets the radio to FM function.
Definition: SI4735.cpp:724
bool getRdsNewBlockA()
Get the Rds New Block A.
Definition: SI4735.h:1525
uint8_t raw
Definition: SI4735.h:460
void setVolume(uint8_t volume)
RESP8 - Returns the Chip Revision (ASCII).
Definition: SI4735.cpp:1200
uint8_t getRdsTextSegmentAddress(void)
Returns the address of the text segment.
Definition: SI4735.cpp:1921
uint8_t raw
Definition: SI4735.h:545
uint8_t raw
Definition: SI4735.h:332
void setAudioMuteMcuPin(int8_t pin)
Sets the Audio Mute Mcu Pin.
Definition: SI4735.h:1768
bool downloadPatch(int eeprom_i2c_address)
Transfers the content of a patch stored in a eeprom to the SI4735 device.
Definition: SI4735.cpp:2742
uint8_t raw[2]
Definition: SI4735.h:871
void ssbSetup()
Starts the Si473X device on SSB (same AM Mode).
Definition: SI4735.cpp:2610
bool getCurrentSoftMuteIndicator()
Soft Mute Indicator.
Definition: SI4735.h:1349
bool controlMcu
Definition: SI4735.h:990
uint8_t getFirmwareFWMINOR()
RESP2 - Returns the Firmware Major Revision (ASCII).
Definition: SI4735.h:1403
uint8_t getCurrentMultipath()
Gets the current Multipath.
Definition: SI4735.h:1385
void waitToSend(void)
Wait for the si473x is ready (Clear to Send (CTS) status bit have to be 1).
Definition: SI4735.cpp:331
si47x_status getInterruptStatus()
Updates bits 6:0 of the status byte.
Definition: SI4735.cpp:93
#define FM_BLEND_SNR_MONO_THRESHOLD
Definition: SI4735.h:58
void setFmBlendRssiStereoThreshold(uint8_t parameter)
Sets RSSI threshold for stereo blend. (Full stereo above threshold, blend below threshold....
Definition: SI4735.cpp:1022
void setDeviceOtherI2CAddress(uint8_t i2cAddr)
Sets the onther I2C Bus Address (for Si470X)
Definition: SI4735.cpp:295
uint8_t raw[2]
Definition: SI4735.h:850
void digitalOutputFormat(uint8_t OSIZE, uint8_t OMONO, uint8_t OMODE, uint8_t OFALL)
Configures the digital audio output format.
Definition: SI4735.cpp:1166
bool getCurrentBlendDetectInterrupt()
Multipath Detect High.
Definition: SI4735.h:1393
#define FM_BLEND_RSSI_MONO_THRESHOLD
Definition: SI4735.h:56
#define FM_CURRENT_MODE
Definition: SI4735.h:152
uint8_t raw[8]
Definition: SI4735.h:526
void frequencyUp()
Increments the current frequency on current band/function by using the current step.
Definition: SI4735.cpp:659
si47x_rds_status currentRdsStatus
current RDS status
Definition: SI4735.h:978
uint8_t getCurrentSignedFrequencyOffset()
Definition: SI4735.h:1390
si47x_ssb_mode currentSSBMode
indicates if USB or LSB
Definition: SI4735.h:980
int8_t audioMuteMcuPin
Definition: SI4735.h:992
#define GPIO_SET
Definition: SI4735.h:70
void setTuneFrequencyAntennaCapacitor(uint16_t capacitor)
Only FM. Freeze Metrics During Alternate Frequency Jump.
Definition: SI4735.cpp:583
#define AM_SEEK_BAND_BOTTOM
Definition: SI4735.h:102
uint8_t getRdsFlagAB(void)
Returns the current Text Flag A/B
Definition: SI4735.cpp:1899
void getCurrentReceivedSignalQuality(uint8_t INTACK)
Queries the status of the Received Signal Quality (RSQ) of the current channel.
Definition: SI4735.cpp:1439
bool getCurrentAfcRailIndicator()
AFC Rail Indicator.
Definition: SI4735.h:1337
uint16_t value
frequency (integer value)
Definition: SI4735.h:258
bool getRdsNewBlockB()
Get the Rds New Block B.
Definition: SI4735.h:1535
void setSSBSoftMute(uint8_t SMUTESEL)
Sets SSB Soft-mute Based on RSSI or SNR Selection:
Definition: SI4735.cpp:2353
int16_t deviceAddress
current I2C buss address
Definition: SI4735.h:952
void setMaxDelaySetFrequency(uint16_t ms)
Set the Max Delay after Set Frequency.
Definition: SI4735.h:1632
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.
Definition: SI4735.cpp:2313
#define SSB_TUNE_FREQ
Definition: SI4735.h:74
#define DIGITAL_OUTPUT_SAMPLE_RATE
Definition: SI4735.h:83
void setAM()
Sets the radio to AM function. It means: LW MW and SW.
Definition: SI4735.cpp:698
uint8_t getFirmwarePN()
Blend Detect Interrupt.
Definition: SI4735.h:1401
void ssbPowerUp()
This function can be useful for debug and test.
Definition: SI4735.cpp:2622
#define MAX_DELAY_AFTER_POWERUP
Definition: SI4735.h:157
void setFrequencyStep(uint16_t step)
Sets the current step value.
Definition: SI4735.h:1662
void clearRdsBuffer2A()
Clear RDS buffer 2A (text)
Definition: SI4735.cpp:1648
void seekStationUp()
Search for the next station.
Definition: SI4735.cpp:1540
bool getCurrentRssiDetectLow()
Checks if RSSI detected is LOW.
Definition: SI4735.h:1287
void setTuneFrequencyFreeze(uint8_t FREEZE)
Returns the FREEZE status.
Definition: SI4735.h:1454
#define FM_BLEND_STEREO_THRESHOLD
Definition: SI4735.h:53
uint8_t getFirmwareCMPMAJOR()
RESP5 - Returns the Patch ID Low byte (HEX).
Definition: SI4735.h:1406
uint16_t raw
Definition: SI4735.h:892
void setFmBlendMonoThreshold(uint8_t parameter)
Sets RSSI threshold for mono blend (Full mono below threshold, blend above threshold).
Definition: SI4735.cpp:1006
uint16_t currentMinimumFrequency
minimum frequency of the current band
Definition: SI4735.h:963
bool getTuneCompleteTriggered()
Get the Tune Complete status.
Definition: SI4735.h:1081
virtual void setMcuClockSpeed(uint32_t clock)
Sets the Mcu Clock Speed if the platform supports this resource.
Definition: SI4735.cpp:2881
uint8_t volume
Definition: SI4735.h:984
void volumeDown()
Set sound volume level Down
Definition: SI4735.cpp:1256
void setFmBlendMultiPathStereoThreshold(uint8_t parameter)
Sets multipath threshold for stereo blend (Full stereo below threshold, blend above threshold).
Definition: SI4735.cpp:1086
uint8_t getCurrentAvcAmMaxGain()
Get the current Avc Am Max Gain.
Definition: SI4735.h:1202
int rdsTextAdress2B
rds_buffer2B current position
Definition: SI4735.h:949
int rdsTextAdress2A
rds_buffer2A current position
Definition: SI4735.h:948
SI4735()
Construct a new SI4735::SI4735.
Definition: SI4735.cpp:58
uint8_t raw[2]
Raw powerup parameters data. Same arg memory position. So, same content.
Definition: SI4735.h:194
char * getRdsTime(void)
Gets the RDS time and date when the Group type is 4.
Definition: SI4735.cpp:2165
#define FM_RDS_INT_SOURCE
Definition: SI4735.h:48
bool getStatusCTS()
Gets the Error flag Clear to Send.
Definition: SI4735.h:1101
uint8_t raw
Definition: SI4735.h:215
#define SI473X_ADDR_SEN_LOW
Definition: SI4735.h:28
void setAM(uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step)
Sets the radio to AM (LW/MW/SW) function.
Definition: SI4735.cpp:755
#define AM_SEEK_FREQ_SPACING
Definition: SI4735.h:104
uint16_t maxDelayAfterPouwerUp
Definition: SI4735.h:955
void setSSBAudioBandwidth(uint8_t AUDIOBW)
SSB Audio Bandwidth for SSB mode.
Definition: SI4735.cpp:2432
si47x_set_frequency currentFrequencyParams
Definition: SI4735.h:974
void setSBBSidebandCutoffFilter(uint8_t SBCUTFLT)
Sets SBB Sideband Cutoff Filter for band pass and low pass filters.
Definition: SI4735.cpp:2402
#define DIGITAL_OUTPUT_FORMAT
Definition: SI4735.h:82
void setFmBLendSnrMonoThreshold(uint8_t parameter)
Sets SNR threshold for mono blend (Full mono below threshold, blend above threshold).
Definition: SI4735.cpp:1070
char * getRdsText2A(void)
Gets the Text processed for the 2A group.
Definition: SI4735.cpp:2099
void setRdsConfig(uint8_t RDSEN, uint8_t BLETHA, uint8_t BLETHB, uint8_t BLETHC, uint8_t BLETHD)
Sets RDS property.
Definition: SI4735.cpp:1711
void setFmBlendSnrStereoThreshold(uint8_t parameter)
Sets SNR threshold for stereo blend (Full stereo above threshold, blend below threshold).
Definition: SI4735.cpp:1054
void waitInterrupr(void)
Interrupt handle.
Definition: SI4735.cpp:72
void getCurrentReceivedSignalQuality(void)
Queries the status of the Received Signal Quality (RSQ) of the current channel (FM_RSQ_STATUS)
Definition: SI4735.cpp:1486
void setSeekRssiThreshold(uint16_t value)
Sets the RSSI threshold for a valid AM Seek/Tune.
Definition: SI4735.cpp:1614
void setSeekSrnThreshold(uint16_t value)
Sets the SNR threshold for a valid AM Seek/Tune.
Definition: SI4735.cpp:1600
SI4735 Class.
Definition: SI4735.h:940
uint8_t resetPin
pin used on Arduino Board to RESET the Si47XX device
Definition: SI4735.h:958
void setI2CFastMode(void)
Sets I2C buss to 400KHz.
Definition: SI4735.h:1729
#define AM_TUNE_STATUS
Definition: SI4735.h:65
void setup(uint8_t resetPin, uint8_t defaultFunction)
Starts the Si473X device.
Definition: SI4735.cpp:554
void setSSB(uint8_t usblsb)
Set the radio to AM function.
Definition: SI4735.cpp:2455
void setAmSoftMuteMaxAttenuation(uint8_t smattn=0)
Sets the Am Soft Mute Max Attenuation.
Definition: SI4735.h:1217
uint8_t raw
Definition: SI4735.h:311
#define SI473X_ADDR_SEN_HIGH
Definition: SI4735.h:29
int16_t getDeviceI2CAddress(uint8_t resetPin)
I2C bus address setup.
Definition: SI4735.cpp:236
void setBandwidth(uint8_t AMCHFLT, uint8_t AMPLFLT)
Selects the bandwidth of the channel filter for AM reception.
Definition: SI4735.cpp:865
uint8_t getReceivedSignalStrengthIndicator()
Returns the value of Received Signal Strength Indicator (dBμV).
Definition: SI4735.h:1143
void setI2CStandardMode(void)
Sets I2C buss to 100KHz.
Definition: SI4735.h:1722
virtual void mcuSleepDown()
You might want to do something when MCU wakes up.
Definition: SI4735.cpp:2866
bool isCurrentTuneSSB()
Returns true if the current function is SSB (SSB_TUNE_FREQ).
Definition: SI4735.cpp:839
bool getRadioDataSystemInterrupt()
Get the Radio Data System (RDS) Interrupt status.
Definition: SI4735.h:1071
bool getBandLimit()
Returns true if a seek hit the band limit.
Definition: SI4735.h:1120
void setAudioMode(uint8_t audioMode)
Returns the current volume level.
Definition: SI4735.h:1434
void getNext4Block(char *)
Process data received from group 2A.
Definition: SI4735.cpp:2007
uint32_t controlMcuClock
Definition: SI4735.h:993
void setSSB(uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step, uint8_t usblsb)
Definition: SI4735.cpp:2487
#define AM_SEEK_START
Definition: SI4735.h:64
uint16_t value
Definition: SI4735.h:271
uint8_t getCurrentStereoBlend()
Gets the value of the amount of stereo blend in % (100 = full stereo, 0 = full mono).
Definition: SI4735.h:1361
void setSSBAutomaticVolumeControl(uint8_t AVCEN)
Sets SSB Automatic Volume Control (AVC) for SSB mode.
Definition: SI4735.cpp:2368
char rds_buffer2A[65]
RDS Radio Text buffer - Program Information.
Definition: SI4735.h:943
void reset(void)
Reset the SI473X
Definition: SI4735.cpp:309
bool getCurrentMultipathDetectLow()
Signed frequency offset (kHz).
Definition: SI4735.h:1391
#define RX_HARD_MUTE
Definition: SI4735.h:117
si47x_firmware_query_library queryLibraryId()
Query the library information of the Si47XX device.
Definition: SI4735.cpp:2551
uint8_t getTuneFrequencyFreeze()
FAST Tuning. If set, executes fast and invalidated tune. The tune status will not be accurate.
Definition: SI4735.h:1453
uint8_t getCurrentRSSI()
Get the current receive signal strength (0–127 dBμV)
Definition: SI4735.h:1267
#define SET_PROPERTY
Definition: SI4735.h:34
uint8_t getRdsVersionCode(void)
Gets the version code (extracted from the Block B)
Definition: SI4735.cpp:1937
uint16_t getCurrentFrequency()
Gets the current frequency saved in memory.
Definition: SI4735.h:1678
#define FM_BLEND_SNR_STEREO_THRESHOLD
Definition: SI4735.h:57
bool getCurrentMultipathDetectHigh()
Multipath Detect Low.
Definition: SI4735.h:1392
char * getRdsText2B(void)
Gets the Text processed for the 2B group.
Definition: SI4735.cpp:2132
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.
Definition: SI4735.cpp:1799
#define GET_PROPERTY
Definition: SI4735.h:35
uint16_t maxDelaySetFrequency
Definition: SI4735.h:954
#define FM_BLEND_MONO_THRESHOLD
Definition: SI4735.h:54
#define FM_TUNE_FREQ
Definition: SI4735.h:39
void setGpioCtl(uint8_t GPO1OEN, uint8_t GPO2OEN, uint8_t GPO3OEN)
Enables output for GPO1, 2, and 3.
Definition: SI4735.cpp:130
void sendProperty(uint16_t propertyNumber, uint16_t param)
Sends (sets) property to the SI47XX.
Definition: SI4735.cpp:913
#define SSB_MODE
Definition: SI4735.h:124
void clearRdsBuffer2B()
Clear RDS buffer 2B (text)
Definition: SI4735.cpp:1660
uint8_t getStatusSNR()
Gets the SNR metric when tune is complete (dB)
Definition: SI4735.h:1155
#define AM_AGC_STATUS
Definition: SI4735.h:67
void clearRdsBuffer0A()
Clear RDS buffer 0A (text)
Definition: SI4735.cpp:1671
si47x_agc_status currentAgcStatus
current AGC status
Definition: SI4735.h:979
bool getRdsSync()
Get the Rds Sync.
Definition: SI4735.h:1545
uint16_t getFrequency(void)
Gets the current frequency of the Si4735 (AM or FM)
Definition: SI4735.cpp:1278
void setDeviceI2CAddress(uint8_t senPin)
Sets the I2C Bus Address.
Definition: SI4735.cpp:281
uint8_t currentTune
tell the current tune (FM, AM or SSB)
Definition: SI4735.h:961
void setFmBlendMultiPathMonoThreshold(uint8_t parameter)
Sets Multipath threshold for mono blend (Full mono above threshold, blend below threshold).
Definition: SI4735.cpp:1102
uint8_t raw[2]
Definition: SI4735.h:824
uint8_t raw[6]
Definition: SI4735.h:771
#define AM_SEEK_BAND_TOP
Definition: SI4735.h:103
uint8_t getNumRdsFifoUsed()
Get the Num Rds Fifo Used.
Definition: SI4735.h:1565
uint8_t raw[8]
Check it.
Definition: SI4735.h:373
#define GET_REV
Definition: SI4735.h:32
uint8_t getFirmwarePATCHH()
RESP3 - Returns the Firmware Minor Revision (ASCII).
Definition: SI4735.h:1404
#define AM_SOFT_MUTE_MAX_ATTENUATION
Definition: SI4735.h:98
void setAudioMute(bool off)
Sets the audio on or off.
Definition: SI4735.cpp:1215
void analogPowerUp(void)
You have to call setPowerUp method before.
Definition: SI4735.cpp:434
void RdsInit()
Starts the control member variables for RDS.
Definition: SI4735.cpp:1634
void powerDown(void)
Moves the device from powerup to powerdown mode.
Definition: SI4735.cpp:449
virtual void setMcuControl(bool value)
Enables MCU control resource.
Definition: SI4735.cpp:2821
uint8_t raw[9]
Definition: SI4735.h:406
bool getStatusError()
Get the Status Error.
Definition: SI4735.h:1091
uint16_t DOSR
Definition: SI4735.h:906
uint8_t raw[2]
Definition: SI4735.h:651
void disableFmDebug()
There is a debug feature that remains active in Si4704/05/3x-D60 firmware which can create periodic n...
Definition: SI4735.cpp:1137
uint16_t currentStep
current steps
Definition: SI4735.h:967
uint8_t raw[8]
Definition: SI4735.h:441
uint8_t lastTextFlagAB
Definition: SI4735.h:957
bool getCurrentValidChannel()
Checks if the current channel is valid.
Definition: SI4735.h:1327
uint8_t currentAudioMode
current audio mode used (ANALOG or DIGITAL or both)
Definition: SI4735.h:986
bool getCurrentSnrDetectLow()
Checks if SNR detect is low.
Definition: SI4735.h:1307
bool getCurrentPilot()
Checks the current pilot.
Definition: SI4735.h:1373
void setAvcAmMaxGain(uint8_t gain)
Sets the maximum gain for automatic volume control.
Definition: SI4735.cpp:1417
bool getACFIndicator()
Returns true if the AFC rails (AFC Rail Indicator).
Definition: SI4735.h:1108
void setFmBLendRssiMonoThreshold(uint8_t parameter)
Sets RSSI threshold for mono blend (Full mono below threshold, blend above threshold).
Definition: SI4735.cpp:1038
void setRdsIntSource(uint8_t RDSNEWBLOCKB, uint8_t RDSNEWBLOCKA, uint8_t RDSSYNCFOUND, uint8_t RDSSYNCLOST, uint8_t RDSRECV)
Configures interrupt related to RDS.
Definition: SI4735.cpp:1757
#define AM_RSQ_STATUS
Definition: SI4735.h:66
bool getRdsReceived()
Get the Rds Received FIFO.
Definition: SI4735.h:1494
si473x_powerup powerUp
Definition: SI4735.h:982
uint16_t currentMaximumFrequency
maximum frequency of the current band
Definition: SI4735.h:964
char * getRdsText(void)
Gets the RDS Text when the message is of the Group Type 2 version A.
Definition: SI4735.cpp:2042
void setAutomaticGainControl(uint8_t AGCDIS, uint8_t AGCIDX)
Automatic Gain Control setup.
Definition: SI4735.cpp:1383
#define FM_RSQ_STATUS
Definition: SI4735.h:44
int rdsTextAdress0A
rds_buffer0A current position
Definition: SI4735.h:950
void seekStationDown()
Search the previous station.
Definition: SI4735.cpp:1554
bool getRdsSyncFound()
Get the Rds Sync Found.
Definition: SI4735.h:1514
#define FM_AGC_OVERRIDE
Definition: SI4735.h:43
uint8_t getCurrentSNR()
Gets the current SNR metric (0–127 dB).
Definition: SI4735.h:1277
uint16_t value
Definition: SI4735.h:476
uint8_t getFirmwareFWMAJOR()
RESP1 - Part Number (HEX)
Definition: SI4735.h:1402
bool getSignalQualityInterrupt()
Get the Signal Quality Interrupt status.
Definition: SI4735.h:1061
#define FM_BLEND_MULTIPATH_MONO_THRESHOLD
Definition: SI4735.h:60
#define FM_SEEK_START
Definition: SI4735.h:40
bool getStatusValid()
Gets the channel status.
Definition: SI4735.h:1133
void getRdsStatus()
Gets RDS Status.
Definition: SI4735.cpp:1848
void setHardwareAudioMute(bool on)
Sets the Hardware Audio Mute.
Definition: SI4735.h:1784
void volumeUp()
Set sound volume level Up
Definition: SI4735.cpp:1242
void setI2CLowSpeedMode(void)
Sets I2C buss to 10KHz.
Definition: SI4735.h:1712
uint16_t raw
Definition: SI4735.h:241
si47x_firmware_information firmwareInfo
firmware information
Definition: SI4735.h:977
uint8_t getCurrentVolume()
Definition: SI4735.h:1414
void digitalOutputSampleRate(uint16_t DOSR)
Enables digital audio output and configures digital audio output sample rate in samples per second (s...
Definition: SI4735.cpp:1186
void getNext2Block(char *)
Process data received from group 2B.
Definition: SI4735.cpp:1973
uint8_t raw[13]
Definition: SI4735.h:599
int32_t getProperty(uint16_t propertyValue)
Gets a property from the SI47XX.
Definition: SI4735.cpp:946
void getFirmware(void)
Gets firmware information.
Definition: SI4735.cpp:472
#define RX_VOLUME
Definition: SI4735.h:116
#define AM_AUTOMATIC_VOLUME_CONTROL_MAX_GAIN
Definition: SI4735.h:88
int8_t controlMcuPin
Definition: SI4735.h:991
#define MIN_DELAY_WAIT_SEND_LOOP
Definition: SI4735.h:158
void setSSBBfo(int offset)
Sets the SSB Beat Frequency Offset (BFO).
Definition: SI4735.cpp:2264
#define AM_SEEK_SNR_THRESHOLD
Definition: SI4735.h:105
uint8_t getFirmwarePATCHL()
RESP4 - Returns the Patch ID High byte (HEX).
Definition: SI4735.h:1405
uint8_t raw[2]
Definition: SI4735.h:622
uint8_t getFirmwareCHIPREV()
RESP7 - Returns the Component Minor Revision (ASCII).
Definition: SI4735.h:1408
void getStatus(uint8_t, uint8_t)
Gets the current status of the Si4735 (AM or FM)
Definition: SI4735.cpp:1300
#define POWER_DOWN
Definition: SI4735.h:33
void sendSSBModeProperty()
Just send the property SSB_MOD to the device. Internal use (privete method).
Definition: SI4735.cpp:2508
void setFmBlendStereoThreshold(uint8_t parameter)
Sets RSSI threshold for stereo blend (Full stereo above threshold, blend below threshold).
Definition: SI4735.cpp:990
#define AM_CHANNEL_FILTER
Definition: SI4735.h:87
#define SI473X_ANALOG_AUDIO
Definition: SI4735.h:146
void setSSBDspAfc(uint8_t DSP_AFCDIS)
Sets DSP AFC disable or enable.
Definition: SI4735.cpp:2338
#define GPIO_CTL
Definition: SI4735.h:69
void frequencyDown()
Decrements the current frequency on current band/function by using the current step.
Definition: SI4735.cpp:676
uint8_t getStatusMULT()
Get the Status the M U L T.
Definition: SI4735.h:1167
bool getCurrentRssiDetectHigh()
Checks if RSSI detected is high.
Definition: SI4735.h:1297
#define FM_BLEND_MULTIPATH_STEREO_THRESHOLD
Definition: SI4735.h:59
void setSeekAmSpacing(uint16_t spacing)
Selects frequency spacingfor AM seek. Default is 10 kHz spacing.
Definition: SI4735.cpp:1586
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.
Definition: SI4735.cpp:356
#define GET_INT_STATUS
Definition: SI4735.h:36
uint8_t raw[3]
Definition: SI4735.h:803
char rds_buffer0A[9]
RDS Basic tuning and switching information (Type 0 groups)
Definition: SI4735.h:945
void setSSBAvcDivider(uint8_t AVC_DIVIDER)
Sets AVC Divider.
Definition: SI4735.cpp:2383
#define AM_SEEK_RSSI_THRESHOLD
Definition: SI4735.h:106
uint8_t getFirmwareCMPMINOR()
RESP6 - Returns the Component Major Revision (ASCII).
Definition: SI4735.h:1407
#define SSB_CURRENT_MODE
Definition: SI4735.h:154
#define FM_RDS_CONFIG
Definition: SI4735.h:50
uint16_t currentWorkFrequency
current frequency
Definition: SI4735.h:965
void setFrequency(uint16_t)
Set the frequency to the corrent function of the Si4735 (FM, AM or SSB)
Definition: SI4735.cpp:621