PU2CLR Si4735 Arduino Library  2.0.0
Arduino Library for Si47XX Devices - By Ricardo Lima Caratti
SI4735.h
Go to the documentation of this file.
1 /**
2  * @brief SI4735 ARDUINO LIBRARY
3  *
4  * @details This is an Arduino library for the SI47XX, BROADCAST AM/FM/SW RADIO RECEIVER IC family from Silicon Labs.
5  * @details This library is intended to provide an easier interface for controlling the SI47XX by using Arduino platform.
6  * @details The communication used by this library is I2C.
7  * @details This file contains: const (#define), Defined Data type and Methods declarations
8  * @details You can see a complete documentation on <https://github.com/pu2clr/SI4735>
9  * @details The are more than 20 examples on <https://github.com/pu2clr/SI4735/tree/master/examples>
10  *
11  * @see https://pu2clr.github.io/SI4735/
12  * @see Si47XX PROGRAMMING GUIDE AN332 (Rev 1.0): https://www.silabs.com/documents/public/application-notes/AN332.pdf
13  * @see AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; AMENDMENT FOR SI4735-D60 SSB AND NBFM PATCHES
14  *
15  *
16  * @author PU2CLR - Ricardo Lima Caratti
17  * @date 2019-2020
18  */
19 
20 #include <Arduino.h>
21 #include <Wire.h>
22 
23 #define POWER_UP_FM 0 // FM
24 #define POWER_UP_AM 1 // AM and SSB (if patch applyed)
25 #define POWER_UP_WB 3 // Weather Band Receiver
26 #define POWER_PATCH 15 //
27 
28 // SI473X commands (general)
29 #define SI473X_ADDR_SEN_LOW 0x11 // SI473X I2C bus address when the SEN pin (16) is set to low 0V.
30 #define SI473X_ADDR_SEN_HIGH 0x63 // SI473X I2C bus address when the SEN pin (16) is set to high +3.3V
31 
32 #define POWER_UP 0x01 // Power up device and mode selection.
33 #define GET_REV 0x10 // Returns revision information on the device.
34 #define POWER_DOWN 0x11 // Power down device.
35 #define SET_PROPERTY 0x12 // Sets the value of a property.
36 #define GET_PROPERTY 0x13 // Retrieves a property’s value.
37 #define GET_INT_STATUS 0x14 // Read interrupt status bits.
38 
39 // FM
40 #define FM_TUNE_FREQ 0x20
41 #define FM_SEEK_START 0x21 // Begins searching for a valid FM frequency.
42 #define FM_TUNE_STATUS 0x22
43 #define FM_AGC_STATUS 0x27
44 #define FM_AGC_OVERRIDE 0x28
45 #define FM_RSQ_STATUS 0x23
46 #define FM_RDS_STATUS 0x24 // Returns RDS information for current channel and reads an entry from the RDS FIFO.
47 
48 // FM RDS properties
49 #define FM_RDS_INT_SOURCE 0x1500
50 #define FM_RDS_INT_FIFO_COUNT 0x1501
51 #define FM_RDS_CONFIG 0x1502
52 #define FM_RDS_CONFIDENCE 0x1503
53 
54 #define FM_DEEMPHASIS 0x1100
55 #define FM_BLEND_STEREO_THRESHOLD 0x1105
56 #define FM_BLEND_MONO_THRESHOLD 0x1106
57 #define FM_BLEND_RSSI_STEREO_THRESHOLD 0x1800
58 #define FM_BLEND_RSSI_MONO_THRESHOLD 0x1801
59 #define FM_BLEND_SNR_STEREO_THRESHOLD 0x1804
60 #define FM_BLEND_SNR_MONO_THRESHOLD 0x1805
61 #define FM_BLEND_MULTIPATH_STEREO_THRESHOLD 0x1808
62 #define FM_BLEND_MULTIPATH_MONO_THRESHOLD 0x1809
63 
64 // FM SEEK Properties
65 #define FM_SEEK_BAND_BOTTOM 0x1400 // Sets the bottom of the FM band for seek
66 #define FM_SEEK_BAND_TOP 0x1401 // Sets the top of the FM band for seek
67 #define FM_SEEK_FREQ_SPACING 0x1402 // Selects frequency spacing for FM seek
68 #define FM_SEEK_TUNE_SNR_THRESHOLD 0x1403 // Sets the SNR threshold for a valid FM Seek/Tune
69 #define FM_SEEK_TUNE_RSSI_THRESHOLD 0x1404 // Sets the RSSI threshold for a valid FM Seek/Tune
70 
71 // AM command
72 #define AM_TUNE_FREQ 0x40 // Tunes to a given AM frequency.
73 #define AM_SEEK_START 0x41 // Begins searching for a valid AM frequency.
74 #define AM_TUNE_STATUS 0x42 // Queries the status of the already issued AM_TUNE_FREQ or AM_SEEK_START command.
75 #define AM_RSQ_STATUS 0x43 // Queries the status of the Received Signal Quality (RSQ) for the current channel.
76 #define AM_AGC_STATUS 0x47 // Queries the current AGC settings.
77 #define AM_AGC_OVERRIDE 0x48 // Overrides AGC settings by disabling and forcing it to a fixed value.
78 #define GPIO_CTL 0x80 // Configures GPO1, 2, and 3 as output or Hi-Z.
79 #define GPIO_SET 0x81 // Sets GPO1, 2, and 3 output level (low or high).
80 
81 //SSB command (SAME AM CMD VALUES)
82 // See AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; pages 4 and 5
83 #define SSB_TUNE_FREQ 0x40 // Tunes to a given SSB frequency.
84 #define SSB_TUNE_STATUS 0x42 // Queries the status of the already issued SSB_TUNE_FREQ or AM_SEEK_START command.
85 #define SSB_RSQ_STATUS 0x43 // Queries the status of the Received Signal Quality (RSQ) for the current channel.
86 #define SSB_AGC_STATUS 0x47 // Queries the current AGC settings.
87 #define SSB_AGC_OVERRIDE 0x48 // Overrides AGC settings by disabling and forcing it to a fixed value.
88 
89 // AM/SW/LW Receiver Property Summary
90 // See Si47XX PROGRAMMING GUIDE AN332 (REV 1.0); page 125
91 #define DIGITAL_OUTPUT_FORMAT 0x0102 // Configure digital audio outputs.
92 #define DIGITAL_OUTPUT_SAMPLE_RATE 0x0104 // Configure digital audio output sample rate
93 #define REFCLK_FREQ 0x0201 //Sets frequency of reference clock in Hz. The range is 31130 to 34406 Hz, or 0 to disable the AFC. Default is 32768 Hz.
94 #define REFCLK_PRESCALE 0x0202 // Sets the prescaler value for RCLK input.
95 #define AM_DEEMPHASIS 0x3100 // Sets deemphasis time constant. Can be set to 50 μs. Deemphasis is disabled by default.
96 #define AM_CHANNEL_FILTER 0x3102 // Selects the bandwidth of the channel filter for AM reception. The choices are 6, 4, 3, 2, 2.5, 1.8, or 1 (kHz). The default bandwidth is 2 kHz.
97 #define AM_AUTOMATIC_VOLUME_CONTROL_MAX_GAIN 0x3103 // Sets the maximum gain for automatic volume control.
98 #define AM_MODE_AFC_SW_PULL_IN_RANGE 0x3104 // Sets the SW AFC pull-in range.
99 #define AM_MODE_AFC_SW_LOCK_IN_RANGE 0x3105 // Sets the SW AFC lock-in.
100 #define AM_RSQ_INTERRUPTS 0x3200 // Same SSB - Configures interrupt related to Received Signal Quality metrics. All interrupts are disabled by default.
101 #define AM_RSQ_SNR_HIGH_THRESHOLD 0x3201 //Sets high threshold for SNR interrupt.
102 #define AM_RSQ_SNR_LOW_THRESHOLD 0x3202 // Sets low threshold for SNR interrupt.
103 #define AM_RSQ_RSSI_HIGH_THRESHOLD 0x3203 // Sets high threshold for RSSI interrupt.
104 #define AM_RSQ_RSSI_LOW_THRESHOLD 0x3204 // Sets low threshold for RSSI interrupt.
105 #define AM_SOFT_MUTE_RATE 0x3300 // Sets the attack and decay rates when entering or leaving soft mute. The default is 278 dB/s.
106 #define AM_SOFT_MUTE_SLOPE 0x3301 // Sets the AM soft mute slope. Default value is a slope of 1.
107 #define AM_SOFT_MUTE_MAX_ATTENUATION 0x3302 // Sets maximum attenuation during soft mute (dB). Set to 0 to disable soft mute. Default is 8 dB.
108 #define AM_SOFT_MUTE_SNR_THRESHOLD 0x3303 // Sets SNR threshold to engage soft mute. Default is 8 dB.
109 #define AM_SOFT_MUTE_RELEASE_RATE 0x3304 // Sets softmute release rate. Smaller values provide slower release, and larger values provide faster release.
110 #define AM_SOFT_MUTE_ATTACK_RATE 0x3305 // Sets software attack rate. Smaller values provide slower attack, and larger values provide faster attack.
111 #define AM_SEEK_BAND_BOTTOM 0x3400 // Sets the bottom of the AM band for seek. Default is 520.
112 #define AM_SEEK_BAND_TOP 0x3401 // Sets the top of the AM band for seek. Default is 1710.
113 #define AM_SEEK_FREQ_SPACING 0x3402 // Selects frequency spacing for AM seek. Default is 10 kHz spacing.
114 #define AM_SEEK_SNR_THRESHOLD 0x3403 // Sets the SNR threshold for a valid AM Seek/Tune.
115 #define AM_SEEK_RSSI_THRESHOLD 0x3404 // Sets the RSSI threshold for a valid AM Seek/Tune.
116 #define AM_AGC_ATTACK_RATE 0x3702 // Sets the number of milliseconds the high peak detector must be exceeded before decreasing gain.
117 #define AM_AGC_RELEASE_RATE 0x3703 // Sets the number of milliseconds the low peak detector must not be exceeded before increasing the gain.
118 #define AM_FRONTEND_AGC_CONTROL 0x3705 // Adjusts AM AGC for frontend (external) attenuator and LNA.
119 #define AM_NB_DETECT_THRESHOLD 0x3900 // Sets the threshold for detecting impulses in dB above the noise floor
120 #define AM_NB_INTERVAL 0x3901 // Interval in micro-seconds that original samples are replaced by interpolated clean samples
121 #define AM_NB_RATE 0x3902 // Noise blanking rate in 100 Hz units. Default value is 64.
122 #define AM_NB_IIR_FILTER 0x3903 // Sets the bandwidth of the noise floor estimator. Default value is 300.
123 #define AM_NB_DELAY 0x3904 // Delay in micro-seconds before applying impulse blanking to the original samples
124 
125 #define RX_VOLUME 0x4000
126 #define RX_HARD_MUTE 0x4001
127 
128 // SSB properties
129 // See AN332 REV 0.8 Universal Programming Guide (Amendment for SI4735-D60 SSN and NBFM Patches)
130 
131 #define GPO_IEN 0x0001 // AM and SSB - Enable interrupt source
132 #define SSB_BFO 0x0100 // Sets the Beat Frequency Offset (BFO) under SSB mode.
133 #define SSB_MODE 0x0101 // Sets number of properties of the SSB mode.
134 #define SSB_RSQ_INTERRUPTS 0x3200 // Configure Interrupts related to RSQ
135 #define SSB_RSQ_SNR_HI_THRESHOLD 0x3201 // Sets high threshold for SNR interrupt
136 #define SSB_RSQ_SNR_LO_THRESHOLD 0x3202 // Sets low threshold for SNR interrupt
137 #define SSB_RSQ_RSSI_HI_THRESHOLD 0x3203 // Sets high threshold for RSSI interrupt
138 #define SSB_RSQ_RSSI_LO_THRESHOLD 0x3204 // Sets low threshold for RSSI interrupt
139 #define SSB_SOFT_MUTE_RATE 0x3300 // Sets the attack and decay rates when entering or leaving soft mute
140 #define SSB_SOFT_MUTE_MAX_ATTENUATION 0x3302 // Sets the maximum attenuation during soft mute (db); 0dB to disable soft mute; defaul 8dB;
141 #define SSB_SOFT_MUTE_SNR_THRESHOLD 0x3303 // Sets SNR threshould to engage soft mute. Defaul 8dB
142 #define SSB_RF_AGC_ATTACK_RATE 0x3700 // Sets the number of milliseconds the high RF peak detector must be exceeded before decreasing the gain. Defaul 4.
143 #define SSB_RF_AGC_RELEASE_RATE 0x3701 // Sets the number of milliseconds the low RF peak detector must be exceeded before increasing the gain. Defaul 24.
144 
145 // SSB
146 #define SSB_RF_IF_AGC_ATTACK_RATE 0x3702 // Sets the number of milliseconds the high IF peak detector must be exceeded before decreasing gain. Defaul 4.
147 #define SSB_RF_IF_AGC_RELEASE_RATE 0x3703 // Sets the number of milliseconds the low IF peak detector must be exceeded before increasing the gain. Defaul 140.
148 
149 // See AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; pages 12 and 13
150 #define LSB_MODE 1 // 01
151 #define USB_MODE 2 // 10
152 
153 // Parameters
154 #define SI473X_RDS_OUTPUT_ONLY 0b00000000 // RDS output only (no audio outputs) Si4749 only
155 #define SI473X_ANALOG_AUDIO 0b00000101 // Analog Audio Inputs
156 #define SI473X_DIGITAL_AUDIO1 0b00001011 // Digital audio output (DCLK, LOUT/DFS, ROUT/DIO)
157 #define SI473X_DIGITAL_AUDIO2 0b10110000 // Digital audio outputs (DCLK, DFS, DIO)
158 #define SI473X_ANALOG_DIGITAL_AUDIO 0b10110101 // Analog and digital audio outputs (LOUT/ROUT and DCLK, DFS,DIO)
159 
160 // Other parameters
161 #define FM_CURRENT_MODE 0
162 #define AM_CURRENT_MODE 1
163 #define SSB_CURRENT_MODE 2
164 
165 #define SEEK_UP 1
166 #define SEEK_DOWN 0
167 
168 #define MAX_DELAY_AFTER_SET_FREQUENCY 30 // In ms - This value helps to improve the precision during of getting frequency value
169 #define MAX_DELAY_AFTER_POWERUP 10 // In ms - Max delay you have to setup after a power up command.
170 #define MIN_DELAY_WAIT_SEND_LOOP 300 // In uS (Microsecond) - each loop of waitToSend sould wait this value in microsecond
171 #define MAX_SEEK_TIME 8000 // defines the maximum seeking time 8s is default.
172 
173 #define XOSCEN_CRYSTAL 1 // Use crystal oscillator
174 #define XOSCEN_RCLK 0 // Use external RCLK (crystal oscillator disabled).
175 
176 /** @defgroup group01 Union, Struct and Defined Data Types
177  * @section group01 Data Types
178  *
179  * @brief SI473X data representation
180  *
181  * @details The goal of this approach is separating data from code.
182  * The Si47XX family works with many internal data that can be represented by data structure
183  * or defined data type in C/C++. These C/C++ resources have been used widely here.
184  * This aproach made the library easier to build and maintain. Each data structure created
185  * here has its reference (name of the document and page on which it was based).
186  * In other words, to make the SI47XX device easier to deal, some defined data types were
187  * created to handle byte and bits to process commands, properties and responses.
188  * These data types will be usefull to deal with SI473X
189  */
190 
191 /**
192  * @ingroup group01
193  *
194  * @brief Power Up arguments data type
195  *
196  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 64 and 65
197  */
198 typedef union
199 {
200  struct
201  {
202  // ARG1
203  uint8_t FUNC : 4; //!< Function (0 = FM Receive; 1–14 = Reserved; 15 = Query Library ID)
204  uint8_t XOSCEN : 1; //!< Crystal Oscillator Enable (0 = crystal oscillator disabled; 1 = Use crystal oscillator and and OPMODE=ANALOG AUDIO) .
205  uint8_t PATCH : 1; //!< Patch Enable (0 = Boot normally; 1 = Copy non-volatile memory to RAM).
206  uint8_t GPO2OEN : 1; //!< GPO2 Output Enable (0 = GPO2 output disabled; 1 = GPO2 output enabled).
207  uint8_t CTSIEN : 1; //!< CTS Interrupt Enable (0 = CTS interrupt disabled; 1 = CTS interrupt enabled).
208  // ARG2
209  uint8_t OPMODE; //!< Application Setting. See page 65
210  } arg; //!< Refined powerup parameters
211  uint8_t raw[2]; //!< Raw powerup parameters data. Same arg memory position. So, same content.
212 } si473x_powerup;
213 
214 /**
215  * @ingroup group01
216  *
217  * @brief Data type for Enables output for GPO1, GPO2 and GPO3
218  *
219  * @details GPO1, 2, and 3 can be configured for output (Hi-Z or active drive) by setting the GPO1OEN, GPO2OEN, and GPO3OEN bit.
220  *
221  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 82 and 144
222  */
223 typedef union
224 {
225  struct
226  {
227  uint8_t DUMMY1 : 1; //!< Always write 0.
228  uint8_t GPO1OEN : 1; //!< GPO1 Output Enable.
229  uint8_t GPO2OEN : 1; //!< GPO2 Output Enable.
230  uint8_t GPO3OEN : 1; //!< GPO3 Output Enable.
231  uint8_t DUMMY2 : 4; //!< Always write 0.
232  } arg; //!< Refined powerup parameters
234 } si473x_gpio;
235 
236 /**
237  * @ingroup group01
238  *
239  * @brief Data type for Configuring the sources for the GPO2/INT interrupt pin
240  *
241  * @details Valid sources are the lower 8 bits of the STATUS byte, including CTS, ERR, RSQINT, and STCINT bits.
242  *
243  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 146
244  */
245 typedef union
246 {
247  struct
248  {
249  uint8_t STCIEN : 1; //!< Seek/Tune Complete Interrupt Enable (0 or 1).
250  uint8_t DUMMY1 : 2; //!< Always write 0.
251  uint8_t RSQIEN : 1; //!< RSQ Interrupt Enable (0 or 1).
252  uint8_t DUMMY2 : 2; //!< Always write 0.
253  uint8_t ERRIEN : 1; //!< ERR Interrupt Enable (0 or 1).
254  uint8_t CTSIEN : 1; //!< CTS Interrupt Enable (0 or 1).
255  uint8_t STCREP : 1; //!< STC Interrupt Repeat (0 or 1).
256  uint8_t DUMMY3 : 2; //!< Always write 0.
257  uint8_t RSQREP : 1; //!< RSQ Interrupt Repeat (0 or 1).
258  uint8_t DUMMY4 : 4; //!< Always write 0.
259  } arg;
261 } si473x_gpio_ien;
262 
263 /**
264  * @ingroup group01
265  *
266  * @brief Represents how the frequency is stored in the si4735.
267  * @details It helps to convert frequency in uint16_t to two bytes (uint8_t) (FREQL and FREQH)
268  */
269 typedef union
270 {
271  struct
272  {
273  uint8_t FREQL; //!< Tune Frequency Low byte.
274  uint8_t FREQH; //!< Tune Frequency High byte.
275  } raw; //!< Raw data that represents the frequency stored in the Si47XX device.
276  uint16_t value; //!< frequency (integer value)
277 } si47x_frequency;
278 
279 /**
280  * @ingroup group01
281  * @brief Antenna Tuning Capacitor data type manupulation
282  */
283 typedef union
284 {
285  struct
286  {
287  uint8_t ANTCAPL; //!< Antenna Tuning Capacitor High byte
288  uint8_t ANTCAPH; //!< Antenna Tuning Capacitor Low byte
289  } raw;
291 } si47x_antenna_capacitor;
292 
293 /**
294  * @ingroup group01
295  *
296  * @brief AM Tune frequency data type command (AM_TUNE_FREQ command)
297  *
298  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 135
299  */
300 typedef union
301 {
302  struct
303  {
304  uint8_t FAST : 1; //!< ARG1 - FAST Tuning. If set, executes fast and invalidated tune. The tune status will not be accurate.
305  uint8_t FREEZE : 1; //!< Valid only for FM (Must be 0 to AM)
306  uint8_t DUMMY1 : 4; //!< Always set 0
307  uint8_t USBLSB : 2; //!< SSB Upper Side Band (USB) and Lower Side Band (LSB) Selection. 10 = USB is selected; 01 = LSB is selected.
308  uint8_t FREQH; //!< ARG2 - Tune Frequency High byte.
309  uint8_t FREQL; //!< ARG3 - Tune Frequency Low byte.
310  uint8_t ANTCAPH; //!< ARG4 - Antenna Tuning Capacitor High byte.
311  uint8_t ANTCAPL; //!< ARG5 - Antenna Tuning Capacitor Low byte. Note used for FM.
312  } arg;
314 } si47x_set_frequency;
315 
316 /**
317  * @ingroup group01
318  *
319  * @brief Seek frequency (automatic tuning). ARG1
320  *
321  * @details Represents searching for a valid frequency data type AM and FM.
322  * @details When AM, the searching data have to be complemented by si47x_seek_am_complement.
323  *
324  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 72 and 137
325  * @see si47x_seek_am_complement
326  */
327 typedef union
328 {
329  struct
330  {
331  uint8_t RESERVED1 : 2;
332  uint8_t WRAP : 1; //!< Determines whether the seek should Wrap = 1, or Halt = 0 when it hits the band limit.
333  uint8_t SEEKUP : 1; //!< Determines the direction of the search, either UP = 1, or DOWN = 0.
334  uint8_t RESERVED2 : 4;
335  } arg;
337 } si47x_seek;
338 
339 /**
340  * @ingroup group01
341  *
342  * @brief Seek frequency (automatic tuning) AM complement (ARG2, ARG3, ARG4 and ARG5)
343  *
344  * @details Represents AM complement searching information for a valid frequency data type.
345  *
346  * @see @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 72 and 137
347  */
348 typedef struct
349 {
350  uint8_t ARG2; // Always 0.
351  uint8_t ARG3; // Always 0.
354 } si47x_seek_am_complement;
355 
356 /**
357  * @ingroup group01 status response structure
358  *
359  * @brief Status response data representation
360  *
361  * @details Represents searching for a valid frequency data type.
362  */
363 typedef union
364 {
365  struct
366  {
367  uint8_t STCINT : 1; //!< 1 = Tune complete has been triggered.
368  uint8_t DUMMY1 : 1; //!< Reserved (Values may vary).
369  uint8_t RDSINT : 1; //!< 1 = Radio data system interrupt has been triggered.
370  uint8_t RSQINT : 1; //!< 1 = Received Signal Quality measurement has been triggered.
371  uint8_t DUMMY2 : 2; //!< Reserved (Values may vary).
372  uint8_t ERR : 1; //!< 1 = Error.
373  uint8_t CTS : 1; //!< 0 = Wait before sending next command; 1 = Clear to send next command.
374  } refined;
376 } si47x_status;
377 
378 /**
379  * @ingroup group01
380  *
381  * @brief Response status command
382  *
383  * @details Response data from a query status command
384  *
385  * @see Si47XX PROGRAMMING GUIDE; pages 73 and
386  */
387 typedef union
388 {
389  struct
390  {
391  // Status
392  uint8_t STCINT : 1; //!< Seek/Tune Complete Interrupt; 1 = Tune complete has been triggered.
393  uint8_t DUMMY1 : 1;
394  uint8_t RDSINT : 1; //!< Radio Data System (RDS) Interrup; 0 = interrupt has not been triggered.
395  uint8_t RSQINT : 1; //!< Received Signal Quality Interrupt; 0 = interrupt has not been triggered.
396  uint8_t DUMMY2 : 2;
397  uint8_t ERR : 1; //!< Error. 0 = No error 1 = Error
398  uint8_t CTS : 1; //!< Clear to Send.
399  // RESP1
400  uint8_t VALID : 1; //!< Valid Channel
401  uint8_t AFCRL : 1; //!< AFC Rail Indicator
402  uint8_t DUMMY3 : 5;
403  uint8_t BLTF : 1; //!< Reports if a seek hit the band limit
404  // RESP2
405  uint8_t READFREQH; //!< Read Frequency High byte.
406  // RESP3
407  uint8_t READFREQL; //!< Read Frequency Low byte.
408  // RESP4
409  uint8_t RSSI; //!< Received Signal Strength Indicator (dBμV)
410  // RESP5
411  uint8_t SNR; //!< This byte contains the SNR metric when tune is complete (dB).
412  // RESP6
413  uint8_t MULT; //!< If FM, contains the multipath metric when tune is complete; IF AM READANTCAPH (tuning capacitor value high byte)
414  // RESP7
415  uint8_t READANTCAP; //!< If FM, contains the current antenna tuning capacitor value; IF AM READANTCAPL (tuning capacitor value low byte)
416  } resp;
417  uint8_t raw[8]; //!< Check it
418 } si47x_response_status;
419 
420 /**
421  * @ingroup group01
422  *
423  * @brief Data representation for Firmware Information (GET_REV)
424  *
425  * @details The part number, chip revision, firmware revision, patch revision and component revision numbers.
426  *
427  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 66 and 131
428  */
429 typedef union
430 {
431  struct
432  {
433  // status ("RESP0")
434  uint8_t STCINT : 1;
435  uint8_t DUMMY1 : 1;
436  uint8_t RDSINT : 1;
437  uint8_t RSQINT : 1;
438  uint8_t DUMMY2 : 2;
439  uint8_t ERR : 1;
440  uint8_t CTS : 1;
441  uint8_t PN; //!< RESP1 - Final 2 digits of Part Number (HEX).
442  uint8_t FWMAJOR; //!< RESP2 - Firmware Major Revision (ASCII).
443  uint8_t FWMINOR; //!< RESP3 - Firmware Minor Revision (ASCII).
444  uint8_t PATCHH; //!< RESP4 - Patch ID High byte (HEX).
445  uint8_t PATCHL; //!< RESP5 - Patch ID Low byte (HEX).
446  uint8_t CMPMAJOR; //!< RESP6 - Component Major Revision (ASCII).
447  uint8_t CMPMINOR; //!< RESP7 - Component Minor Revision (ASCII).
448  uint8_t CHIPREV; //!< RESP8 - Chip Revision (ASCII).
449  // RESP9 to RESP15 not used
450  } resp;
452 } si47x_firmware_information;
453 
454 /**
455  * @ingroup group01
456  *
457  * @brief Firmware Query Library ID response.
458  *
459  * @details Used to represent the response of a power up command with FUNC = 15 (patch)
460  *
461  * To confirm that the patch is compatible with the internal device library revision, the library
462  * revision should be confirmed by issuing the POWER_UP command with Function = 15 (query library ID)
463  *
464  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 12
465  */
466 typedef union
467 {
468  struct
469  {
470  // status ("RESP0")
471  uint8_t STCINT : 1;
472  uint8_t DUMMY1 : 1;
473  uint8_t RDSINT : 1;
474  uint8_t RSQINT : 1;
475  uint8_t DUMMY2 : 2;
476  uint8_t ERR : 1;
477  uint8_t CTS : 1;
478  uint8_t PN; //!< RESP1 - Final 2 digits of Part Number (HEX).
479  uint8_t FWMAJOR; //!< RESP2 - Firmware Major Revision (ASCII).
480  uint8_t FWMINOR; //!< RESP3 - Firmware Minor Revision (ASCII).
481  uint8_t RESERVED1; //!< RESP4 - Reserved, various values.
482  uint8_t RESERVED2; //!< RESP5 - Reserved, various values.
483  uint8_t CHIPREV; //!< RESP6 - Chip Revision (ASCII).
484  uint8_t LIBRARYID; //!< RESP7 - Library Revision (HEX).
485  // RESP9 to RESP15 not used
486  } resp;
488 } si47x_firmware_query_library;
489 
490 /**
491  * @ingroup group01
492  *
493  * @brief Seek station status
494  *
495  * @details Status of FM_TUNE_FREQ or FM_SEEK_START commands or Status of AM_TUNE_FREQ or AM_SEEK_START commands.
496  *
497  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 73 and 139
498  */
499 typedef union
500 {
501  struct
502  {
503  uint8_t INTACK : 1; //!< If set, clears the seek/tune complete interrupt status indicator.
504  uint8_t CANCEL : 1; //!< If set, aborts a seek currently in progress.
505  uint8_t RESERVED2 : 6;
506  } arg;
508 } si47x_tune_status;
509 
510 /**
511  * @ingroup group01
512  *
513  * @brief Data type to deal with SET_PROPERTY command
514  *
515  * @details Property Data type (help to deal with SET_PROPERTY command on si473X)
516  */
517 typedef union
518 {
519  struct
520  {
521  uint8_t byteLow;
522  uint8_t byteHigh;
523  } raw;
525 } si47x_property;
526 
527 /**
528  * @ingroup group01
529  *
530  * @brief Radio Signal Quality data representation
531  *
532  * @details Data type for status information about the received signal quality (FM_RSQ_STATUS and AM_RSQ_STATUS)
533  *
534  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 75 and
535  */
536 typedef union
537 {
538  struct
539  {
540  // status ("RESP0")
541  uint8_t STCINT : 1;
542  uint8_t DUMMY1 : 1;
543  uint8_t RDSINT : 1;
544  uint8_t RSQINT : 1;
545  uint8_t DUMMY2 : 2;
546  uint8_t ERR : 1;
547  uint8_t CTS : 1;
548  // RESP1
549  uint8_t RSSIILINT : 1; //!< RSSI Detect Low.
550  uint8_t RSSIHINT : 1; //!< RSSI Detect High.
551  uint8_t SNRLINT : 1; //!< SNR Detect Low.
552  uint8_t SNRHINT : 1; //!< SNR Detect High.
553  uint8_t MULTLINT : 1; //!< Multipath Detect Low
554  uint8_t MULTHINT : 1; //!< Multipath Detect High
555  uint8_t DUMMY3 : 1;
556  uint8_t BLENDINT : 1; //!< Blend Detect Interrupt.
557  // RESP2
558  uint8_t VALID : 1; //!< Valid Channel.
559  uint8_t AFCRL : 1; //!< AFC Rail Indicator.
560  uint8_t DUMMY4 : 1;
561  uint8_t SMUTE : 1; //!< Soft Mute Indicator. Indicates soft mute is engaged.
562  uint8_t DUMMY5 : 4;
563  // RESP3
564  uint8_t STBLEND : 7; //!< Indicates amount of stereo blend in% (100 = full stereo, 0 = full mono).
565  uint8_t PILOT : 1; //!< Indicates stereo pilot presence.
566  // RESP4 to RESP7
567  uint8_t RSSI; //!< RESP4 - Contains the current receive signal strength (0–127 dBμV).
568  uint8_t SNR; //!< RESP5 - Contains the current SNR metric (0–127 dB).
569  uint8_t MULT; //!< RESP6 - Contains the current multipath metric. (0 = no multipath; 100 = full multipath)
570  uint8_t FREQOFF; //!< RESP7 - Signed frequency offset (kHz).
571  } resp;
573 } si47x_rqs_status;
574 
575 /**
576  * @ingroup group01
577  * @brief Adjusts the AM AGC for external front-end attenuator and external front-end cascode LNA.
578  * @see Si47XX PROAMMING GUIDE; AN332 (REV 1.0); page 168
579  */
580 typedef union
581 {
582  struct
583  {
584  uint8_t ATTN_BACKUP;
585  uint8_t MIN_GAIN_INDEX;
586  } field;
588 } si47x_frontend_agc_control;
589 
590 /**
591  * @ingroup group01
592  *
593  * @brief Data type for RDS Status command and response information
594  *
595  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 77 and 78
596  * @see Also https://en.wikipedia.org/wiki/Radio_Data_System
597  */
598 typedef union
599 {
600  struct
601  {
602  uint8_t INTACK : 1; // Interrupt Acknowledge; 0 = RDSINT status preserved; 1 = Clears RDSINT.
603  uint8_t MTFIFO : 1; // Empty FIFO; 0 = If FIFO not empty; 1 = Clear RDS Receive FIFO.
604  uint8_t STATUSONLY : 1; // Determines if data should be removed from the RDS FIFO.
605  uint8_t dummy : 5;
606  } arg;
608 } si47x_rds_command;
609 
610 /**
611  * @ingroup group01
612  *
613  * @brief Response data type for current channel and reads an entry from the RDS FIFO.
614  *
615  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 77 and 78
616  */
617 typedef union
618 {
619  struct
620  {
621  // status ("RESP0")
622  uint8_t STCINT : 1;
623  uint8_t DUMMY1 : 1;
624  uint8_t RDSINT : 1;
625  uint8_t RSQINT : 1;
626  uint8_t DUMMY2 : 2;
627  uint8_t ERR : 1;
628  uint8_t CTS : 1;
629  // RESP1
630  uint8_t RDSRECV : 1; //!< RDS Received; 1 = FIFO filled to minimum number of groups set by RDSFIFOCNT.
631  uint8_t RDSSYNCLOST : 1; //!< RDS Sync Lost; 1 = Lost RDS synchronization.
632  uint8_t RDSSYNCFOUND : 1; //!< RDS Sync Found; 1 = Found RDS synchronization.
633  uint8_t DUMMY3 : 1;
634  uint8_t RDSNEWBLOCKA : 1; //!< RDS New Block A; 1 = Valid Block A data has been received.
635  uint8_t RDSNEWBLOCKB : 1; //!< RDS New Block B; 1 = Valid Block B data has been received.
636  uint8_t DUMMY4 : 2;
637  // RESP2
638  uint8_t RDSSYNC : 1; //!< RDS Sync; 1 = RDS currently synchronized.
639  uint8_t DUMMY5 : 1;
640  uint8_t GRPLOST : 1; //!< Group Lost; 1 = One or more RDS groups discarded due to FIFO overrun.
641  uint8_t DUMMY6 : 5;
642  // RESP3 to RESP11
643  uint8_t RDSFIFOUSED; //!< RESP3 - RDS FIFO Used; Number of groups remaining in the RDS FIFO (0 if empty).
644  uint8_t BLOCKAH; //!< RESP4 - RDS Block A; HIGH byte
645  uint8_t BLOCKAL; //!< RESP5 - RDS Block A; LOW byte
646  uint8_t BLOCKBH; //!< RESP6 - RDS Block B; HIGH byte
647  uint8_t BLOCKBL; //!< RESP7 - RDS Block B; LOW byte
648  uint8_t BLOCKCH; //!< RESP8 - RDS Block C; HIGH byte
649  uint8_t BLOCKCL; //!< RESP9 - RDS Block C; LOW byte
650  uint8_t BLOCKDH; //!< RESP10 - RDS Block D; HIGH byte
651  uint8_t BLOCKDL; //!< RESP11 - RDS Block D; LOW byte
652  // RESP12 - Blocks A to D Corrected Errors.
653  // 0 = No errors;
654  // 1 = 1–2 bit errors detected and corrected;
655  // 2 = 3–5 bit errors detected and corrected.
656  // 3 = Uncorrectable.
657  uint8_t BLED : 2;
658  uint8_t BLEC : 2;
659  uint8_t BLEB : 2;
660  uint8_t BLEA : 2;
661  } resp;
663 } si47x_rds_status;
664 
665 /**
666  * @ingroup group01
667  *
668  * @brief FM_RDS_INT_SOURCE property data type
669  *
670  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 103
671  * @see also https://en.wikipedia.org/wiki/Radio_Data_System
672  */
673 typedef union
674 {
675  struct
676  {
677  uint8_t RDSRECV : 1; //!< If set, generate RDSINT when RDS FIFO has at least FM_RDS_INT_FIFO_COUNT entries.
678  uint8_t RDSSYNCLOST : 1; //!< If set, generate RDSINT when RDS loses synchronization.
679  uint8_t RDSSYNCFOUND : 1; //!< f set, generate RDSINT when RDS gains synchronization.
680  uint8_t DUMMY1 : 1; //!< Always write to 0.
681  uint8_t RDSNEWBLOCKA : 1; //!< If set, generate an interrupt when Block A data is found or subsequently changed
682  uint8_t RDSNEWBLOCKB : 1; //!< If set, generate an interrupt when Block B data is found or subsequently changed
683  uint8_t DUMMY2 : 5; //!< Reserved - Always write to 0.
684  uint8_t DUMMY3 : 5; //!< Reserved - Always write to 0.
685  } refined;
687 } si47x_rds_int_source;
688 
689 /**
690  * @ingroup group01
691  *
692  * @brief Data type for FM_RDS_CONFIG Property
693  *
694  * IMPORTANT: all block errors must be less than or equal the associated block error threshold for the group
695  * to be stored in the RDS FIFO.
696  * 0 = No errors; 1 = 1–2 bit errors detected and corrected; 2 = 3–5 bit errors detected and corrected; 3 = Uncorrectable.
697  * Recommended Block Error Threshold options:
698  * 2,2,2,2 = No group stored if any errors are uncorrected.
699  * 3,3,3,3 = Group stored regardless of errors.
700  * 0,0,0,0 = No group stored containing corrected or uncorrected errors.
701  * 3,2,3,3 = Group stored with corrected errors on B, regardless of errors on A, C, or D.
702  *
703  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 58 and 104
704  */
705 typedef union
706 {
707  struct
708  {
709  uint8_t RDSEN : 1; //!< 1 = RDS Processing Enable.
710  uint8_t DUMMY1 : 7;
711  uint8_t BLETHD : 2; //!< Block Error Threshold BLOCKD
712  uint8_t BLETHC : 2; //!< Block Error Threshold BLOCKC.
713  uint8_t BLETHB : 2; //!< Block Error Threshold BLOCKB.
714  uint8_t BLETHA : 2; //!< Block Error Threshold BLOCKA.
715  } arg;
717 } si47x_rds_config;
718 
719 /**
720  * @ingroup group01
721  *
722  * @brief Block A data type
723  */
724 typedef union
725 {
726  struct
727  {
728  uint16_t pi;
729  } refined;
730  struct
731  {
732  uint8_t highValue; // Most Significant uint8_t first
733  uint8_t lowValue;
734  } raw;
735 } si47x_rds_blocka;
736 
737 /**
738  * @ingroup group01
739  *
740  * @brief Block B data type
741  *
742  * @details For GCC on System-V ABI on 386-compatible (32-bit processors), the following stands:
743  *
744  * 1) Bit-fields are allocated from right to left (least to most significant).
745  * 2) A bit-field must entirely reside in a storage unit appropriate for its declared type.
746  * Thus a bit-field never crosses its unit boundary.
747  * 3) Bit-fields may share a storage unit with other struct/union members, including members that are not bit-fields.
748  * Of course, struct members occupy different parts of the storage unit.
749  * 4) Unnamed bit-fields' types do not affect the alignment of a structure or union, although individual
750  * bit-fields' member offsets obey the alignment constraints.
751  *
752  * @see also Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 78 and 79
753  * @see also https://en.wikipedia.org/wiki/Radio_Data_System
754  */
755 typedef union
756 {
757  struct
758  {
759  uint16_t address : 2; // Depends on Group Type and Version codes. If 0A or 0B it is the Text Segment Address.
760  uint16_t DI : 1; // Decoder Controll bit
761  uint16_t MS : 1; // Music/Speech
762  uint16_t TA : 1; // Traffic Announcement
763  uint16_t programType : 5; // PTY (Program Type) code
764  uint16_t trafficProgramCode : 1; // (TP) => 0 = No Traffic Alerts; 1 = Station gives Traffic Alerts
765  uint16_t versionCode : 1; // (B0) => 0=A; 1=B
766  uint16_t groupType : 4; // Group Type code.
767  } group0;
768  struct
769  {
770  uint16_t address : 4; // Depends on Group Type and Version codes. If 2A or 2B it is the Text Segment Address.
771  uint16_t textABFlag : 1; // Do something if it chanhes from binary "0" to binary "1" or vice-versa
772  uint16_t programType : 5; // PTY (Program Type) code
773  uint16_t trafficProgramCode : 1; // (TP) => 0 = No Traffic Alerts; 1 = Station gives Traffic Alerts
774  uint16_t versionCode : 1; // (B0) => 0=A; 1=B
775  uint16_t groupType : 4; // Group Type code.
776  } group2;
777  struct
778  {
779  uint16_t content : 4; // Depends on Group Type and Version codes.
780  uint16_t textABFlag : 1; // Do something if it chanhes from binary "0" to binary "1" or vice-versa
781  uint16_t programType : 5; // PTY (Program Type) code
782  uint16_t trafficProgramCode : 1; // (TP) => 0 = No Traffic Alerts; 1 = Station gives Traffic Alerts
783  uint16_t versionCode : 1; // (B0) => 0=A; 1=B
784  uint16_t groupType : 4; // Group Type code.
785  } refined;
786  struct
787  {
788  uint8_t lowValue;
789  uint8_t highValue; // Most Significant byte first
790  } raw;
791 } si47x_rds_blockb;
792 
793 /*
794  *
795  *
796  * Group type 4A ( RDS Date and Time)
797  * When group type 4A is used by the station, it shall be transmitted every minute according to EN 50067.
798  * This Structure uses blocks 2,3 and 5 (B,C,D)
799  *
800  * Commented due to “Crosses boundary” on GCC 32-bit plataform.
801  */
802 /*
803 typedef union {
804  struct
805  {
806  uint32_t offset : 5; // Local Time Offset
807  uint32_t offset_sense : 1; // Local Offset Sign ( 0 = + , 1 = - )
808  uint32_t minute : 6; // UTC Minutes
809  uint32_t hour : 5; // UTC Hours
810  uint32_t mjd : 17; // Modified Julian Day Code
811  } refined;
812  uint8_t raw[6];
813 } si47x_rds_date_time;
814 */
815 
816 /**
817  * @ingroup group01
818  *
819  * Group type 4A ( RDS Date and Time)
820  * When group type 4A is used by the station, it shall be transmitted every minute according to EN 50067.
821  * This Structure uses blocks 2,3 and 5 (B,C,D)
822  *
823  * ATTENTION:
824  * To make it compatible with 8, 16 and 32 bits platforms and avoid Crosses boundary, it was necessary to
825  * split minute and hour representation.
826  */
827 typedef union
828 {
829  struct
830  {
831  uint8_t offset : 5; // Local Time Offset
832  uint8_t offset_sense : 1; // Local Offset Sign ( 0 = + , 1 = - )
833  uint8_t minute1 : 2; // UTC Minutes - 2 bits less significant (void “Crosses boundary”).
834  uint8_t minute2 : 4; // UTC Minutes - 4 bits more significant (void “Crosses boundary”)
835  uint8_t hour1 : 4; // UTC Hours - 4 bits less significant (void “Crosses boundary”)
836  uint8_t hour2 : 1; // UTC Hours - 4 bits more significant (void “Crosses boundary”)
837  uint32_t mjd : 17; // Modified Julian Day Code
838  } refined;
840 } si47x_rds_date_time;
841 
842 /**
843  * @ingroup group01
844  *
845  * AGC data types
846  * FM / AM and SSB structure to AGC
847  *
848  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); For FM page 80; for AM page 142
849  * @see AN332 REV 0.8 Universal Programming Guide Amendment for SI4735-D60 SSB and NBFM patches; page 18.
850  */
851 typedef union
852 {
853  struct
854  {
855  // status ("RESP0")
856  uint8_t STCINT : 1;
857  uint8_t DUMMY1 : 1;
858  uint8_t RDSINT : 1; // Not used for AM/SSB
859  uint8_t RSQINT : 1;
860  uint8_t DUMMY2 : 2;
861  uint8_t ERR : 1;
862  uint8_t CTS : 1;
863  // RESP1
864  uint8_t AGCDIS : 1; // This bit indicates if the AGC is enabled or disabled. 0 = AGC enabled; 1 = AGC disabled.
865  uint8_t DUMMY : 7;
866  // RESP2
867  uint8_t AGCIDX; // For FM (5 bits - READ_LNA_GAIN_INDEX - 0 = Minimum attenuation (max gain)). For AM (8 bits). This byte reports the current AGC gain index.
868  } refined;
870 } si47x_agc_status;
871 
872 /**
873  * @ingroup group01
874  *
875  * If FM, Overrides AGC setting by disabling the AGC and forcing the LNA to have a certain gain that ranges between 0
876  * (minimum attenuation) and 26 (maximum attenuation).
877  * If AM, overrides the AGC setting by disabling the AGC and forcing the gain index that ranges between 0
878  *
879  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); For FM page 81; for AM page 143
880  */
881 typedef union
882 {
883  struct
884  {
885  // ARG1
886  uint8_t AGCDIS : 1; // if set to 1 indicates if the AGC is disabled. 0 = AGC enabled; 1 = AGC disabled.
887  uint8_t DUMMY : 7;
888  // ARG2
889  uint8_t AGCIDX; // AGC Index; If AMAGCDIS = 1, this byte forces the AGC gain index; 0 = Minimum attenuation (max gain)
890  } arg;
892 } si47x_agc_overrride;
893 
894 /**
895  * @ingroup group01
896  *
897  * The bandwidth of the AM channel filter data type
898  * AMCHFLT values: 0 = 6 kHz Bandwidth
899  * 1 = 4 kHz Bandwidth
900  * 2 = 3 kHz Bandwidth
901  * 3 = 2 kHz Bandwidth
902  * 4 = 1 kHz Bandwidth
903  * 5 = 1.8 kHz Bandwidth
904  * 6 = 2.5 kHz Bandwidth, gradual roll off
905  * 7–15 = Reserved (Do not use)
906  *
907  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 125 and 151
908  */
909 typedef union
910 {
911  struct
912  {
913  uint8_t AMCHFLT : 4; //!< Selects the bandwidth of the AM channel filter.
914  uint8_t DUMMY1 : 4;
915  uint8_t AMPLFLT : 1; //!< Enables the AM Power Line Noise Rejection Filter.
916  uint8_t DUMMY2 : 7;
917  } param;
919 } si47x_bandwidth_config; // AM_CHANNEL_FILTER
920 
921 /**
922  * @ingroup group01
923  *
924  * SSB - datatype for SSB_MODE (property 0x0101)
925  *
926  * @see AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 24
927  */
928 typedef union
929 {
930  struct
931  {
932  uint8_t AUDIOBW : 4; //!< 0 = 1.2kHz (default); 1=2.2kHz; 2=3kHz; 3=4kHz; 4=500Hz; 5=1kHz
933  uint8_t SBCUTFLT : 4; //!< SSB side band cutoff filter for band passand low pass filter
934  uint8_t AVC_DIVIDER : 4; //!< set 0 for SSB mode; set 3 for SYNC mode;
935  uint8_t AVCEN : 1; //!< SSB Automatic Volume Control (AVC) enable; 0=disable; 1=enable (default);
936  uint8_t SMUTESEL : 1; //!< SSB Soft-mute Based on RSSI or SNR
937  uint8_t DUMMY1 : 1; //!< Always write 0;
938  uint8_t DSP_AFCDIS : 1; //!< 0=SYNC MODE, AFC enable; 1=SSB MODE, AFC disable.
939  } param;
941 } si47x_ssb_mode;
942 
943 /**
944  * @ingroup group01
945  *
946  * @brief Digital audio output format data structure (Property 0x0102. DIGITAL_OUTPUT_FORMAT).
947  *
948  * @details Used to configure: DCLK edge, data format, force mono, and sample precision.
949  *
950  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 195.
951  */
952 typedef union
953 {
954  struct
955  {
956  uint8_t OSIZE : 2; //!< Digital Output Audio Sample Precision (0=16 bits, 1=20 bits, 2=24 bits, 3=8bits).
957  uint8_t OMONO : 1; //!< Digital Output Mono Mode (0=Use mono/stereo blend ).
958  uint8_t OMODE : 4; //!< Digital Output Mode (0000=I2S, 0110 = Left-justified, 1000 = MSB at second DCLK after DFS pulse, 1100 = MSB at first DCLK after DFS pulse).
959  uint8_t OFALL : 1; //!< Digital Output DCLK Edge (0 = use DCLK rising edge, 1 = use DCLK falling edge)
960  uint8_t dummy : 8; //!< Always 0.
961  } refined;
963 } si4735_digital_output_format;
964 
965 /**
966  * @ingroup group01
967  * @brief patch header stored in a eeprom
968  * @details This data type represents o header of a eeprom with a patch content
969  * @details This structure will be used to read an eeprom generated by leo sketch SI47XX_09_SAVE_SSB_PATCH_EEPROM.ino.
970  * @details The sketch SI47XX_09_SAVE_SSB_PATCH_EEPROM can be found on Examples/SI47XX_TOOLS folder
971  */
972 typedef union
973 {
974  struct
975  {
976  uint8_t reserved[8]; // Not used
977  uint8_t status[8]; // Note used
978  uint8_t patch_id[14]; // Patch name
979  uint16_t patch_size; // Patch size (in bytes)
980  } refined;
982 } si4735_eeprom_patch_header;
983 
984 /**
985  * @ingroup group01
986  *
987  * @brief Digital audio output sample structure (Property 0x0104. DIGITAL_OUTPUT_SAMPLE_RATE).
988  *
989  * @details Used to enable digital audio output and to configure the digital audio output sample rate in samples per second (sps).
990  *
991  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 196.
992  */
993 typedef struct
994 {
995  uint16_t DOSR; // Digital Output Sample Rate(32–48 ksps .0 to disable digital audio output).
996 } si4735_digital_output_sample_rate; // Maybe not necessary
997 
998 volatile static bool data_from_si4735; /** @ingroup group04 store the interrupt status */
999 
1000 /**
1001  * @brief Interrupt Function
1002  *
1003  * @details this function just set the volatile static bool data_from_si4735 to true;
1004  *
1005  * If you are using interrupt feature, this function will be called by the system, not by you.
1006  * If you are not using interrupt feature, please, ignore the compile message:
1007  * "warning: 'void interrupt_hundler()' defined but not used [-Wunused-function]"
1008  */
1009 static void interrupt_hundler()
1010 {
1011  data_from_si4735 = true;
1012 };
1013 
1014 /**********************************************************************
1015  * SI4735 Class definition
1016  **********************************************************************/
1017 
1018 /**
1019  * @brief SI4735 Class
1020  *
1021  * @details This class implements all functions to help you to control the Si47XX devices.
1022  * This library was built based on “Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0)”.
1023  * It also can be used on all members of the SI473X family respecting, of course, the features available
1024  * for each IC version. These functionalities can be seen in the comparison matrix shown in
1025  * table 1 (Product Family Function); pages 2 and 3 of the programming guide.
1026  *
1027  * @author PU2CLR - Ricardo Lima Caratti
1028  */
1029 class SI4735
1030 {
1031 protected:
1032  char rds_buffer2A[65]; //!< RDS Radio Text buffer - Program Information
1033  char rds_buffer2B[33]; //!< RDS Radio Text buffer - Station Informaation
1034  char rds_buffer0A[9]; //!< RDS Basic tuning and switching information (Type 0 groups)
1035  char rds_time[20]; //!< RDS date time received information
1036 
1037  int rdsTextAdress2A; //!< rds_buffer2A current position
1038  int rdsTextAdress2B; //!< rds_buffer2B current position
1039  int rdsTextAdress0A; //!< rds_buffer0A current position
1040 
1041  int16_t deviceAddress = SI473X_ADDR_SEN_LOW; //!< Stores the current I2C bus address.
1042 
1043  // Delays
1044  uint16_t maxDelaySetFrequency = MAX_DELAY_AFTER_SET_FREQUENCY; //!< Stores the maximum delay after set frequency command (in ms).
1045  uint16_t maxDelayAfterPouwerUp = MAX_DELAY_AFTER_POWERUP; //!< Stores the maximum delay you have to setup after a power up command (in ms).
1046  unsigned long maxSeekTime = MAX_SEEK_TIME; //!< Stores the maximum time (ms) for a seeking process. Defines the maximum seeking time.
1047 
1049  uint8_t resetPin; //!< pin used on Arduino Board to RESET the Si47XX device
1050  uint8_t interruptPin; //!< pin used on Arduino Board to control interrupt. If -1, interrupt is no used.
1051 
1052  uint8_t currentTune; //!< tell the current tune (FM, AM or SSB)
1053 
1054  uint16_t currentMinimumFrequency; //!< minimum frequency of the current band
1055  uint16_t currentMaximumFrequency; //!< maximum frequency of the current band
1056  uint16_t currentWorkFrequency; //!< current frequency
1057 
1058  uint16_t currentStep; //!< Stores the current step used to increment or decrement the frequency.
1059 
1060  uint8_t lastMode = -1; //!< Stores the last mode used.
1061 
1062  uint8_t currentAvcAmMaxGain = 48; //!< Stores the current Automatic Volume Control Gain for AM. Default value is 48.
1063  uint8_t currentClockType = XOSCEN_CRYSTAL; //!< Stores the current clock type used (Crystal or REF CLOCK)
1064  uint8_t currentInterruptEnable = 0; //!< If you are using interrupt, this variable stores 1.
1065 
1066  uint16_t refClock = 31768; //!< Frequency of Reference Clock in Hz.
1067  uint16_t refClockPrescale = 1; //!< Prescaler for Reference Clock (divider).
1068  uint8_t refClockSourcePin = 0; //!< 0 = RCLK pin is clock source; 1 = DCLK pin is clock source.
1069 
1070  si47x_frequency currentFrequency; //!< data structure to get current frequency
1071  si47x_set_frequency currentFrequencyParams;
1072  si47x_rqs_status currentRqsStatus; //!< current Radio SIgnal Quality status
1073  si47x_response_status currentStatus; //!< current device status
1074  si47x_firmware_information firmwareInfo; //!< firmware information
1075  si47x_rds_status currentRdsStatus; //!< current RDS status
1076  si47x_agc_status currentAgcStatus; //!< current AGC status
1077  si47x_ssb_mode currentSSBMode; //!< indicates if USB or LSB
1078 
1079  si473x_powerup powerUp;
1080 
1081  uint8_t volume = 32; //!< Stores the current vlume setup (0-63).
1082 
1083  uint8_t currentAudioMode = SI473X_ANALOG_AUDIO; //!< Current audio mode used (ANALOG or DIGITAL or both)
1086 
1087  void waitInterrupr(void);
1088  si47x_status getInterruptStatus();
1089 
1090  void setGpioCtl(uint8_t GPO1OEN, uint8_t GPO2OEN, uint8_t GPO3OEN);
1091  void setGpio(uint8_t GPO1LEVEL, uint8_t GPO2LEVEL, uint8_t GPO3LEVEL);
1092  void setGpioIen(uint8_t STCIEN, uint8_t RSQIEN, uint8_t ERRIEN, uint8_t CTSIEN, uint8_t STCREP, uint8_t RSQREP);
1093 
1094  void sendProperty(uint16_t propertyNumber, uint16_t param);
1095 
1096  void sendSSBModeProperty();
1097  void disableFmDebug();
1098  void clearRdsBuffer2A();
1099  void clearRdsBuffer2B();
1100  void clearRdsBuffer0A();
1101 
1102 public:
1103  SI4735();
1104  void reset(void);
1105  void waitToSend(void);
1106 
1107  void setup(uint8_t resetPin, uint8_t defaultFunction);
1108  void setup(uint8_t resetPin, int interruptPin, uint8_t defaultFunction, uint8_t audioMode = SI473X_ANALOG_AUDIO, uint8_t clockType = XOSCEN_CRYSTAL);
1109 
1110  void setRefClock(uint16_t refclk);
1111  void setRefClockPrescaler(uint16_t prescale, uint8_t rclk_sel = 0);
1112 
1114 
1115  /**
1116  * @ingroup group10 Generic set and get property
1117  *
1118  * @brief Sets a given SI47XX device property
1119  *
1120  * @details Sets the Si47XX device with a given attribute.
1121  * @details You might need to use the bit operations or some bit field structure to set right the values.
1122  * @details Used this function instead of the sendProperty.
1123  *
1124  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 55, 69, 124 and 134.
1125  * @see getProperty, sendProperty
1126  * @param propertyNumber
1127  * @param param pamameter value
1128  */
1129  inline void setProperty(uint16_t propertyNumber, uint16_t param)
1130  {
1131  sendProperty(propertyNumber, param);
1132  };
1133 
1134  void sendCommand(uint8_t cmd, int parameter_size, const uint8_t *parameter);
1135  void getCommandResponse(int num_of_bytes, uint8_t *response);
1136  si47x_status getStatusResponse();
1137 
1138  void setPowerUp(uint8_t CTSIEN, uint8_t GPO2OEN, uint8_t PATCH, uint8_t XOSCEN, uint8_t FUNC, uint8_t OPMODE);
1139  void radioPowerUp(void);
1140  void analogPowerUp(void);
1141  void powerDown(void);
1142 
1143  void setFrequency(uint16_t);
1144 
1145  void getStatus(uint8_t, uint8_t);
1146 
1147  uint16_t getFrequency(void);
1148 
1149  /**
1150  * STATUS RESPONSE
1151  * Set of methods to get current status information. Call them after getStatus or getFrequency or seekStation
1152  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 63
1153  */
1154 
1155  /**
1156  * @ingroup group08
1157  * @brief Get the Signal Quality Interrupt status
1158  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 63
1159  * @return RDSINT status
1160  */
1162  {
1163  return currentStatus.resp.RSQINT;
1164  };
1165 
1166  /**
1167  * @ingroup group08
1168  * @brief Get the Radio Data System (RDS) Interrupt status
1169  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 63
1170  * @return RDSINT status
1171  */
1173  {
1174  return currentStatus.resp.RDSINT;
1175  };
1176 
1177  /**
1178  * @ingroup group08
1179  * @brief Get the Tune Complete status
1180  * @details Seek/Tune Complete Interrupt; 1 = Tune complete has been triggered.
1181  * @return STCINT status
1182  */
1184  {
1185  return currentStatus.resp.STCINT;
1186  };
1187 
1188  /**
1189  * @ingroup group08
1190  * @brief Get the Status Error
1191  * @details Return the Error flag (true or false) of status of the least Tune or Seek
1192  * @return Error flag
1193  */
1194  inline bool getStatusError()
1195  {
1196  return currentStatus.resp.ERR;
1197  };
1198 
1199  /**
1200  * @ingroup group08
1201  * @brief Gets the Error flag Clear to Send
1202  *
1203  * @return CTS
1204  */
1205  inline bool getStatusCTS() { return currentStatus.resp.CTS; };
1206 
1207  /**
1208  * @ingroup group08
1209  * @brief Returns true if the AFC rails (AFC Rail Indicator).
1210  *
1211  * @return true
1212  */
1213  inline bool getACFIndicator()
1214  {
1215  return currentStatus.resp.AFCRL;
1216  };
1217 
1218  /**
1219  * @ingroup group08
1220  * @brief Returns true if a seek hit the band limit
1221  *
1222  * @details (WRAP = 0 in FM_START_SEEK) or wrapped to the original frequency(WRAP = 1).
1223  *
1224  * @return BLTF
1225  */
1226  inline bool getBandLimit()
1227  {
1228  return currentStatus.resp.BLTF;
1229  };
1230 
1231  /**
1232  * @ingroup group08
1233  * @brief Gets the channel status
1234  *
1235  * @details Returns true if the channel is currently valid as determined by the seek/tune properties (0x1403, 0x1404, 0x1108)
1236  *
1237  * @return true
1238  * @return false
1239  */
1240  inline bool getStatusValid()
1241  {
1242  return currentStatus.resp.VALID;
1243  };
1244 
1245  /**
1246  * @ingroup group08
1247  * @brief Returns the value of Received Signal Strength Indicator (dBμV).
1248  *
1249  * @return uint8_t
1250  */
1252  {
1253  return currentStatus.resp.RSSI;
1254  };
1255 
1256  /**
1257  * @ingroup group08
1258  * @brief Gets the SNR metric when tune is complete (dB)
1259  *
1260  * @details Returns the value of the SNR metric when tune is complete (dB).
1261  *
1262  * @return uint8_t
1263  */
1265  {
1266  return currentStatus.resp.SNR;
1267  };
1268 
1269  /**
1270  * @ingroup group08
1271  * @brief Get the Status the M U L T
1272  *
1273  * @details Returns the value containing the multipath metric when tune is complete.
1274  *
1275  * @return uint8_t
1276  */
1278  {
1279  return currentStatus.resp.MULT;
1280  };
1281 
1282  /**
1283  * @ingroup group17
1284  * @brief Get the Antenna Tuning Capacitor value
1285  * @details Returns the current antenna tuning capacitor value. The tuning capacitance is 95 fF x READANTCAP + 7 pF.
1286  * @details ON AM or SSB mode, the MULT attribute sotores the high byte of READANTCAP and the attribute READANTCAP by itself stores the low byte.
1287  *
1288  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 74,74, 140 and 141.
1289  * @return uint8_t capacitance
1290  */
1292  {
1293  si47x_antenna_capacitor cap;
1294 
1295  if (currentTune == FM_TUNE_FREQ)
1296  return currentStatus.resp.READANTCAP;
1297  else
1298  {
1299  cap.raw.ANTCAPL = currentStatus.resp.READANTCAP; // On AM it is the low byte the READANTCAP value
1300  cap.raw.ANTCAPH = currentStatus.resp.MULT; // On AM it is the high byte the READANTCAP value
1301  return cap.value;
1302  }
1303  };
1304 
1305  void getAutomaticGainControl(); //!< Queries Automatic Gain Control STATUS
1306 
1307  /**
1308  * @ingroup group17
1309  * @brief Sets the Avc Am Max Gain to 48dB
1310  *
1311  */
1312  inline void setAvcAmMaxGain()
1313  {
1314  sendProperty(AM_AUTOMATIC_VOLUME_CONTROL_MAX_GAIN, ((currentAvcAmMaxGain = 48) * 340));
1315  };
1316 
1317  void setAvcAmMaxGain(uint8_t gain); //!< Sets the maximum gain for automatic volume control.
1318 
1319  /**
1320  * @ingroup group17
1321  * @brief Get the current Avc Am Max Gain
1322  *
1323  * @return uint8_t Current AVC gain index value
1324  */
1326  {
1327  return currentAvcAmMaxGain;
1328  };
1329 
1330  /**
1331  * @ingroup group17
1332  * @brief Sets the Am Soft Mute Max Attenuation
1333  *
1334  * @details This function can be useful to disable Soft Mute. The value 0 disable soft mute.
1335  * @details Specified in units of dB. Default maximum attenuation is 8 dB. It works for AM and SSB.
1336  *
1337  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 158.
1338  *
1339  * @param smattn Maximum attenuation to apply when in soft mute
1340  */
1341  inline void setAmSoftMuteMaxAttenuation(uint8_t smattn = 0)
1342  {
1343  sendProperty(AM_SOFT_MUTE_MAX_ATTENUATION, smattn);
1344  };
1345 
1346  /**
1347  * @ingroup group17
1348  * @brief Sets the SSB Soft Mute Max Attenuation object
1349  *
1350  * @details Sets maximum attenuation during soft mute (dB). Set to 0 to disable soft mute.
1351  * @details Specified in units of dB. Default maximum attenuation is 8 dB.
1352  * @details You can use setAmSoftMuteMaxAttenuation instead. Same AM property values.
1353  * @param smattn Maximum attenuation to apply when in soft mute.
1354  */
1355  inline void setSsbSoftMuteMaxAttenuation(uint8_t smattn = 0)
1356  {
1357  sendProperty(SSB_SOFT_MUTE_MAX_ATTENUATION, smattn);
1358  };
1359 
1360  /**
1361  * @ingroup group08
1362  * @brief Checks if the AGC is enabled
1363  *
1364  * @return true if the AGC is enabled
1365  */
1366  inline bool isAgcEnabled()
1367  {
1368  return !currentAgcStatus.refined.AGCDIS;
1369  };
1370 
1371  /**
1372  * @ingroup group08
1373  * @brief Gets the current AGC gain index
1374  *
1375  * @return uint8_t The current AGC gain index.
1376  */
1378  {
1379  return currentAgcStatus.refined.AGCIDX;
1380  };
1381 
1382  void setAutomaticGainControl(uint8_t AGCDIS, uint8_t AGCIDX);
1383 
1384  void getCurrentReceivedSignalQuality(uint8_t INTACK);
1386 
1387  // AM and FM
1388 
1389  /**
1390  * @ingroup group08
1391  * @brief Get the current receive signal strength (0–127 dBμV)
1392  *
1393  * @return uint8_t a value between 0 to 127
1394  */
1396  {
1397  return currentRqsStatus.resp.RSSI;
1398  };
1399 
1400  /**
1401  * @ingroup group08
1402  * @brief Gets the current SNR metric (0–127 dB).
1403  *
1404  * @return uint8_t SNR value in dB (0-127)
1405  */
1407  {
1408  return currentRqsStatus.resp.SNR;
1409  };
1410 
1411  /**
1412  * @ingroup group08
1413  * @brief Checks if RSSI detected is LOW.
1414  *
1415  * @return true if RSSI is low
1416  */
1418  {
1419  return currentRqsStatus.resp.RSSIILINT;
1420  };
1421 
1422  /**
1423  * @ingroup group08
1424  * @brief Checks if RSSI detected is high
1425  *
1426  * @return true if RSSI detected is high
1427  */
1429  {
1430  return currentRqsStatus.resp.RSSIHINT;
1431  };
1432 
1433  /**
1434  * @ingroup group08
1435  * @brief Checks if SNR detect is low
1436  *
1437  * @return true if SNR detected is low
1438  */
1440  {
1441  return currentRqsStatus.resp.SNRLINT;
1442  };
1443 
1444  /**
1445  * @ingroup group08
1446  * @brief Checks if SNR detect is high
1447  *
1448  * @return true if SNR detect is high
1449  */
1451  {
1452  return currentRqsStatus.resp.SNRHINT;
1453  };
1454 
1455  /**
1456  * @ingroup group08
1457  * @brief Checks if the current channel is valid
1458  *
1459  * @return true if the current channel is valid
1460  */
1462  {
1463  return currentRqsStatus.resp.VALID;
1464  };
1465 
1466  /**
1467  * @ingroup group08
1468  * @brief AFC Rail Indicator
1469  *
1470  * @return true or false
1471  */
1473  {
1474  return currentRqsStatus.resp.AFCRL;
1475  };
1476 
1477  /**
1478  * @ingroup group08
1479  * @brief Soft Mute Indicator.
1480  *
1481  * @details Indicates soft mute is engaged.
1482  *
1483  * @return true if soft mute indicates is engaged.
1484  */
1486  {
1487  return currentRqsStatus.resp.SMUTE;
1488  };
1489 
1490  // Just FM
1491 
1492  /**
1493  * @ingroup group08
1494  * @brief Gets the value of the amount of stereo blend in % (100 = full stereo, 0 = full mono).
1495  *
1496  * @return uint8_t value (0 to 100)
1497  */
1499  {
1500  return currentRqsStatus.resp.STBLEND;
1501  };
1502 
1503  /**
1504  * @ingroup group08
1505  * @brief Checks the current pilot
1506  *
1507  * @details Indicates stereo pilot presence.
1508  *
1509  * @return true if stereo pilot presence has detected
1510  */
1511  inline bool getCurrentPilot()
1512  {
1513  return currentRqsStatus.resp.PILOT;
1514  };
1515 
1516  /**
1517  * @ingroup group08
1518  * @brief Gets the current Multipath
1519  *
1520  * @details Contains the current multipath metric. (0 = no multipath; 100 = full multipath)
1521  *
1522  * @return uint8_t value (0 to 100)
1523  */
1525  {
1526  return currentRqsStatus.resp.MULT;
1527  };
1528 
1529  /**
1530  * @ingroup group08
1531  * @brief Gets the Signed frequency offset (kHz).
1532  *
1533  * @return uint8_t
1534  */
1536  return currentRqsStatus.resp.FREQOFF;
1537  };
1538 
1539  /**
1540  * @ingroup group08
1541  * @brief Get Multipath Detect Low
1542  *
1543  * @return true
1544  * @return false
1545  */
1547  return currentRqsStatus.resp.MULTLINT;
1548  };
1549 
1550  /**
1551  * @ingroup group08
1552  * @brief Gets the Current Multipath Detect High
1553  *
1554  * @return true
1555  * @return false
1556  */
1558  return currentRqsStatus.resp.MULTHINT;
1559  };
1560 
1561  /**
1562  * @ingroup group08
1563  * @brief Gets the Current Blend Detect Interrupt
1564  *
1565  * @return true
1566  * @return false
1567  */
1569  return currentRqsStatus.resp.BLENDINT;
1570  };
1571 
1572  /*
1573  * FIRMWARE RESPONSE
1574  *
1575  * See Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 66
1576  */
1577 
1578  /**
1579  * @ingroup group06
1580  * @brief Returns the Firmware Part Number
1581  *
1582  * @return uint8_t
1583  */
1585  return firmwareInfo.resp.PN;
1586  };
1587 
1588  /**
1589  * @ingroup group06
1590  * @brief Returns the Firmware F W M A J O R
1591  *
1592  * @return uint8_t
1593  */
1595  return firmwareInfo.resp.FWMAJOR;
1596  };
1597 
1598  /**
1599  * @ingroup group06
1600  * @brief Returns the Firmware F W M I N O R
1601  *
1602  * @return uint8_t
1603  */
1605  return firmwareInfo.resp.FWMINOR;
1606  };
1607 
1608  /**
1609  * @ingroup group06
1610  * @brief Returns the Firmware P A T C H HIGH
1611  *
1612  * @return uint8_t
1613  */
1615  return firmwareInfo.resp.PATCHH;
1616  };
1617 
1618  /**
1619  * @ingroup group06
1620  * @brief Returns the Firmware P A T C H LOW
1621  *
1622  * @return uint8_t
1623  */
1625  return firmwareInfo.resp.PATCHL;
1626  };
1627 
1628  /**
1629  * @ingroup group06
1630  * @brief Get the Firmware C M P M A J O R object
1631  *
1632  * @return uint8_t
1633  */
1635  return firmwareInfo.resp.CMPMAJOR;
1636  }; //!< RESP6 - Returns the Component Major Revision (ASCII).
1637 
1638  /**
1639  * @ingroup group06
1640  * @brief Returns the Component Minor Revision (ASCII) (RESP7)
1641  *
1642  * @return uint8_t
1643  */
1645  return firmwareInfo.resp.CMPMINOR;
1646  };
1647 
1648  /**
1649  * @ingroup group06
1650  * @brief RESP8 - Returns the Chip Revision (ASCII)
1651  *
1652  * @return uint8_t
1653  */
1655  return firmwareInfo.resp.CHIPREV;
1656  };
1657 
1658  void setVolume(uint8_t volume);
1659  uint8_t getVolume();
1660  void volumeDown();
1661  void volumeUp();
1662 
1663  /**
1664  * @ingroup group13 Audio volume
1665  * @brief Get the Current Volume
1666  * @details Returns the current volume level.
1667  * @return uint8_t
1668  */
1669  inline uint8_t getCurrentVolume() { return volume; };
1670 
1671  /**
1672  * @ingroup group13 Audio volume
1673  * @brief Set the Volume Up
1674  * @details Same volumeUp()
1675  * @see volumeUp
1676  */
1677  inline void setVolumeUp() { volumeUp(); };
1678  /**
1679  * @ingroup group13 Audio volume
1680  * @brief Set the Volume Down
1681  * @details Same volumeDown()
1682  * @return voi
1683  */
1684  inline void setVolumeDown() { volumeDown(); };
1685 
1686  /**
1687  * @ingroup group13 Digital Audio setup
1688  * @brief Sets the Audio Mode. See table below.
1689  * @details If you want to change the audio mode, call this function before call setAM(), setFM() or setSSB().
1690  * @details Sets the Si47XX device to use ANALOG or DIGITAL audio output. The table below show the valid values.
1691  * @details This function will only take effect after calling setAM(), setFM() or setSSB().
1692  *
1693  *
1694  * | Macro | Value (Binary) | Description |
1695  * | ----- | ----- | ----------- |
1696  * | SI473X_ANALOG_AUDIO | 0b00000101 | Analog Audio Inputs |
1697  * | SI473X_DIGITAL_AUDIO1 | 0b00001011 | Digital audio output (DCLK, LOUT/DFS, ROUT/DIO) |
1698  * | SI473X_DIGITAL_AUDIO2 | 0b10110000 | Digital audio outputs (DCLK, DFS, DIO) |
1699  * | SI473X_DIGITAL_AUDIO3 | 0b10110101 | Analog and digital audio outputs (LOUT/ROUT and DCLK, DFS,DIO) |
1700  *
1701  * @see setAM(), setFM(), setSSB().
1702  * @param audioMode One of the values options above
1703  */
1704  inline void setAudioMode(uint8_t audioMode)
1705  {
1706  currentAudioMode = audioMode;
1707  };
1708 
1709  /**
1710  * @ingroup group13 Audio Noise Blank Delay
1711  * @brief Sets the delay before applying impulse blanking
1712  * @details Delay in micro-sonds before applying impulse blanking to the original samples. Default value is 172.
1713  *
1714  * @param value Delay in micro-seconds
1715  */
1716  inline void setAmDelayNB(uint16_t value) {
1717  sendProperty(AM_NB_DELAY, value);
1718  }
1719 
1720  void digitalOutputFormat(uint8_t OSIZE, uint8_t OMONO, uint8_t OMODE, uint8_t OFALL);
1721  void digitalOutputSampleRate(uint16_t DOSR);
1722 
1723  void setAudioMute(bool off); // if true mute the audio; else unmute
1724 
1725  void setAM();
1726  void setFM();
1727  void setAM(uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step);
1728  void setFM(uint16_t fromFreq, uint16_t toFreq, uint16_t initialFreq, uint16_t step);
1729 
1730  /**
1731  * @ingroup group08
1732  * @brief Sets the FM Receive de-emphasis to 50 or 75 μs.
1733  * @details valid parameters are 1 = 50 μs. Usedin Europe, Australia, Japan; 2 = 75 μs. Used in USA (default)
1734  *
1735  * @param parameter 1 or 2 (default 1 - USA)
1736  */
1737  inline void setFMDeEmphasis(uint8_t parameter)
1738  {
1739  sendProperty(FM_DEEMPHASIS, parameter);
1740  };
1741 
1742 
1743  /**
1744  * @ingroup group08
1745  * @brief Sets the AM Receive de-emphasis to 50 or disable.
1746  * @details valid parameters are 1 = 50 μs. Usedin urope, Australia, Japan; 2 = 75 μs. Used in USA (default)
1747  *
1748  * @param parameter 1 = enable or 0 = disable
1749  */
1750  inline void setAMDeEmphasis(uint8_t parameter)
1751  {
1752  sendProperty(AM_DEEMPHASIS, parameter);
1753  };
1754 
1755  /**
1756  * @ingroup group08
1757  * @brief Sets the AM attenuation slope during soft mute
1758  * @details Configures attenuation slope during soft mute in dB attenuation per dB SNR below the soft mute SNR threshold.
1759  * @details Soft mute attenuation is the minimum of SMSLOPEx(SMTHR–SNR) and SMATTN.
1760  * @details The default slope is 1 dB/dB for AMRX component 5.0 or later and 2 dB/dB for AMRX component 3.0 or earlier.
1761  *
1762  * @see setAmSoftMuteMaxAttenuation
1763  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0);
1764  * @param parameter the valid values are 1–5 (default 1).
1765  */
1766  inline void setAMSoftMuteSlop(uint8_t parameter)
1767  {
1768  sendProperty(AM_SOFT_MUTE_SLOPE, parameter);
1769  };
1770 
1771 
1772  /**
1773  * @ingroup group08
1774  * @brief Sets the attack and decay rates when entering or leaving soft mute.
1775  * @details The value specified is multiplied by 4.35 dB/s to come up with the actual attack rate
1776  * @details The default rate is 278 dB/s.
1777  * @see setAmSoftMuteMaxAttenuation
1778  * @see Si47XX PRORAMMING GUIDE; AN332 (REV 1.0);
1779  * @param parameter The valid values are 1-255 ( Default is ~64 - [64 x 4.35 = 278] )
1780  */
1781  inline void setAMSoftMuteRate(uint8_t parameter)
1782  {
1783  sendProperty(AM_SOFT_MUTE_RATE, parameter);
1784  };
1785 
1786 
1787  /**
1788  * @ingroup group08
1789  * @brief Sets the SNR threshold to engage soft mute
1790  * @details Whenever the SNR for a tuned frequency drops below this threshold the AM reception will go in soft mute,
1791  * @details provided soft mute max attenuation property is non-zero. The default value is 8dB
1792  * @see setAmSoftMuteMxAttenuation
1793  * @see Si47XX PROAMMING GUIDE; AN332 (REV 1.0);
1794  * @param parameter 0-63 (default is 8)
1795  */
1796  inline void setAMSoftMuteSnrThreshold(uint8_t parameter)
1797  {
1798  sendProperty(AM_SOFT_MUTE_SNR_THRESHOLD, parameter);
1799  };
1800 
1801  /**
1802  * @ingroup group08
1803  * @brief Sets the soft mute release rate.
1804  * @details Smaller values provide slower release and larger values provide faster release. The default is 8192 (approximately 8000 dB/s).
1805  * @see setAmSoftMuteMxAttenuation
1806  * @see Si47XX PROAMMING GUIDE; AN332 (REV 1.0);
1807  * @param parameter 1–32767
1808  */
1809  inline void setAMSoftMuteReleaseRate(uint8_t parameter)
1810  {
1811  sendProperty(AM_SOFT_MUTE_RELEASE_RATE, parameter);
1812  };
1813 
1814  /**
1815  * @ingroup group08
1816  * @brief Sets the soft mute attack rate.
1817  * @details Smaller values provide slower attack and larger values provide faster attack.
1818  * @see setAmSoftMuteMxAttenuation
1819  * @see Si47XX PROAMMING GUIDE; AN332 (REV 1.0);
1820  * @param parameter 1–32767 (The default is 8192 (approximately 8000 dB/s)
1821  */
1822  inline void setAMSoftMuteAttackRate(uint16_t parameter)
1823  {
1824  sendProperty(AM_SOFT_MUTE_ATTACK_RATE, parameter);
1825  };
1826 
1827  /**
1828  * @ingroup group08
1829  * @brief Sets the AGC attack rate.
1830  * @details Large values provide slower attack, and smaller values provide faster attack..
1831  * @see setAmAgcAttackRate
1832  * @see Si47XX PROAMMING GUIDE; AN332 (REV 1.2); page 167
1833  * @param parameter Range: 4–248 (The default is 0x04)
1834  */
1835  inline void setAmAgcAttackRate(uint16_t parameter)
1836  {
1837  sendProperty(AM_AGC_ATTACK_RATE, parameter);
1838  };
1839 
1840  /**
1841  * @ingroup group08
1842  * @brief Sets the AGC release rate.
1843  * @details Larger values provide slower release, and smaller values provide faster release.
1844  * @see setAmAgcReleaseRate
1845  * @see Si47XX PROAMMING GUIDE; AN332 (REV 1.2); page 168
1846  * @param parameter Range: 4–248 (The default is 0x8C)
1847  */
1848  inline void setAmAgcReleaseRate(uint16_t parameter)
1849  {
1850  sendProperty(AM_AGC_RELEASE_RATE, parameter);
1851  };
1852 
1853  /**
1854  * @ingroup group08
1855  * @brief Sets the AGC attack rate on SSB mode.
1856  * @details Large values provide slower attack, and smaller values provide faster attack..
1857  * @see setSsbAgcAttackRate
1858  * @see AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 29
1859  * @param parameter Range: 4–248 (The default is 0x04)
1860  */
1861  inline void setSsbAgcAttackRate(uint16_t parameter)
1862  {
1863  sendProperty(SSB_RF_AGC_ATTACK_RATE, parameter);
1864  };
1865 
1866  /**
1867  * @ingroup group08
1868  * @brief Sets the AGC Release rate on SSB mode.
1869  * @details Larger values provide slower release, and smaller values provide faster release.
1870  * @see setSsbAgcAttackRate
1871  * @see AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 29
1872  * @param parameter Range: 4–248 (The default is 0x18)
1873  */
1874  inline void setSsbAgcReleaseRate(uint16_t parameter)
1875  {
1876  sendProperty(SSB_RF_AGC_RELEASE_RATE, parameter);
1877  };
1878 
1879  /**
1880  * @ingroup group08
1881  * @brief Adjusts the AM AGC for external front-end attenuator and external front-end cascode LNA.
1882  * @details This property contains two fields: MIN_GAIN_INDEX and ATTN_BACKUP.
1883  * @details MIN_GAIN_INDEX impacts sensitivity and U/D performance. Lower values improve sensitivity, but degrade
1884  * @details far away blocker U/D performance.
1885  * @details Higher values degrade sensitivity, but improve U/D. With MIN_GAIN_INDEX=19 and Si4743 EVB reference
1886  * @details design, the Si474x provides sensitivity of 28dBuV typical and U/D exceeding 55dB on far away blockers.
1887  * @details With MIN_GAIN_INDEX=24, the Si474x provides sensitivity of 34dBuV typical and U/D approaching 70dB on
1888  * @details far away blockers.
1889  * @see Si47XX PROAMMING GUIDE; AN332 (REV 1.0); page 168
1890  * @param MIN_GAIN_INDEX Values below 19 have minimal sensitivity improvement; Higher values degrade sensitivity, but improve U/D.
1891  * @param ATTN_BACKUP ???
1892  */
1893  inline void setAMFrontEndAgcControl(uint8_t MIN_GAIN_INDEX, uint8_t ATTN_BACKUP)
1894  {
1895  si47x_frontend_agc_control param;
1896 
1897  param.field.MIN_GAIN_INDEX = MIN_GAIN_INDEX;
1898  param.field.ATTN_BACKUP = ATTN_BACKUP;
1899 
1900  sendProperty(AM_FRONTEND_AGC_CONTROL, param.word);
1901  };
1902 
1903 
1904  /* @ingroup group08 Check FM mode status
1905  * @brief Returns true if the current function is FM (FM_TUNE_FREQ).
1906  *
1907  * @return true if the current function is FM (FM_TUNE_FREQ).
1908  */
1909  inline bool isCurrentTuneFM()
1910  {
1911  return (currentTune == FM_TUNE_FREQ);
1912  }
1913 
1914  /**
1915  * @ingroup group08 Check AM mode status
1916  *
1917  * @brief Returns true if the current function is AM (AM_TUNE_FREQ).
1918  *
1919  * @return true if the current function is AM (AM_TUNE_FREQ).
1920  */
1921  inline bool isCurrentTuneAM()
1922  {
1923  return (currentTune == AM_TUNE_FREQ);
1924  }
1925 
1926  /**
1927  * @ingroup group08 Check SSB mode status
1928  *
1929  * @brief Returns true if the current function is SSB (SSB_TUNE_FREQ).
1930  *
1931  * @return true if the current function is SSB (SSB_TUNE_FREQ).
1932  */
1933  inline bool isCurrentTuneSSB()
1934  {
1935  return (currentTune == SSB_TUNE_FREQ);
1936  }
1937 
1938  void setBandwidth(uint8_t AMCHFLT, uint8_t AMPLFLT);
1939 
1940  /**
1941  * @ingroup group08 Tune Frequency
1942  * @brief Returns the FAST tuning status
1943  *
1944  * @retrn uint8_t
1945  */
1947  return currentFrequencyParams.arg.FAST;
1948  };
1949 
1950  /**
1951  * @ingroup group08 Tune Frequency
1952  * @brief Sets the FAST Tuning.
1953  * @details If set, excutes fast and invalidated tune. Theune status will not be accurate
1954  *
1955  * @param FAST
1956  */
1957  inline void setTuneFrequencyFast (uint8_t FAST) {
1958  currentFrequencyParams.arg.FAST = FAST;
1959  };
1960 
1961  /**
1962  * @ingroup group08 Tune Frequency
1963  * @brief Returns the FREEZE status
1964  *
1965  * @return unt8_t
1966  */
1968  return currentFrequencyParams.arg.FREEZE;
1969  };
1970 
1971  /**
1972  * @ingroup group08 Tune Frequency
1973  * @brief Sets Freeze Metrics During Alternate Frequency Jum.
1974  * @details Only on FM mode
1975  *
1976  * @param FREEZE
1977  */
1978  inline void setTuneFrequencyFreze(uint8_t FREEZE) {
1979  currentFrequencyParams.arg.FREEZE = FREEZE;
1980  };
1981 
1982 
1983  void setTuneFrequencyAntennaCapacitor(uint16_t capacitor);
1984 
1985  void frequencyUp();
1986  void frequencyDown();
1987 
1988  /**
1989  * @ingroup group08 Tune Frequency
1990  * @brief Set the FrequencyUp
1991  * @details Same frequencyUp
1992  * @see frequencyUp
1993  */
1994  inline void setFrequencyUp() { frequencyUp(); };
1995 
1996  /**
1997  * @ingroup group08 Tune Frequency
1998  * @brief Set the Frequency Down
1999  * @details same frequencyDown
2000  * @see frequencyDown
2001  */
2002  inline void setFrequencyDown() { frequencyDown(); };
2003 
2004  void getFirmware(void);
2005 
2006  void seekStation(uint8_t SEEKUP, uint8_t WRAP); // See WRAP parameter
2007 
2008  /**
2009  * @ingroup group08 Seek
2010  * @brief Sets the maximum time in milliseconds for seeking. The default value is 8000ms (8s).
2011  * @details Depending on the bandwidth, your reception conditions or step configuration, the seek process can take a long time.
2012  * @details This function sets a time limit for seeking process and back the control to the system if the time runs out.
2013  *
2014  * @addindex Seek
2015  *
2016  * @param time_in_ms time in milliseconds.
2017  */
2018  inline void setMaxSeekTime(long time_in_ms)
2019  {
2020  this->maxSeekTime = time_in_ms;
2021  };
2022 
2023  /**
2024  * @ingroup group08 Seek
2025  *
2026  * @brief Search for the next station
2027  * @details Seek a station up. Stop when a station is found or the frequency has reached the upper limit
2028  * @see seekStation, seekStationProgress, setSeekAmLimits setSeekFmLimits
2029  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 124, 137, 139, 278
2030  */
2031  inline void seekStationUp()
2032  {
2033  seekStationProgress(NULL, SEEK_UP);
2034  };
2035 
2036  /**
2037  * @ingroup group08 Seek
2038  *
2039  * @brief Search the previous station
2040  * @details Seek a station Down. Stop when a station is found or the frequency has reached the lower limit
2041  * @see seekStation, seekStationProgress, setSeekAmLimits, setSeekFmLimits
2042  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 124, 137, 139, 278
2043  */
2044  inline void seekStationDown()
2045  {
2046  seekStationProgress(NULL, SEEK_DOWN);
2047  };
2048 
2049  void seekNextStation();
2050  void seekPreviousStation();
2051 
2052  void seekStationProgress(void (*showFunc)(uint16_t f), uint8_t up_down);
2053 
2054  // AM Seek property configurations
2055  void setSeekAmLimits(uint16_t bottom, uint16_t top);
2056  void setSeekAmSpacing(uint16_t spacing);
2057  void setSeekAmSrnThreshold(uint16_t value);
2058  void setSeekAmRssiThreshold(uint16_t value);
2059 
2060  // FM Seek property configurations
2061  void setSeekFmLimits(uint16_t bottom, uint16_t top);
2062  void setSeekFmSpacing(uint16_t spacing);
2063  void setSeekFmSrnThreshold(uint16_t value);
2064  void setSeekFmRssiThreshold(uint16_t value);
2065 
2066  void setFmBlendStereoThreshold(uint8_t parameter);
2067  void setFmBlendMonoThreshold(uint8_t parameter);
2068  void setFmBlendRssiStereoThreshold(uint8_t parameter);
2069  void setFmBLendRssiMonoThreshold(uint8_t parameter);
2070  void setFmBlendSnrStereoThreshold(uint8_t parameter);
2071  void setFmBLendSnrMonoThreshold(uint8_t parameter);
2072  void setFmBlendMultiPathStereoThreshold(uint8_t parameter);
2073  void setFmBlendMultiPathMonoThreshold(uint8_t parameter);
2074  void setFmStereoOn();
2075  void setFmStereoOff();
2076 
2077  void RdsInit();
2078  void setRdsIntSource(uint8_t RDSNEWBLOCKB, uint8_t RDSNEWBLOCKA, uint8_t RDSSYNCFOUND, uint8_t RDSSYNCLOST, uint8_t RDSRECV);
2079  void getRdsStatus(uint8_t INTACK, uint8_t MTFIFO, uint8_t STATUSONLY);
2080  void getRdsStatus();
2081 
2082  /**
2083  * @ingroup group16 RDS
2084  * @brief Get the Rds Received FIFO
2085  * @details if FIFO is 1, it means the minimum number of groups was filled
2086  * @return true if minimum number of groups was filled.
2087  */
2088  inline bool getRdsReceived()
2089  {
2090  return currentRdsStatus.resp.RDSRECV;
2091  };
2092 
2093  /**
2094  * @ingroup group16 RDS
2095  * @brief Get the Rds Sync Lost object
2096  * @details returns true (1) if Lost RDS synchronization is detected.
2097  * @return true if Lost RDS synchronization detected.
2098  */
2099  inline bool getRdsSyncLost()
2100  {
2101  return currentRdsStatus.resp.RDSSYNCLOST;
2102  };
2103 
2104  /**
2105  * @ingroup group16 RDS
2106  * @brief Get the Rds Sync Found
2107  * @details return true if found RDS synchronization
2108  * @return true if found RDS synchronization
2109  */
2110  inline bool getRdsSyncFound()
2111  {
2112  return currentRdsStatus.resp.RDSSYNCFOUND;
2113  };
2114 
2115  /**
2116  * @ingroup group16 RDS
2117  * @brief Get the Rds New Block A
2118  *
2119  * @details Returns true if valid Block A data has been received.
2120  * @return true or false
2121  */
2122  inline bool getRdsNewBlockA()
2123  {
2124  return currentRdsStatus.resp.RDSNEWBLOCKA;
2125  };
2126 
2127  /**
2128  * @ingroup group16 RDS
2129  * @brief Get the Rds New Block B
2130  * @details Returns true if valid Block B data has been received.
2131  * @return true or false
2132  */
2133  inline bool getRdsNewBlockB()
2134  {
2135  return currentRdsStatus.resp.RDSNEWBLOCKB;
2136  };
2137 
2138  /**
2139  * @ingroup group16 RDS
2140  * @brief Get the Rds Sync
2141  * @details Returns true if RDS currently synchronized.
2142  * @return true or false
2143  */
2144  inline bool getRdsSync()
2145  {
2146  return currentRdsStatus.resp.RDSSYNC;
2147  };
2148 
2149  /**
2150  * @ingroup group16 RDS
2151  * @brief Get the Group Lost
2152  * @details Returns true if one or more RDS groups discarded due to FIFO overrun.
2153  * @return true or false
2154  */
2155  inline bool getGroupLost()
2156  {
2157  return currentRdsStatus.resp.GRPLOST;
2158  };
2159 
2160  /**
2161  * @brief Get the Num Rds Fifo Used
2162  * @details Return the number of RDS FIFO used
2163  * @return uint8_t Total RDS FIFO used
2164  */
2166  {
2167  return currentRdsStatus.resp.RDSFIFOUSED;
2168  };
2169 
2170  void setRdsConfig(uint8_t RDSEN, uint8_t BLETHA, uint8_t BLETHB, uint8_t BLETHC, uint8_t BLETHD);
2171  uint16_t getRdsPI(void);
2172  uint8_t getRdsGroupType(void);
2173  uint8_t getRdsFlagAB(void);
2174  uint8_t getRdsVersionCode(void);
2175  uint8_t getRdsProgramType(void);
2177 
2178  char *getRdsText(void);
2179  char *getRdsText0A(void); // Gets the Station name
2180  char *getRdsText2A(void); // Gets the Radio Text
2181  char *getRdsText2B(void);
2182 
2183  char *getRdsTime(void);
2184 
2185  void getNext2Block(char *);
2186  void getNext4Block(char *);
2187 
2188  void setSSBBfo(int offset);
2189  void setSSBConfig(uint8_t AUDIOBW, uint8_t SBCUTFLT, uint8_t AVC_DIVIDER, uint8_t AVCEN, uint8_t SMUTESEL, uint8_t DSP_AFCDIS);
2190  void setSSB(uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step, uint8_t usblsb);
2191  void setSSB(uint8_t usblsb);
2192  void setSSBAudioBandwidth(uint8_t AUDIOBW);
2193  void setSSBAutomaticVolumeControl(uint8_t AVCEN);
2194  void setSBBSidebandCutoffFilter(uint8_t SBCUTFLT);
2195  void setSSBAvcDivider(uint8_t AVC_DIVIDER);
2196  void setSSBDspAfc(uint8_t DSP_AFCDIS);
2197  void setSSBSoftMute(uint8_t SMUTESEL);
2198 
2199  si47x_firmware_query_library queryLibraryId();
2200  void patchPowerUp();
2201  bool downloadPatch(const uint8_t *ssb_patch_content, const uint16_t ssb_patch_content_size);
2202  void loadPatch(const uint8_t *ssb_patch_content, const uint16_t ssb_patch_content_size, uint8_t ssb_audiobw = 1);
2203  si4735_eeprom_patch_header downloadPatchFromEeprom(int eeprom_i2c_address);
2204  void ssbPowerUp();
2205 
2206  /**
2207  * @ingroup group06 Si47XX device Power Up
2208  * @brief Set the Max Delay Power Up
2209  * @details Sets the delay needed in ms after a powerup command (default is 10ms).
2210  * @details Some crystal oscillator might need more time to become stable (500 ms is the recommended).
2211  * @details Low values make the load SSB patch faster. However, it can make the system unstable.
2212  *
2213  * @see MAX_DELAY_AFTER_POWERUP
2214  * @param ms delay in ms
2215  */
2216  inline void setMaxDelayPowerUp(uint16_t ms)
2217  {
2218  this->maxDelayAfterPouwerUp = ms;
2219  }
2220 
2221  /**
2222  * @ingroup group08 Tune Frequency
2223  * @brief Set the Max Delay after Set Frequency
2224  *
2225  * @details After the set frequency command, the system need a time to get ready to the next set frequency (default value 30ms).
2226  * @details Why the waitToSend() does not work in this case? No idea for while!
2227  * @details A low value makes the getFrequency command inaccurate.
2228  *
2229  * @see MAX_DELAY_AFTER_POWERUP
2230  * @param ms
2231  */
2232  inline void setMaxDelaySetFrequency(uint16_t ms)
2233  {
2234  this->maxDelaySetFrequency = ms;
2235  }
2236 
2237  /**
2238  * @ingroup group08 Tune Frequency step
2239  *
2240  * @brief Sets the current step value.
2241  *
2242  * @details This function does not check the limits of the current band. Please, don't take a step bigger than your legs.
2243  * @details Example:
2244  * @code
2245  * setFM(6400,10800,10390,10);
2246  * setFrequencyStep(100); // the step will be 1MHz (you are using FM mode)
2247  * .
2248  * .
2249  * .
2250  * setAM(7000,7600,7100,5);
2251  * setFrequencyStep(1); // the step will be 1kHz (you are usin AM or SSB mode)
2252  * @endcode
2253  *
2254  * @see setFM()
2255  * @see setAM()
2256  * @see setSSB()
2257  *
2258  * @param step if you are using FM, 10 means 100kHz. If you are using AM 10 means 10kHz
2259  * For AM, 1 (1kHz) to 1000 (1MHz) are valid values.
2260  * For FM 5 (50kHz), 10 (100kHz) and 100 (1MHz) are valid values.
2261  */
2262  inline void setFrequencyStep(uint16_t step)
2263  {
2264  this->currentStep = step;
2265  }
2266 
2267  /**
2268  * @ingroup group08 Frequency
2269  *
2270  * @brief Gets the current frequency saved in memory.
2271  *
2272  * @details Unlike getFrequency, this method gets the current frequency recorded after the last setFrequency command.
2273  * @details This method avoids bus traffic and CI processing.
2274  * @details However, you can not get others status information like RSSI.
2275  *
2276  * @see getFrequency()
2277  */
2279  {
2280  return this->currentWorkFrequency;
2281  }
2282 
2283  /**
2284  * @ingroup group08 Si47XX device Status
2285  *
2286  * @brief Gets the current status of the Si47XX (AM, FM or SSB)
2287  *
2288  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 73 (FM) and 139 (AM)
2289  */
2290  inline void getStatus()
2291  {
2292  getStatus(0, 1);
2293  }
2294 
2295  void setDeviceI2CAddress(uint8_t senPin);
2297  void setDeviceOtherI2CAddress(uint8_t i2cAddr);
2298 
2299  /*******************************************************************************
2300  * The functions below modify the clock frequency for I2C communication.
2301  * 100kHz is usually the baseline.
2302  * Use one of these funcition if you have problem on you default configuration.
2303  *******************************************************************************/
2304 
2305  /**
2306  * @ingroup group18 MCU I2C Speed
2307  * @brief Sets I2C bus to 10kHz
2308  */
2309  inline void setI2CLowSpeedMode(void)
2310  {
2311  Wire.setClock(10000);
2312  };
2313 
2314  /**
2315  * @ingroup group18 MCU I2C Speed
2316  *
2317  * @brief Sets I2C bus to 100kHz
2318  */
2319  inline void setI2CStandardMode(void) { Wire.setClock(100000); };
2320 
2321  /**
2322  * @ingroup group18 MCU I2C Speed
2323  *
2324  * @brief Sets I2C bus to 400kHz
2325  */
2326  inline void setI2CFastMode(void)
2327  {
2328  Wire.setClock(400000);
2329  };
2330 
2331  /**
2332  * @ingroup group18 MCU I2C Speed
2333  *
2334  * @brief Sets the I2C bus to a given value.
2335  * ATTENTION: use this function with cation
2336  *
2337  * @param value in Hz. For example: The values 500000 sets the bus to 500kHz.
2338  */
2339  inline void setI2CFastModeCustom(long value = 500000) { Wire.setClock(value); };
2340 
2341  /**
2342  * @ingroup group18 MCU External Audio Mute
2343  *
2344  * @brief Sets the Audio Mute Mcu Pin
2345  * @details This function sets the mcu digital pin you want to use to control the external audio mute circuit.
2346  * @details Some users may be uncomfortable with the loud popping of the speaker during some transitions caused by some SI47XX commands.
2347  * @details This problem occurs during the transition from the power down to power up.
2348  * @details Every time the user changes the mode (FM to AM or AM to FM) the power down and power up commands are required by the Si47XX devices.
2349  * @details If you have a extra circuit in your receiver to mute the audio on amplifier input, you can configure a MCU pin to control it by using this function.
2350  *
2351  * @see setHardwareAudioMute
2352  * @param pin if 0 ou greater sets the MCU digital pin will be used to control de external circuit.
2353  */
2354  inline void setAudioMuteMcuPin(int8_t pin)
2355  {
2356  audioMuteMcuPin = pin;
2357  pinMode(audioMuteMcuPin, OUTPUT);
2358  };
2359 
2360  /**
2361  * @ingroup group18 MCU External Audio Mute
2362  *
2363  * @brief Sets the Hardware Audio Mute
2364  * @details Turns the Hardware audio mute on or off
2365  *
2366  * @see setAudioMuteMcuPin
2367  *
2368  * @param on True or false
2369  */
2370  inline void setHardwareAudioMute(bool on)
2371  {
2372  digitalWrite(audioMuteMcuPin, on);
2373  delayMicroseconds(300);
2374  }
2375 };
SI4735::setGpioIen
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
SI4735::getRdsProgramType
uint8_t getRdsProgramType(void)
Returns the Program Type (extracted from the Block B)
Definition: SI4735.cpp:2185
SSB_SOFT_MUTE_MAX_ATTENUATION
#define SSB_SOFT_MUTE_MAX_ATTENUATION
Definition: SI4735.h:140
SI4735::currentSsbStatus
uint8_t currentSsbStatus
Definition: SI4735.h:1084
SI4735::setRefClockPrescaler
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:546
SEEK_DOWN
#define SEEK_DOWN
Definition: SI4735.h:166
SI4735::currentInterruptEnable
uint8_t currentInterruptEnable
If you are using interrupt, this variable stores 1.
Definition: SI4735.h:1064
SI4735::getStatusResponse
si47x_status getStatusResponse()
Gets the first byte response.
Definition: SI4735.cpp:1487
FM_BLEND_RSSI_STEREO_THRESHOLD
#define FM_BLEND_RSSI_STEREO_THRESHOLD
Definition: SI4735.h:57
SI4735::downloadPatch
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:2896
SI4735::currentFrequency
si47x_frequency currentFrequency
data structure to get current frequency
Definition: SI4735.h:1070
SI4735::setMaxDelayPowerUp
void setMaxDelayPowerUp(uint16_t ms)
Set the Max Delay Power Up.
Definition: SI4735.h:2216
FM_TUNE_STATUS
#define FM_TUNE_STATUS
Definition: SI4735.h:42
SI4735::patchPowerUp
void patchPowerUp()
This method can be used to prepare the device to apply SSBRX patch.
Definition: SI4735.cpp:2822
SI4735::seekStationUp
void seekStationUp()
Search for the next station.
Definition: SI4735.h:2031
SI4735::interruptPin
uint8_t interruptPin
pin used on Arduino Board to control interrupt. If -1, interrupt is no used.
Definition: SI4735.h:1050
SI4735::lastMode
uint8_t lastMode
Stores the last mode used.
Definition: SI4735.h:1060
MAX_DELAY_AFTER_SET_FREQUENCY
#define MAX_DELAY_AFTER_SET_FREQUENCY
Definition: SI4735.h:168
SI4735::setProperty
void setProperty(uint16_t propertyNumber, uint16_t param)
Sets a given SI47XX device property.
Definition: SI4735.h:1129
SSB_BFO
#define SSB_BFO
Definition: SI4735.h:132
SI4735::refClockPrescale
uint16_t refClockPrescale
Prescaler for Reference Clock (divider).
Definition: SI4735.h:1067
SI4735::isCurrentTuneAM
bool isCurrentTuneAM()
Returns true if the current function is AM (AM_TUNE_FREQ).
Definition: SI4735.h:1921
SI4735::setFmStereoOn
void setFmStereoOn()
Turn Off Stereo operation.
Definition: SI4735.cpp:1689
SI4735::setFmStereoOff
void setFmStereoOff()
Turn Off Stereo operation.
Definition: SI4735.cpp:1679
SI4735::rds_time
char rds_time[20]
RDS date time received information.
Definition: SI4735.h:1035
SI4735::setFM
void setFM(uint16_t fromFreq, uint16_t toFreq, uint16_t initialFreq, uint16_t step)
Sets the radio to FM function.
Definition: SI4735.cpp:862
SI4735::setSeekFmSpacing
void setSeekFmSpacing(uint16_t spacing)
Selects frequency spacingfor FM seek. Default is 100 kHz kHz spacing. There are only 3 valid values: ...
Definition: SI4735.cpp:1334
POWER_UP
#define POWER_UP
Definition: SI4735.h:32
SI4735::getRdsGroupType
uint8_t getRdsGroupType(void)
Returns the Group Type (extracted from the Block B)
Definition: SI4735.cpp:2111
SI4735::getRdsText0A
char * getRdsText0A(void)
Gets the station name and other messages.
Definition: SI4735.cpp:2295
SI4735::getCurrentRSSI
uint8_t getCurrentRSSI()
Get the current receive signal strength (0–127 dBμV)
Definition: SI4735.h:1395
SI4735::setSeekFmSrnThreshold
void setSeekFmSrnThreshold(uint16_t value)
Sets the SNR threshold for a valid FM Seek/Tune.
Definition: SI4735.cpp:1364
SI4735::getReceivedSignalStrengthIndicator
uint8_t getReceivedSignalStrengthIndicator()
Returns the value of Received Signal Strength Indicator (dBμV).
Definition: SI4735.h:1251
SI4735::refClockSourcePin
uint8_t refClockSourcePin
0 = RCLK pin is clock source; 1 = DCLK pin is clock source.
Definition: SI4735.h:1068
SI4735::setAvcAmMaxGain
void setAvcAmMaxGain(uint8_t gain)
Sets the maximum gain for automatic volume control.
Definition: SI4735.cpp:1077
SI4735::maxSeekTime
unsigned long maxSeekTime
Stores the maximum time (ms) for a seeking process. Defines the maximum seeking time.
Definition: SI4735.h:1046
GPO_IEN
#define GPO_IEN
Definition: SI4735.h:131
AM_CURRENT_MODE
#define AM_CURRENT_MODE
Definition: SI4735.h:162
SI4735::getVolume
uint8_t getVolume()
Gets the current volume level.
Definition: SI4735.cpp:1809
AM_TUNE_FREQ
#define AM_TUNE_FREQ
Definition: SI4735.h:72
SI4735::getFirmwarePATCHL
uint8_t getFirmwarePATCHL()
Returns the Firmware P A T C H LOW.
Definition: SI4735.h:1624
SI4735::rds_buffer2B
char rds_buffer2B[33]
RDS Radio Text buffer - Station Informaation.
Definition: SI4735.h:1033
SI4735::setHardwareAudioMute
void setHardwareAudioMute(bool on)
Sets the Hardware Audio Mute.
Definition: SI4735.h:2370
SI4735::setVolumeDown
void setVolumeDown()
Set the Volume Down.
Definition: SI4735.h:1684
SI4735::isCurrentTuneFM
bool isCurrentTuneFM()
Definition: SI4735.h:1909
XOSCEN_CRYSTAL
#define XOSCEN_CRYSTAL
Definition: SI4735.h:173
SI4735::getRdsPI
uint16_t getRdsPI(void)
Returns the programa type.
Definition: SI4735.cpp:2095
si4735_digital_output_format::raw
uint16_t raw
Definition: SI4735.h:962
FM_AGC_STATUS
#define FM_AGC_STATUS
Definition: SI4735.h:43
SI4735::currentStatus
si47x_response_status currentStatus
current device status
Definition: SI4735.h:1073
si47x_frontend_agc_control::word
uint16_t word
Definition: SI4735.h:587
SI4735::setGpio
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
SI4735::currentAvcAmMaxGain
uint8_t currentAvcAmMaxGain
Stores the current Automatic Volume Control Gain for AM. Default value is 48.
Definition: SI4735.h:1062
si47x_rds_date_time::raw
uint8_t raw[6]
Definition: SI4735.h:839
SI4735::setAMSoftMuteReleaseRate
void setAMSoftMuteReleaseRate(uint8_t parameter)
Sets the soft mute release rate.
Definition: SI4735.h:1809
SI4735::getCurrentMultipathDetectHigh
bool getCurrentMultipathDetectHigh()
Gets the Current Multipath Detect High.
Definition: SI4735.h:1557
SI4735::getSignalQualityInterrupt
bool getSignalQualityInterrupt()
Get the Signal Quality Interrupt status.
Definition: SI4735.h:1161
SI4735::setFrequencyUp
void setFrequencyUp()
Set the FrequencyUp.
Definition: SI4735.h:1994
SSB_RF_AGC_ATTACK_RATE
#define SSB_RF_AGC_ATTACK_RATE
Definition: SI4735.h:142
SI4735::getFrequency
uint16_t getFrequency(void)
Gets the current frequency of the Si4735 (AM or FM)
Definition: SI4735.cpp:938
AM_AGC_RELEASE_RATE
#define AM_AGC_RELEASE_RATE
Definition: SI4735.h:117
SI4735::getCurrentSnrDetectHigh
bool getCurrentSnrDetectHigh()
Checks if SNR detect is high.
Definition: SI4735.h:1450
SI4735::setSeekAmSpacing
void setSeekAmSpacing(uint16_t spacing)
Selects frequency spacingfor AM seek. Default is 10 kHz spacing.
Definition: SI4735.cpp:1320
FM_RDS_STATUS
#define FM_RDS_STATUS
Definition: SI4735.h:46
si47x_set_frequency::raw
uint8_t raw[5]
Definition: SI4735.h:313
SI4735::currentRqsStatus
si47x_rqs_status currentRqsStatus
current Radio SIgnal Quality status
Definition: SI4735.h:1072
si47x_rds_int_source::raw
uint8_t raw[2]
Definition: SI4735.h:686
AM_AGC_OVERRIDE
#define AM_AGC_OVERRIDE
Definition: SI4735.h:77
si47x_rds_config::raw
uint8_t raw[2]
Definition: SI4735.h:716
SI4735::setFM
void setFM()
Sets the radio to FM function.
Definition: SI4735.cpp:794
SI4735::setAMFrontEndAgcControl
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:1893
SI4735::getCurrentMultipath
uint8_t getCurrentMultipath()
Gets the current Multipath.
Definition: SI4735.h:1524
si47x_tune_status::raw
uint8_t raw
Definition: SI4735.h:507
FM_SEEK_TUNE_SNR_THRESHOLD
#define FM_SEEK_TUNE_SNR_THRESHOLD
Definition: SI4735.h:68
SI4735::getFirmwareCHIPREV
uint8_t getFirmwareCHIPREV()
RESP8 - Returns the Chip Revision (ASCII)
Definition: SI4735.h:1654
SI4735::setVolume
void setVolume(uint8_t volume)
Sets volume level (0 to 63)
Definition: SI4735.cpp:1775
SI4735::getRdsTextSegmentAddress
uint8_t getRdsTextSegmentAddress(void)
Returns the address of the text segment.
Definition: SI4735.cpp:2150
SI4735::seekStationProgress
void seekStationProgress(void(*showFunc)(uint16_t f), uint8_t up_down)
Seeks a station up or down.
Definition: SI4735.cpp:1257
si47x_status::raw
uint8_t raw
Definition: SI4735.h:375
SI4735::powerDown
void powerDown(void)
Moves the device from powerup to powerdown mode.
Definition: SI4735.cpp:463
SI4735::getACFIndicator
bool getACFIndicator()
Returns true if the AFC rails (AFC Rail Indicator).
Definition: SI4735.h:1213
SI4735::getCurrentReceivedSignalQuality
void getCurrentReceivedSignalQuality(void)
Queries the status of the Received Signal Quality (RSQ) of the current channel (FM_RSQ_STATUS)
Definition: SI4735.cpp:1146
SI4735::waitToSend
void waitToSend(void)
Wait for the si473x is ready (Clear to Send (CTS) status bit have to be 1).
Definition: SI4735.cpp:327
SI4735::getInterruptStatus
si47x_status getInterruptStatus()
Updates bits 6:0 of the status byte.
Definition: SI4735.cpp:94
FM_BLEND_SNR_MONO_THRESHOLD
#define FM_BLEND_SNR_MONO_THRESHOLD
Definition: SI4735.h:60
SI4735::setFmBlendRssiStereoThreshold
void setFmBlendRssiStereoThreshold(uint8_t parameter)
Sets RSSI threshold for stereo blend. (Full stereo above threshold, blend below threshold....
Definition: SI4735.cpp:1589
SI4735::getTuneFrequecyFreeze
uint8_t getTuneFrequecyFreeze()
Returns the FREEZE status.
Definition: SI4735.h:1967
SI4735::setDeviceOtherI2CAddress
void setDeviceOtherI2CAddress(uint8_t i2cAddr)
Sets the onther I2C Bus Address (for Si470X)
Definition: SI4735.cpp:294
SI4735::seekPreviousStation
void seekPreviousStation()
Search the previous station.
Definition: SI4735.cpp:1220
SI4735::getAgcGainIndex
uint8_t getAgcGainIndex()
Gets the current AGC gain index.
Definition: SI4735.h:1377
SI4735::setAMSoftMuteSnrThreshold
void setAMSoftMuteSnrThreshold(uint8_t parameter)
Sets the SNR threshold to engage soft mute.
Definition: SI4735.h:1796
SI4735::digitalOutputFormat
void digitalOutputFormat(uint8_t OSIZE, uint8_t OMONO, uint8_t OMODE, uint8_t OFALL)
Configures the digital audio output format.
Definition: SI4735.cpp:1737
FM_BLEND_RSSI_MONO_THRESHOLD
#define FM_BLEND_RSSI_MONO_THRESHOLD
Definition: SI4735.h:58
FM_CURRENT_MODE
#define FM_CURRENT_MODE
Definition: SI4735.h:161
SI4735::getRdsReceived
bool getRdsReceived()
Get the Rds Received FIFO.
Definition: SI4735.h:2088
SI4735::frequencyUp
void frequencyUp()
Increments the current frequency on current band/function by using the current step.
Definition: SI4735.cpp:730
SI4735::setSsbAgcReleaseRate
void setSsbAgcReleaseRate(uint16_t parameter)
Sets the AGC Release rate on SSB mode.
Definition: SI4735.h:1874
SI4735::currentRdsStatus
si47x_rds_status currentRdsStatus
current RDS status
Definition: SI4735.h:1075
SI4735::setAudioMuteMcuPin
void setAudioMuteMcuPin(int8_t pin)
Sets the Audio Mute Mcu Pin.
Definition: SI4735.h:2354
SI4735::getCurrentSignedFrequencyOffset
uint8_t getCurrentSignedFrequencyOffset()
Gets the Signed frequency offset (kHz).
Definition: SI4735.h:1535
SI4735::sendCommand
void sendCommand(uint8_t cmd, int parameter_size, const uint8_t *parameter)
Sends a given command to the SI47XX devices.
Definition: SI4735.cpp:1446
SI4735::currentSSBMode
si47x_ssb_mode currentSSBMode
indicates if USB or LSB
Definition: SI4735.h:1077
SI4735::setSsbSoftMuteMaxAttenuation
void setSsbSoftMuteMaxAttenuation(uint8_t smattn=0)
Sets the SSB Soft Mute Max Attenuation object.
Definition: SI4735.h:1355
SI4735::audioMuteMcuPin
int8_t audioMuteMcuPin
Definition: SI4735.h:1085
GPIO_SET
#define GPIO_SET
Definition: SI4735.h:79
SI4735::setTuneFrequencyAntennaCapacitor
void setTuneFrequencyAntennaCapacitor(uint16_t capacitor)
Selects the tuning capacitor value.
Definition: SI4735.cpp:652
AM_SEEK_BAND_BOTTOM
#define AM_SEEK_BAND_BOTTOM
Definition: SI4735.h:111
SI4735::getRdsFlagAB
uint8_t getRdsFlagAB(void)
Returns the current Text Flag A/B
Definition: SI4735.cpp:2128
SI4735::setAmSoftMuteMaxAttenuation
void setAmSoftMuteMaxAttenuation(uint8_t smattn=0)
Sets the Am Soft Mute Max Attenuation.
Definition: SI4735.h:1341
SI4735::getCurrentAfcRailIndicator
bool getCurrentAfcRailIndicator()
AFC Rail Indicator.
Definition: SI4735.h:1472
SI4735::analogPowerUp
void analogPowerUp(void)
You have to call setPowerUp method before.
Definition: SI4735.cpp:448
SI4735::getFirmwarePN
uint8_t getFirmwarePN()
Returns the Firmware Part Number.
Definition: SI4735.h:1584
si47x_frequency::value
uint16_t value
frequency (integer value)
Definition: SI4735.h:276
SI4735::getAutomaticGainControl
void getAutomaticGainControl()
Queries Automatic Gain Control STATUS.
Definition: SI4735.cpp:998
SI4735::getCurrentRssiDetectLow
bool getCurrentRssiDetectLow()
Checks if RSSI detected is LOW.
Definition: SI4735.h:1417
SI4735::setSSBSoftMute
void setSSBSoftMute(uint8_t SMUTESEL)
Sets SSB Soft-mute Based on RSSI or SNR Selection:
Definition: SI4735.cpp:2583
si47x_seek_am_complement::ANTCAPH
uint8_t ANTCAPH
Definition: SI4735.h:352
AM_SOFT_MUTE_RELEASE_RATE
#define AM_SOFT_MUTE_RELEASE_RATE
Definition: SI4735.h:109
SI4735::deviceAddress
int16_t deviceAddress
Stores the current I2C bus address.
Definition: SI4735.h:1041
SI4735::setMaxDelaySetFrequency
void setMaxDelaySetFrequency(uint16_t ms)
Set the Max Delay after Set Frequency.
Definition: SI4735.h:2232
SI4735::setSSBConfig
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:2543
SSB_TUNE_FREQ
#define SSB_TUNE_FREQ
Definition: SI4735.h:83
DIGITAL_OUTPUT_SAMPLE_RATE
#define DIGITAL_OUTPUT_SAMPLE_RATE
Definition: SI4735.h:92
SI4735::getCurrentValidChannel
bool getCurrentValidChannel()
Checks if the current channel is valid.
Definition: SI4735.h:1461
SI4735::setAM
void setAM()
Sets the radio to AM function. It means: LW MW and SW.
Definition: SI4735.cpp:769
SI4735::ssbPowerUp
void ssbPowerUp()
This function can be useful for debug and test.
Definition: SI4735.cpp:2838
MAX_DELAY_AFTER_POWERUP
#define MAX_DELAY_AFTER_POWERUP
Definition: SI4735.h:169
AM_SOFT_MUTE_ATTACK_RATE
#define AM_SOFT_MUTE_ATTACK_RATE
Definition: SI4735.h:110
SI4735::setFrequencyStep
void setFrequencyStep(uint16_t step)
Sets the current step value.
Definition: SI4735.h:2262
SI4735::clearRdsBuffer2A
void clearRdsBuffer2A()
Clear RDS buffer 2A (text)
Definition: SI4735.cpp:1874
FM_BLEND_STEREO_THRESHOLD
#define FM_BLEND_STEREO_THRESHOLD
Definition: SI4735.h:55
SI4735::getCurrentFrequency
uint16_t getCurrentFrequency()
Gets the current frequency saved in memory.
Definition: SI4735.h:2278
SI4735::getRdsNewBlockA
bool getRdsNewBlockA()
Get the Rds New Block A.
Definition: SI4735.h:2122
SI4735::getStatusSNR
uint8_t getStatusSNR()
Gets the SNR metric when tune is complete (dB)
Definition: SI4735.h:1264
SI4735::setAMSoftMuteRate
void setAMSoftMuteRate(uint8_t parameter)
Sets the attack and decay rates when entering or leaving soft mute.
Definition: SI4735.h:1781
SI4735::setMaxSeekTime
void setMaxSeekTime(long time_in_ms)
Sets the maximum time in milliseconds for seeking. The default value is 8000ms (8s).
Definition: SI4735.h:2018
SI4735::setAMSoftMuteSlop
void setAMSoftMuteSlop(uint8_t parameter)
Sets the AM attenuation slope during soft mute.
Definition: SI4735.h:1766
SI4735::loadPatch
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:2953
SI4735::getStatus
void getStatus(uint8_t, uint8_t)
Gets the current status of the Si4735 (AM or FM)
Definition: SI4735.cpp:960
SI4735::setFmBlendMonoThreshold
void setFmBlendMonoThreshold(uint8_t parameter)
Sets RSSI threshold for mono blend (Full mono below threshold, blend above threshold).
Definition: SI4735.cpp:1573
SI4735::currentMinimumFrequency
uint16_t currentMinimumFrequency
minimum frequency of the current band
Definition: SI4735.h:1054
SI4735::volume
uint8_t volume
Stores the current vlume setup (0-63).
Definition: SI4735.h:1081
SI4735::volumeDown
void volumeDown()
Set sound volume level Down
Definition: SI4735.cpp:1835
SI4735::getBandLimit
bool getBandLimit()
Returns true if a seek hit the band limit.
Definition: SI4735.h:1226
SI4735::setFmBlendMultiPathStereoThreshold
void setFmBlendMultiPathStereoThreshold(uint8_t parameter)
Sets multipath threshold for stereo blend (Full stereo below threshold, blend above threshold).
Definition: SI4735.cpp:1653
SI4735::getFirmwarePATCHH
uint8_t getFirmwarePATCHH()
Returns the Firmware P A T C H HIGH.
Definition: SI4735.h:1614
SI4735::rdsTextAdress2B
int rdsTextAdress2B
rds_buffer2B current position
Definition: SI4735.h:1038
SI4735::rdsTextAdress2A
int rdsTextAdress2A
rds_buffer2A current position
Definition: SI4735.h:1037
SI4735::SI4735
SI4735()
Construct a new SI4735::SI4735.
Definition: SI4735.cpp:59
SI4735::setAMSoftMuteAttackRate
void setAMSoftMuteAttackRate(uint16_t parameter)
Sets the soft mute attack rate.
Definition: SI4735.h:1822
si473x_powerup::raw
uint8_t raw[2]
Raw powerup parameters data. Same arg memory position. So, same content.
Definition: SI4735.h:211
SI4735::getRdsTime
char * getRdsTime(void)
Gets the RDS time and date when the Group type is 4.
Definition: SI4735.cpp:2395
FM_RDS_INT_SOURCE
#define FM_RDS_INT_SOURCE
Definition: SI4735.h:49
si473x_gpio::raw
uint8_t raw
Definition: SI4735.h:233
si47x_rds_command::raw
uint8_t raw
Definition: SI4735.h:607
MAX_SEEK_TIME
#define MAX_SEEK_TIME
Definition: SI4735.h:171
FM_DEEMPHASIS
#define FM_DEEMPHASIS
Definition: SI4735.h:54
SI4735::setPowerUp
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:357
SI473X_ADDR_SEN_LOW
#define SI473X_ADDR_SEN_LOW
Definition: SI4735.h:29
SI4735::setAM
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:824
AM_SEEK_FREQ_SPACING
#define AM_SEEK_FREQ_SPACING
Definition: SI4735.h:113
AM_SOFT_MUTE_SNR_THRESHOLD
#define AM_SOFT_MUTE_SNR_THRESHOLD
Definition: SI4735.h:108
SI4735::maxDelayAfterPouwerUp
uint16_t maxDelayAfterPouwerUp
Stores the maximum delay you have to setup after a power up command (in ms).
Definition: SI4735.h:1045
SI4735::setSSBAudioBandwidth
void setSSBAudioBandwidth(uint8_t AUDIOBW)
SSB Audio Bandwidth for SSB mode.
Definition: SI4735.cpp:2662
SI4735::currentFrequencyParams
si47x_set_frequency currentFrequencyParams
Definition: SI4735.h:1071
SI4735::setSBBSidebandCutoffFilter
void setSBBSidebandCutoffFilter(uint8_t SBCUTFLT)
Sets SBB Sideband Cutoff Filter for band pass and low pass filters.
Definition: SI4735.cpp:2632
DIGITAL_OUTPUT_FORMAT
#define DIGITAL_OUTPUT_FORMAT
Definition: SI4735.h:91
SI4735::setAmAgcReleaseRate
void setAmAgcReleaseRate(uint16_t parameter)
Sets the AGC release rate.
Definition: SI4735.h:1848
SI4735::setFmBLendSnrMonoThreshold
void setFmBLendSnrMonoThreshold(uint8_t parameter)
Sets SNR threshold for mono blend (Full mono below threshold, blend above threshold).
Definition: SI4735.cpp:1637
SI4735::getRdsText2A
char * getRdsText2A(void)
Gets the Text processed for the 2A group.
Definition: SI4735.cpp:2328
SI4735::setRdsConfig
void setRdsConfig(uint8_t RDSEN, uint8_t BLETHA, uint8_t BLETHB, uint8_t BLETHC, uint8_t BLETHD)
Sets RDS property.
Definition: SI4735.cpp:1940
SI4735::setFmBlendSnrStereoThreshold
void setFmBlendSnrStereoThreshold(uint8_t parameter)
Sets SNR threshold for stereo blend (Full stereo above threshold, blend below threshold).
Definition: SI4735.cpp:1621
SI4735::setSeekAmRssiThreshold
void setSeekAmRssiThreshold(uint16_t value)
Sets the RSSI threshold for a valid AM Seek/Tune.
Definition: SI4735.cpp:1378
SI4735::waitInterrupr
void waitInterrupr(void)
Interrupt handle.
Definition: SI4735.cpp:73
si47x_seek_am_complement::ANTCAPL
uint8_t ANTCAPL
Definition: SI4735.h:353
SI4735::seekNextStation
void seekNextStation()
Search for the next station.
Definition: SI4735.cpp:1205
si47x_rds_status::raw
uint8_t raw[13]
Definition: SI4735.h:662
SI4735::isAgcEnabled
bool isAgcEnabled()
Checks if the AGC is enabled.
Definition: SI4735.h:1366
SI4735
SI4735 Class.
Definition: SI4735.h:1029
SI4735::resetPin
uint8_t resetPin
pin used on Arduino Board to RESET the Si47XX device
Definition: SI4735.h:1049
SI4735::getCurrentRssiDetectHigh
bool getCurrentRssiDetectHigh()
Checks if RSSI detected is high.
Definition: SI4735.h:1428
si4735_eeprom_patch_header::raw
uint8_t raw[32]
Definition: SI4735.h:981
SI4735::getRdsSync
bool getRdsSync()
Get the Rds Sync.
Definition: SI4735.h:2144
AM_TUNE_STATUS
#define AM_TUNE_STATUS
Definition: SI4735.h:74
si47x_seek_am_complement::ARG2
uint8_t ARG2
Definition: SI4735.h:350
SI4735::setup
void setup(uint8_t resetPin, uint8_t defaultFunction)
Starts the Si473X device.
Definition: SI4735.cpp:623
SI4735::setSSB
void setSSB(uint8_t usblsb)
Set the radio to AM function.
Definition: SI4735.cpp:2685
si47x_seek::raw
uint8_t raw
Definition: SI4735.h:336
SI473X_ADDR_SEN_HIGH
#define SI473X_ADDR_SEN_HIGH
Definition: SI4735.h:30
SI4735::refClock
uint16_t refClock
Frequency of Reference Clock in Hz.
Definition: SI4735.h:1066
SI4735::getDeviceI2CAddress
int16_t getDeviceI2CAddress(uint8_t resetPin)
I2C bus address setup.
Definition: SI4735.cpp:235
SI4735::setSeekFmRssiThreshold
void setSeekFmRssiThreshold(uint16_t value)
Sets the RSSI threshold for a valid FM Seek/Tune.
Definition: SI4735.cpp:1392
SI4735::seekStationDown
void seekStationDown()
Search the previous station.
Definition: SI4735.h:2044
si47x_agc_overrride::raw
uint8_t raw[2]
Definition: SI4735.h:891
SI4735::getStatusCTS
bool getStatusCTS()
Gets the Error flag Clear to Send.
Definition: SI4735.h:1205
SI4735::getGroupLost
bool getGroupLost()
Get the Group Lost.
Definition: SI4735.h:2155
SI4735::isCurrentTuneSSB
bool isCurrentTuneSSB()
Returns true if the current function is SSB (SSB_TUNE_FREQ).
Definition: SI4735.h:1933
SI4735::getFirmwareCMPMAJOR
uint8_t getFirmwareCMPMAJOR()
Get the Firmware C M P M A J O R object.
Definition: SI4735.h:1634
SI4735::getCurrentReceivedSignalQuality
void getCurrentReceivedSignalQuality(uint8_t INTACK)
Queries the status of the Received Signal Quality (RSQ) of the current channel.
Definition: SI4735.cpp:1099
SI4735::setAudioMode
void setAudioMode(uint8_t audioMode)
Sets the Audio Mode. See table below.
Definition: SI4735.h:1704
SI4735::setSeekFmLimits
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:1305
SI4735::getNext4Block
void getNext4Block(char *)
Process data received from group 2A.
Definition: SI4735.cpp:2236
SI4735::setSSB
void setSSB(uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step, uint8_t usblsb)
Definition: SI4735.cpp:2717
AM_SEEK_START
#define AM_SEEK_START
Definition: SI4735.h:73
si47x_antenna_capacitor::value
uint16_t value
Definition: SI4735.h:290
SI4735::getStatusError
bool getStatusError()
Get the Status Error.
Definition: SI4735.h:1194
AM_SOFT_MUTE_SLOPE
#define AM_SOFT_MUTE_SLOPE
Definition: SI4735.h:106
SI4735::setup
void setup(uint8_t resetPin, int interruptPin, uint8_t defaultFunction, uint8_t audioMode=SI473X_ANALOG_AUDIO, uint8_t clockType=XOSCEN_CRYSTAL)
Starts the Si473X device.
Definition: SI4735.cpp:571
SI4735::setSSBAutomaticVolumeControl
void setSSBAutomaticVolumeControl(uint8_t AVCEN)
Sets SSB Automatic Volume Control (AVC) for SSB mode.
Definition: SI4735.cpp:2598
SI4735::setFrequencyDown
void setFrequencyDown()
Set the Frequency Down.
Definition: SI4735.h:2002
si47x_agc_status::raw
uint8_t raw[3]
Definition: SI4735.h:869
SI4735::rds_buffer2A
char rds_buffer2A[65]
RDS Radio Text buffer - Program Information.
Definition: SI4735.h:1032
AM_FRONTEND_AGC_CONTROL
#define AM_FRONTEND_AGC_CONTROL
Definition: SI4735.h:118
SI4735::reset
void reset(void)
Reset the SI473X
Definition: SI4735.cpp:308
REFCLK_PRESCALE
#define REFCLK_PRESCALE
Definition: SI4735.h:94
RX_HARD_MUTE
#define RX_HARD_MUTE
Definition: SI4735.h:126
SI4735::queryLibraryId
si47x_firmware_query_library queryLibraryId()
Query the library information of the Si47XX device.
Definition: SI4735.cpp:2781
si47x_seek_am_complement::ARG3
uint8_t ARG3
Definition: SI4735.h:351
SI4735::getCurrentMultipathDetectLow
bool getCurrentMultipathDetectLow()
Get Multipath Detect Low.
Definition: SI4735.h:1546
SET_PROPERTY
#define SET_PROPERTY
Definition: SI4735.h:35
SI4735::getRdsVersionCode
uint8_t getRdsVersionCode(void)
Gets the version code (extracted from the Block B)
Definition: SI4735.cpp:2166
SI4735::setSeekAmSrnThreshold
void setSeekAmSrnThreshold(uint16_t value)
Sets the SNR threshold for a valid AM Seek/Tune.
Definition: SI4735.cpp:1348
FM_SEEK_FREQ_SPACING
#define FM_SEEK_FREQ_SPACING
Definition: SI4735.h:67
AM_AGC_ATTACK_RATE
#define AM_AGC_ATTACK_RATE
Definition: SI4735.h:116
FM_BLEND_SNR_STEREO_THRESHOLD
#define FM_BLEND_SNR_STEREO_THRESHOLD
Definition: SI4735.h:59
SI4735::getRdsText2B
char * getRdsText2B(void)
Gets the Text processed for the 2B group.
Definition: SI4735.cpp:2361
SI4735::getRdsStatus
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:2028
GET_PROPERTY
#define GET_PROPERTY
Definition: SI4735.h:36
SI4735::maxDelaySetFrequency
uint16_t maxDelaySetFrequency
Stores the maximum delay after set frequency command (in ms).
Definition: SI4735.h:1044
FM_BLEND_MONO_THRESHOLD
#define FM_BLEND_MONO_THRESHOLD
Definition: SI4735.h:56
FM_SEEK_BAND_BOTTOM
#define FM_SEEK_BAND_BOTTOM
Definition: SI4735.h:65
FM_TUNE_FREQ
#define FM_TUNE_FREQ
Definition: SI4735.h:40
SI4735::getRadioDataSystemInterrupt
bool getRadioDataSystemInterrupt()
Get the Radio Data System (RDS) Interrupt status.
Definition: SI4735.h:1172
SI4735::setGpioCtl
void setGpioCtl(uint8_t GPO1OEN, uint8_t GPO2OEN, uint8_t GPO3OEN)
Enables output for GPO1, 2, and 3.
Definition: SI4735.cpp:130
SI4735::sendProperty
void sendProperty(uint16_t propertyNumber, uint16_t param)
Sends (sets) property to the SI47XX.
Definition: SI4735.cpp:1414
SSB_MODE
#define SSB_MODE
Definition: SI4735.h:133
SI4735::clearRdsBuffer2B
void clearRdsBuffer2B()
Clear RDS buffer 2B (text)
Definition: SI4735.cpp:1887
AM_AGC_STATUS
#define AM_AGC_STATUS
Definition: SI4735.h:76
SI4735::clearRdsBuffer0A
void clearRdsBuffer0A()
Clear RDS buffer 0A (text)
Definition: SI4735.cpp:1899
SI4735::currentAgcStatus
si47x_agc_status currentAgcStatus
current AGC status
Definition: SI4735.h:1076
SI4735::setDeviceI2CAddress
void setDeviceI2CAddress(uint8_t senPin)
Sets the I2C Bus Address.
Definition: SI4735.cpp:280
SI4735::currentTune
uint8_t currentTune
tell the current tune (FM, AM or SSB)
Definition: SI4735.h:1052
SI4735::getStatus
void getStatus()
Gets the current status of the Si47XX (AM, FM or SSB)
Definition: SI4735.h:2290
SI4735::setFmBlendMultiPathMonoThreshold
void setFmBlendMultiPathMonoThreshold(uint8_t parameter)
Sets Multipath threshold for mono blend (Full mono above threshold, blend below threshold).
Definition: SI4735.cpp:1669
FM_SEEK_BAND_TOP
#define FM_SEEK_BAND_TOP
Definition: SI4735.h:66
SI4735::getFirmwareCMPMINOR
uint8_t getFirmwareCMPMINOR()
RESP6 - Returns the Component Major Revision (ASCII).
Definition: SI4735.h:1644
SSB_RF_AGC_RELEASE_RATE
#define SSB_RF_AGC_RELEASE_RATE
Definition: SI4735.h:143
AM_SEEK_BAND_TOP
#define AM_SEEK_BAND_TOP
Definition: SI4735.h:112
SI4735::radioPowerUp
void radioPowerUp(void)
Powerup the Si47XX.
Definition: SI4735.cpp:413
SI4735::getNumRdsFifoUsed
uint8_t getNumRdsFifoUsed()
Get the Num Rds Fifo Used.
Definition: SI4735.h:2165
si47x_response_status::raw
uint8_t raw[8]
Check it.
Definition: SI4735.h:417
GET_REV
#define GET_REV
Definition: SI4735.h:33
SI4735::setAutomaticGainControl
void setAutomaticGainControl(uint8_t AGCDIS, uint8_t AGCIDX)
Automatic Gain Control setup.
Definition: SI4735.cpp:1043
si47x_ssb_mode::raw
uint8_t raw[2]
Definition: SI4735.h:940
AM_SOFT_MUTE_MAX_ATTENUATION
#define AM_SOFT_MUTE_MAX_ATTENUATION
Definition: SI4735.h:107
SI4735::setAudioMute
void setAudioMute(bool off)
Sets the audio on or off.
Definition: SI4735.cpp:1792
SI4735::getCurrentAvcAmMaxGain
uint8_t getCurrentAvcAmMaxGain()
Get the current Avc Am Max Gain.
Definition: SI4735.h:1325
SI4735::setTuneFrequencyFreze
void setTuneFrequencyFreze(uint8_t FREEZE)
Sets Freeze Metrics During Alternate Frequency Jum.
Definition: SI4735.h:1978
SI4735::RdsInit
void RdsInit()
Starts the control member variables for RDS.
Definition: SI4735.cpp:1860
si47x_firmware_information::raw
uint8_t raw[9]
Definition: SI4735.h:451
SI4735::disableFmDebug
void disableFmDebug()
There is a debug feature that remains active in Si4704/05/3x-D60 firmware which can create periodic n...
Definition: SI4735.cpp:1704
SI4735::currentStep
uint16_t currentStep
Stores the current step used to increment or decrement the frequency.
Definition: SI4735.h:1058
SI4735::downloadPatchFromEeprom
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:2983
si47x_firmware_query_library::raw
uint8_t raw[8]
Definition: SI4735.h:487
SI4735::lastTextFlagAB
uint8_t lastTextFlagAB
Definition: SI4735.h:1048
SI4735::getFirmwareFWMINOR
uint8_t getFirmwareFWMINOR()
Returns the Firmware F W M I N O R.
Definition: SI4735.h:1604
SI4735::currentAudioMode
uint8_t currentAudioMode
Current audio mode used (ANALOG or DIGITAL or both)
Definition: SI4735.h:1083
SI4735::setFMDeEmphasis
void setFMDeEmphasis(uint8_t parameter)
Sets the FM Receive de-emphasis to 50 or 75 μs.
Definition: SI4735.h:1737
SI4735::setAMDeEmphasis
void setAMDeEmphasis(uint8_t parameter)
Sets the AM Receive de-emphasis to 50 or disable.
Definition: SI4735.h:1750
SI4735::setVolumeUp
void setVolumeUp()
Set the Volume Up.
Definition: SI4735.h:1677
SI4735::seekStation
void seekStation(uint8_t SEEKUP, uint8_t WRAP)
Look for a station (Automatic tune)
Definition: SI4735.cpp:1162
FM_SEEK_TUNE_RSSI_THRESHOLD
#define FM_SEEK_TUNE_RSSI_THRESHOLD
Definition: SI4735.h:69
SI4735::getFirmwareFWMAJOR
uint8_t getFirmwareFWMAJOR()
Returns the Firmware F W M A J O R.
Definition: SI4735.h:1594
SEEK_UP
#define SEEK_UP
Definition: SI4735.h:165
SI4735::setFmBLendRssiMonoThreshold
void setFmBLendRssiMonoThreshold(uint8_t parameter)
Sets RSSI threshold for mono blend (Full mono below threshold, blend above threshold).
Definition: SI4735.cpp:1605
SI4735::setI2CFastMode
void setI2CFastMode(void)
Sets I2C bus to 400kHz.
Definition: SI4735.h:2326
SI4735::setRdsIntSource
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:1986
AM_RSQ_STATUS
#define AM_RSQ_STATUS
Definition: SI4735.h:75
SI4735::powerUp
si473x_powerup powerUp
Definition: SI4735.h:1079
SI4735::currentMaximumFrequency
uint16_t currentMaximumFrequency
maximum frequency of the current band
Definition: SI4735.h:1055
SI4735::getCurrentStereoBlend
uint8_t getCurrentStereoBlend()
Gets the value of the amount of stereo blend in % (100 = full stereo, 0 = full mono).
Definition: SI4735.h:1498
SI4735::setAvcAmMaxGain
void setAvcAmMaxGain()
Sets the Avc Am Max Gain to 48dB.
Definition: SI4735.h:1312
si47x_rqs_status::raw
uint8_t raw[8]
Definition: SI4735.h:572
AM_NB_DELAY
#define AM_NB_DELAY
Definition: SI4735.h:123
AM_DEEMPHASIS
#define AM_DEEMPHASIS
Definition: SI4735.h:95
SI4735::getRdsText
char * getRdsText(void)
Gets the RDS Text when the message is of the Group Type 2 version A.
Definition: SI4735.cpp:2271
FM_RSQ_STATUS
#define FM_RSQ_STATUS
Definition: SI4735.h:45
SI4735::rdsTextAdress0A
int rdsTextAdress0A
rds_buffer0A current position
Definition: SI4735.h:1039
SI4735::setI2CStandardMode
void setI2CStandardMode(void)
Sets I2C bus to 100kHz.
Definition: SI4735.h:2319
SI4735::getStatusValid
bool getStatusValid()
Gets the channel status.
Definition: SI4735.h:1240
SI4735::setI2CLowSpeedMode
void setI2CLowSpeedMode(void)
Sets I2C bus to 10kHz.
Definition: SI4735.h:2309
FM_AGC_OVERRIDE
#define FM_AGC_OVERRIDE
Definition: SI4735.h:44
si47x_property::value
uint16_t value
Definition: SI4735.h:524
FM_BLEND_MULTIPATH_MONO_THRESHOLD
#define FM_BLEND_MULTIPATH_MONO_THRESHOLD
Definition: SI4735.h:62
SI4735::setSsbAgcAttackRate
void setSsbAgcAttackRate(uint16_t parameter)
Sets the AGC attack rate on SSB mode.
Definition: SI4735.h:1861
FM_SEEK_START
#define FM_SEEK_START
Definition: SI4735.h:41
SI4735::getRdsStatus
void getRdsStatus()
Gets RDS Status.
Definition: SI4735.cpp:2077
SI4735::volumeUp
void volumeUp()
Set sound volume level Up
Definition: SI4735.cpp:1821
si473x_gpio_ien::raw
uint16_t raw
Definition: SI4735.h:260
SI4735::firmwareInfo
si47x_firmware_information firmwareInfo
firmware information
Definition: SI4735.h:1074
SI4735::getRdsNewBlockB
bool getRdsNewBlockB()
Get the Rds New Block B.
Definition: SI4735.h:2133
SI4735::getAntennaTuningCapacitor
uint16_t getAntennaTuningCapacitor()
Get the Antenna Tuning Capacitor value.
Definition: SI4735.h:1291
SI4735::digitalOutputSampleRate
void digitalOutputSampleRate(uint16_t DOSR)
Enables digital audio output and configures digital audio output sample rate in samples per second (s...
Definition: SI4735.cpp:1761
AM_SOFT_MUTE_RATE
#define AM_SOFT_MUTE_RATE
Definition: SI4735.h:105
SI4735::getNext2Block
void getNext2Block(char *)
Process data received from group 2B.
Definition: SI4735.cpp:2202
SI4735::getStatusMULT
uint8_t getStatusMULT()
Get the Status the M U L T.
Definition: SI4735.h:1277
SI4735::getProperty
int32_t getProperty(uint16_t propertyValue)
Gets a given property from the SI47XX.
Definition: SI4735.cpp:1513
SI4735::setAmAgcAttackRate
void setAmAgcAttackRate(uint16_t parameter)
Sets the AGC attack rate.
Definition: SI4735.h:1835
SI4735::getFirmware
void getFirmware(void)
Gets firmware information.
Definition: SI4735.cpp:485
RX_VOLUME
#define RX_VOLUME
Definition: SI4735.h:125
AM_AUTOMATIC_VOLUME_CONTROL_MAX_GAIN
#define AM_AUTOMATIC_VOLUME_CONTROL_MAX_GAIN
Definition: SI4735.h:97
SI4735::setTuneFrequencyFast
void setTuneFrequencyFast(uint8_t FAST)
Sets the FAST Tuning.
Definition: SI4735.h:1957
MIN_DELAY_WAIT_SEND_LOOP
#define MIN_DELAY_WAIT_SEND_LOOP
Definition: SI4735.h:170
SI4735::setSSBBfo
void setSSBBfo(int offset)
Sets the SSB Beat Frequency Offset (BFO).
Definition: SI4735.cpp:2494
AM_SEEK_SNR_THRESHOLD
#define AM_SEEK_SNR_THRESHOLD
Definition: SI4735.h:114
SI4735::getCurrentSnrDetectLow
bool getCurrentSnrDetectLow()
Checks if SNR detect is low.
Definition: SI4735.h:1439
si4735_digital_output_sample_rate::DOSR
uint16_t DOSR
Definition: SI4735.h:995
SI4735::currentClockType
uint8_t currentClockType
Stores the current clock type used (Crystal or REF CLOCK)
Definition: SI4735.h:1063
SI4735::getCurrentSNR
uint8_t getCurrentSNR()
Gets the current SNR metric (0–127 dB).
Definition: SI4735.h:1406
POWER_DOWN
#define POWER_DOWN
Definition: SI4735.h:34
SI4735::getCurrentVolume
uint8_t getCurrentVolume()
Get the Current Volume.
Definition: SI4735.h:1669
SI4735::sendSSBModeProperty
void sendSSBModeProperty()
Just send the property SSB_MOD to the device. Internal use (privete method).
Definition: SI4735.cpp:2738
SI4735::setFmBlendStereoThreshold
void setFmBlendStereoThreshold(uint8_t parameter)
Sets RSSI threshold for stereo blend (Full stereo above threshold, blend below threshold).
Definition: SI4735.cpp:1557
AM_CHANNEL_FILTER
#define AM_CHANNEL_FILTER
Definition: SI4735.h:96
SI4735::setI2CFastModeCustom
void setI2CFastModeCustom(long value=500000)
Sets the I2C bus to a given value. ATTENTION: use this function with cation.
Definition: SI4735.h:2339
SI473X_ANALOG_AUDIO
#define SI473X_ANALOG_AUDIO
Definition: SI4735.h:155
SI4735::setSSBDspAfc
void setSSBDspAfc(uint8_t DSP_AFCDIS)
Sets DSP AFC disable or enable.
Definition: SI4735.cpp:2568
GPIO_CTL
#define GPIO_CTL
Definition: SI4735.h:78
SI4735::frequencyDown
void frequencyDown()
Decrements the current frequency on current band/function by using the current step.
Definition: SI4735.cpp:747
SI4735::getCurrentBlendDetectInterrupt
bool getCurrentBlendDetectInterrupt()
Gets the Current Blend Detect Interrupt.
Definition: SI4735.h:1568
SI4735::setAmDelayNB
void setAmDelayNB(uint16_t value)
Sets the delay before applying impulse blanking.
Definition: SI4735.h:1716
si47x_bandwidth_config::raw
uint8_t raw[2]
Definition: SI4735.h:918
SI4735::setRefClock
void setRefClock(uint16_t refclk)
Sets the frequency of the REFCLK from the output of the prescaler.
Definition: SI4735.cpp:528
SI4735::setSeekAmLimits
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:1289
SI4735::getTuneFrequecyFast
uint8_t getTuneFrequecyFast()
Returns the FAST tuning status.
Definition: SI4735.h:1946
FM_BLEND_MULTIPATH_STEREO_THRESHOLD
#define FM_BLEND_MULTIPATH_STEREO_THRESHOLD
Definition: SI4735.h:61
SI4735::getCurrentSoftMuteIndicator
bool getCurrentSoftMuteIndicator()
Soft Mute Indicator.
Definition: SI4735.h:1485
GET_INT_STATUS
#define GET_INT_STATUS
Definition: SI4735.h:37
SI4735::rds_buffer0A
char rds_buffer0A[9]
RDS Basic tuning and switching information (Type 0 groups)
Definition: SI4735.h:1034
SI4735::setSSBAvcDivider
void setSSBAvcDivider(uint8_t AVC_DIVIDER)
Sets AVC Divider.
Definition: SI4735.cpp:2613
REFCLK_FREQ
#define REFCLK_FREQ
Definition: SI4735.h:93
SI4735::getTuneCompleteTriggered
bool getTuneCompleteTriggered()
Get the Tune Complete status.
Definition: SI4735.h:1183
AM_SEEK_RSSI_THRESHOLD
#define AM_SEEK_RSSI_THRESHOLD
Definition: SI4735.h:115
SSB_CURRENT_MODE
#define SSB_CURRENT_MODE
Definition: SI4735.h:163
SI4735::getRdsSyncLost
bool getRdsSyncLost()
Get the Rds Sync Lost object.
Definition: SI4735.h:2099
FM_RDS_CONFIG
#define FM_RDS_CONFIG
Definition: SI4735.h:51
SI4735::setBandwidth
void setBandwidth(uint8_t AMCHFLT, uint8_t AMPLFLT)
Selects the bandwidth of the channel filter for AM reception.
Definition: SI4735.cpp:898
SI4735::getCurrentPilot
bool getCurrentPilot()
Checks the current pilot.
Definition: SI4735.h:1511
SI4735::getRdsSyncFound
bool getRdsSyncFound()
Get the Rds Sync Found.
Definition: SI4735.h:2110
SI4735::getCommandResponse
void getCommandResponse(int num_of_bytes, uint8_t *response)
Returns with the command response.
Definition: SI4735.cpp:1468
SI4735::currentWorkFrequency
uint16_t currentWorkFrequency
current frequency
Definition: SI4735.h:1056
SI4735::setFrequency
void setFrequency(uint16_t)
Set the frequency to the corrent function of the Si4735 (FM, AM or SSB)
Definition: SI4735.cpp:692