2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
32#define SI473X_ADDR_SEN_LOW 0x11
33#define SI473X_ADDR_SEN_HIGH 0x63
37#define POWER_DOWN 0x11
38#define SET_PROPERTY 0x12
39#define GET_PROPERTY 0x13
40#define GET_INT_STATUS 0x14
43#define FM_TUNE_FREQ 0x20
44#define FM_SEEK_START 0x21
45#define FM_TUNE_STATUS 0x22
46#define FM_AGC_STATUS 0x27
47#define FM_AGC_OVERRIDE 0x28
48#define FM_RSQ_STATUS 0x23
49#define FM_RDS_STATUS 0x24
51#define FM_NB_DETECT_THRESHOLD 0x1900
52#define FM_NB_INTERVAL 0x1901
53#define FM_NB_RATE 0x1902
54#define FM_NB_IIR_FILTER 0x1903
55#define FM_NB_DELAY 0x1904
58#define FM_RDS_INT_SOURCE 0x1500
59#define FM_RDS_INT_FIFO_COUNT 0x1501
60#define FM_RDS_CONFIG 0x1502
61#define FM_RDS_CONFIDENCE 0x1503
63#define FM_DEEMPHASIS 0x1100
64#define FM_BLEND_STEREO_THRESHOLD 0x1105
65#define FM_BLEND_MONO_THRESHOLD 0x1106
66#define FM_BLEND_RSSI_STEREO_THRESHOLD 0x1800
67#define FM_BLEND_RSSI_MONO_THRESHOLD 0x1801
68#define FM_BLEND_SNR_STEREO_THRESHOLD 0x1804
69#define FM_BLEND_SNR_MONO_THRESHOLD 0x1805
70#define FM_BLEND_MULTIPATH_STEREO_THRESHOLD 0x1808
71#define FM_BLEND_MULTIPATH_MONO_THRESHOLD 0x1809
72#define FM_CHANNEL_FILTER 0x1102
73#define FM_SOFT_MUTE_MAX_ATTENUATION 0x1302
76#define FM_SEEK_BAND_BOTTOM 0x1400
77#define FM_SEEK_BAND_TOP 0x1401
78#define FM_SEEK_FREQ_SPACING 0x1402
79#define FM_SEEK_TUNE_SNR_THRESHOLD 0x1403
80#define FM_SEEK_TUNE_RSSI_THRESHOLD 0x1404
84#define NBFM_TUNE_FREQ 0x50
85#define NBFM_TUNE_STATUS 0x52
86#define NBFM_RSQ_STATUS 0x53
87#define NBFM_AGC_STATUS 0x57
88#define NBFM_AGC_OVERRIDE 0x58
93#define NBFM_MAX_TUNE_ERROR 0x5108
94#define NBFM_RSQ_INT_SOURCE 0x5200
95#define NBFM_RSQ_SNR_HI_THRESHOLD 0x5201
96#define NBFM_RSQ_SNR_LO_THRESHOLD 0x5202
97#define NBFM_RSQ_RSSI_HI_THRESHOLD 0x5203
98#define NBFM_RSQ_RSSI_LO_THRESHOLD 0x5204
99#define NBFM_VALID_SNR_THRESHOLD 0x5403
100#define NBFM_VALID_RSSI_THRESHOLD 0x5404
104#define AM_TUNE_FREQ 0x40
105#define AM_SEEK_START 0x41
106#define AM_TUNE_STATUS 0x42
107#define AM_RSQ_STATUS 0x43
108#define AM_AGC_STATUS 0x47
109#define AM_AGC_OVERRIDE 0x48
115#define SSB_TUNE_FREQ 0x40
116#define SSB_TUNE_STATUS 0x42
117#define SSB_RSQ_STATUS 0x43
118#define SSB_AGC_STATUS 0x47
119#define SSB_AGC_OVERRIDE 0x48
123#define DIGITAL_OUTPUT_FORMAT 0x0102
124#define DIGITAL_OUTPUT_SAMPLE_RATE 0x0104
125#define REFCLK_FREQ 0x0201
126#define REFCLK_PRESCALE 0x0202
127#define AM_DEEMPHASIS 0x3100
128#define AM_CHANNEL_FILTER 0x3102
129#define AM_AUTOMATIC_VOLUME_CONTROL_MAX_GAIN 0x3103
130#define AM_MODE_AFC_SW_PULL_IN_RANGE 0x3104
131#define AM_MODE_AFC_SW_LOCK_IN_RANGE 0x3105
132#define AM_RSQ_INTERRUPTS 0x3200
133#define AM_RSQ_SNR_HIGH_THRESHOLD 0x3201
134#define AM_RSQ_SNR_LOW_THRESHOLD 0x3202
135#define AM_RSQ_RSSI_HIGH_THRESHOLD 0x3203
136#define AM_RSQ_RSSI_LOW_THRESHOLD 0x3204
137#define AM_SOFT_MUTE_RATE 0x3300
138#define AM_SOFT_MUTE_SLOPE 0x3301
139#define AM_SOFT_MUTE_MAX_ATTENUATION 0x3302
140#define AM_SOFT_MUTE_SNR_THRESHOLD 0x3303
141#define AM_SOFT_MUTE_RELEASE_RATE 0x3304
142#define AM_SOFT_MUTE_ATTACK_RATE 0x3305
143#define AM_SEEK_BAND_BOTTOM 0x3400
144#define AM_SEEK_BAND_TOP 0x3401
145#define AM_SEEK_FREQ_SPACING 0x3402
146#define AM_SEEK_SNR_THRESHOLD 0x3403
147#define AM_SEEK_RSSI_THRESHOLD 0x3404
148#define AM_AGC_ATTACK_RATE 0x3702
149#define AM_AGC_RELEASE_RATE 0x3703
150#define AM_FRONTEND_AGC_CONTROL 0x3705
151#define AM_NB_DETECT_THRESHOLD 0x3900
152#define AM_NB_INTERVAL 0x3901
153#define AM_NB_RATE 0x3902
154#define AM_NB_IIR_FILTER 0x3903
155#define AM_NB_DELAY 0x3904
157#define RX_VOLUME 0x4000
158#define RX_HARD_MUTE 0x4001
163#define GPO_IEN 0x0001
164#define SSB_BFO 0x0100
165#define SSB_MODE 0x0101
166#define SSB_RSQ_INTERRUPTS 0x3200
167#define SSB_RSQ_SNR_HI_THRESHOLD 0x3201
168#define SSB_RSQ_SNR_LO_THRESHOLD 0x3202
169#define SSB_RSQ_RSSI_HI_THRESHOLD 0x3203
170#define SSB_RSQ_RSSI_LO_THRESHOLD 0x3204
171#define SSB_SOFT_MUTE_RATE 0x3300
172#define SSB_SOFT_MUTE_MAX_ATTENUATION 0x3302
173#define SSB_SOFT_MUTE_SNR_THRESHOLD 0x3303
174#define SSB_RF_AGC_ATTACK_RATE 0x3700
175#define SSB_RF_AGC_RELEASE_RATE 0x3701
176#define SSB_IF_AGC_RELEASE_RATE 0x3703
177#define SSB_IF_AGC_ATTACK_RATE 0x3702
180#define SSB_RF_IF_AGC_ATTACK_RATE 0x3702
181#define SSB_RF_IF_AGC_RELEASE_RATE 0x3703
188#define SI473X_RDS_OUTPUT_ONLY 0b00000000
189#define SI473X_ANALOG_AUDIO 0b00000101
190#define SI473X_DIGITAL_AUDIO1 0b00001011
191#define SI473X_DIGITAL_AUDIO2 0b10110000
192#define SI473X_ANALOG_DIGITAL_AUDIO 0b10110101
195#define FM_CURRENT_MODE 0
196#define AM_CURRENT_MODE 1
197#define SSB_CURRENT_MODE 2
198#define NBFM_CURRENT_MODE 3
203#define MAX_DELAY_AFTER_SET_FREQUENCY 30
204#define MAX_DELAY_AFTER_POWERUP 10
205#define MIN_DELAY_WAIT_SEND_LOOP 300
206#define MAX_SEEK_TIME 8000
208#define DEFAULT_CURRENT_AVC_AM_MAX_GAIN 36
210#define XOSCEN_CRYSTAL 1
214
215
216
217
218
219
220
221
222
223
224
225
226
229
230
231
232
233
234
252
253
254
255
256
257
258
259
274
275
276
277
278
279
280
281
301
302
303
304
305
317
318
319
328} si47x_antenna_capacitor;
331
332
333
334
335
336
351} si47x_set_frequency;
354
355
356
357
358
359
360
361
362
363
368 uint8_t RESERVED1 : 2;
371 uint8_t RESERVED2 : 4;
377
378
379
380
381
382
383
384
391} si47x_seek_am_complement;
394
395
396
397
398
399
416
417
418
419
420
421
422
423
455} si47x_response_status;
458
459
460
461
462
463
464
465
489} si47x_firmware_information;
492
493
494
495
496
497
498
499
500
501
502
525} si47x_firmware_query_library;
528
529
530
531
532
533
534
535
542 uint8_t RESERVED2 : 6;
548
549
550
551
552
553
565
566
567
568
569
570
571
572
586 uint8_t RSSIILINT : 1;
587 uint8_t RSSIHINT : 1;
590 uint8_t MULTLINT : 1;
591 uint8_t MULTHINT : 1;
593 uint8_t BLENDINT : 1;
613
614
615
616
622 uint8_t MIN_GAIN_INDEX;
625} si47x_frontend_agc_control;
628
629
630
631
632
633
634
641 uint8_t STATUSONLY : 1;
648
649
650
651
652
653
668 uint8_t RDSSYNCLOST : 1;
669 uint8_t RDSSYNCFOUND : 1;
671 uint8_t RDSNEWBLOCKA : 1;
672 uint8_t RDSNEWBLOCKB : 1;
703
704
705
706
707
708
709
715 uint8_t RDSSYNCLOST : 1;
716 uint8_t RDSSYNCFOUND : 1;
718 uint8_t RDSNEWBLOCKA : 1;
719 uint8_t RDSNEWBLOCKB : 1;
724} si47x_rds_int_source;
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
757
758
759
760
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
796 uint16_t address : 2;
800 uint16_t programType : 5;
801 uint16_t trafficProgramCode : 1;
802 uint16_t versionCode : 1;
803 uint16_t groupType : 4;
807 uint16_t address : 4;
808 uint16_t textABFlag : 1;
809 uint16_t programType : 5;
810 uint16_t trafficProgramCode : 1;
811 uint16_t versionCode : 1;
812 uint16_t groupType : 4;
816 uint16_t content : 4;
817 uint16_t textABFlag : 1;
818 uint16_t programType : 5;
819 uint16_t trafficProgramCode : 1;
820 uint16_t versionCode : 1;
821 uint16_t groupType : 4;
831
832
833
834
835
836
837
838
840
841
842
843
844
845
846
847
848
849
850
851
854
855
856
857
858
859
860
861
862
863
869 uint8_t offset_sense : 1;
878} si47x_rds_date_time;
881
882
883
884
885
886
887
888
911
912
913
914
915
916
917
918
930} si47x_agc_overrride;
933
934
935
936
937
938
939
940
941
942
943
944
945
946
957} si47x_bandwidth_config;
960
961
962
963
964
965
971 uint8_t SBCUTFLT : 4;
972 uint8_t AVC_DIVIDER : 4;
974 uint8_t SMUTESEL : 1;
976 uint8_t DSP_AFCDIS : 1;
982
983
984
985
986
987
988
989
990
1002} si4735_digital_output_format;
1005
1006
1007
1008
1009
1010
1015 uint8_t reserved[8];
1017 uint8_t patch_id[14];
1018 uint16_t patch_size;
1021} si4735_eeprom_patch_header;
1024
1025
1026
1027
1028
1029
1030
1031
1035} si4735_digital_output_sample_rate;
1039
1040
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1121 void sendProperty(uint16_t propertyNumber, uint16_t param);
1135 void setGpioCtl(uint8_t GPO1OEN, uint8_t GPO2OEN, uint8_t GPO3OEN);
1136 void setGpio(uint8_t GPO1LEVEL, uint8_t GPO2LEVEL, uint8_t GPO3LEVEL);
1137 void setGpioIen(uint8_t STCIEN, uint8_t RSQIEN, uint8_t ERRIEN, uint8_t CTSIEN, uint8_t STCREP, uint8_t RSQREP);
1139 void setup(uint8_t resetPin, uint8_t defaultFunction);
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1163 sendProperty(propertyNumber, param);
1166 void sendCommand(uint8_t cmd,
int parameter_size,
const uint8_t *parameter);
1170 void setPowerUp(uint8_t CTSIEN, uint8_t GPO2OEN, uint8_t PATCH, uint8_t XOSCEN, uint8_t FUNC, uint8_t OPMODE);
1182
1183
1184
1185
1188
1189
1190
1191
1192
1195 return currentStatus.resp.RSQINT;
1199
1200
1201
1202
1203
1206 return currentStatus.resp.RDSINT;
1210
1211
1212
1213
1214
1217 return currentStatus.resp.STCINT;
1221
1222
1223
1224
1225
1228 return currentStatus.resp.ERR;
1232
1233
1234
1235
1236
1240
1241
1242
1243
1244
1247 return currentStatus.resp.AFCRL;
1251
1252
1253
1254
1255
1256
1257
1260 return currentStatus.resp.BLTF;
1264
1265
1266
1267
1268
1269
1270
1271
1274 return currentStatus.resp.VALID;
1278
1279
1280
1281
1282
1285 return currentStatus.resp.RSSI;
1289
1290
1291
1292
1293
1294
1295
1298 return currentStatus.resp.SNR;
1302
1303
1304
1305
1306
1307
1308
1311 return currentStatus.resp.MULT;
1315
1316
1317
1318
1319
1320
1321
1322
1325 si47x_antenna_capacitor cap;
1328 return currentStatus.resp.READANTCAP;
1331 cap.raw.ANTCAPL = currentStatus.resp.READANTCAP;
1332 cap.raw.ANTCAPH = currentStatus.resp.MULT;
1340
1341
1342
1346 currentAvcAmMaxGain = 90;
1350
1351
1352
1356 currentAvcAmMaxGain = 12;
1360
1361
1362
1373
1374
1375
1376
1377
1380 return currentAvcAmMaxGain;
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1400
1401
1402
1403
1404
1405
1406
1407
1414
1415
1416
1417
1418
1419
1426
1427
1428
1429
1430
1431
1438
1439
1440
1441
1442
1445 return !currentAgcStatus.refined.AGCDIS;
1449
1450
1451
1452
1453
1456 return currentAgcStatus.refined.AGCIDX;
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478 inline void setAGC(uint8_t AGCDIS, uint8_t AGCIDX) { setAutomaticGainControl( AGCDIS, AGCIDX); };
1481 void setSsbAgcOverrite(uint8_t SSBAGCDIS, uint8_t SSBAGCNDX, uint8_t reserved = 0);
1489
1490
1491
1492
1493
1496 return currentRqsStatus.resp.RSSI;
1500
1501
1502
1503
1504
1507 return currentRqsStatus.resp.SNR;
1511
1512
1513
1514
1515
1518 return currentRqsStatus.resp.RSSIILINT;
1522
1523
1524
1525
1526
1529 return currentRqsStatus.resp.RSSIHINT;
1533
1534
1535
1536
1537
1540 return currentRqsStatus.resp.SNRLINT;
1544
1545
1546
1547
1548
1551 return currentRqsStatus.resp.SNRHINT;
1555
1556
1557
1558
1559
1562 return currentRqsStatus.resp.VALID;
1566
1567
1568
1569
1570
1573 return currentRqsStatus.resp.AFCRL;
1577
1578
1579
1580
1581
1582
1583
1586 return currentRqsStatus.resp.SMUTE;
1592
1593
1594
1595
1596
1599 return currentRqsStatus.resp.STBLEND;
1603
1604
1605
1606
1607
1608
1609
1612 return currentRqsStatus.resp.PILOT;
1616
1617
1618
1619
1620
1621
1622
1625 return currentRqsStatus.resp.MULT;
1629
1630
1631
1632
1633
1635 return currentRqsStatus.resp.FREQOFF;
1639
1640
1641
1642
1643
1644
1646 return currentRqsStatus.resp.MULTLINT;
1650
1651
1652
1653
1654
1655
1657 return currentRqsStatus.resp.MULTHINT;
1661
1662
1663
1664
1665
1666
1668 return currentRqsStatus.resp.BLENDINT;
1672
1673
1674
1675
1678
1679
1680
1681
1682
1684 return firmwareInfo.resp.PN;
1688
1689
1690
1691
1692
1694 return firmwareInfo.resp.FWMAJOR;
1698
1699
1700
1701
1702
1704 return firmwareInfo.resp.FWMINOR;
1708
1709
1710
1711
1712
1714 return firmwareInfo.resp.PATCHH;
1718
1719
1720
1721
1722
1724 return firmwareInfo.resp.PATCHL;
1728
1729
1730
1731
1732
1734 return firmwareInfo.resp.CMPMAJOR;
1738
1739
1740
1741
1742
1744 return firmwareInfo.resp.CMPMINOR;
1748
1749
1750
1751
1752
1754 return firmwareInfo.resp.CHIPREV;
1763
1764
1765
1766
1767
1771
1772
1773
1774
1775
1778
1779
1780
1781
1782
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1805 currentAudioMode = audioMode;
1809
1810
1811
1812
1813
1814
1826 void setAM(uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step);
1827 void setFM(uint16_t fromFreq, uint16_t toFreq, uint16_t initialFreq, uint16_t step);
1830
1831
1832
1833
1834
1835
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1858
1859
1860
1861
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879 inline void setFmNoiseBlank(uint16_t nb_rate = 64, uint16_t nb_interval = 55, uint16_t nb_irr_filter = 300)
1887
1888
1889
1890
1897
1898
1899
1900
1901
1908
1909
1910
1911
1918
1919
1920
1921
1928
1929
1930
1931
1932
1933
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1957
1958
1959
1960
1961
1962
1963
1964
1972
1973
1974
1975
1976
1977
1978
1979
1986
1987
1988
1989
1990
1991
1992
1999
2000
2001
2002
2003
2004
2005
2012
2013
2014
2015
2016
2017
2018
2025
2026
2027
2028
2029
2030
2031
2038
2039
2040
2041
2042
2043
2044
2051
2052
2053
2054
2055
2056
2057
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2079 si47x_frontend_agc_control param;
2081 param.field.MIN_GAIN_INDEX = MIN_GAIN_INDEX;
2082 param.field.ATTN_BACKUP = ATTN_BACKUP;
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101 inline void setAmNoiseBlank(uint16_t nb_rate = 64, uint16_t nb_interval = 55, uint16_t nb_irr_filter = 300)
2109
2110
2111
2112
2119
2120
2121
2122
2123
2124
2131
2132
2133
2134
2135
2136
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2163
2164
2165
2166
2167
2169 return currentFrequencyParams.arg.FAST;
2173
2174
2175
2176
2177
2178
2180 currentFrequencyParams.arg.FAST = FAST;
2184
2185
2186
2187
2188
2190 return currentFrequencyParams.arg.FREEZE;
2194
2195
2196
2197
2198
2199
2201 currentFrequencyParams.arg.FREEZE = FREEZE;
2211
2212
2213
2214
2215
2219
2220
2221
2222
2223
2231
2232
2233
2234
2235
2236
2237
2238
2239
2246
2247
2248
2249
2250
2251
2252
2255 seekStationProgress(NULL,
SEEK_UP);
2259
2260
2261
2262
2263
2264
2265
2275 void seekStationProgress(
void (*showFunc)(uint16_t f),
bool (*stopSeking)(), uint8_t up_down);
2282
2283
2284
2285
2286
2287
2291
2292
2293
2294
2295
2296
2297
2307
2308
2309
2310
2311
2312
2316
2317
2318
2319
2320
2321
2322
2323
2324
2341 void setRdsIntSource(uint8_t RDSRECV, uint8_t RDSSYNCLOST, uint8_t RDSSYNCFOUND, uint8_t RDSNEWBLOCKA, uint8_t RDSNEWBLOCKB);
2342 void getRdsStatus(uint8_t INTACK, uint8_t MTFIFO, uint8_t STATUSONLY);
2345
2346
2347
2348
2349
2352 return currentRdsStatus.resp.RDSRECV;
2356
2357
2358
2359
2360
2363 return currentRdsStatus.resp.RDSSYNCLOST;
2367
2368
2369
2370
2371
2374 return currentRdsStatus.resp.RDSSYNCFOUND;
2378
2379
2380
2381
2382
2383
2386 return currentRdsStatus.resp.RDSNEWBLOCKA;
2390
2391
2392
2393
2394
2397 return currentRdsStatus.resp.RDSNEWBLOCKB;
2401
2402
2403
2404
2405
2408 return currentRdsStatus.resp.RDSSYNC;
2412
2413
2414
2415
2416
2419 return currentRdsStatus.resp.GRPLOST;
2423
2424
2425
2426
2427
2430 return currentRdsStatus.resp.RDSFIFOUSED;
2434
2435
2436
2437
2438
2445
2446
2447
2448
2449
2455
2456
2457
2458
2464
2465
2466
2467
2468
2475
2476
2477
2478
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2501
2502
2503
2504
2505
2512
2513
2514
2515
2516
2522 void setRdsConfig(uint8_t RDSEN, uint8_t BLETHA, uint8_t BLETHB, uint8_t BLETHC, uint8_t BLETHD);
2535 void mjdConverter(uint32_t mjd, uint32_t *year, uint32_t *month, uint32_t *day);
2538 bool getRdsDateTime(uint16_t *year, uint16_t *month, uint16_t *day, uint16_t *hour, uint16_t * minute);
2544 void setSSBConfig(uint8_t AUDIOBW, uint8_t SBCUTFLT, uint8_t AVC_DIVIDER, uint8_t AVCEN, uint8_t SMUTESEL, uint8_t DSP_AFCDIS);
2545 void setSSB(uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step, uint8_t usblsb);
2546 void setSSB(uint8_t usblsb);
2552
2553
2554
2555
2556
2564 void setNBFM(uint16_t fromFreq, uint16_t toFreq, uint16_t initialFreq, uint16_t step);
2566 void loadPatchNBFM(
const uint8_t *patch_content,
const uint16_t patch_content_size);
2571 bool downloadPatch(
const uint8_t *ssb_patch_content,
const uint16_t ssb_patch_content_size);
2572 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);
2573 void loadPatch(
const uint8_t *ssb_patch_content,
const uint16_t ssb_patch_content_size, uint8_t ssb_audiobw = 1);
2578
2579
2580
2581
2582
2583
2584
2585
2586
2589 this->maxDelayAfterPouwerUp = ms;
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2605 this->maxDelaySetFrequency = ms;
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2635 this->currentStep = step;
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2651 return this->currentWorkFrequency;
2655
2656
2657
2658
2659
2670
2671
2672
2673
2676
2677
2678
2681 Wire.setClock(10000);
2685
2686
2687
2688
2692
2693
2694
2695
2698 Wire.setClock(400000);
2702
2703
2704
2705
2706
2707
2708
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2726 audioMuteMcuPin = pin;
2727 pinMode(audioMuteMcuPin, OUTPUT);
2731
2732
2733
2734
2735
2736
2737
2738
2739
2742 digitalWrite(audioMuteMcuPin, on);
2743 delayMicroseconds(300);
2746 void convertToChar(uint16_t value,
char *strValue, uint8_t len, uint8_t dot, uint8_t separator,
bool remove_leading_zeros =
true );
#define AM_DEEMPHASIS
Definition: SI4735.h:127
#define SSB_AGC_STATUS
Definition: SI4735.h:118
#define AM_AGC_STATUS
Definition: SI4735.h:108
#define MIN_DELAY_WAIT_SEND_LOOP
Definition: SI4735.h:205
#define SI473X_ADDR_SEN_HIGH
Definition: SI4735.h:33
#define GPO_IEN
Definition: SI4735.h:163
#define FM_SEEK_BAND_BOTTOM
Definition: SI4735.h:76
#define FM_TUNE_STATUS
Definition: SI4735.h:45
#define SSB_MODE
Definition: SI4735.h:165
#define SSB_BFO
Definition: SI4735.h:164
#define FM_SEEK_START
Definition: SI4735.h:44
#define AM_SEEK_BAND_TOP
Definition: SI4735.h:144
#define FM_BLEND_SNR_MONO_THRESHOLD
Definition: SI4735.h:69
#define AM_AGC_OVERRIDE
Definition: SI4735.h:109
#define AM_SOFT_MUTE_SLOPE
Definition: SI4735.h:138
#define AM_NB_DELAY
Definition: SI4735.h:155
#define AM_NB_INTERVAL
Definition: SI4735.h:152
#define AM_AUTOMATIC_VOLUME_CONTROL_MAX_GAIN
Definition: SI4735.h:129
#define XOSCEN_CRYSTAL
Definition: SI4735.h:210
#define NBFM_TUNE_FREQ
Definition: SI4735.h:84
#define DEFAULT_CURRENT_AVC_AM_MAX_GAIN
Definition: SI4735.h:208
#define AM_CURRENT_MODE
Definition: SI4735.h:196
#define MAX_DELAY_AFTER_SET_FREQUENCY
Definition: SI4735.h:203
#define SSB_RF_AGC_ATTACK_RATE
Definition: SI4735.h:174
#define AM_SEEK_SNR_THRESHOLD
Definition: SI4735.h:146
#define AM_CHANNEL_FILTER
Definition: SI4735.h:128
#define FM_NB_DETECT_THRESHOLD
Definition: SI4735.h:51
#define SI473X_ADDR_SEN_LOW
Definition: SI4735.h:32
#define NBFM_CURRENT_MODE
Definition: SI4735.h:198
#define AM_RSQ_STATUS
Definition: SI4735.h:107
#define AM_SOFT_MUTE_MAX_ATTENUATION
Definition: SI4735.h:139
#define AM_SEEK_FREQ_SPACING
Definition: SI4735.h:145
#define SSB_RF_AGC_RELEASE_RATE
Definition: SI4735.h:175
#define AM_TUNE_FREQ
Definition: SI4735.h:104
#define AM_FRONTEND_AGC_CONTROL
Definition: SI4735.h:150
#define RX_HARD_MUTE
Definition: SI4735.h:158
#define NBFM_RSQ_STATUS
Definition: SI4735.h:86
#define NBFM_AGC_OVERRIDE
Definition: SI4735.h:88
#define SEEK_UP
Definition: SI4735.h:200
#define REFCLK_PRESCALE
Definition: SI4735.h:126
#define SSB_IF_AGC_RELEASE_RATE
Definition: SI4735.h:176
#define NBFM_TUNE_STATUS
Definition: SI4735.h:85
#define SEEK_DOWN
Definition: SI4735.h:201
#define FM_BLEND_MULTIPATH_MONO_THRESHOLD
Definition: SI4735.h:71
#define AM_AGC_RELEASE_RATE
Definition: SI4735.h:149
#define FM_AGC_OVERRIDE
Definition: SI4735.h:47
#define SSB_IF_AGC_ATTACK_RATE
Definition: SI4735.h:177
#define AM_NB_RATE
Definition: SI4735.h:153
#define FM_BLEND_STEREO_THRESHOLD
Definition: SI4735.h:64
#define FM_BLEND_MULTIPATH_STEREO_THRESHOLD
Definition: SI4735.h:70
#define FM_NB_IIR_FILTER
Definition: SI4735.h:54
#define FM_RDS_INT_SOURCE
Definition: SI4735.h:58
#define FM_SOFT_MUTE_MAX_ATTENUATION
Definition: SI4735.h:73
#define DIGITAL_OUTPUT_SAMPLE_RATE
Definition: SI4735.h:124
#define FM_BLEND_MONO_THRESHOLD
Definition: SI4735.h:65
#define FM_BLEND_RSSI_MONO_THRESHOLD
Definition: SI4735.h:67
#define MAX_DELAY_AFTER_POWERUP
Definition: SI4735.h:204
#define SET_PROPERTY
Definition: SI4735.h:38
#define FM_BLEND_SNR_STEREO_THRESHOLD
Definition: SI4735.h:68
#define FM_SEEK_TUNE_RSSI_THRESHOLD
Definition: SI4735.h:80
#define FM_RSQ_STATUS
Definition: SI4735.h:48
#define DIGITAL_OUTPUT_FORMAT
Definition: SI4735.h:123
#define XOSCEN_RCLK
Definition: SI4735.h:211
#define GET_REV
Definition: SI4735.h:36
#define FM_DEEMPHASIS
Definition: SI4735.h:63
#define FM_SEEK_TUNE_SNR_THRESHOLD
Definition: SI4735.h:79
#define FM_TUNE_FREQ
Definition: SI4735.h:43
#define AM_NB_IIR_FILTER
Definition: SI4735.h:154
#define POWER_DOWN
Definition: SI4735.h:37
#define AM_SEEK_RSSI_THRESHOLD
Definition: SI4735.h:147
#define AM_SOFT_MUTE_SNR_THRESHOLD
Definition: SI4735.h:140
#define FM_NB_INTERVAL
Definition: SI4735.h:52
#define GET_INT_STATUS
Definition: SI4735.h:40
#define SSB_TUNE_FREQ
Definition: SI4735.h:115
#define SSB_AGC_OVERRIDE
Definition: SI4735.h:119
#define AM_SOFT_MUTE_RATE
Definition: SI4735.h:137
#define AM_SOFT_MUTE_ATTACK_RATE
Definition: SI4735.h:142
#define FM_BLEND_RSSI_STEREO_THRESHOLD
Definition: SI4735.h:66
#define POWER_UP
Definition: SI4735.h:35
#define FM_RDS_STATUS
Definition: SI4735.h:49
#define GPIO_CTL
Definition: SI4735.h:110
#define FM_SEEK_FREQ_SPACING
Definition: SI4735.h:78
#define FM_AGC_STATUS
Definition: SI4735.h:46
#define NBFM_AGC_STATUS
Definition: SI4735.h:87
#define FM_NB_RATE
Definition: SI4735.h:53
#define FM_CURRENT_MODE
Definition: SI4735.h:195
#define MAX_SEEK_TIME
Definition: SI4735.h:206
#define GET_PROPERTY
Definition: SI4735.h:39
#define AM_SEEK_START
Definition: SI4735.h:105
#define SSB_CURRENT_MODE
Definition: SI4735.h:197
#define FM_NB_DELAY
Definition: SI4735.h:55
#define AM_SOFT_MUTE_RELEASE_RATE
Definition: SI4735.h:141
#define REFCLK_FREQ
Definition: SI4735.h:125
#define SSB_SOFT_MUTE_MAX_ATTENUATION
Definition: SI4735.h:172
#define AM_TUNE_STATUS
Definition: SI4735.h:106
#define AM_AGC_ATTACK_RATE
Definition: SI4735.h:148
#define FM_SEEK_BAND_TOP
Definition: SI4735.h:77
#define RX_VOLUME
Definition: SI4735.h:157
#define GPIO_SET
Definition: SI4735.h:111
#define AM_SEEK_BAND_BOTTOM
Definition: SI4735.h:143
#define FM_RDS_CONFIG
Definition: SI4735.h:60
#define FM_CHANNEL_FILTER
Definition: SI4735.h:72
#define SI473X_ANALOG_AUDIO
Definition: SI4735.h:189
#define FM_RDS_INT_FIFO_COUNT
Definition: SI4735.h:59
SI4735 Class.
Definition: SI4735.h:1054
uint8_t ctsIntEnable
Definition: SI4735.h:1090
uint8_t currentSsbStatus
Definition: SI4735.h:1111
bool rdsEndGroupB
Definition: SI4735.h:1066
void setFmNoiseBlankInterval(uint16_t parameter)
Set the Fm Noise Blank Interval.
Definition: SI4735.h:1891
char rds_buffer2A[65]
RDS Radio Text buffer - Program Information.
Definition: SI4735.h:1056
int rdsTextAdress0A
rds_buffer0A current position
Definition: SI4735.h:1063
si473x_powerup powerUp
Definition: SI4735.h:1106
uint8_t lastMode
Stores the last mode used.
Definition: SI4735.h:1086
int8_t audioMuteMcuPin
Definition: SI4735.h:1112
int rdsTextAdress2A
rds_buffer2A current position
Definition: SI4735.h:1061
uint8_t currentClockType
Stores the current clock type used (Crystal or REF CLOCK)
Definition: SI4735.h:1089
void setAmNoiseBlank(uint16_t nb_rate=64, uint16_t nb_interval=55, uint16_t nb_irr_filter=300)
Set the Am Noise Blank.
Definition: SI4735.h:2101
int16_t deviceAddress
Stores the current I2C bus address.
Definition: SI4735.h:1068
uint16_t refClock
Frequency of Reference Clock in Hz.
Definition: SI4735.h:1093
void setFmNoiseBlankThreshold(uint16_t parameter)
Set the Fm Noise Blank Threshold.
Definition: SI4735.h:1862
si47x_rds_status currentRdsStatus
current RDS status
Definition: SI4735.h:1102
si47x_frequency currentFrequency
data structure to get current frequency
Definition: SI4735.h:1097
uint16_t currentMinimumFrequency
minimum frequency of the current band
Definition: SI4735.h:1080
uint8_t currentAudioMode
Current audio mode used (ANALOG or DIGITAL or both)
Definition: SI4735.h:1110
bool rdsEndGroupA
Definition: SI4735.h:1065
uint8_t refClockSourcePin
0 = RCLK pin is clock source; 1 = DCLK pin is clock source.
Definition: SI4735.h:1095
void setFmNoiseBlankRate(uint16_t parameter)
Set the Fm Noise Blank Rate.
Definition: SI4735.h:1902
uint16_t maxDelaySetFrequency
Stores the maximum delay after set frequency command (in ms).
Definition: SI4735.h:1071
uint8_t resetPin
pin used on Arduino Board to RESET the Si47XX device
Definition: SI4735.h:1076
uint8_t currentAvcAmMaxGain
Stores the current Automatic Volume Control Gain for AM.
Definition: SI4735.h:1088
si47x_ssb_mode currentSSBMode
indicates if USB or LSB
Definition: SI4735.h:1104
char rds_buffer2B[33]
RDS Radio Text buffer - Station Informaation.
Definition: SI4735.h:1057
si47x_response_status currentStatus
current device status
Definition: SI4735.h:1100
uint16_t maxDelayAfterPouwerUp
Stores the maximum delay you have to setup after a power up command (in ms).
Definition: SI4735.h:1072
SI4735()
Construct a new SI4735::SI4735.
Definition: SI4735.cpp:60
si47x_set_frequency currentFrequencyParams
Definition: SI4735.h:1098
void setFmNoiseBlankDelay(uint16_t parameter)
Set the Fm Noise Blank Delay.
Definition: SI4735.h:1912
void setFmNoiseBlank_IIR_Filter(uint16_t parameter)
Set the FmNoiseBlank IIR Filter.
Definition: SI4735.h:1922
uint16_t refClockPrescale
Prescaler for Reference Clock (divider).
Definition: SI4735.h:1094
uint16_t currentWorkFrequency
current frequency
Definition: SI4735.h:1082
si47x_rqs_status currentRqsStatus
current Radio SIgnal Quality status
Definition: SI4735.h:1099
uint8_t gpo2Enable
Definition: SI4735.h:1091
uint16_t currentMaximumFrequency
maximum frequency of the current band
Definition: SI4735.h:1081
uint8_t volume
Stores the current vlume setup (0-63).
Definition: SI4735.h:1108
uint8_t lastTextFlagAB
Definition: SI4735.h:1075
char rds_buffer0A[9]
RDS Basic tuning and switching information (Type 0 groups)
Definition: SI4735.h:1058
uint8_t currentTune
tell the current tune (FM, AM or SSB)
Definition: SI4735.h:1078
void setFmNoiseBlank(uint16_t nb_rate=64, uint16_t nb_interval=55, uint16_t nb_irr_filter=300)
Set the Fm Noise Blank.
Definition: SI4735.h:1879
si47x_firmware_information firmwareInfo
firmware information
Definition: SI4735.h:1101
unsigned long maxSeekTime
Stores the maximum time (ms) for a seeking process. Defines the maximum seeking time.
Definition: SI4735.h:1073
uint16_t currentStep
Stores the current step used to increment or decrement the frequency.
Definition: SI4735.h:1084
int rdsTextAdress2B
rds_buffer2B current position
Definition: SI4735.h:1062
si47x_agc_status currentAgcStatus
current AGC status
Definition: SI4735.h:1103
bool isCurrentTuneFM()
Definition: SI4735.h:2113
void setFmBandwidth(uint8_t filter_value=0)
Sets the Bandwith on FM mode.
Definition: SI4735.h:2157
char rds_time[25]
RDS date time received information.
Definition: SI4735.h:1059
uint16_t raw
Definition: SI4735.h:1001
uint8_t raw[8]
Definition: SI4735.h:609
uint8_t raw[3]
Definition: SI4735.h:907
uint8_t raw
Definition: SI4735.h:644
uint8_t raw[6]
Definition: SI4735.h:877
uint8_t raw[8]
Definition: SI4735.h:524
uint8_t raw[13]
Definition: SI4735.h:699
uint8_t ARG2
Definition: SI4735.h:387
uint8_t raw[5]
Definition: SI4735.h:350
uint8_t raw[2]
Definition: SI4735.h:929
uint16_t value
Definition: SI4735.h:561
uint8_t raw
Definition: SI4735.h:373
uint8_t raw
Definition: SI4735.h:412
uint8_t raw[32]
Definition: SI4735.h:1020
uint16_t DOSR
Definition: SI4735.h:1034
uint8_t raw[8]
Check it.
Definition: SI4735.h:454
uint8_t ARG3
Definition: SI4735.h:388
uint16_t raw
Definition: SI4735.h:297
uint8_t raw[9]
Definition: SI4735.h:488
uint16_t value
Definition: SI4735.h:327
uint8_t raw[2]
Definition: SI4735.h:956
uint16_t value
frequency (integer value)
Definition: SI4735.h:313
uint8_t raw[2]
Raw powerup parameters data. Same arg memory position. So, same content.
Definition: SI4735.h:248
uint8_t raw[2]
Definition: SI4735.h:723
uint8_t raw[2]
Definition: SI4735.h:978
uint8_t ANTCAPL
Definition: SI4735.h:390
uint8_t raw[2]
Definition: SI4735.h:753
uint8_t ANTCAPH
Definition: SI4735.h:389
uint8_t raw
Definition: SI4735.h:270
uint8_t raw
Definition: SI4735.h:544
uint16_t word
Definition: SI4735.h:624
void setGpioCtl(uint8_t GPO1OEN, uint8_t GPO2OEN, uint8_t GPO3OEN)
Enables output for GPO1, 2, and 3.
Definition: SI4735.cpp:119
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:158
void setDeviceOtherI2CAddress(uint8_t i2cAddr)
Sets the onther I2C Bus Address (for Si470X)
Definition: SI4735.cpp:283
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:195
void setDeviceI2CAddress(uint8_t senPin)
Sets the I2C Bus Address.
Definition: SI4735.cpp:269
int16_t getDeviceI2CAddress(uint8_t resetPin)
I2C bus address setup.
Definition: SI4735.cpp:224
si47x_status getInterruptStatus()
Updates bits 6:0 of the status byte.
Definition: SI4735.cpp:83
uint8_t getFirmwarePATCHH()
Returns the Firmware P A T C H HIGH.
Definition: SI4735.h:1713
uint8_t getFirmwareFWMINOR()
Returns the Firmware F W M I N O R.
Definition: SI4735.h:1703
void waitToSend(void)
Wait for the si473x is ready (Clear to Send (CTS) status bit have to be 1).
Definition: SI4735.cpp:316
uint8_t getFirmwareCMPMINOR()
RESP6 - Returns the Component Major Revision (ASCII).
Definition: SI4735.h:1743
uint8_t getFirmwarePN()
Returns the Firmware Part Number.
Definition: SI4735.h:1683
uint8_t getFirmwareCMPMAJOR()
Get the Firmware C M P M A J O R object.
Definition: SI4735.h:1733
uint8_t getFirmwarePATCHL()
Returns the Firmware P A T C H LOW.
Definition: SI4735.h:1723
uint8_t getFirmwareFWMAJOR()
Returns the Firmware F W M A J O R.
Definition: SI4735.h:1693
uint8_t getFirmwareCHIPREV()
RESP8 - Returns the Chip Revision (ASCII)
Definition: SI4735.h:1753
void setMaxDelayPowerUp(uint16_t ms)
Set the Max Delay Power Up.
Definition: SI4735.h:2587
void reset(void)
Reset the SI473X
Definition: SI4735.cpp:297
void getFirmware(void)
Gets firmware information.
Definition: SI4735.cpp:476
void radioPowerUp(void)
Powerup the Si47XX.
Definition: SI4735.cpp:404
void analogPowerUp(void)
You have to call setPowerUp method before.
Definition: SI4735.cpp:439
void setRefClock(uint16_t refclk)
Sets the frequency of the REFCLK from the output of the prescaler.
Definition: SI4735.cpp:519
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:346
void setup(uint8_t resetPin, uint8_t defaultFunction)
Starts the Si473X device.
Definition: SI4735.cpp:614
void powerDown(void)
Moves the device from powerup to powerdown mode.
Definition: SI4735.cpp:454
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.
Definition: SI4735.cpp:548
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.
Definition: SI4735.cpp:574
bool getCurrentRssiDetectLow()
Checks if RSSI detected is LOW.
Definition: SI4735.h:1516
uint8_t getStatusMULT()
Get the Status the M U L T.
Definition: SI4735.h:1309
bool getCurrentPilot()
Checks the current pilot.
Definition: SI4735.h:1610
bool getCurrentSnrDetectLow()
Checks if SNR detect is low.
Definition: SI4735.h:1538
bool getCurrentBlendDetectInterrupt()
Gets the Current Blend Detect Interrupt.
Definition: SI4735.h:1667
void setAMSoftMuteSlop(uint8_t parameter)
Sets the AM attenuation slope during soft mute.
Definition: SI4735.h:1950
bool getBandLimit()
Returns true if a seek hit the band limit.
Definition: SI4735.h:1258
void seekStationDown()
Search the previous station.
Definition: SI4735.h:2266
void setAGC(uint8_t AGCDIS, uint8_t AGCIDX)
Automatic Gain Control setup (alternative name for setAutomaticGainControl )
Definition: SI4735.h:1478
void setAutomaticGainControl(uint8_t AGCDIS, uint8_t AGCIDX)
Automatic Gain Control setup.
Definition: SI4735.cpp:1044
uint8_t getCurrentSignedFrequencyOffset()
Gets the Signed frequency offset (kHz).
Definition: SI4735.h:1634
bool getTuneCompleteTriggered()
Get the Tune Complete status.
Definition: SI4735.h:1215
void setFMDeEmphasis(uint8_t parameter)
Sets the FM Receive de-emphasis to 50 or 75 μs.
Definition: SI4735.h:1836
void seekStation(uint8_t SEEKUP, uint8_t WRAP)
Look for a station (Automatic tune)
Definition: SI4735.cpp:1172
void seekStationProgress(void(*showFunc)(uint16_t f), bool(*stopSeking)(), uint8_t up_down)
Seeks a station up or down.
Definition: SI4735.cpp:1322
void setAMSoftMuteReleaseRate(uint8_t parameter)
Sets the soft mute release rate.
Definition: SI4735.h:1993
void getStatus()
Gets the current status of the Si47XX (AM, FM or SSB)
Definition: SI4735.h:2660
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:815
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.
Definition: SI4735.h:2077
bool isCurrentTuneAM()
Returns true if the current function is AM (AM_TUNE_FREQ).
Definition: SI4735.h:2125
void setAMSoftMuteRate(uint8_t parameter)
Sets the attack and decay rates when entering or leaving soft mute.
Definition: SI4735.h:1965
uint8_t getAgcGainIndex()
Gets the current AGC gain index.
Definition: SI4735.h:1454
void setSeekFmSrnThreshold(uint16_t value)
Set the Seek Fm Srn Threshold object.
Definition: SI4735.h:2313
uint8_t getCurrentRSSI()
Get the current receive signal strength (0–127 dBμV)
Definition: SI4735.h:1494
void setTuneFrequencyFast(uint8_t FAST)
Sets the FAST Tuning.
Definition: SI4735.h:2179
void getStatus(uint8_t, uint8_t)
Gets the current status of the Si4735 (AM or FM)
Definition: SI4735.cpp:951
bool getCurrentValidChannel()
Checks if the current channel is valid.
Definition: SI4735.h:1560
void setAvcAmMaxGain(uint8_t gain=90)
Sets the maximum gain for automatic volume control.
Definition: SI4735.cpp:1084
void setSeekFmSpacing(uint16_t spacing)
Selects frequency spacingfor FM seek. Default is 100 kHz (value 10) spacing. There are only 3 valid v...
Definition: SI4735.cpp:1402
void setFrequency(uint16_t)
Set the frequency to the corrent function of the Si4735 (FM, AM or SSB)
Definition: SI4735.cpp:683
void setAMDeEmphasis(uint8_t parameter)
Sets the AM Receive de-emphasis to 50 or disable.
Definition: SI4735.h:1934
void setAMSoftMuteSnrThreshold(uint8_t parameter)
Sets the SNR threshold to engage soft mute.
Definition: SI4735.h:1980
void setFM(uint16_t fromFreq, uint16_t toFreq, uint16_t initialFreq, uint16_t step)
Sets the radio to FM function.
Definition: SI4735.cpp:853
bool isCurrentTuneSSB()
Returns true if the current function is SSB (SSB_TUNE_FREQ).
Definition: SI4735.h:2137
bool getStatusError()
Get the Status Error.
Definition: SI4735.h:1226
void setTuneFrequencyFreze(uint8_t FREEZE)
Sets Freeze Metrics During Alternate Frequency Jum.
Definition: SI4735.h:2200
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:1357
uint8_t getCurrentMultipath()
Gets the current Multipath.
Definition: SI4735.h:1623
void setSeekAmSpacing(uint16_t spacing)
Selects frequency spacingfor AM seek. Default is 10 kHz spacing.
Definition: SI4735.cpp:1388
void setAmAgcAttackRate(uint16_t parameter)
Sets the AGC attack rate.
Definition: SI4735.h:2019
void getCurrentReceivedSignalQuality(void)
Queries the status of the Received Signal Quality (RSQ) of the current channel (FM_RSQ_STATUS)
Definition: SI4735.cpp:1156
void setAM()
Sets the radio to AM function. It means: LW MW and SW.
Definition: SI4735.cpp:760
bool getCurrentSoftMuteIndicator()
Soft Mute Indicator.
Definition: SI4735.h:1584
void setFrequencyUp()
Set the FrequencyUp.
Definition: SI4735.h:2216
void setFrequencyStep(uint16_t step)
Sets the current step value.
Definition: SI4735.h:2633
uint8_t getTuneFrequecyFast()
Returns the FAST tuning status.
Definition: SI4735.h:2168
void setMaxDelaySetFrequency(uint16_t ms)
Set the Max Delay after Set Frequency.
Definition: SI4735.h:2603
uint16_t getFrequency(void)
Gets the current frequency of the Si4735 (AM or FM)
Definition: SI4735.cpp:929
void seekStationProgress(void(*showFunc)(uint16_t f), uint8_t up_down)
Seeks a station up or down.
Definition: SI4735.cpp:1267
void setSeekAmSrnThreshold(uint16_t value)
Set the Seek Am Srn Threshold object.
Definition: SI4735.h:2288
uint16_t getCurrentFrequency()
Gets the current frequency saved in memory.
Definition: SI4735.h:2649
bool getCurrentMultipathDetectHigh()
Gets the Current Multipath Detect High.
Definition: SI4735.h:1656
void setSeekAmSNRThreshold(uint16_t value)
Sets the SNR threshold for a valid AM Seek/Tune.
Definition: SI4735.h:2298
void setBandwidth(uint8_t AMCHFLT, uint8_t AMPLFLT)
Selects the bandwidth of the channel filter for AM reception.
Definition: SI4735.cpp:889
void setSeekFmSNRThreshold(uint16_t value)
Sets the SNR threshold for a valid FM Seek/Tune.
Definition: SI4735.h:2325
void frequencyDown()
Decrements the current frequency on current band/function by using the current step.
Definition: SI4735.cpp:738
uint8_t getTuneFrequecyFreeze()
Returns the FREEZE status.
Definition: SI4735.h:2189
void setSeekFmRssiThreshold(uint16_t value)
Sets the RSSI threshold for a valid FM Seek/Tune.
Definition: SI4735.cpp:1431
bool getRadioDataSystemInterrupt()
Get the Radio Data System (RDS) Interrupt status.
Definition: SI4735.h:1204
void setFrequencyDown()
Set the Frequency Down.
Definition: SI4735.h:2224
void setAMSoftMuteAttackRate(uint16_t parameter)
Sets the soft mute attack rate.
Definition: SI4735.h:2006
void getAutomaticGainControl()
Queries Automatic Gain Control STATUS.
Definition: SI4735.cpp:999
void setTuneFrequencyAntennaCapacitor(uint16_t capacitor)
Selects the tuning capacitor value.
Definition: SI4735.cpp:643
void seekStationUp()
Search for the next station.
Definition: SI4735.h:2253
void setAmAgcReleaseRate(uint16_t parameter)
Sets the AGC release rate.
Definition: SI4735.h:2032
bool getACFIndicator()
Returns true if the AFC rails (AFC Rail Indicator).
Definition: SI4735.h:1245
void seekNextStation()
Search for the next station.
Definition: SI4735.cpp:1215
void getCurrentReceivedSignalQuality(uint8_t INTACK)
Queries the status of the Received Signal Quality (RSQ) of the current channel.
Definition: SI4735.cpp:1105
uint8_t getStatusSNR()
Gets the SNR metric when tune is complete (dB)
Definition: SI4735.h:1296
void frequencyUp()
Increments the current frequency on current band/function by using the current step.
Definition: SI4735.cpp:721
void setFmSoftMuteMaxAttenuation(uint8_t smattn=0)
Sets the Fm Soft Mute Max Attenuation.
Definition: SI4735.h:1852
uint8_t getCurrentStereoBlend()
Gets the value of the amount of stereo blend in % (100 = full stereo, 0 = full mono).
Definition: SI4735.h:1597
void setFM()
Sets the radio to FM function.
Definition: SI4735.cpp:785
bool getSignalQualityInterrupt()
Get the Signal Quality Interrupt status.
Definition: SI4735.h:1193
bool getCurrentMultipathDetectLow()
Get Multipath Detect Low.
Definition: SI4735.h:1645
void seekPreviousStation()
Search the previous station.
Definition: SI4735.cpp:1230
uint8_t getCurrentSNR()
Gets the current SNR metric (0–127 dB).
Definition: SI4735.h:1505
bool getCurrentRssiDetectHigh()
Checks if RSSI detected is high.
Definition: SI4735.h:1527
void setSeekAmRssiThreshold(uint16_t value)
Sets the RSSI threshold for a valid AM Seek/Tune.
Definition: SI4735.cpp:1417
bool isAgcEnabled()
Checks if the AGC is enabled.
Definition: SI4735.h:1443
bool getCurrentSnrDetectHigh()
Checks if SNR detect is high.
Definition: SI4735.h:1549
void setMaxSeekTime(long time_in_ms)
Sets the maximum time in milliseconds for seeking. The default value is 8000ms (8s).
Definition: SI4735.h:2240
uint8_t getReceivedSignalStrengthIndicator()
Returns the value of Received Signal Strength Indicator (dBμV).
Definition: SI4735.h:1283
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.
Definition: SI4735.cpp:1373
bool getStatusValid()
Gets the channel status.
Definition: SI4735.h:1272
bool getStatusCTS()
Gets the Error flag Clear to Send.
Definition: SI4735.h:1237
bool getCurrentAfcRailIndicator()
AFC Rail Indicator.
Definition: SI4735.h:1571
void setProperty(uint16_t propertyNumber, uint16_t param)
Sets a given SI47XX device property.
Definition: SI4735.h:1161
void sendCommand(uint8_t cmd, int parameter_size, const uint8_t *parameter)
Sends a given command to the SI47XX devices.
Definition: SI4735.cpp:1485
void sendProperty(uint16_t propertyNumber, uint16_t param)
Sends (sets) property to the SI47XX.
Definition: SI4735.cpp:1453
void getCommandResponse(int num_of_bytes, uint8_t *response)
Returns with the command response.
Definition: SI4735.cpp:1507
int32_t getProperty(uint16_t propertyValue)
Gets a given property from the SI47XX.
Definition: SI4735.cpp:1553
si47x_status getStatusResponse()
Gets the first byte response.
Definition: SI4735.cpp:1527
void setFmBlendMultiPathStereoThreshold(uint8_t parameter)
Sets multipath threshold for stereo blend (Full stereo below threshold, blend above threshold).
Definition: SI4735.cpp:1693
void setFmBLendRssiMonoThreshold(uint8_t parameter)
Sets RSSI threshold for mono blend (Full mono below threshold, blend above threshold).
Definition: SI4735.cpp:1645
void setFmBlendSnrStereoThreshold(uint8_t parameter)
Sets SNR threshold for stereo blend (Full stereo above threshold, blend below threshold).
Definition: SI4735.cpp:1661
void setFmStereoOn()
Turn Off Stereo operation.
Definition: SI4735.cpp:1729
void setFmStereoOff()
Turn Off Stereo operation.
Definition: SI4735.cpp:1719
void setFmBlendRssiStereoThreshold(uint8_t parameter)
Sets RSSI threshold for stereo blend. (Full stereo above threshold, blend below threshold....
Definition: SI4735.cpp:1629
void setFmBlendStereoThreshold(uint8_t parameter)
Sets RSSI threshold for stereo blend (Full stereo above threshold, blend below threshold).
Definition: SI4735.cpp:1597
void setFmBlendMultiPathMonoThreshold(uint8_t parameter)
Sets Multipath threshold for mono blend (Full mono above threshold, blend below threshold).
Definition: SI4735.cpp:1709
void setFmBlendMonoThreshold(uint8_t parameter)
Sets RSSI threshold for mono blend (Full mono below threshold, blend above threshold).
Definition: SI4735.cpp:1613
void setFmBLendSnrMonoThreshold(uint8_t parameter)
Sets SNR threshold for mono blend (Full mono below threshold, blend above threshold).
Definition: SI4735.cpp:1677
void disableFmDebug()
There is a debug feature that remains active in Si4704/05/3x-D60 firmware which can create periodic n...
Definition: SI4735.cpp:1744
void setVolumeDown()
Set the Volume Down.
Definition: SI4735.h:1783
void setAudioMute(bool off)
Sets the audio on or off.
Definition: SI4735.cpp:1832
void digitalOutputSampleRate(uint16_t DOSR)
Enables digital audio output and configures digital audio output sample rate in samples per second (s...
Definition: SI4735.cpp:1801
void volumeDown()
Set sound volume level Down
Definition: SI4735.cpp:1875
void setVolume(uint8_t volume)
Sets volume level (0 to 63)
Definition: SI4735.cpp:1815
uint8_t getCurrentVolume()
Get the Current Volume.
Definition: SI4735.h:1768
void volumeUp()
Set sound volume level Up
Definition: SI4735.cpp:1861
void setAmDelayNB(uint16_t value)
Sets the delay before applying impulse blanking.
Definition: SI4735.h:1815
void setAudioMode(uint8_t audioMode)
Sets the Audio Mode. See table below.
Definition: SI4735.h:1803
uint8_t getVolume()
Gets the current volume level.
Definition: SI4735.cpp:1849
void setVolumeUp()
Set the Volume Up.
Definition: SI4735.h:1776
void digitalOutputFormat(uint8_t OSIZE, uint8_t OMONO, uint8_t OMODE, uint8_t OFALL)
Configures the digital audio output format.
Definition: SI4735.cpp:1777
uint8_t getRdsFlagAB(void)
Returns the current Text Flag A/B
Definition: SI4735.cpp:2152
void resetEndIndicatorGroupB()
Resets 0xD or 0xA special characters condition (makes it false)
Definition: SI4735.h:2479
char * getRdsText0A(void)
Gets the station name and other messages.
Definition: SI4735.cpp:2321
void rdsClearFifo()
Empty FIFO.
Definition: SI4735.h:2506
bool getEndIndicatorGroupB()
Check if 0xD or 0xA special characters were received for group B.
Definition: SI4735.h:2469
void resetEndIndicatorGroupA()
Resets 0xD or 0xA special characters condition (makes it false)
Definition: SI4735.h:2459
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:2068
void rdsClearInterrupt()
Clears RDSINT.
Definition: SI4735.h:2517
char * getRdsDateTime(void)
Gets the RDS the Time and Date when the Group type is 4.
Definition: SI4735.cpp:2601
bool getRdsNewBlockA()
Get the Rds New Block A.
Definition: SI4735.h:2384
bool getRdsReceived()
Get the Rds Received FIFO.
Definition: SI4735.h:2350
bool getRdsSync()
Get the Rds Sync.
Definition: SI4735.h:2406
char * getRdsText(void)
Gets the RDS Text when the message is of the Group Type 2 version A.
Definition: SI4735.cpp:2297
bool getRdsSyncFound()
Get the Rds Sync Found.
Definition: SI4735.h:2372
char * getRdsText2B(void)
Gets the Text processed for the 2B group.
Definition: SI4735.cpp:2387
uint8_t getNumRdsFifoUsed()
Get the Num Rds Fifo Used.
Definition: SI4735.h:2428
bool getGroupLost()
Get the Group Lost.
Definition: SI4735.h:2417
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.
Definition: SI4735.cpp:2529
void getRdsStatus()
Gets RDS Status.
Definition: SI4735.h:2495
uint8_t getRdsGroupType(void)
Returns the Group Type (extracted from the Block B)
Definition: SI4735.cpp:2135
char * getRdsTime(void)
Gets the RDS time and date when the Group type is 4.
Definition: SI4735.cpp:2425
uint8_t getRdsTextSegmentAddress(void)
Returns the address of the text segment.
Definition: SI4735.cpp:2174
void getNext2Block(char *)
Process data received from group 2B.
Definition: SI4735.cpp:2226
void mjdConverter(uint32_t mjd, uint32_t *year, uint32_t *month, uint32_t *day)
Converts the MJD number to integers Year, month and day.
Definition: SI4735.cpp:2490
bool getRdsSyncLost()
Get the Rds Sync Lost object.
Definition: SI4735.h:2361
uint8_t getRdsProgramType(void)
Returns the Program Type (extracted from the Block B)
Definition: SI4735.cpp:2209
void clearRdsBuffer2A()
Clear RDS buffer 2A (text)
Definition: SI4735.cpp:1914
void setFifoCount(uint16_t value)
Sets the minimum number of RDS groups stored in the RDS FIFO before RDSRECV is set.
Definition: SI4735.h:2439
void setRdsConfig(uint8_t RDSEN, uint8_t BLETHA, uint8_t BLETHB, uint8_t BLETHC, uint8_t BLETHD)
Sets RDS property.
Definition: SI4735.cpp:1980
void getNext4Block(char *)
Process data received from group 2A.
Definition: SI4735.cpp:2261
bool getEndIndicatorGroupA()
Check if 0xD or 0xA special characters were received for group A.
Definition: SI4735.h:2450
void setRdsIntSource(uint8_t RDSRECV, uint8_t RDSSYNCLOST, uint8_t RDSSYNCFOUND, uint8_t RDSNEWBLOCKA, uint8_t RDSNEWBLOCKB)
Configures interrupt related to RDS.
Definition: SI4735.cpp:2026
void clearRdsBuffer0A()
Clear RDS buffer 0A (text)
Definition: SI4735.cpp:1939
char * getRdsText2A(void)
Gets the Text processed for the 2A group.
Definition: SI4735.cpp:2354
void clearRdsBuffer2B()
Clear RDS buffer 2B (text)
Definition: SI4735.cpp:1927
uint16_t getRdsPI(void)
Returns the programa type.
Definition: SI4735.cpp:2119
uint8_t getRdsVersionCode(void)
Gets the version code (extracted from the Block B)
Definition: SI4735.cpp:2190
bool getRdsNewBlockB()
Get the Rds New Block B.
Definition: SI4735.h:2395
void RdsInit()
Starts the control member variables for RDS.
Definition: SI4735.cpp:1900
void setAmSoftMuteMaxAttenuation(uint8_t smattn=0)
Sets the Am Soft Mute Max Attenuation.
Definition: SI4735.h:1394
void ssbPowerUp()
This function can be useful for debug and test.
Definition: SI4735.cpp:3125
void setSsbAgcAttackRate(uint16_t parameter)
Sets the AGC attack rate on SSB mode.
Definition: SI4735.h:2045
uint8_t getCurrentAvcAmMaxGain()
Get the current Avc Am Max Gain.
Definition: SI4735.h:1378
void setSsbIfAgcAttackRate(uint8_t param=4)
Sets the IF AGC attack rate.
Definition: SI4735.h:1432
void setSsbAgcOverrite(uint8_t SSBAGCDIS, uint8_t SSBAGCNDX, uint8_t reserved=0)
Automatic Gain Control setup.
Definition: SI4735.cpp:3021
void setSSB(uint8_t usblsb)
Set the radio to AM function.
Definition: SI4735.cpp:2913
void setAvcAmDefaultGain()
Sets the Avc Am Max Gain to default gain (0x2A80)
Definition: SI4735.h:1363
void getSsbAgcStatus()
Queries SSB Automatic Gain Control STATUS.
Definition: SI4735.cpp:2994
void setSSBBfo(int offset)
Sets the SSB Beat Frequency Offset (BFO).
Definition: SI4735.cpp:2723
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.
Definition: SI4735.cpp:3312
uint16_t getAntennaTuningCapacitor()
Get the Antenna Tuning Capacitor value.
Definition: SI4735.h:1323
void setSsbAgcReleaseRate(uint16_t parameter)
Sets the AGC Release rate on SSB mode.
Definition: SI4735.h:2058
void setSSBAudioBandwidth(uint8_t AUDIOBW)
SSB Audio Bandwidth for SSB mode.
Definition: SI4735.cpp:2890
void setSSBDspAfc(uint8_t DSP_AFCDIS)
Sets DSP AFC disable or enable.
Definition: SI4735.cpp:2797
void setAvcAmMaxGain()
Sets the Avc Am Max Gain to maximum gain (0x7800)
Definition: SI4735.h:1343
void setSSBSidebandCutoffFilter(uint8_t SBCUTFLT)
Sets SBB Sideband Cutoff Filter for band pass and low pass filters.
Definition: SI4735.cpp:2860
si4735_eeprom_patch_header downloadPatchFromEeprom(int eeprom_i2c_address)
Transfers the content of a patch stored in an eeprom to the SI4735 device.
Definition: SI4735.cpp:3342
void setSSB(uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step, uint8_t usblsb)
Definition: SI4735.cpp:2947
void setSsbSoftMuteMaxAttenuation(uint8_t smattn=0)
Sets the SSB Soft Mute Max Attenuation object.
Definition: SI4735.h:1408
void setSSBSoftMute(uint8_t SMUTESEL)
Sets SSB Soft-mute Based on RSSI or SNR Selection:
Definition: SI4735.cpp:2812
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:2772
void setSsbIfAgcReleaseRate(uint8_t param=140)
Sets the number of milliseconds the low IF peak detector.
Definition: SI4735.h:1420
void setSSBAutomaticVolumeControl(uint8_t AVCEN)
Sets SSB Automatic Volume Control (AVC) for SSB mode.
Definition: SI4735.cpp:2827
si47x_firmware_query_library queryLibraryId()
Query the library information of the Si47XX device.
Definition: SI4735.cpp:3068
void sendSSBModeProperty()
Just send the property SSB_MOD to the device. Internal use (privete method).
Definition: SI4735.cpp:2968
void setSBBSidebandCutoffFilter(uint8_t SBCUTFLT)
Definition: SI4735.h:2557
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)
Deal with compressed SSB patch.
Definition: SI4735.cpp:3271
void setAvcAmMinGain()
Sets the Avc Am Max Gain to minimal gain (0x1000)
Definition: SI4735.h:1353
void patchPowerUp()
This method can be used to prepare the device to apply SSBRX patch.
Definition: SI4735.cpp:3109
void setSSBAvcDivider(uint8_t AVC_DIVIDER)
Sets AVC Divider.
Definition: SI4735.cpp:2842
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:3183
void setI2CStandardMode(void)
Sets I2C bus to 100kHz.
Definition: SI4735.h:2689
void setAudioMuteMcuPin(int8_t pin)
Sets the Audio Mute Mcu Pin.
Definition: SI4735.h:2724
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.
Definition: SI4735.cpp:3418
void setHardwareAudioMute(bool on)
Sets the Hardware Audio Mute.
Definition: SI4735.h:2740
void setI2CFastModeCustom(long value=500000)
Sets the I2C bus to a given value. ATTENTION: use this function with cation.
Definition: SI4735.h:2709
void setI2CFastMode(void)
Sets I2C bus to 400kHz.
Definition: SI4735.h:2696
void setI2CLowSpeedMode(void)
Sets I2C bus to 10kHz.
Definition: SI4735.h:2679
void setNBFM(uint16_t fromFreq, uint16_t toFreq, uint16_t initialFreq, uint16_t step)
Definition: SI4735.cpp:3582
void setNBFM()
Set the radio to FM function.
Definition: SI4735.cpp:3551
void setFrequencyNBFM(uint16_t freq)
Set the frequency to the corrent function of the Si4735 on NBFM mode.
Definition: SI4735.cpp:3610
void patchPowerUpNBFM()
This method can be used to prepare the device to apply NBFM patch.
Definition: SI4735.cpp:3508
void loadPatchNBFM(const uint8_t *patch_content, const uint16_t patch_content_size)
Loads a given NBFM patch content.
Definition: SI4735.cpp:3527