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