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 32
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  uint32_t mjd : 17; // Modified Julian Day Code
875  } refined;
877 } si47x_rds_date_time;
878 
879 /**
880  * @ingroup group01
881  *
882  * AGC data types
883  * FM / AM and SSB structure to AGC
884  *
885  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); For FM page 80; for AM page 142
886  * @see AN332 REV 0.8 Universal Programming Guide Amendment for SI4735-D60 SSB and NBFM patches; page 18.
887  */
888 typedef union
889 {
890  struct
891  {
892  // status ("RESP0")
893  uint8_t STCINT : 1;
894  uint8_t DUMMY1 : 1;
895  uint8_t RDSINT : 1; // Not used for AM/SSB
896  uint8_t RSQINT : 1;
897  uint8_t DUMMY2 : 2;
898  uint8_t ERR : 1;
899  uint8_t CTS : 1;
900  // RESP1
901  uint8_t AGCDIS : 1; // This bit indicates if the AGC is enabled or disabled. 0 = AGC enabled; 1 = AGC disabled.
902  uint8_t DUMMY : 7;
903  // RESP2
904  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.
905  } refined;
907 } si47x_agc_status;
908 
909 /**
910  * @ingroup group01
911  *
912  * If FM, Overrides AGC setting by disabling the AGC and forcing the LNA to have a certain gain that ranges between 0
913  * (minimum attenuation) and 26 (maximum attenuation).
914  * If AM, overrides the AGC setting by disabling the AGC and forcing the gain index that ranges between 0
915  *
916  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); For FM page 81; for AM page 143
917  */
918 typedef union
919 {
920  struct
921  {
922  // ARG1
923  uint8_t AGCDIS : 1; // if set to 1 indicates if the AGC is disabled. 0 = AGC enabled; 1 = AGC disabled.
924  uint8_t DUMMY : 7;
925  // ARG2
926  uint8_t AGCIDX; // AGC Index; If AMAGCDIS = 1, this byte forces the AGC gain index; 0 = Minimum attenuation (max gain)
927  } arg;
929 } si47x_agc_overrride;
930 
931 /**
932  * @ingroup group01
933  *
934  * The bandwidth of the AM channel filter data type
935  * AMCHFLT values: 0 = 6 kHz Bandwidth
936  * 1 = 4 kHz Bandwidth
937  * 2 = 3 kHz Bandwidth
938  * 3 = 2 kHz Bandwidth
939  * 4 = 1 kHz Bandwidth
940  * 5 = 1.8 kHz Bandwidth
941  * 6 = 2.5 kHz Bandwidth, gradual roll off
942  * 7–15 = Reserved (Do not use)
943  *
944  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 125 and 151
945  */
946 typedef union
947 {
948  struct
949  {
950  uint8_t AMCHFLT : 4; //!< Selects the bandwidth of the AM channel filter.
951  uint8_t DUMMY1 : 4;
952  uint8_t AMPLFLT : 1; //!< Enables the AM Power Line Noise Rejection Filter.
953  uint8_t DUMMY2 : 7;
954  } param;
956 } si47x_bandwidth_config; // AM_CHANNEL_FILTER
957 
958 /**
959  * @ingroup group01
960  *
961  * SSB - datatype for SSB_MODE (property 0x0101)
962  *
963  * @see AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 24
964  */
965 typedef union
966 {
967  struct
968  {
969  uint8_t AUDIOBW : 4; //!< 0 = 1.2kHz (default); 1=2.2kHz; 2=3kHz; 3=4kHz; 4=500Hz; 5=1kHz
970  uint8_t SBCUTFLT : 4; //!< SSB side band cutoff filter for band passand low pass filter
971  uint8_t AVC_DIVIDER : 4; //!< set 0 for SSB mode; set 3 for SYNC mode;
972  uint8_t AVCEN : 1; //!< SSB Automatic Volume Control (AVC) enable; 0=disable; 1=enable (default);
973  uint8_t SMUTESEL : 1; //!< SSB Soft-mute Based on RSSI or SNR
974  uint8_t DUMMY1 : 1; //!< Always write 0;
975  uint8_t DSP_AFCDIS : 1; //!< 0=SYNC MODE, AFC enable; 1=SSB MODE, AFC disable.
976  } param;
978 } si47x_ssb_mode;
979 
980 /**
981  * @ingroup group01
982  *
983  * @brief Digital audio output format data structure (Property 0x0102. DIGITAL_OUTPUT_FORMAT).
984  *
985  * @details Used to configure: DCLK edge, data format, force mono, and sample precision.
986  *
987  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 195.
988  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); chapter 9 - Digital Audio Interface
989  */
990 typedef union
991 {
992  struct
993  {
994  uint8_t OSIZE : 2; //!< Digital Output Audio Sample Precision (0=16 bits, 1=20 bits, 2=24 bits, 3=8bits).
995  uint8_t OMONO : 1; //!< Digital Output Mono Mode (0=Use mono/stereo blend ).
996  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).
997  uint8_t OFALL : 1; //!< Digital Output DCLK Edge (0 = use DCLK rising edge, 1 = use DCLK falling edge)
998  uint8_t dummy : 8; //!< Always 0.
999  } refined;
1001 } si4735_digital_output_format;
1002 
1003 /**
1004  * @ingroup group01
1005  * @brief patch header stored in a eeprom
1006  * @details This data type represents o header of a eeprom with a patch content
1007  * @details This structure will be used to read an eeprom generated by leo sketch SI47XX_09_SAVE_SSB_PATCH_EEPROM.ino.
1008  * @details The sketch SI47XX_09_SAVE_SSB_PATCH_EEPROM can be found on Examples/SI47XX_TOOLS folder
1009  */
1010 typedef union
1011 {
1012  struct
1013  {
1014  uint8_t reserved[8]; // Not used
1015  uint8_t status[8]; // Note used
1016  uint8_t patch_id[14]; // Patch name
1017  uint16_t patch_size; // Patch size (in bytes)
1018  } refined;
1020 } si4735_eeprom_patch_header;
1021 
1022 /**
1023  * @ingroup group01
1024  *
1025  * @brief Digital audio output sample structure (Property 0x0104. DIGITAL_OUTPUT_SAMPLE_RATE).
1026  *
1027  * @details Used to enable digital audio output and to configure the digital audio output sample rate in samples per second (sps).
1028  *
1029  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 196.
1030  */
1031 typedef struct
1032 {
1033  uint16_t DOSR; // Digital Output Sample Rate(32–48 ksps .0 to disable digital audio output).
1034 } si4735_digital_output_sample_rate; // Maybe not necessary
1035 
1036 
1037 /**********************************************************************
1038  * SI4735 Class definition
1039  **********************************************************************/
1040 
1041 /**
1042  * @brief SI4735 Class
1043  *
1044  * @details This class implements all functions to help you to control the Si47XX devices.
1045  * This library was built based on “Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0)”.
1046  * It also can be used on all members of the SI473X family respecting, of course, the features available
1047  * for each IC version. These functionalities can be seen in the comparison matrix shown in
1048  * table 1 (Product Family Function); pages 2 and 3 of the programming guide.
1049  *
1050  * @author PU2CLR - Ricardo Lima Caratti
1051  */
1052 class SI4735
1053 {
1054 protected:
1055  char rds_buffer2A[65]; //!< RDS Radio Text buffer - Program Information
1056  char rds_buffer2B[33]; //!< RDS Radio Text buffer - Station Informaation
1057  char rds_buffer0A[9]; //!< RDS Basic tuning and switching information (Type 0 groups)
1058  char rds_time[20]; //!< RDS date time received information
1059 
1060  int rdsTextAdress2A; //!< rds_buffer2A current position
1061  int rdsTextAdress2B; //!< rds_buffer2B current position
1062  int rdsTextAdress0A; //!< rds_buffer0A current position
1063 
1064  bool rdsEndGroupA = false;
1065  bool rdsEndGroupB = false;
1066 
1067  int16_t deviceAddress = SI473X_ADDR_SEN_LOW; //!< Stores the current I2C bus address.
1068 
1069  // Delays
1070  uint16_t maxDelaySetFrequency = MAX_DELAY_AFTER_SET_FREQUENCY; //!< Stores the maximum delay after set frequency command (in ms).
1071  uint16_t maxDelayAfterPouwerUp = MAX_DELAY_AFTER_POWERUP; //!< Stores the maximum delay you have to setup after a power up command (in ms).
1072  unsigned long maxSeekTime = MAX_SEEK_TIME; //!< Stores the maximum time (ms) for a seeking process. Defines the maximum seeking time.
1073 
1075  uint8_t resetPin; //!< pin used on Arduino Board to RESET the Si47XX device
1076 
1077  uint8_t currentTune; //!< tell the current tune (FM, AM or SSB)
1078 
1079  uint16_t currentMinimumFrequency; //!< minimum frequency of the current band
1080  uint16_t currentMaximumFrequency; //!< maximum frequency of the current band
1081  uint16_t currentWorkFrequency; //!< current frequency
1082 
1083  uint16_t currentStep; //!< Stores the current step used to increment or decrement the frequency.
1084 
1085  uint8_t lastMode = -1; //!< Stores the last mode used.
1086 
1087  uint8_t currentAvcAmMaxGain = DEFAULT_CURRENT_AVC_AM_MAX_GAIN; //!< Stores the current Automatic Volume Control Gain for AM.
1088  uint8_t currentClockType = XOSCEN_CRYSTAL; //!< Stores the current clock type used (Crystal or REF CLOCK)
1091 
1092  uint16_t refClock = 32768; //!< Frequency of Reference Clock in Hz.
1093  uint16_t refClockPrescale = 1; //!< Prescaler for Reference Clock (divider).
1094  uint8_t refClockSourcePin = 0; //!< 0 = RCLK pin is clock source; 1 = DCLK pin is clock source.
1095 
1096  si47x_frequency currentFrequency; //!< data structure to get current frequency
1097  si47x_set_frequency currentFrequencyParams;
1098  si47x_rqs_status currentRqsStatus; //!< current Radio SIgnal Quality status
1099  si47x_response_status currentStatus; //!< current device status
1100  si47x_firmware_information firmwareInfo; //!< firmware information
1101  si47x_rds_status currentRdsStatus; //!< current RDS status
1102  si47x_agc_status currentAgcStatus; //!< current AGC status
1103  si47x_ssb_mode currentSSBMode; //!< indicates if USB or LSB
1104 
1105  si473x_powerup powerUp;
1106 
1107  uint8_t volume = 32; //!< Stores the current vlume setup (0-63).
1108 
1109  uint8_t currentAudioMode = SI473X_ANALOG_AUDIO; //!< Current audio mode used (ANALOG or DIGITAL or both)
1112 
1113  void waitInterrupr(void);
1114  si47x_status getInterruptStatus();
1115 
1116  // void setGpioCtl(uint8_t GPO1OEN, uint8_t GPO2OEN, uint8_t GPO3OEN);
1117  // void setGpio(uint8_t GPO1LEVEL, uint8_t GPO2LEVEL, uint8_t GPO3LEVEL);
1118  // void setGpioIen(uint8_t STCIEN, uint8_t RSQIEN, uint8_t ERRIEN, uint8_t CTSIEN, uint8_t STCREP, uint8_t RSQREP);
1119 
1120  void sendProperty(uint16_t propertyNumber, uint16_t param);
1121 
1122  void sendSSBModeProperty();
1123  void disableFmDebug();
1124  void clearRdsBuffer2A();
1125  void clearRdsBuffer2B();
1126  void clearRdsBuffer0A();
1127  void getSsbAgcStatus();
1128 
1129 public:
1130  SI4735();
1131  void reset(void);
1132  void waitToSend(void);
1133 
1134  void setGpioCtl(uint8_t GPO1OEN, uint8_t GPO2OEN, uint8_t GPO3OEN);
1135  void setGpio(uint8_t GPO1LEVEL, uint8_t GPO2LEVEL, uint8_t GPO3LEVEL);
1136  void setGpioIen(uint8_t STCIEN, uint8_t RSQIEN, uint8_t ERRIEN, uint8_t CTSIEN, uint8_t STCREP, uint8_t RSQREP);
1137 
1138  void setup(uint8_t resetPin, uint8_t defaultFunction);
1139  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);
1140 
1141  void setRefClock(uint16_t refclk);
1142  void setRefClockPrescaler(uint16_t prescale, uint8_t rclk_sel = 0);
1143 
1145 
1146  /**
1147  * @ingroup group10 Generic set and get property
1148  *
1149  * @brief Sets a given SI47XX device property
1150  *
1151  * @details Sets the Si47XX device with a given attribute.
1152  * @details You might need to use the bit operations or some bit field structure to set right the values.
1153  * @details Used this function instead of the sendProperty.
1154  *
1155  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 55, 69, 124 and 134.
1156  * @see getProperty, sendProperty
1157  * @param propertyNumber
1158  * @param param pamameter value
1159  */
1160  inline void setProperty(uint16_t propertyNumber, uint16_t param)
1161  {
1162  sendProperty(propertyNumber, param);
1163  };
1164 
1165  void sendCommand(uint8_t cmd, int parameter_size, const uint8_t *parameter);
1166  void getCommandResponse(int num_of_bytes, uint8_t *response);
1167  si47x_status getStatusResponse();
1168 
1169  void setPowerUp(uint8_t CTSIEN, uint8_t GPO2OEN, uint8_t PATCH, uint8_t XOSCEN, uint8_t FUNC, uint8_t OPMODE);
1170  void radioPowerUp(void);
1171  void analogPowerUp(void);
1172  void powerDown(void);
1173 
1174  void setFrequency(uint16_t);
1175 
1176  void getStatus(uint8_t, uint8_t);
1177 
1178  uint16_t getFrequency(void);
1179 
1180  /**
1181  * STATUS RESPONSE
1182  * Set of methods to get current status information. Call them after getStatus or getFrequency or seekStation
1183  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 63
1184  */
1185 
1186  /**
1187  * @ingroup group08
1188  * @brief Get the Signal Quality Interrupt status
1189  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 63
1190  * @return RDSINT status
1191  */
1193  {
1194  return currentStatus.resp.RSQINT;
1195  };
1196 
1197  /**
1198  * @ingroup group08
1199  * @brief Get the Radio Data System (RDS) Interrupt status
1200  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 63
1201  * @return RDSINT status
1202  */
1204  {
1205  return currentStatus.resp.RDSINT;
1206  };
1207 
1208  /**
1209  * @ingroup group08
1210  * @brief Get the Tune Complete status
1211  * @details Seek/Tune Complete Interrupt; 1 = Tune complete has been triggered.
1212  * @return STCINT status
1213  */
1215  {
1216  return currentStatus.resp.STCINT;
1217  };
1218 
1219  /**
1220  * @ingroup group08
1221  * @brief Get the Status Error
1222  * @details Return the Error flag (true or false) of status of the least Tune or Seek
1223  * @return Error flag
1224  */
1225  inline bool getStatusError()
1226  {
1227  return currentStatus.resp.ERR;
1228  };
1229 
1230  /**
1231  * @ingroup group08
1232  * @brief Gets the Error flag Clear to Send
1233  *
1234  * @return CTS
1235  */
1236  inline bool getStatusCTS() { return currentStatus.resp.CTS; };
1237 
1238  /**
1239  * @ingroup group08
1240  * @brief Returns true if the AFC rails (AFC Rail Indicator).
1241  *
1242  * @return true
1243  */
1244  inline bool getACFIndicator()
1245  {
1246  return currentStatus.resp.AFCRL;
1247  };
1248 
1249  /**
1250  * @ingroup group08
1251  * @brief Returns true if a seek hit the band limit
1252  *
1253  * @details (WRAP = 0 in FM_START_SEEK) or wrapped to the original frequency(WRAP = 1).
1254  *
1255  * @return BLTF
1256  */
1257  inline bool getBandLimit()
1258  {
1259  return currentStatus.resp.BLTF;
1260  };
1261 
1262  /**
1263  * @ingroup group08
1264  * @brief Gets the channel status
1265  *
1266  * @details Returns true if the channel is currently valid as determined by the seek/tune properties (0x1403, 0x1404, 0x1108)
1267  *
1268  * @return true
1269  * @return false
1270  */
1271  inline bool getStatusValid()
1272  {
1273  return currentStatus.resp.VALID;
1274  };
1275 
1276  /**
1277  * @ingroup group08
1278  * @brief Returns the value of Received Signal Strength Indicator (dBμV).
1279  *
1280  * @return uint8_t
1281  */
1283  {
1284  return currentStatus.resp.RSSI;
1285  };
1286 
1287  /**
1288  * @ingroup group08
1289  * @brief Gets the SNR metric when tune is complete (dB)
1290  *
1291  * @details Returns the value of the SNR metric when tune is complete (dB).
1292  *
1293  * @return uint8_t
1294  */
1296  {
1297  return currentStatus.resp.SNR;
1298  };
1299 
1300  /**
1301  * @ingroup group08
1302  * @brief Get the Status the M U L T
1303  *
1304  * @details Returns the value containing the multipath metric when tune is complete.
1305  *
1306  * @return uint8_t
1307  */
1309  {
1310  return currentStatus.resp.MULT;
1311  };
1312 
1313  /**
1314  * @ingroup group17
1315  * @brief Get the Antenna Tuning Capacitor value
1316  * @details Returns the current antenna tuning capacitor value. The tuning capacitance is 95 fF x READANTCAP + 7 pF.
1317  * @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.
1318  *
1319  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 74,74, 140 and 141.
1320  * @return uint8_t capacitance
1321  */
1323  {
1324  si47x_antenna_capacitor cap;
1325 
1326  if (currentTune == FM_TUNE_FREQ)
1327  return currentStatus.resp.READANTCAP;
1328  else
1329  {
1330  cap.raw.ANTCAPL = currentStatus.resp.READANTCAP; // On AM it is the low byte the READANTCAP value
1331  cap.raw.ANTCAPH = currentStatus.resp.MULT; // On AM it is the high byte the READANTCAP value
1332  return cap.value;
1333  }
1334  };
1335 
1336  void getAutomaticGainControl(); //!< Queries Automatic Gain Control STATUS
1337 
1338  /**
1339  * @ingroup group17
1340  * @brief Sets the Avc Am Max Gain to maximum gain (0x7800)
1341  */
1342  inline void setAvcAmMaxGain()
1343  {
1344  sendProperty(AM_AUTOMATIC_VOLUME_CONTROL_MAX_GAIN, 0x7800);
1345  currentAvcAmMaxGain = 90;
1346  };
1347 
1348  /**
1349  * @ingroup group17
1350  * @brief Sets the Avc Am Max Gain to minimal gain (0x1000)
1351  */
1352  inline void setAvcAmMinGain()
1353  {
1354  sendProperty(AM_AUTOMATIC_VOLUME_CONTROL_MAX_GAIN, 0x1000);
1355  currentAvcAmMaxGain = 12;
1356  };
1357 
1358  /**
1359  * @ingroup group17
1360  * @brief Sets the Avc Am Max Gain to default gain (0x2A80)
1361  */
1362  inline void setAvcAmDefaultGain()
1363  {
1364  sendProperty(AM_AUTOMATIC_VOLUME_CONTROL_MAX_GAIN, 0x1543);
1365  currentAvcAmMaxGain = DEFAULT_CURRENT_AVC_AM_MAX_GAIN;
1366  };
1367 
1368 
1369  void setAvcAmMaxGain(uint8_t gain = 90); //!< Sets the maximum gain for automatic volume control.
1370 
1371  /**
1372  * @ingroup group17
1373  * @brief Get the current Avc Am Max Gain
1374  *
1375  * @return uint8_t Current AVC gain index value
1376  */
1378  {
1379  return currentAvcAmMaxGain;
1380  };
1381 
1382  /**
1383  * @ingroup group17
1384  * @brief Sets the Am Soft Mute Max Attenuation
1385  *
1386  * @details This function can be useful to disable Soft Mute. The value 0 disable soft mute.
1387  * @details Specified in units of dB. Default maximum attenuation is 8 dB. It works for AM and SSB.
1388  *
1389  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 158.
1390  *
1391  * @param smattn Maximum attenuation to apply when in soft mute
1392  */
1393  inline void setAmSoftMuteMaxAttenuation(uint8_t smattn = 0)
1394  {
1395  sendProperty(AM_SOFT_MUTE_MAX_ATTENUATION, smattn);
1396  };
1397 
1398  /**
1399  * @ingroup group17
1400  * @brief Sets the SSB Soft Mute Max Attenuation object
1401  *
1402  * @details Sets maximum attenuation during soft mute (dB). Set to 0 to disable soft mute.
1403  * @details Specified in units of dB. Default maximum attenuation is 8 dB.
1404  * @details You can use setAmSoftMuteMaxAttenuation instead. Same AM property values.
1405  * @param smattn Maximum attenuation to apply when in soft mute.
1406  */
1407  inline void setSsbSoftMuteMaxAttenuation(uint8_t smattn = 0)
1408  {
1409  sendProperty(SSB_SOFT_MUTE_MAX_ATTENUATION, smattn);
1410  };
1411 
1412  /**
1413  * @ingroup group17
1414  * @brief Sets the number of milliseconds the low IF peak detector
1415  *
1416  * @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).
1417  * @param param number of milliseconds ( from 4 to 248; step 4); default value 0x008C (140).
1418  */
1419  inline void setSsbIfAgcReleaseRate(uint8_t param = 140)
1420  {
1421  sendProperty(SSB_IF_AGC_RELEASE_RATE, param);
1422  };
1423 
1424  /**
1425  * @ingroup group17
1426  * @brief Sets the IF AGC attack rate
1427  *
1428  * @details Large values provide slower attack, and smaller values provide faster attack
1429  * @param param number of milliseconds ( from 4 to 248; step 4); default value 4.
1430  */
1431  inline void setSsbIfAgcAttackRate(uint8_t param = 4)
1432  {
1433  sendProperty(SSB_IF_AGC_ATTACK_RATE, param);
1434  };
1435 
1436  /**
1437  * @ingroup group08
1438  * @brief Checks if the AGC is enabled
1439  *
1440  * @return true if the AGC is enabled
1441  */
1442  inline bool isAgcEnabled()
1443  {
1444  return !currentAgcStatus.refined.AGCDIS;
1445  };
1446 
1447  /**
1448  * @ingroup group08
1449  * @brief Gets the current AGC gain index
1450  *
1451  * @return uint8_t The current AGC gain index.
1452  */
1454  {
1455  return currentAgcStatus.refined.AGCIDX;
1456  };
1457 
1458  void setAutomaticGainControl(uint8_t AGCDIS, uint8_t AGCIDX);
1459  void setSsbAgcOverrite(uint8_t SSBAGCDIS, uint8_t SSBAGCNDX);
1460 
1461  void getCurrentReceivedSignalQuality(uint8_t INTACK);
1463 
1464  // AM and FM
1465 
1466  /**
1467  * @ingroup group08
1468  * @brief Get the current receive signal strength (0–127 dBμV)
1469  *
1470  * @return uint8_t a value between 0 to 127
1471  */
1473  {
1474  return currentRqsStatus.resp.RSSI;
1475  };
1476 
1477  /**
1478  * @ingroup group08
1479  * @brief Gets the current SNR metric (0–127 dB).
1480  *
1481  * @return uint8_t SNR value in dB (0-127)
1482  */
1484  {
1485  return currentRqsStatus.resp.SNR;
1486  };
1487 
1488  /**
1489  * @ingroup group08
1490  * @brief Checks if RSSI detected is LOW.
1491  *
1492  * @return true if RSSI is low
1493  */
1495  {
1496  return currentRqsStatus.resp.RSSIILINT;
1497  };
1498 
1499  /**
1500  * @ingroup group08
1501  * @brief Checks if RSSI detected is high
1502  *
1503  * @return true if RSSI detected is high
1504  */
1506  {
1507  return currentRqsStatus.resp.RSSIHINT;
1508  };
1509 
1510  /**
1511  * @ingroup group08
1512  * @brief Checks if SNR detect is low
1513  *
1514  * @return true if SNR detected is low
1515  */
1517  {
1518  return currentRqsStatus.resp.SNRLINT;
1519  };
1520 
1521  /**
1522  * @ingroup group08
1523  * @brief Checks if SNR detect is high
1524  *
1525  * @return true if SNR detect is high
1526  */
1528  {
1529  return currentRqsStatus.resp.SNRHINT;
1530  };
1531 
1532  /**
1533  * @ingroup group08
1534  * @brief Checks if the current channel is valid
1535  *
1536  * @return true if the current channel is valid
1537  */
1539  {
1540  return currentRqsStatus.resp.VALID;
1541  };
1542 
1543  /**
1544  * @ingroup group08
1545  * @brief AFC Rail Indicator
1546  *
1547  * @return true or false
1548  */
1550  {
1551  return currentRqsStatus.resp.AFCRL;
1552  };
1553 
1554  /**
1555  * @ingroup group08
1556  * @brief Soft Mute Indicator.
1557  *
1558  * @details Indicates soft mute is engaged.
1559  *
1560  * @return true if soft mute indicates is engaged.
1561  */
1563  {
1564  return currentRqsStatus.resp.SMUTE;
1565  };
1566 
1567  // Just FM
1568 
1569  /**
1570  * @ingroup group08
1571  * @brief Gets the value of the amount of stereo blend in % (100 = full stereo, 0 = full mono).
1572  *
1573  * @return uint8_t value (0 to 100)
1574  */
1576  {
1577  return currentRqsStatus.resp.STBLEND;
1578  };
1579 
1580  /**
1581  * @ingroup group08
1582  * @brief Checks the current pilot
1583  *
1584  * @details Indicates stereo pilot presence.
1585  *
1586  * @return true if stereo pilot presence has detected
1587  */
1588  inline bool getCurrentPilot()
1589  {
1590  return currentRqsStatus.resp.PILOT;
1591  };
1592 
1593  /**
1594  * @ingroup group08
1595  * @brief Gets the current Multipath
1596  *
1597  * @details Contains the current multipath metric. (0 = no multipath; 100 = full multipath)
1598  *
1599  * @return uint8_t value (0 to 100)
1600  */
1602  {
1603  return currentRqsStatus.resp.MULT;
1604  };
1605 
1606  /**
1607  * @ingroup group08
1608  * @brief Gets the Signed frequency offset (kHz).
1609  *
1610  * @return uint8_t
1611  */
1613  return currentRqsStatus.resp.FREQOFF;
1614  };
1615 
1616  /**
1617  * @ingroup group08
1618  * @brief Get Multipath Detect Low
1619  *
1620  * @return true
1621  * @return false
1622  */
1624  return currentRqsStatus.resp.MULTLINT;
1625  };
1626 
1627  /**
1628  * @ingroup group08
1629  * @brief Gets the Current Multipath Detect High
1630  *
1631  * @return true
1632  * @return false
1633  */
1635  return currentRqsStatus.resp.MULTHINT;
1636  };
1637 
1638  /**
1639  * @ingroup group08
1640  * @brief Gets the Current Blend Detect Interrupt
1641  *
1642  * @return true
1643  * @return false
1644  */
1646  return currentRqsStatus.resp.BLENDINT;
1647  };
1648 
1649  /*
1650  * FIRMWARE RESPONSE
1651  *
1652  * See Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 66
1653  */
1654 
1655  /**
1656  * @ingroup group06
1657  * @brief Returns the Firmware Part Number
1658  *
1659  * @return uint8_t
1660  */
1662  return firmwareInfo.resp.PN;
1663  };
1664 
1665  /**
1666  * @ingroup group06
1667  * @brief Returns the Firmware F W M A J O R
1668  *
1669  * @return uint8_t
1670  */
1672  return firmwareInfo.resp.FWMAJOR;
1673  };
1674 
1675  /**
1676  * @ingroup group06
1677  * @brief Returns the Firmware F W M I N O R
1678  *
1679  * @return uint8_t
1680  */
1682  return firmwareInfo.resp.FWMINOR;
1683  };
1684 
1685  /**
1686  * @ingroup group06
1687  * @brief Returns the Firmware P A T C H HIGH
1688  *
1689  * @return uint8_t
1690  */
1692  return firmwareInfo.resp.PATCHH;
1693  };
1694 
1695  /**
1696  * @ingroup group06
1697  * @brief Returns the Firmware P A T C H LOW
1698  *
1699  * @return uint8_t
1700  */
1702  return firmwareInfo.resp.PATCHL;
1703  };
1704 
1705  /**
1706  * @ingroup group06
1707  * @brief Get the Firmware C M P M A J O R object
1708  *
1709  * @return uint8_t
1710  */
1712  return firmwareInfo.resp.CMPMAJOR;
1713  }; //!< RESP6 - Returns the Component Major Revision (ASCII).
1714 
1715  /**
1716  * @ingroup group06
1717  * @brief Returns the Component Minor Revision (ASCII) (RESP7)
1718  *
1719  * @return uint8_t
1720  */
1722  return firmwareInfo.resp.CMPMINOR;
1723  };
1724 
1725  /**
1726  * @ingroup group06
1727  * @brief RESP8 - Returns the Chip Revision (ASCII)
1728  *
1729  * @return uint8_t
1730  */
1732  return firmwareInfo.resp.CHIPREV;
1733  };
1734 
1735  void setVolume(uint8_t volume);
1736  uint8_t getVolume();
1737  void volumeDown();
1738  void volumeUp();
1739 
1740  /**
1741  * @ingroup group13 Audio volume
1742  * @brief Get the Current Volume
1743  * @details Returns the current volume level.
1744  * @return uint8_t
1745  */
1746  inline uint8_t getCurrentVolume() { return volume; };
1747 
1748  /**
1749  * @ingroup group13 Audio volume
1750  * @brief Set the Volume Up
1751  * @details Same volumeUp()
1752  * @see volumeUp
1753  */
1754  inline void setVolumeUp() { volumeUp(); };
1755  /**
1756  * @ingroup group13 Audio volume
1757  * @brief Set the Volume Down
1758  * @details Same volumeDown()
1759  * @return voi
1760  */
1761  inline void setVolumeDown() { volumeDown(); };
1762 
1763  /**
1764  * @ingroup group13 Digital Audio setup
1765  * @brief Sets the Audio Mode. See table below.
1766  * @details If you want to change the audio mode, call this function before call setAM(), setFM() or setSSB().
1767  * @details Sets the Si47XX device to use ANALOG or DIGITAL audio output. The table below show the valid values.
1768  * @details This function will only take effect after calling setAM(), setFM() or setSSB().
1769  *
1770  *
1771  * | Macro | Value (Binary) | Description |
1772  * | ----- | ----- | ----------- |
1773  * | SI473X_ANALOG_AUDIO | 0b00000101 | Analog Audio Inputs |
1774  * | SI473X_DIGITAL_AUDIO1 | 0b00001011 | Digital audio output (DCLK, LOUT/DFS, ROUT/DIO) |
1775  * | SI473X_DIGITAL_AUDIO2 | 0b10110000 | Digital audio outputs (DCLK, DFS, DIO) |
1776  * | SI473X_DIGITAL_AUDIO3 | 0b10110101 | Analog and digital audio outputs (LOUT/ROUT and DCLK, DFS,DIO) |
1777  *
1778  * @see setAM(), setFM(), setSSB().
1779  * @param audioMode One of the values options above
1780  */
1781  inline void setAudioMode(uint8_t audioMode)
1782  {
1783  currentAudioMode = audioMode;
1784  };
1785 
1786  /**
1787  * @ingroup group13 Audio Noise Blank Delay
1788  * @brief Sets the delay before applying impulse blanking
1789  * @details Delay in micro-seconds before applying impulse blanking to the original samples. Default value is 172.
1790  *
1791  * @param value Delay in micro-seconds
1792  */
1793  inline void setAmDelayNB(uint16_t value) {
1794  sendProperty(AM_NB_DELAY, value);
1795  }
1796 
1797  void digitalOutputFormat(uint8_t OSIZE, uint8_t OMONO, uint8_t OMODE, uint8_t OFALL);
1798  void digitalOutputSampleRate(uint16_t DOSR);
1799 
1800  void setAudioMute(bool off); // if true mute the audio; else unmute
1801 
1802  void setAM();
1803  void setFM();
1804  void setAM(uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step);
1805  void setFM(uint16_t fromFreq, uint16_t toFreq, uint16_t initialFreq, uint16_t step);
1806 
1807  /**
1808  * @ingroup group08
1809  * @brief Sets the FM Receive de-emphasis to 50 or 75 μs.
1810  * @details valid parameters are 1 = 50 μs. Usedin Europe, Australia, Japan; 2 = 75 μs. Used in USA (default)
1811  *
1812  * @param parameter 1 or 2 (default 1 - USA)
1813  */
1814  inline void setFMDeEmphasis(uint8_t parameter)
1815  {
1816  sendProperty(FM_DEEMPHASIS, parameter);
1817  };
1818 
1819  /**
1820  * @ingroup group08
1821  * @brief Sets the Fm Soft Mute Max Attenuation
1822  *
1823  * @details This function can be useful to disable Soft Mute on FM mode. The value 0 disable soft mute.
1824  * @details Specified in units of dB. Default maximum attenuation is 8 dB. It works for AM and SSB.
1825  *
1826  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 97.
1827  *
1828  * @param smattn Maximum attenuation to apply when in soft mute
1829  */
1830  inline void setFmSoftMuteMaxAttenuation(uint8_t smattn = 0)
1831  {
1832  sendProperty(FM_SOFT_MUTE_MAX_ATTENUATION, smattn);
1833  };
1834 
1835  /**
1836  * @brief Set the Fm Noise Blank Threshold
1837  * @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.
1838  * @param parameter (from 0 to 90. default is 10)
1839  */
1840  inline void setFmNoiseBlankThreshold(uint16_t parameter)
1841  {
1842  sendProperty(FM_NB_DETECT_THRESHOLD, parameter);
1843  };
1844 
1845  /**
1846  * @brief Set the Fm Noise Blank
1847  * @details Sets Noise blanking rate in 100 Hz units
1848  * @details Sets the Interval in micro-seconds that original samples are replaced by sample-hold clean samples.
1849  * @details Sets the bandwidth of the noise floor estimator.
1850  *
1851  * @details ATTENTION: It works on SI474X. It may not work on SI473X devices.
1852  *
1853  * @param nb_rate Noise blanking rate in 100 Hz units. Default value is 64.
1854  * @param nb_interval Interval in micro-seconds that original samples are replaced by interpolated clean samples. Default value is 55 μs.
1855  * @param nb_irr_filter Sets the bandwidth of the noise floor estimator. Default value is 300.
1856  */
1857  inline void setFmNoiseBlank(uint16_t nb_rate = 64, uint16_t nb_interval = 55, uint16_t nb_irr_filter = 300)
1858  {
1859  sendProperty(FM_NB_RATE, nb_rate);
1860  sendProperty(FM_NB_INTERVAL, nb_interval);
1861  sendProperty(FM_NB_IIR_FILTER, nb_irr_filter);
1862  }
1863 
1864  /**
1865  * @brief Set the Fm Noise Blank Interval
1866  * @details Interval in micro-seconds that original samples are replaced by interpolated clean samples.
1867  * @param parameter ( from 8 to 48. default value is 24)
1868  */
1869  inline void setFmNoiseBlankInterval(uint16_t parameter)
1870  {
1871  sendProperty(FM_NB_INTERVAL, parameter);
1872  };
1873 
1874  /**
1875  * @brief Set the Fm Noise Blank Rate
1876  * @details Noise blanking rate in 100 Hz units.
1877  *
1878  * @param parameter ( from 1 to 64. default value is 64)
1879  */
1880  inline void setFmNoiseBlankRate(uint16_t parameter)
1881  {
1882  sendProperty(FM_NB_RATE, parameter);
1883  };
1884 
1885  /**
1886  * @brief Set the Fm Noise Blank Delay
1887  * @details Delay in micro-seconds before applying impulse blanking to the original samples.
1888  * @param parameter ( from 125 to 219. default value is 170)
1889  */
1890  inline void setFmNoiseBlankDelay(uint16_t parameter)
1891  {
1892  sendProperty(FM_NB_DELAY, parameter);
1893  };
1894 
1895  /**
1896  * @brief Set the FmNoiseBlank IIR Filter
1897  * @details Sets the bandwidth of the noise floor estimator.
1898  * @param parameter (from 300 to 1600. default value is 300)
1899  */
1900  inline void setFmNoiseBlank_IIR_Filter(uint16_t parameter)
1901  {
1902  sendProperty(FM_NB_IIR_FILTER, parameter);
1903  }
1904 
1905  /**
1906  * @ingroup group08
1907  * @brief Sets the AM Receive de-emphasis to 50 or disable.
1908  * @details valid parameters are 1 = 50 μs. Usedin urope, Australia, Japan; 2 = 75 μs. Used in USA (default)
1909  *
1910  * @param parameter 1 = enable or 0 = disable
1911  */
1912  inline void setAMDeEmphasis(uint8_t parameter)
1913  {
1914  sendProperty(AM_DEEMPHASIS, parameter);
1915  };
1916 
1917  /**
1918  * @ingroup group08
1919  * @brief Sets the AM attenuation slope during soft mute
1920  * @details Configures attenuation slope during soft mute in dB attenuation per dB SNR below the soft mute SNR threshold.
1921  * @details Soft mute attenuation is the minimum of SMSLOPEx(SMTHR–SNR) and SMATTN.
1922  * @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.
1923  *
1924  * @see setAmSoftMuteMaxAttenuation
1925  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0);
1926  * @param parameter the valid values are 1–5 (default 1).
1927  */
1928  inline void setAMSoftMuteSlop(uint8_t parameter)
1929  {
1930  sendProperty(AM_SOFT_MUTE_SLOPE, parameter);
1931  };
1932 
1933 
1934  /**
1935  * @ingroup group08
1936  * @brief Sets the attack and decay rates when entering or leaving soft mute.
1937  * @details The value specified is multiplied by 4.35 dB/s to come up with the actual attack rate
1938  * @details The default rate is 278 dB/s.
1939  * @see setAmSoftMuteMaxAttenuation
1940  * @see Si47XX PRORAMMING GUIDE; AN332 (REV 1.0);
1941  * @param parameter The valid values are 1-255 ( Default is ~64 - [64 x 4.35 = 278] )
1942  */
1943  inline void setAMSoftMuteRate(uint8_t parameter)
1944  {
1945  sendProperty(AM_SOFT_MUTE_RATE, parameter);
1946  };
1947 
1948 
1949  /**
1950  * @ingroup group08
1951  * @brief Sets the SNR threshold to engage soft mute
1952  * @details Whenever the SNR for a tuned frequency drops below this threshold the AM reception will go in soft mute,
1953  * @details provided soft mute max attenuation property is non-zero. The default value is 8dB
1954  * @see setAmSoftMuteMxAttenuation
1955  * @see Si47XX PROAMMING GUIDE; AN332 (REV 1.0);
1956  * @param parameter 0-63 (default is 8)
1957  */
1958  inline void setAMSoftMuteSnrThreshold(uint8_t parameter)
1959  {
1960  sendProperty(AM_SOFT_MUTE_SNR_THRESHOLD, parameter);
1961  };
1962 
1963  /**
1964  * @ingroup group08
1965  * @brief Sets the soft mute release rate.
1966  * @details Smaller values provide slower release and larger values provide faster release. The default is 8192 (approximately 8000 dB/s).
1967  * @see setAmSoftMuteMxAttenuation
1968  * @see Si47XX PROAMMING GUIDE; AN332 (REV 1.0);
1969  * @param parameter 1–32767
1970  */
1971  inline void setAMSoftMuteReleaseRate(uint8_t parameter)
1972  {
1973  sendProperty(AM_SOFT_MUTE_RELEASE_RATE, parameter);
1974  };
1975 
1976  /**
1977  * @ingroup group08
1978  * @brief Sets the soft mute attack rate.
1979  * @details Smaller values provide slower attack and larger values provide faster attack.
1980  * @see setAmSoftMuteMxAttenuation
1981  * @see Si47XX PROAMMING GUIDE; AN332 (REV 1.0);
1982  * @param parameter 1–32767 (The default is 8192 (approximately 8000 dB/s)
1983  */
1984  inline void setAMSoftMuteAttackRate(uint16_t parameter)
1985  {
1986  sendProperty(AM_SOFT_MUTE_ATTACK_RATE, parameter);
1987  };
1988 
1989  /**
1990  * @ingroup group08
1991  * @brief Sets the AGC attack rate.
1992  * @details Large values provide slower attack, and smaller values provide faster attack..
1993  * @see setAmAgcAttackRate
1994  * @see Si47XX PROAMMING GUIDE; AN332 (REV 1.2); page 167
1995  * @param parameter Range: 4–248 (The default is 0x04)
1996  */
1997  inline void setAmAgcAttackRate(uint16_t parameter)
1998  {
1999  sendProperty(AM_AGC_ATTACK_RATE, parameter);
2000  };
2001 
2002  /**
2003  * @ingroup group08
2004  * @brief Sets the AGC release rate.
2005  * @details Larger values provide slower release, and smaller values provide faster release.
2006  * @see setAmAgcReleaseRate
2007  * @see Si47XX PROAMMING GUIDE; AN332 (REV 1.2); page 168
2008  * @param parameter Range: 4–248 (The default is 0x8C)
2009  */
2010  inline void setAmAgcReleaseRate(uint16_t parameter)
2011  {
2012  sendProperty(AM_AGC_RELEASE_RATE, parameter);
2013  };
2014 
2015  /**
2016  * @ingroup group17
2017  * @brief Sets the AGC attack rate on SSB mode.
2018  * @details Large values provide slower attack, and smaller values provide faster attack..
2019  * @see setSsbAgcAttackRate
2020  * @see AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 29
2021  * @param parameter Range: 4–248 (The default is 0x04)
2022  */
2023  inline void setSsbAgcAttackRate(uint16_t parameter)
2024  {
2025  sendProperty(SSB_RF_AGC_ATTACK_RATE, parameter);
2026  };
2027 
2028  /**
2029  * @ingroup group17
2030  * @brief Sets the AGC Release rate on SSB mode.
2031  * @details Larger values provide slower release, and smaller values provide faster release.
2032  * @see setSsbAgcAttackRate
2033  * @see AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 29
2034  * @param parameter Range: 4–248 (The default is 0x18)
2035  */
2036  inline void setSsbAgcReleaseRate(uint16_t parameter)
2037  {
2038  sendProperty(SSB_RF_AGC_RELEASE_RATE, parameter);
2039  };
2040 
2041  /**
2042  * @ingroup group08
2043  * @brief Adjusts the AM AGC for external front-end attenuator and external front-end cascode LNA.
2044  * @details This property contains two fields: MIN_GAIN_INDEX and ATTN_BACKUP.
2045  * @details MIN_GAIN_INDEX impacts sensitivity and U/D performance. Lower values improve sensitivity, but degrade
2046  * @details far away blocker U/D performance.
2047  * @details Higher values degrade sensitivity, but improve U/D. With MIN_GAIN_INDEX=19 and Si4743 EVB reference
2048  * @details design, the Si474x provides sensitivity of 28dBuV typical and U/D exceeding 55dB on far away blockers.
2049  * @details With MIN_GAIN_INDEX=24, the Si474x provides sensitivity of 34dBuV typical and U/D approaching 70dB on
2050  * @details far away blockers.
2051  * @see Si47XX PROAMMING GUIDE; AN332 (REV 1.0); page 168
2052  * @param MIN_GAIN_INDEX Values below 19 have minimal sensitivity improvement; Higher values degrade sensitivity, but improve U/D.
2053  * @param ATTN_BACKUP ???
2054  */
2055  inline void setAMFrontEndAgcControl(uint8_t MIN_GAIN_INDEX, uint8_t ATTN_BACKUP)
2056  {
2057  si47x_frontend_agc_control param;
2058 
2059  param.field.MIN_GAIN_INDEX = MIN_GAIN_INDEX;
2060  param.field.ATTN_BACKUP = ATTN_BACKUP;
2061 
2062  sendProperty(AM_FRONTEND_AGC_CONTROL, param.word);
2063  };
2064 
2065  /**
2066  * @brief Set the Am Noise Blank
2067  *
2068  * @details Sets Noise blanking rate in 100 Hz units
2069  * @details Sets the Interval in micro-seconds that original samples are replaced by sample-hold clean samples.
2070  * @details Sets the bandwidth of the noise floor estimator.
2071  *
2072  * @details ATTENTION: It works on SI474X. It may not work on SI473X devices.
2073  *
2074  * @param nb_rate Noise blanking rate in 100 Hz units. Default value is 64.
2075  * @param nb_interval Interval in micro-seconds that original samples are replaced by interpolated clean samples. Default value is 55 μs.
2076  * @param nb_irr_filter Sets the bandwidth of the noise floor estimator. Default value is 300.
2077  *
2078  */
2079  inline void setAmNoiseBlank(uint16_t nb_rate = 64, uint16_t nb_interval = 55, uint16_t nb_irr_filter = 300)
2080  {
2081  sendProperty(AM_NB_RATE, nb_rate);
2082  sendProperty(AM_NB_INTERVAL, nb_interval);
2083  sendProperty(AM_NB_IIR_FILTER, nb_irr_filter);
2084  }
2085 
2086  /* @ingroup group08 Check FM mode status
2087  * @brief Returns true if the current function is FM (FM_TUNE_FREQ).
2088  *
2089  * @return true if the current function is FM (FM_TUNE_FREQ).
2090  */
2091  inline bool isCurrentTuneFM()
2092  {
2093  return (currentTune == FM_TUNE_FREQ);
2094  }
2095 
2096  /**
2097  * @ingroup group08 Check AM mode status
2098  *
2099  * @brief Returns true if the current function is AM (AM_TUNE_FREQ).
2100  *
2101  * @return true if the current function is AM (AM_TUNE_FREQ).
2102  */
2103  inline bool isCurrentTuneAM()
2104  {
2105  return (currentTune == AM_TUNE_FREQ);
2106  }
2107 
2108  /**
2109  * @ingroup group08 Check SSB mode status
2110  *
2111  * @brief Returns true if the current function is SSB (SSB_TUNE_FREQ).
2112  *
2113  * @return true if the current function is SSB (SSB_TUNE_FREQ).
2114  */
2115  inline bool isCurrentTuneSSB()
2116  {
2117  return (currentTune == SSB_TUNE_FREQ);
2118  }
2119 
2120  void setBandwidth(uint8_t AMCHFLT, uint8_t AMPLFLT);
2121 
2122  /**
2123  * @brief Sets the Bandwith on FM mode
2124  * @details Selects bandwidth of channel filter applied at the demodulation stage. Default is automatic which means the device automatically selects proper channel filter. <BR>
2125  * @details | Filter | Description |
2126  * @details | ------- | -------------|
2127  * @details | 0 | Automatically select proper channel filter (Default) |
2128  * @details | 1 | Force wide (110 kHz) channel filter |
2129  * @details | 2 | Force narrow (84 kHz) channel filter |
2130  * @details | 3 | Force narrower (60 kHz) channel filter |
2131  * @details | 4 | Force narrowest (40 kHz) channel filter |
2132  *
2133  * @param filter_value
2134  */
2135  inline void setFmBandwidth(uint8_t filter_value = 0)
2136  {
2137  sendProperty(FM_CHANNEL_FILTER, filter_value);
2138  }
2139 
2140  /**
2141  * @ingroup group08 Tune Frequency
2142  * @brief Returns the FAST tuning status
2143  *
2144  * @retrn uint8_t
2145  */
2147  return currentFrequencyParams.arg.FAST;
2148  };
2149 
2150  /**
2151  * @ingroup group08 Tune Frequency
2152  * @brief Sets the FAST Tuning.
2153  * @details If set, excutes fast and invalidated tune. Theune status will not be accurate
2154  *
2155  * @param FAST
2156  */
2157  inline void setTuneFrequencyFast (uint8_t FAST) {
2158  currentFrequencyParams.arg.FAST = FAST;
2159  };
2160 
2161  /**
2162  * @ingroup group08 Tune Frequency
2163  * @brief Returns the FREEZE status
2164  *
2165  * @return unt8_t
2166  */
2168  return currentFrequencyParams.arg.FREEZE;
2169  };
2170 
2171  /**
2172  * @ingroup group08 Tune Frequency
2173  * @brief Sets Freeze Metrics During Alternate Frequency Jum.
2174  * @details Only on FM mode
2175  *
2176  * @param FREEZE
2177  */
2178  inline void setTuneFrequencyFreze(uint8_t FREEZE) {
2179  currentFrequencyParams.arg.FREEZE = FREEZE;
2180  };
2181 
2182 
2183  void setTuneFrequencyAntennaCapacitor(uint16_t capacitor);
2184 
2185  void frequencyUp();
2186  void frequencyDown();
2187 
2188  /**
2189  * @ingroup group08 Tune Frequency
2190  * @brief Set the FrequencyUp
2191  * @details Same frequencyUp
2192  * @see frequencyUp
2193  */
2194  inline void setFrequencyUp() { frequencyUp(); };
2195 
2196  /**
2197  * @ingroup group08 Tune Frequency
2198  * @brief Set the Frequency Down
2199  * @details same frequencyDown
2200  * @see frequencyDown
2201  */
2202  inline void setFrequencyDown() { frequencyDown(); };
2203 
2204  void getFirmware(void);
2205 
2206  void seekStation(uint8_t SEEKUP, uint8_t WRAP); // See WRAP parameter
2207 
2208  /**
2209  * @ingroup group08 Seek
2210  * @brief Sets the maximum time in milliseconds for seeking. The default value is 8000ms (8s).
2211  * @details Depending on the bandwidth, your reception conditions or step configuration, the seek process can take a long time.
2212  * @details This function sets a time limit for seeking process and back the control to the system if the time runs out.
2213  *
2214  * @addindex Seek
2215  *
2216  * @param time_in_ms time in milliseconds.
2217  */
2218  inline void setMaxSeekTime(long time_in_ms)
2219  {
2220  this->maxSeekTime = time_in_ms;
2221  };
2222 
2223  /**
2224  * @ingroup group08 Seek
2225  *
2226  * @brief Search for the next station
2227  * @details Seek a station up. Stop when a station is found or the frequency has reached the upper limit
2228  * @see seekStation, seekStationProgress, setSeekAmLimits setSeekFmLimits
2229  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 124, 137, 139, 278
2230  */
2231  inline void seekStationUp()
2232  {
2233  seekStationProgress(NULL, SEEK_UP);
2234  };
2235 
2236  /**
2237  * @ingroup group08 Seek
2238  *
2239  * @brief Search the previous station
2240  * @details Seek a station Down. Stop when a station is found or the frequency has reached the lower limit
2241  * @see seekStation, seekStationProgress, setSeekAmLimits, setSeekFmLimits
2242  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 124, 137, 139, 278
2243  */
2244  inline void seekStationDown()
2245  {
2246  seekStationProgress(NULL, SEEK_DOWN);
2247  };
2248 
2249  void seekNextStation();
2250  void seekPreviousStation();
2251 
2252  void seekStationProgress(void (*showFunc)(uint16_t f), uint8_t up_down);
2253  void seekStationProgress(void (*showFunc)(uint16_t f), bool (*stopSeking)(), uint8_t up_down);
2254 
2255  // AM Seek property configurations
2256  void setSeekAmLimits(uint16_t bottom, uint16_t top);
2257  void setSeekAmSpacing(uint16_t spacing);
2258  void setSeekAmSrnThreshold(uint16_t value);
2259  void setSeekAmRssiThreshold(uint16_t value);
2260 
2261  // FM Seek property configurations
2262  void setSeekFmLimits(uint16_t bottom, uint16_t top);
2263  void setSeekFmSpacing(uint16_t spacing);
2264  void setSeekFmSrnThreshold(uint16_t value);
2265  void setSeekFmRssiThreshold(uint16_t value);
2266 
2267  void setFmBlendStereoThreshold(uint8_t parameter);
2268  void setFmBlendMonoThreshold(uint8_t parameter);
2269  void setFmBlendRssiStereoThreshold(uint8_t parameter);
2270  void setFmBLendRssiMonoThreshold(uint8_t parameter);
2271  void setFmBlendSnrStereoThreshold(uint8_t parameter);
2272  void setFmBLendSnrMonoThreshold(uint8_t parameter);
2273  void setFmBlendMultiPathStereoThreshold(uint8_t parameter);
2274  void setFmBlendMultiPathMonoThreshold(uint8_t parameter);
2275  void setFmStereoOn();
2276  void setFmStereoOff();
2277 
2278  void RdsInit();
2279  void setRdsIntSource(uint8_t RDSRECV, uint8_t RDSSYNCLOST, uint8_t RDSSYNCFOUND, uint8_t RDSNEWBLOCKA, uint8_t RDSNEWBLOCKB);
2280  void getRdsStatus(uint8_t INTACK, uint8_t MTFIFO, uint8_t STATUSONLY);
2281 
2282  /**
2283  * @ingroup group16 RDS
2284  * @brief Get the Rds Received FIFO
2285  * @details if FIFO is 1, it means the minimum number of groups was filled
2286  * @return true if minimum number of groups was filled.
2287  */
2288  inline bool getRdsReceived()
2289  {
2290  return currentRdsStatus.resp.RDSRECV;
2291  };
2292 
2293  /**
2294  * @ingroup group16 RDS
2295  * @brief Get the Rds Sync Lost object
2296  * @details returns true (1) if Lost RDS synchronization is detected.
2297  * @return true if Lost RDS synchronization detected.
2298  */
2299  inline bool getRdsSyncLost()
2300  {
2301  return currentRdsStatus.resp.RDSSYNCLOST;
2302  };
2303 
2304  /**
2305  * @ingroup group16 RDS
2306  * @brief Get the Rds Sync Found
2307  * @details return true if found RDS synchronization
2308  * @return true if found RDS synchronization
2309  */
2310  inline bool getRdsSyncFound()
2311  {
2312  return currentRdsStatus.resp.RDSSYNCFOUND;
2313  };
2314 
2315  /**
2316  * @ingroup group16 RDS
2317  * @brief Get the Rds New Block A
2318  *
2319  * @details Returns true if valid Block A data has been received.
2320  * @return true or false
2321  */
2322  inline bool getRdsNewBlockA()
2323  {
2324  return currentRdsStatus.resp.RDSNEWBLOCKA;
2325  };
2326 
2327  /**
2328  * @ingroup group16 RDS
2329  * @brief Get the Rds New Block B
2330  * @details Returns true if valid Block B data has been received.
2331  * @return true or false
2332  */
2333  inline bool getRdsNewBlockB()
2334  {
2335  return currentRdsStatus.resp.RDSNEWBLOCKB;
2336  };
2337 
2338  /**
2339  * @ingroup group16 RDS
2340  * @brief Get the Rds Sync
2341  * @details Returns true if RDS currently synchronized.
2342  * @return true or false
2343  */
2344  inline bool getRdsSync()
2345  {
2346  return currentRdsStatus.resp.RDSSYNC;
2347  };
2348 
2349  /**
2350  * @ingroup group16 RDS
2351  * @brief Get the Group Lost
2352  * @details Returns true if one or more RDS groups discarded due to FIFO overrun.
2353  * @return true or false
2354  */
2355  inline bool getGroupLost()
2356  {
2357  return currentRdsStatus.resp.GRPLOST;
2358  };
2359 
2360  /**
2361  * @ingroup group16 RDS
2362  * @brief Get the Num Rds Fifo Used
2363  * @details Return the number of RDS FIFO used
2364  * @return uint8_t Total RDS FIFO used
2365  */
2367  {
2368  return currentRdsStatus.resp.RDSFIFOUSED;
2369  };
2370 
2371  /**
2372  * @ingroup group16 RDS
2373  * @brief Sets the minimum number of RDS groups stored in the RDS FIFO before RDSRECV is set.
2374  * @details Return the number of RDS FIFO used
2375  * @param value from 0 to 25. Default value is 0.
2376  */
2377  inline void setFifoCount(uint16_t value)
2378  {
2379  sendProperty(FM_RDS_INT_FIFO_COUNT, value);
2380  };
2381 
2382  /**
2383  * @ingroup group16 RDS
2384  * @brief Check if 0xD or 0xA special characters were received for group A
2385  * @see resetEndIndicatorGroupA
2386  * @return true or false
2387  */
2388  inline bool getEndIndicatorGroupA() {
2389  return rdsEndGroupA;
2390  }
2391 
2392  /**
2393  * @ingroup group16 RDS
2394  * @brief Resets 0xD or 0xA special characters condition (makes it false)
2395  * @see getEndIndicatorGroupA
2396  */
2397  inline void resetEndIndicatorGroupA() {
2398  rdsEndGroupA = false;
2399  }
2400 
2401  /**
2402  * @ingroup group16 RDS
2403  * @brief Check if 0xD or 0xA special characters were received for group B
2404  * @see resetEndIndicatorGroupB
2405  * @return true or false
2406  */
2408  {
2409  return rdsEndGroupB;
2410  }
2411 
2412  /**
2413  * @ingroup group16 RDS
2414  * @brief Resets 0xD or 0xA special characters condition (makes it false)
2415  * @see getEndIndicatorGroupB
2416  */
2418  {
2419  rdsEndGroupB = false;
2420  }
2421 
2422  /**
2423  * @ingroup group16 RDS status
2424  *
2425  * @brief Gets RDS Status.
2426  *
2427  * @details Same result of calling getRdsStatus(0,0,0).
2428  * @details Please, call getRdsStatus(uint8_t INTACK, uint8_t MTFIFO, uint8_t STATUSONLY) instead getRdsStatus()
2429  * if you want other behaviour.
2430  *
2431  * @see SI4735::getRdsStatus(uint8_t INTACK, uint8_t MTFIFO, uint8_t STATUSONLY)
2432  */
2433  inline void getRdsStatus()
2434  {
2435  getRdsStatus(0, 0, 0);
2436  }
2437 
2438  /**
2439  * @ingroup group16 RDS status
2440  * @brief Empty FIFO
2441  * @details Clear RDS Receive FIFO.
2442  * @see getRdsStatus
2443  */
2444  inline void rdsClearFifo()
2445  {
2446  getRdsStatus(0, 1, 0);
2447  }
2448 
2449  /**
2450  * @ingroup group16 RDS status
2451  * @brief Clears RDSINT.
2452  * @details INTACK Interrupt Acknowledge; 0 = RDSINT status preserved. 1 = Clears RDSINT.
2453  * @see getRdsStatus
2454  */
2455  inline void rdsClearInterrupt()
2456  {
2457  getRdsStatus(1, 0, 0);
2458  }
2459 
2460  void setRdsConfig(uint8_t RDSEN, uint8_t BLETHA, uint8_t BLETHB, uint8_t BLETHC, uint8_t BLETHD);
2461  uint16_t getRdsPI(void);
2462  uint8_t getRdsGroupType(void);
2463  uint8_t getRdsFlagAB(void);
2464  uint8_t getRdsVersionCode(void);
2465  uint8_t getRdsProgramType(void);
2467 
2468  char *getRdsText(void);
2469  char *getRdsText0A(void); // Gets the Station name
2470  char *getRdsText2A(void); // Gets the Radio Text
2471  char *getRdsText2B(void);
2472 
2473  char *getRdsTime(void);
2474 
2475  void getNext2Block(char *);
2476  void getNext4Block(char *);
2477 
2478  void setSSBBfo(int offset);
2479  void setSSBConfig(uint8_t AUDIOBW, uint8_t SBCUTFLT, uint8_t AVC_DIVIDER, uint8_t AVCEN, uint8_t SMUTESEL, uint8_t DSP_AFCDIS);
2480  void setSSB(uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step, uint8_t usblsb);
2481  void setSSB(uint8_t usblsb);
2482  void setSSBAudioBandwidth(uint8_t AUDIOBW);
2483  void setSSBAutomaticVolumeControl(uint8_t AVCEN);
2484  void setSBBSidebandCutoffFilter(uint8_t SBCUTFLT);
2485  void setSSBAvcDivider(uint8_t AVC_DIVIDER);
2486  void setSSBDspAfc(uint8_t DSP_AFCDIS);
2487  void setSSBSoftMute(uint8_t SMUTESEL);
2488 
2489  void setNBFM();
2490  void setNBFM(uint16_t fromFreq, uint16_t toFreq, uint16_t initialFreq, uint16_t step);
2491  void patchPowerUpNBFM();
2492  void loadPatchNBFM(const uint8_t *patch_content, const uint16_t patch_content_size);
2493  void setFrequencyNBFM(uint16_t freq);
2494 
2495  si47x_firmware_query_library queryLibraryId();
2496  void patchPowerUp();
2497  bool downloadPatch(const uint8_t *ssb_patch_content, const uint16_t ssb_patch_content_size);
2498  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);
2499  void loadPatch(const uint8_t *ssb_patch_content, const uint16_t ssb_patch_content_size, uint8_t ssb_audiobw = 1);
2500  si4735_eeprom_patch_header downloadPatchFromEeprom(int eeprom_i2c_address);
2501  void ssbPowerUp();
2502 
2503  /**
2504  * @ingroup group06 Si47XX device Power Up
2505  * @brief Set the Max Delay Power Up
2506  * @details Sets the delay needed in ms after a powerup command (default is 10ms).
2507  * @details Some crystal oscillator might need more time to become stable (500 ms is the recommended).
2508  * @details Low values make the load SSB patch faster. However, it can make the system unstable.
2509  *
2510  * @see MAX_DELAY_AFTER_POWERUP
2511  * @param ms delay in ms
2512  */
2513  inline void setMaxDelayPowerUp(uint16_t ms)
2514  {
2515  this->maxDelayAfterPouwerUp = ms;
2516  }
2517 
2518  /**
2519  * @ingroup group08 Tune Frequency
2520  * @brief Set the Max Delay after Set Frequency
2521  *
2522  * @details After the set frequency command, the system need a time to get ready to the next set frequency (default value 30ms).
2523  * @details Why the waitToSend() does not work in this case? No idea for while!
2524  * @details A low value makes the getFrequency command inaccurate.
2525  *
2526  * @see MAX_DELAY_AFTER_POWERUP
2527  * @param ms
2528  */
2529  inline void setMaxDelaySetFrequency(uint16_t ms)
2530  {
2531  this->maxDelaySetFrequency = ms;
2532  }
2533 
2534  /**
2535  * @ingroup group08 Tune Frequency step
2536  *
2537  * @brief Sets the current step value.
2538  *
2539  * @details This function does not check the limits of the current band. Please, don't take a step bigger than your legs.
2540  * @details Example:
2541  * @code
2542  * setFM(6400,10800,10390,10);
2543  * setFrequencyStep(100); // the step will be 1MHz (you are using FM mode)
2544  * .
2545  * .
2546  * .
2547  * setAM(7000,7600,7100,5);
2548  * setFrequencyStep(1); // the step will be 1kHz (you are usin AM or SSB mode)
2549  * @endcode
2550  *
2551  * @see setFM()
2552  * @see setAM()
2553  * @see setSSB()
2554  *
2555  * @param step if you are using FM, 10 means 100kHz. If you are using AM 10 means 10kHz
2556  * For AM, 1 (1kHz) to 1000 (1MHz) are valid values.
2557  * For FM 5 (50kHz), 10 (100kHz) and 100 (1MHz) are valid values.
2558  */
2559  inline void setFrequencyStep(uint16_t step)
2560  {
2561  this->currentStep = step;
2562  }
2563 
2564  /**
2565  * @ingroup group08 Frequency
2566  *
2567  * @brief Gets the current frequency saved in memory.
2568  *
2569  * @details Unlike getFrequency, this method gets the current frequency recorded after the last setFrequency command.
2570  * @details This method avoids bus traffic and CI processing.
2571  * @details However, you can not get others status information like RSSI.
2572  *
2573  * @see getFrequency()
2574  */
2576  {
2577  return this->currentWorkFrequency;
2578  }
2579 
2580  /**
2581  * @ingroup group08 Si47XX device Status
2582  *
2583  * @brief Gets the current status of the Si47XX (AM, FM or SSB)
2584  *
2585  * @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 73 (FM) and 139 (AM)
2586  */
2587  inline void getStatus()
2588  {
2589  getStatus(0, 1);
2590  }
2591 
2592  void setDeviceI2CAddress(uint8_t senPin);
2594  void setDeviceOtherI2CAddress(uint8_t i2cAddr);
2595 
2596  /*******************************************************************************
2597  * The functions below modify the clock frequency for I2C communication.
2598  * 100kHz is usually the baseline.
2599  * Use one of these funcition if you have problem on you default configuration.
2600  *******************************************************************************/
2601 
2602  /**
2603  * @ingroup group18 MCU I2C Speed
2604  * @brief Sets I2C bus to 10kHz
2605  */
2606  inline void setI2CLowSpeedMode(void)
2607  {
2608  Wire.setClock(10000);
2609  };
2610 
2611  /**
2612  * @ingroup group18 MCU I2C Speed
2613  *
2614  * @brief Sets I2C bus to 100kHz
2615  */
2616  inline void setI2CStandardMode(void) { Wire.setClock(100000); };
2617 
2618  /**
2619  * @ingroup group18 MCU I2C Speed
2620  *
2621  * @brief Sets I2C bus to 400kHz
2622  */
2623  inline void setI2CFastMode(void)
2624  {
2625  Wire.setClock(400000);
2626  };
2627 
2628  /**
2629  * @ingroup group18 MCU I2C Speed
2630  *
2631  * @brief Sets the I2C bus to a given value.
2632  * ATTENTION: use this function with cation
2633  *
2634  * @param value in Hz. For example: The values 500000 sets the bus to 500kHz.
2635  */
2636  inline void setI2CFastModeCustom(long value = 500000) { Wire.setClock(value); };
2637 
2638  /**
2639  * @ingroup group18 MCU External Audio Mute
2640  *
2641  * @brief Sets the Audio Mute Mcu Pin
2642  * @details This function sets the mcu digital pin you want to use to control the external audio mute circuit.
2643  * @details Some users may be uncomfortable with the loud popping of the speaker during some transitions caused by some SI47XX commands.
2644  * @details This problem occurs during the transition from the power down to power up.
2645  * @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.
2646  * @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.
2647  *
2648  * @see setHardwareAudioMute
2649  * @param pin if 0 ou greater sets the MCU digital pin will be used to control de external circuit.
2650  */
2651  inline void setAudioMuteMcuPin(int8_t pin)
2652  {
2653  audioMuteMcuPin = pin;
2654  pinMode(audioMuteMcuPin, OUTPUT);
2655  };
2656 
2657  /**
2658  * @ingroup group18 MCU External Audio Mute
2659  *
2660  * @brief Sets the Hardware Audio Mute
2661  * @details Turns the Hardware audio mute on or off
2662  *
2663  * @see setAudioMuteMcuPin
2664  *
2665  * @param on True or false
2666  */
2667  inline void setHardwareAudioMute(bool on)
2668  {
2669  digitalWrite(audioMuteMcuPin, on);
2670  delayMicroseconds(300);
2671  }
2672 };
2673 #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:2224
SSB_SOFT_MUTE_MAX_ATTENUATION
#define SSB_SOFT_MUTE_MAX_ATTENUATION
Definition: SI4735.h:172
SI4735::currentSsbStatus
uint8_t currentSsbStatus
Definition: SI4735.h:1110
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:535
SEEK_DOWN
#define SEEK_DOWN
Definition: SI4735.h:201
SI4735::getStatusResponse
si47x_status getStatusResponse()
Gets the first byte response.
Definition: SI4735.cpp:1542
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:2993
SI4735::currentFrequency
si47x_frequency currentFrequency
data structure to get current frequency
Definition: SI4735.h:1096
SI4735::setMaxDelayPowerUp
void setMaxDelayPowerUp(uint16_t ms)
Set the Max Delay Power Up.
Definition: SI4735.h:2513
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:2919
SI4735::seekStationUp
void seekStationUp()
Search for the next station.
Definition: SI4735.h:2231
AM_NB_INTERVAL
#define AM_NB_INTERVAL
Definition: SI4735.h:152
SI4735::lastMode
uint8_t lastMode
Stores the last mode used.
Definition: SI4735.h:1085
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:1160
SSB_BFO
#define SSB_BFO
Definition: SI4735.h:164
SI4735::refClockPrescale
uint16_t refClockPrescale
Prescaler for Reference Clock (divider).
Definition: SI4735.h:1093
SI4735::isCurrentTuneAM
bool isCurrentTuneAM()
Returns true if the current function is AM (AM_TUNE_FREQ).
Definition: SI4735.h:2103
NBFM_TUNE_FREQ
#define NBFM_TUNE_FREQ
Definition: SI4735.h:84
SI4735::setFmStereoOn
void setFmStereoOn()
Turn Off Stereo operation.
Definition: SI4735.cpp:1744
SI4735::setFmStereoOff
void setFmStereoOff()
Turn Off Stereo operation.
Definition: SI4735.cpp:1734
SI4735::rds_time
char rds_time[20]
RDS date time received information.
Definition: SI4735.h:1058
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:840
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:1388
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:2150
SI4735::getRdsText0A
char * getRdsText0A(void)
Gets the station name and other messages.
Definition: SI4735.cpp:2336
SI4735::setFmNoiseBlankDelay
void setFmNoiseBlankDelay(uint16_t parameter)
Set the Fm Noise Blank Delay.
Definition: SI4735.h:1890
SI4735::setSsbAgcOverrite
void setSsbAgcOverrite(uint8_t SSBAGCDIS, uint8_t SSBAGCNDX)
Automatic Gain Control setup.
Definition: SI4735.cpp:2832
SI4735::getCurrentRSSI
uint8_t getCurrentRSSI()
Get the current receive signal strength (0–127 dBμV)
Definition: SI4735.h:1472
SI4735::setSeekFmSrnThreshold
void setSeekFmSrnThreshold(uint16_t value)
Sets the SNR threshold for a valid FM Seek/Tune.
Definition: SI4735.cpp:1418
SI4735::getReceivedSignalStrengthIndicator
uint8_t getReceivedSignalStrengthIndicator()
Returns the value of Received Signal Strength Indicator (dBμV).
Definition: SI4735.h:1282
SI4735::refClockSourcePin
uint8_t refClockSourcePin
0 = RCLK pin is clock source; 1 = DCLK pin is clock source.
Definition: SI4735.h:1094
SI4735::maxSeekTime
unsigned long maxSeekTime
Stores the maximum time (ms) for a seeking process. Defines the maximum seeking time.
Definition: SI4735.h:1072
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:1869
SI4735::setSsbAgcAttackRate
void setSsbAgcAttackRate(uint16_t parameter)
Sets the AGC attack rate on SSB mode.
Definition: SI4735.h:2023
AM_CURRENT_MODE
#define AM_CURRENT_MODE
Definition: SI4735.h:196
SI4735::getVolume
uint8_t getVolume()
Gets the current volume level.
Definition: SI4735.cpp:1864
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:1701
SI4735::rds_buffer2B
char rds_buffer2B[33]
RDS Radio Text buffer - Station Informaation.
Definition: SI4735.h:1056
SI4735::setHardwareAudioMute
void setHardwareAudioMute(bool on)
Sets the Hardware Audio Mute.
Definition: SI4735.h:2667
SI4735::setNBFM
void setNBFM()
Set the radio to FM function.
Definition: SI4735.cpp:3288
SI4735::setVolumeDown
void setVolumeDown()
Set the Volume Down.
Definition: SI4735.h:1761
SI4735::isCurrentTuneFM
bool isCurrentTuneFM()
Definition: SI4735.h:2091
XOSCEN_CRYSTAL
#define XOSCEN_CRYSTAL
Definition: SI4735.h:210
SI4735::getRdsPI
uint16_t getRdsPI(void)
Returns the programa type.
Definition: SI4735.cpp:2134
si4735_digital_output_format::raw
uint16_t raw
Definition: SI4735.h:1000
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:1900
SI4735::currentStatus
si47x_response_status currentStatus
current device status
Definition: SI4735.h:1099
SI4735::getEndIndicatorGroupA
bool getEndIndicatorGroupA()
Check if 0xD or 0xA special characters were received for group A.
Definition: SI4735.h:2388
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:1087
si47x_rds_date_time::raw
uint8_t raw[6]
Definition: SI4735.h:876
SI4735::setAMSoftMuteReleaseRate
void setAMSoftMuteReleaseRate(uint8_t parameter)
Sets the soft mute release rate.
Definition: SI4735.h:1971
SI4735::getCurrentMultipathDetectHigh
bool getCurrentMultipathDetectHigh()
Gets the Current Multipath Detect High.
Definition: SI4735.h:1634
SI4735::getSignalQualityInterrupt
bool getSignalQualityInterrupt()
Get the Signal Quality Interrupt status.
Definition: SI4735.h:1192
SI4735::setFrequencyUp
void setFrequencyUp()
Set the FrequencyUp.
Definition: SI4735.h:2194
SI4735::resetEndIndicatorGroupA
void resetEndIndicatorGroupA()
Resets 0xD or 0xA special characters condition (makes it false)
Definition: SI4735.h:2397
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:916
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:1527
SI4735::setSeekAmSpacing
void setSeekAmSpacing(uint16_t spacing)
Selects frequency spacingfor AM seek. Default is 10 kHz spacing.
Definition: SI4735.cpp:1374
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:1098
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:2036
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:772
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:2055
SI4735::getCurrentMultipath
uint8_t getCurrentMultipath()
Gets the current Multipath.
Definition: SI4735.h:1601
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:1731
SI4735::setVolume
void setVolume(uint8_t volume)
Sets volume level (0 to 63)
Definition: SI4735.cpp:1830
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:2189
SI4735::seekStationProgress
void seekStationProgress(void(*showFunc)(uint16_t f), uint8_t up_down)
Seeks a station up or down.
Definition: SI4735.cpp:1253
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::powerDown
void powerDown(void)
Moves the device from powerup to powerdown mode.
Definition: SI4735.cpp:452
SI4735::getACFIndicator
bool getACFIndicator()
Returns true if the AFC rails (AFC Rail Indicator).
Definition: SI4735.h:1244
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:1142
SI4735::setFmNoiseBlankRate
void setFmNoiseBlankRate(uint16_t parameter)
Set the Fm Noise Blank Rate.
Definition: SI4735.h:1880
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:1644
SI4735::getTuneFrequecyFreeze
uint8_t getTuneFrequecyFreeze()
Returns the FREEZE status.
Definition: SI4735.h:2167
SI4735::patchPowerUpNBFM
void patchPowerUpNBFM()
This method can be used to prepare the device to apply NBFM patch.
Definition: SI4735.cpp:3245
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:1216
SI4735::rdsClearInterrupt
void rdsClearInterrupt()
Clears RDSINT.
Definition: SI4735.h:2455
SI4735::getAgcGainIndex
uint8_t getAgcGainIndex()
Gets the current AGC gain index.
Definition: SI4735.h:1453
SI4735::setAMSoftMuteSnrThreshold
void setAMSoftMuteSnrThreshold(uint8_t parameter)
Sets the SNR threshold to engage soft mute.
Definition: SI4735.h:1958
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:1792
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:2288
SI4735::frequencyUp
void frequencyUp()
Increments the current frequency on current band/function by using the current step.
Definition: SI4735.cpp:708
SI4735::currentRdsStatus
si47x_rds_status currentRdsStatus
current RDS status
Definition: SI4735.h:1101
SI4735::setAudioMuteMcuPin
void setAudioMuteMcuPin(int8_t pin)
Sets the Audio Mute Mcu Pin.
Definition: SI4735.h:2651
SI4735::getCurrentSignedFrequencyOffset
uint8_t getCurrentSignedFrequencyOffset()
Gets the Signed frequency offset (kHz).
Definition: SI4735.h:1612
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:1500
SI4735::currentSSBMode
si47x_ssb_mode currentSSBMode
indicates if USB or LSB
Definition: SI4735.h:1103
SI4735::setSsbSoftMuteMaxAttenuation
void setSsbSoftMuteMaxAttenuation(uint8_t smattn=0)
Sets the SSB Soft Mute Max Attenuation object.
Definition: SI4735.h:1407
SI4735::audioMuteMcuPin
int8_t audioMuteMcuPin
Definition: SI4735.h:1111
GPIO_SET
#define GPIO_SET
Definition: SI4735.h:111
SI4735::setTuneFrequencyAntennaCapacitor
void setTuneFrequencyAntennaCapacitor(uint16_t capacitor)
Selects the tuning capacitor value.
Definition: SI4735.cpp:630
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:2167
SI4735::setAmSoftMuteMaxAttenuation
void setAmSoftMuteMaxAttenuation(uint8_t smattn=0)
Sets the Am Soft Mute Max Attenuation.
Definition: SI4735.h:1393
SI4735::getCurrentAfcRailIndicator
bool getCurrentAfcRailIndicator()
AFC Rail Indicator.
Definition: SI4735.h:1549
SI4735::analogPowerUp
void analogPowerUp(void)
You have to call setPowerUp method before.
Definition: SI4735.cpp:437
SI4735::getFirmwarePN
uint8_t getFirmwarePN()
Returns the Firmware Part Number.
Definition: SI4735.h:1661
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:986
SI4735::getCurrentRssiDetectLow
bool getCurrentRssiDetectLow()
Checks if RSSI detected is LOW.
Definition: SI4735.h:1494
SI4735::gpo2Enable
uint8_t gpo2Enable
Definition: SI4735.h:1090
SI4735::getEndIndicatorGroupB
bool getEndIndicatorGroupB()
Check if 0xD or 0xA special characters were received for group B.
Definition: SI4735.h:2407
SI4735::setSSBSoftMute
void setSSBSoftMute(uint8_t SMUTESEL)
Sets SSB Soft-mute Based on RSSI or SNR Selection:
Definition: SI4735.cpp:2624
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:1067
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:2529
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:2584
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:1840
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:1538
SI4735::setAM
void setAM()
Sets the radio to AM function. It means: LW MW and SW.
Definition: SI4735.cpp:747
SI4735::ssbPowerUp
void ssbPowerUp()
This function can be useful for debug and test.
Definition: SI4735.cpp:2935
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:2559
SI4735::clearRdsBuffer2A
void clearRdsBuffer2A()
Clear RDS buffer 2A (text)
Definition: SI4735.cpp:1929
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:2575
SI4735::getRdsNewBlockA
bool getRdsNewBlockA()
Get the Rds New Block A.
Definition: SI4735.h:2322
SI4735::getStatusSNR
uint8_t getStatusSNR()
Gets the SNR metric when tune is complete (dB)
Definition: SI4735.h:1295
SI4735::setAMSoftMuteRate
void setAMSoftMuteRate(uint8_t parameter)
Sets the attack and decay rates when entering or leaving soft mute.
Definition: SI4735.h:1943
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:2218
SI4735::setAMSoftMuteSlop
void setAMSoftMuteSlop(uint8_t parameter)
Sets the AM attenuation slope during soft mute.
Definition: SI4735.h:1928
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:3095
SI4735::getStatus
void getStatus(uint8_t, uint8_t)
Gets the current status of the Si4735 (AM or FM)
Definition: SI4735.cpp:938
SI4735::setFmBlendMonoThreshold
void setFmBlendMonoThreshold(uint8_t parameter)
Sets RSSI threshold for mono blend (Full mono below threshold, blend above threshold).
Definition: SI4735.cpp:1628
SI4735::currentMinimumFrequency
uint16_t currentMinimumFrequency
minimum frequency of the current band
Definition: SI4735.h:1079
SI4735::seekStationProgress
void seekStationProgress(void(*showFunc)(uint16_t f), bool(*stopSeking)(), uint8_t up_down)
Seeks a station up or down.
Definition: SI4735.cpp:1308
SI4735::volume
uint8_t volume
Stores the current vlume setup (0-63).
Definition: SI4735.h:1107
SI4735::volumeDown
void volumeDown()
Set sound volume level Down
Definition: SI4735.cpp:1890
SI4735::getBandLimit
bool getBandLimit()
Returns true if a seek hit the band limit.
Definition: SI4735.h:1257
SI4735::setFmBlendMultiPathStereoThreshold
void setFmBlendMultiPathStereoThreshold(uint8_t parameter)
Sets multipath threshold for stereo blend (Full stereo below threshold, blend above threshold).
Definition: SI4735.cpp:1708
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:561
SI4735::getFirmwarePATCHH
uint8_t getFirmwarePATCHH()
Returns the Firmware P A T C H HIGH.
Definition: SI4735.h:1691
SI4735::rdsTextAdress2B
int rdsTextAdress2B
rds_buffer2B current position
Definition: SI4735.h:1061
SI4735::rdsTextAdress2A
int rdsTextAdress2A
rds_buffer2A current position
Definition: SI4735.h:1060
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:1984
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:2436
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:2041
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:802
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:1071
SI4735::setSSBAudioBandwidth
void setSSBAudioBandwidth(uint8_t AUDIOBW)
SSB Audio Bandwidth for SSB mode.
Definition: SI4735.cpp:2703
SI4735::currentFrequencyParams
si47x_set_frequency currentFrequencyParams
Definition: SI4735.h:1097
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:2673
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:2010
SI4735::rdsClearFifo
void rdsClearFifo()
Empty FIFO.
Definition: SI4735.h:2444
SI4735::getSsbAgcStatus
void getSsbAgcStatus()
Queries SSB Automatic Gain Control STATUS.
Definition: SI4735.cpp:2805
SI4735::rdsEndGroupA
bool rdsEndGroupA
Definition: SI4735.h:1064
SI4735::setFmBLendSnrMonoThreshold
void setFmBLendSnrMonoThreshold(uint8_t parameter)
Sets SNR threshold for mono blend (Full mono below threshold, blend above threshold).
Definition: SI4735.cpp:1692
SI4735::getRdsText2A
char * getRdsText2A(void)
Gets the Text processed for the 2A group.
Definition: SI4735.cpp:2369
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:3347
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:1995
SI4735::setFmBlendSnrStereoThreshold
void setFmBlendSnrStereoThreshold(uint8_t parameter)
Sets SNR threshold for stereo blend (Full stereo above threshold, blend below threshold).
Definition: SI4735.cpp:1676
SI4735::setSeekAmRssiThreshold
void setSeekAmRssiThreshold(uint16_t value)
Sets the RSSI threshold for a valid AM Seek/Tune.
Definition: SI4735.cpp:1432
SI4735::setAvcAmMaxGain
void setAvcAmMaxGain(uint8_t gain=90)
Sets the maximum gain for automatic volume control.
Definition: SI4735.cpp:1070
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:1857
si47x_seek_am_complement::ANTCAPL
uint8_t ANTCAPL
Definition: SI4735.h:390
SI4735::seekNextStation
void seekNextStation()
Search for the next station.
Definition: SI4735.cpp:1201
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:1442
SI4735
SI4735 Class.
Definition: SI4735.h:1052
SI4735::resetPin
uint8_t resetPin
pin used on Arduino Board to RESET the Si47XX device
Definition: SI4735.h:1075
SI4735::resetEndIndicatorGroupB
void resetEndIndicatorGroupB()
Resets 0xD or 0xA special characters condition (makes it false)
Definition: SI4735.h:2417
FM_NB_DELAY
#define FM_NB_DELAY
Definition: SI4735.h:55
SI4735::getCurrentRssiDetectHigh
bool getCurrentRssiDetectHigh()
Checks if RSSI detected is high.
Definition: SI4735.h:1505
si4735_eeprom_patch_header::raw
uint8_t raw[32]
Definition: SI4735.h:1019
SI4735::getRdsSync
bool getRdsSync()
Get the Rds Sync.
Definition: SI4735.h:2344
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:601
SI4735::setSSB
void setSSB(uint8_t usblsb)
Set the radio to AM function.
Definition: SI4735.cpp:2726
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:1092
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:1446
SI4735::seekStationDown
void seekStationDown()
Search the previous station.
Definition: SI4735.h:2244
si47x_agc_overrride::raw
uint8_t raw[2]
Definition: SI4735.h:928
SI4735::getStatusCTS
bool getStatusCTS()
Gets the Error flag Clear to Send.
Definition: SI4735.h:1236
SI4735::setSsbIfAgcAttackRate
void setSsbIfAgcAttackRate(uint8_t param=4)
Sets the IF AGC attack rate.
Definition: SI4735.h:1431
SI4735::getGroupLost
bool getGroupLost()
Get the Group Lost.
Definition: SI4735.h:2355
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:1830
SI4735::isCurrentTuneSSB
bool isCurrentTuneSSB()
Returns true if the current function is SSB (SSB_TUNE_FREQ).
Definition: SI4735.h:2115
SI4735::getFirmwareCMPMAJOR
uint8_t getFirmwareCMPMAJOR()
Get the Firmware C M P M A J O R object.
Definition: SI4735.h:1711
SI4735::getCurrentReceivedSignalQuality
void getCurrentReceivedSignalQuality(uint8_t INTACK)
Queries the status of the Received Signal Quality (RSQ) of the current channel.
Definition: SI4735.cpp:1091
SI4735::setAudioMode
void setAudioMode(uint8_t audioMode)
Sets the Audio Mode. See table below.
Definition: SI4735.h:1781
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:1359
SI4735::getNext4Block
void getNext4Block(char *)
Process data received from group 2A.
Definition: SI4735.cpp:2276
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:2758
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:1225
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:2639
SI4735::setFrequencyDown
void setFrequencyDown()
Set the Frequency Down.
Definition: SI4735.h:2202
si47x_agc_status::raw
uint8_t raw[3]
Definition: SI4735.h:906
SI4735::rds_buffer2A
char rds_buffer2A[65]
RDS Radio Text buffer - Program Information.
Definition: SI4735.h:1055
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:2878
si47x_seek_am_complement::ARG3
uint8_t ARG3
Definition: SI4735.h:388
SI4735::getCurrentMultipathDetectLow
bool getCurrentMultipathDetectLow()
Get Multipath Detect Low.
Definition: SI4735.h:1623
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:2205
SI4735::setSeekAmSrnThreshold
void setSeekAmSrnThreshold(uint16_t value)
Sets the SNR threshold for a valid AM Seek/Tune.
Definition: SI4735.cpp:1402
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:2402
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:2083
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:1070
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:1203
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:1468
SSB_MODE
#define SSB_MODE
Definition: SI4735.h:165
SI4735::clearRdsBuffer2B
void clearRdsBuffer2B()
Clear RDS buffer 2B (text)
Definition: SI4735.cpp:1942
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:1954
SI4735::currentAgcStatus
si47x_agc_status currentAgcStatus
current AGC status
Definition: SI4735.h:1102
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:1077
SI4735::getStatus
void getStatus()
Gets the current status of the Si47XX (AM, FM or SSB)
Definition: SI4735.h:2587
SI4735::setFmBlendMultiPathMonoThreshold
void setFmBlendMultiPathMonoThreshold(uint8_t parameter)
Sets Multipath threshold for mono blend (Full mono above threshold, blend below threshold).
Definition: SI4735.cpp:1724
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:1721
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::radioPowerUp
void radioPowerUp(void)
Powerup the Si47XX.
Definition: SI4735.cpp:402
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:1031
si47x_ssb_mode::raw
uint8_t raw[2]
Definition: SI4735.h:977
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:1847
SI4735::getCurrentAvcAmMaxGain
uint8_t getCurrentAvcAmMaxGain()
Get the current Avc Am Max Gain.
Definition: SI4735.h:1377
SI4735::setTuneFrequencyFreze
void setTuneFrequencyFreze(uint8_t FREEZE)
Sets Freeze Metrics During Alternate Frequency Jum.
Definition: SI4735.h:2178
SI4735::RdsInit
void RdsInit()
Starts the control member variables for RDS.
Definition: SI4735.cpp:1915
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:1759
SI4735::currentStep
uint16_t currentStep
Stores the current step used to increment or decrement the frequency.
Definition: SI4735.h:1083
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:3125
si47x_firmware_query_library::raw
uint8_t raw[8]
Definition: SI4735.h:524
SI4735::lastTextFlagAB
uint8_t lastTextFlagAB
Definition: SI4735.h:1074
SI4735::getFirmwareFWMINOR
uint8_t getFirmwareFWMINOR()
Returns the Firmware F W M I N O R.
Definition: SI4735.h:1681
SI4735::currentAudioMode
uint8_t currentAudioMode
Current audio mode used (ANALOG or DIGITAL or both)
Definition: SI4735.h:1109
SI4735::setFMDeEmphasis
void setFMDeEmphasis(uint8_t parameter)
Sets the FM Receive de-emphasis to 50 or 75 μs.
Definition: SI4735.h:1814
SI4735::setAMDeEmphasis
void setAMDeEmphasis(uint8_t parameter)
Sets the AM Receive de-emphasis to 50 or disable.
Definition: SI4735.h:1912
SI4735::setVolumeUp
void setVolumeUp()
Set the Volume Up.
Definition: SI4735.h:1754
SI4735::seekStation
void seekStation(uint8_t SEEKUP, uint8_t WRAP)
Look for a station (Automatic tune)
Definition: SI4735.cpp:1158
SI4735::rdsEndGroupB
bool rdsEndGroupB
Definition: SI4735.h:1065
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:1671
SI4735::setSsbIfAgcReleaseRate
void setSsbIfAgcReleaseRate(uint8_t param=140)
Sets the number of milliseconds the low IF peak detector.
Definition: SI4735.h:1419
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:1660
SI4735::setI2CFastMode
void setI2CFastMode(void)
Sets I2C bus to 400kHz.
Definition: SI4735.h:2623
AM_RSQ_STATUS
#define AM_RSQ_STATUS
Definition: SI4735.h:107
SI4735::powerUp
si473x_powerup powerUp
Definition: SI4735.h:1105
SI4735::currentMaximumFrequency
uint16_t currentMaximumFrequency
maximum frequency of the current band
Definition: SI4735.h:1080
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:3054
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:2079
SI4735::getCurrentStereoBlend
uint8_t getCurrentStereoBlend()
Gets the value of the amount of stereo blend in % (100 = full stereo, 0 = full mono).
Definition: SI4735.h:1575
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:1342
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:2312
FM_RSQ_STATUS
#define FM_RSQ_STATUS
Definition: SI4735.h:48
SI4735::rdsTextAdress0A
int rdsTextAdress0A
rds_buffer0A current position
Definition: SI4735.h:1062
SI4735::setI2CStandardMode
void setI2CStandardMode(void)
Sets I2C bus to 100kHz.
Definition: SI4735.h:2616
SI4735::getStatusValid
bool getStatusValid()
Gets the channel status.
Definition: SI4735.h:1271
SI4735::setI2CLowSpeedMode
void setI2CLowSpeedMode(void)
Sets I2C bus to 10kHz.
Definition: SI4735.h:2606
SI4735::ctsIntEnable
uint8_t ctsIntEnable
Definition: SI4735.h:1089
SI4735::setNBFM
void setNBFM(uint16_t fromFreq, uint16_t toFreq, uint16_t initialFreq, uint16_t step)
Definition: SI4735.cpp:3319
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:2377
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:2433
SI4735::volumeUp
void volumeUp()
Set sound volume level Up
Definition: SI4735.cpp:1876
SI4735::getNumRdsFifoUsed
uint8_t getNumRdsFifoUsed()
Get the Num Rds Fifo Used.
Definition: SI4735.h:2366
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:2135
SI4735::firmwareInfo
si47x_firmware_information firmwareInfo
firmware information
Definition: SI4735.h:1100
SI4735::getRdsNewBlockB
bool getRdsNewBlockB()
Get the Rds New Block B.
Definition: SI4735.h:2333
SI4735::getAntennaTuningCapacitor
uint16_t getAntennaTuningCapacitor()
Get the Antenna Tuning Capacitor value.
Definition: SI4735.h:1322
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:1816
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:2241
SI4735::getStatusMULT
uint8_t getStatusMULT()
Get the Status the M U L T.
Definition: SI4735.h:1308
SI4735::getProperty
int32_t getProperty(uint16_t propertyValue)
Gets a given property from the SI47XX.
Definition: SI4735.cpp:1568
SI4735::setAmAgcAttackRate
void setAmAgcAttackRate(uint16_t parameter)
Sets the AGC attack rate.
Definition: SI4735.h:1997
SI4735::getFirmware
void getFirmware(void)
Gets firmware information.
Definition: SI4735.cpp:474
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:2157
SI4735::setAvcAmDefaultGain
void setAvcAmDefaultGain()
Sets the Avc Am Max Gain to default gain (0x2A80)
Definition: SI4735.h:1362
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:2535
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:1516
si4735_digital_output_sample_rate::DOSR
uint16_t DOSR
Definition: SI4735.h:1033
SI4735::currentClockType
uint8_t currentClockType
Stores the current clock type used (Crystal or REF CLOCK)
Definition: SI4735.h:1088
SI4735::getCurrentSNR
uint8_t getCurrentSNR()
Gets the current SNR metric (0–127 dB).
Definition: SI4735.h:1483
POWER_DOWN
#define POWER_DOWN
Definition: SI4735.h:37
SI4735::getCurrentVolume
uint8_t getCurrentVolume()
Get the Current Volume.
Definition: SI4735.h:1746
SI4735::sendSSBModeProperty
void sendSSBModeProperty()
Just send the property SSB_MOD to the device. Internal use (privete method).
Definition: SI4735.cpp:2779
SI4735::setFmBlendStereoThreshold
void setFmBlendStereoThreshold(uint8_t parameter)
Sets RSSI threshold for stereo blend (Full stereo above threshold, blend below threshold).
Definition: SI4735.cpp:1612
AM_CHANNEL_FILTER
#define AM_CHANNEL_FILTER
Definition: SI4735.h:128
SI4735::setI2CFastModeCustom
void setI2CFastModeCustom(long value=500000)
Sets the I2C bus to a given value. ATTENTION: use this function with cation.
Definition: SI4735.h:2636
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:2609
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:3264
SI4735::frequencyDown
void frequencyDown()
Decrements the current frequency on current band/function by using the current step.
Definition: SI4735.cpp:725
SI4735::getCurrentBlendDetectInterrupt
bool getCurrentBlendDetectInterrupt()
Gets the Current Blend Detect Interrupt.
Definition: SI4735.h:1645
SI4735::setAmDelayNB
void setAmDelayNB(uint16_t value)
Sets the delay before applying impulse blanking.
Definition: SI4735.h:1793
si47x_bandwidth_config::raw
uint8_t raw[2]
Definition: SI4735.h:955
SI4735::setRefClock
void setRefClock(uint16_t refclk)
Sets the frequency of the REFCLK from the output of the prescaler.
Definition: SI4735.cpp:517
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:1343
SI4735::getTuneFrequecyFast
uint8_t getTuneFrequecyFast()
Returns the FAST tuning status.
Definition: SI4735.h:2146
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:1562
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:1057
SI4735::setSSBAvcDivider
void setSSBAvcDivider(uint8_t AVC_DIVIDER)
Sets AVC Divider.
Definition: SI4735.cpp:2654
REFCLK_FREQ
#define REFCLK_FREQ
Definition: SI4735.h:125
SI4735::getTuneCompleteTriggered
bool getTuneCompleteTriggered()
Get the Tune Complete status.
Definition: SI4735.h:1214
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:2299
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:876
SI4735::getCurrentPilot
bool getCurrentPilot()
Checks the current pilot.
Definition: SI4735.h:1588
SI4735::getRdsSyncFound
bool getRdsSyncFound()
Get the Rds Sync Found.
Definition: SI4735.h:2310
SI4735::getCommandResponse
void getCommandResponse(int num_of_bytes, uint8_t *response)
Returns with the command response.
Definition: SI4735.cpp:1522
SI4735::currentWorkFrequency
uint16_t currentWorkFrequency
current frequency
Definition: SI4735.h:1081
SI4735::setAvcAmMinGain
void setAvcAmMinGain()
Sets the Avc Am Max Gain to minimal gain (0x1000)
Definition: SI4735.h:1352
SI4735::setFrequency
void setFrequency(uint16_t)
Set the frequency to the corrent function of the Si4735 (FM, AM or SSB)
Definition: SI4735.cpp:670