PU2CLR SI4844 Arduino Library 1.1.2
Arduino Library for Si4844 Devices - By Ricardo Lima Caratti
Loading...
Searching...
No Matches
SI4844.h
Go to the documentation of this file.
1/**
2 * @brief SI4844 ARDUINO LIBRARY
3 *
4 * @details This is an Arduino library for the SI4822, SI4826, SI4827, SI4840, 4844A, and 4844B, 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/SI4844>
9 *
10 * @see https://pu2clr.github.io/SI4844/
11 * @see github.com
12 *
13 * @author PU2CLR - Ricardo Lima Caratti
14 * @date 2019-2020
15 */
16
17#include <Arduino.h>
18#include <Wire.h>
19
20#define SI4844_ADDRESS 0x11
21
22// English...: Si4844 Commands
23// Portuguese: Comando usado no Si4844
24// Reference.: Si48XX ATDD PROGRAMMING GUIDE, page 12
25#define ATDD_POWER_DOWN 0x11
26#define ATDD_POWER_UP 0xE1
27#define ATDD_AUDIO_MODE 0xE2
28#define GET_REV 0x10
29#define ATDD_XOSCEN 0x80
30#define ATDD_XOWAIT 0x40
31#define ATDD_GET_STATUS 0xE0
32
33#define SET_PROPERTY 0x12
34#define GET_PROPERTY 0x13
35#define RX_VOLUME 0x4000
36#define RX_HARD_MUTE 0x4001
37#define RX_BASS_TREBLE 0x4002
38#define RX_ACTUAL_VOLUME 0x4003
39
40#define FM_SOFT_MUTE_MAX_ATTENUATION 0x1302
41#define AM_SOFT_MUTE_MAX_ATTENUATION 0x3302
42#define FM_DEEMPHASIS 0x1100 // You can use setProperty(FM_DEEMPHASIS, value);
43#define FM_SOFT_MUTE_RATE 0x1300 // You can use setProperty(FM_SOFT_MUTE_RATE, value);
44#define FM_SOFT_MUTE_SLOPE 0x1301 // You can use setProperty(FM_SOFT_MUTE_SLOPE, value);
45#define FM_STEREO_IND_BLEND_THRESHOLD 0x1207 // You can use setProperty(FM_STEREO_IND_BLEND_THRESHOLD, value);
46#define FM_BLEND_RSSI_STEREO_THRESHOLD 0x1800 // You can use setProperty(FM_BLEND_RSSI_STEREO_THRESHOLD, value);
47#define FM_BLEND_RSSI_MONO_THRESHOLD 0x1801 // You can use setProperty(FM_BLEND_RSSI_MONO_THRESHOLD, value);
48
49#define REFCLK_FREQ 0x0201 // You can use setProperty(REFCLK_FREQ, value);
50#define REFCLK_PRESCALE 0x0202 // You can use setProperty(REFCLK_PRESCALE, value);
51
52#define AM_SOFT_MUTE_RATE 0x3300
53#define AM_SOFT_MUTE_SLOPE 0x3301
54#define AM_SOFT_MUTE_SNR_THRESHOLD 0x3303
55
56
57
58
59/** @defgroup GA1 Union and Structures
60 * @section GA1
61 *
62 * @brief SI4844 data representation
63 *
64 * @details The goal of this approach is separating data from code.
65 * The SI4844 works with many internal data that can be represented by data structure
66 * or defined data type in C/C++.
67 */
68
69
70/**
71 * @ingroup GA1
72 * @brief Configures band parameter
73 * @details Represents searching for a valid frequency data type.
74 * @see Page 18 of the Si48XX ATDD PROGRAMMING GUIDE - AN610
75 */
76
77typedef union {
78 struct {
79 uint8_t BANDIDX:6; // Band Index to Set. See Table 8. Pre-defined Band Table
80 uint8_t XOWAIT: 1; // Crystal Oscillator Stabilization Wait Time After Reset. 0 = 600 ms; 1 = 900 ms
81 uint8_t XOSCEN: 1; // Crystal Oscillator Enable. 0 = Use external RCLK; 1 = Use crystal oscillator (XTALI and XTALO with external 32.768 kHz crystal).
82 } refined;
84} si4844_arg_band_index;
85
86/**
87 * @ingroup GA1
88 * @brief Configures all SI48XX parameters
89 * @details Represents searching for a valid frequency data type.
90 * @see Page 18 of the Si48XX ATDD PROGRAMMING GUIDE - AN610
91 */
92typedef union {
93 struct
94 {
95 uint8_t BANDIDX : 6; // Band Index to Set. See Table 8. Pre-defined Band Table
96 uint8_t XOWAIT : 1; // Crystal Oscillator Stabilization Wait Time After Reset. 0 = 600 ms; 1 = 900 ms
97 uint8_t XOSCEN : 1; // Crystal Oscillator Enable. 0 = Use external RCLK; 1 = Use crystal oscillator (XTALI and XTALO with external 32.768 kHz crystal).
98 uint8_t BANDBOT_HIGH; // Band Bottom Frequency Limit; FM 6400..10900 (64.0–109.0 MHz); AM 510..1750 (510–1750 kHz); SW 2300..28500 (2.3–28.5 MHz)
99 uint8_t BANDBOT_LOW; // Band Bottom Frequency Limit; FM 6400..10900 (64.0–109.0 MHz); AM 510..1750 (510–1750 kHz); SW 2300..28500 (2.3–28.5 MHz)
100 uint8_t BANDTOP_HIGH; // Band Top Frequency Limit; FM 6400..10900 (64.0–109.0 MHz); AM 510..1750 (510–1750 kHz); SW 2300..28500 (2.3–28.5 MHz)
101 uint8_t BANDTOP_LOW; // Band Top Frequency Limit; FM 6400..10900 (64.0–109.0 MHz); AM 510..1750 (510–1750 kHz); SW 2300..28500 (2.3–28.5 MHz)
102 uint8_t CHSPC; // Channel Spacing; FM 10 (e.g.,100 kHz); AM 9 or 10 (e.g., 9 kHz or 10 kHz); SW 5 (e.g., 5 kHz)
103 uint8_t DUMMY : 5; // Set it to 00000
104 uint8_t DFBAND : 1; // Default Band Settings; 0 = Allow host controller to override the band property settings; 1 = Force to use tuner default band property settings (Applicable to Si4827 part only)
105 uint8_t UNI_AM : 1; // Universal AM Band. 0 = Disable universal AM band (default AFC range of 1.1 kHz); 1 = Enable universal AM band (wider AFC range in tuning); Applicable to Si4827 and Si4844B parts and AMRX mode only
106 uint8_t TVFREQ : 1; // TV Audio Channel Frequency Display; 0 = Disable TV audio channel frequency display format; 1 = Enable TV audio channel frequency display format; Applicable to Si4827 and Si4844B parts and FMRX mode only
107 } refined;
109} SI4844_arg_band;
110
111/**
112 * @ingroup GA1
113 * @brief Status
114 * @details Represents searching for a valid frequency data type.
115 */
116typedef union {
117 struct
118 {
119 uint8_t D_0 : 1;
120 uint8_t D_1 : 1;
121 uint8_t D_2 : 1;
122 uint8_t D_3 : 1;
123 uint8_t D_4 : 1;
124 uint8_t ERR : 1; //!< 1 = Error.
125 uint8_t CTS : 1; //!< 0 = Wait before sending next command; 1 = Clear to send next command.
126 } refined;
128} si4844_status;
129
130/**
131 * @ingroup GA1
132 * @brief Device Status
133 * @details The structure below represents the four bytes response got by command ATDD_GET_STATUS
134 * @see PROGRAMMING GUIDE, pages 14 and 15
135 */
136typedef struct
137{
138 uint8_t BCFG0 : 1; // Bit 0
139 uint8_t BCFG1 : 1; // bit 1
140 uint8_t STEREO : 1; // bit 2
141 uint8_t STATION : 1; // bit 3
142 uint8_t INFORDY : 1; // bit 4
143 uint8_t HOSTPWRUP : 1; // bit 5
144 uint8_t HOSTRST : 1; // bit 6
145 uint8_t CTS : 1; // bit 7
146 uint8_t BANDIDX : 6; // Form bit 0 to 5
147 uint8_t BANDMODE : 2; // From bit 6 to 7
148 uint8_t d2 : 4; // Frequency digit 2
149 uint8_t d1 : 4; // Frequency digit 1
150 uint8_t d4 : 4; // Frequency digit 4
151 uint8_t d3 : 4; // frequency digit 3
152} si4844_get_status;
153
154/**
155 * @ingroup GA1
156 * @brief Status response
157 * @see See Si48XX ATDD PROGRAMMING GUIDE, pages 14 and 15
158*/
159typedef union {
160 si4844_get_status refined;
162} si4844_status_response;
163
164/**
165 * @ingroup GA1
166 * @brief Firmware Information
167 * @see Si48XX ATDD PROGRAMMING GUIDE, page 22.
168 */
169typedef struct
170{
171 uint8_t RESERVED : 6; // Bit 0 to 5
172 uint8_t ERR : 1; // bit 6
173 uint8_t CTS : 1; // bit 2
174 uint8_t PN; // Final 2 digits of Part Number (HEX).
175 uint8_t FWMAJOR; // Firmware Major Revision (ASCII).
176 uint8_t FWMINOR; // Firmware Minor Revision (ASCII).
177 uint8_t CMPMAJOR; // Component Major Revision (ASCII).
178 uint8_t CMPMINOR; // Component Minor Revision (ASCII).
179 uint8_t CHIPREV; // Chip Revision (ASCII).
180} si4844_firmware_info;
181
182/**
183 * @brief Firmware Response
184 *
185 */
186typedef union {
187 si4844_firmware_info refined;
189} si4844_firmware_response;
190
191/**
192 * @ingroup GA1
193 * @brief Audio Mode
194 */
195typedef union {
196 struct
197 {
198 uint8_t AUDIOMODE : 2;
199 uint8_t FM_MONO : 1;
200 uint8_t ADJPT_ATTN : 1;
201 uint8_t ADJPT_STEO : 1;
202 uint8_t Reserved : 2;
203 uint8_t OPCODE : 1;
204 } arg1;
206} si4844_audiomode;
207
208/**
209 * @ingroup GA1
210 * @brief Audio Status Response
211 */
212typedef union {
213 struct {
214 uint8_t AUDIOMODE:2;
215 uint8_t FM_MONO:1;
216 uint8_t ADJPT_ATTN:1;
217 uint8_t ADJPT_STEO:1;
218 uint8_t Reserved:1;
219 uint8_t ERR:1;
220 uint8_t CTS:1;
221 } status;
223} si4844_audiomode_status_response;
224
225/**
226 * @brief Data type to deal with SET_PROPERTY command
227 *
228 * @details Property Data type (help to deal with SET_PROPERTY command on si473X)
229 */
230typedef union {
231 struct
232 {
233 uint8_t byteLow;
234 uint8_t byteHigh;
235 } raw;
237} si4844_property;
238
239/**
240 * @brief Interrupt status
241 * @details This variable must be true every time an interruption occurs and then must return to the false every time an action resulting from the interruption is performed.
242 * @details The variable below indicates a change of the ATDD status. When it occurs, it means the system needs to process some action (for example show on LCD this change).
243 */
244volatile static bool data_from_device;
245
246/**
247 * @brief Library handle interrupt
248 * @details Handling interruptions.
249 * @details Whenever the status of the ATDD changes, a hardware interrupt is triggered. For example, when you move the tuner
250 * @details potenciometer, the ATDD sends a signal to the Arduino pin (INTERRUPT_PIN). The same is true when the ATDD is capturing
251 * @details mono FM signal and has switched to stereo.
252 * @details You can control the interrupt process via your sketch intead of this library.
253 * @see setStatusInterruptFromDevice, getStatusInterruptFromDevice, setup
254 */
255#ifdef ESP8266 // if the controller is ESP8266, add IRAM_ATTR.
256 IRAM_ATTR
257#endif
258static void interrupt_hundler()
259{
260 data_from_device = true;
261}
262
263/**
264 * @brief SI4844 Class
265 *
266 * @details This class implements all functions to help you to control the Si4844 devices.
267 */
268
270{
271
272private:
273
274 si4844_status_response status_response;
275 si4844_firmware_response firmware_response;
276 uint16_t resetPin;
277 uint16_t interruptPin;
278 uint8_t currentBand = 0;
279
280 uint8_t xoscen = 1;
281 uint8_t xowait = 0;
282
283
284 inline void setClockLow(void) { Wire.setClock(10000); };
285 inline void setClockHigh(void) { Wire.setClock(50000); };
286 inline void waitInterrupt(void);
287 inline bool isClearToSend(void);
288 inline void waitToSend(void);
289
290 // SI4844 band description (FM = 0; AM = 1; SW = 2)
291 const char *bandmode_table[3] = {"FM", "AM", "SW"};
292 const char *stereo_indicator_table[2] = {"Off","On "};
293
294 uint8_t volume = 30;
295 uint8_t bassTreble = 4;
296
297public :
298 /**
299 * @ingroup GB
300 * @brief Set the Data Status From Device
301 * @details It is a flag that means the device triggered an interrupt.
302 * @details You can use this function to back the flag status to false. This way you can check when the device triggers the next interrupt.
303 * @details It is very useful when the user wants to control the interrupt instead of give this control to the library.
304 * @param value true or false
305 */
306 inline void setStatusInterruptFromDevice( bool value ) { data_from_device = value; };
307 /**
308 * @ingroup GB
309 * @brief Get the Data Status From Device
310 * @details It returns true when the device has triggered an interrupt.
311 * @return true or false
312 */
313 inline bool getDataStatusInterruptFromDevice() { return data_from_device; };
314
315
316 void setProperty(uint16_t propertyNumber, uint16_t parameter);
318 void sendCommand(uint8_t cmd, int parameter_size, const uint8_t *parameter);
319 void getCommandResponse(int response_size, uint8_t *response);
320
321 void setup(uint16_t resetPin, int interruptPin, byte defaultBand);
322 void debugDevice(uint16_t resetPin, uint16_t interruptPin, uint8_t defaultBand, void (*showFunc)(char *msg));
323 void reset(void );
324 void setBand(byte);
325
326 void changeVolume(char); // deprecated
327 void volumeUp(void);
328 void volumeDown(void);
329 void setVolume(byte);
330 void setBassTreble(uint8_t bass_treble);
331 void bassTrebleUp();
332 void bassTrebleDown();
333 void audioMute(uint8_t value);
334 void setAudioMute(bool on);
335
336 void setAmSoftMuteMaxAttenuation(uint8_t value);
337 void setFmSoftMuteMaxAttenuation(uint8_t value);
338 void setFmDeemphasis(uint8_t value);
339 void setFmSoftMuteRate(uint8_t value);
340 void setFmSoftMuteSlope(uint8_t value);
341
342 void setAmSoftMuteRate(uint8_t value);
343 void setAmSoftMuteSlope(uint8_t value);
344 void setAmSoftMuteSnrThreshold(uint8_t value);
345
346
347 void setBlendThresholdStereoIndicator(uint16_t value);
348
349 void setCrystalOscillatorEnable(uint8_t XOSCEN );
351 void setReferenceClockFrequency(uint16_t value);
352 void setReferenceClockPrescaler(uint16_t value);
353
354
355
356 si4844_audiomode_status_response
357 setAudioMode(uint8_t audiomode, uint8_t fm_mono, uint8_t adjpt_attn, uint8_t adjpt_steo, uint8_t opcode);
358
359 si4844_status_response *getStatus(void);
360 si4844_firmware_response *getFirmware(void);
361 // customize the frequency range of a band
362 void setCustomBand(uint8_t bandIndex, uint16_t botton, uint16_t top, uint8_t bandSpace, uint8_t dfband = 0, uint8_t uni_am = 0, uint8_t tvreq = 0 );
363
364 void setDefaultBandIndx( uint8_t bandidx);
365
366 void powerDown(void);
367 void powerUp(void);
368
369 float getFrequency(void);
370 bool hasStatusChanged(void);
371 void resetStatus(void);
372
373 /**
374 * @ingroup GB
375 * @brief Gets the current audio volume level
376 *
377 * @return Volume level
378 */
379 inline uint8_t getVolume() {return volume; };
381
382 /**
383 * @ingroup GB
384 * @brief Get the Band Mode
385 * @return char* "FM", "AM" or "SW"
386 */
387 inline char * getBandMode(){ return (char *) bandmode_table[status_response.refined.BANDMODE]; };
388
389 /**
390 * @ingroup GB
391 * @brief Get the Stereo Indicator
392 * @return char* "ON" or "OFF"
393 */
394 inline char * getStereoIndicator(){ return (char *) stereo_indicator_table[status_response.refined.STATION]; };
395
396
397 inline uint16_t getStatusBCFG0() { return status_response.refined.BCFG0; };
398 inline uint16_t getStatusBCFG1() { return status_response.refined.BCFG1; };
399 inline uint16_t getStatusStereo() { return status_response.refined.STEREO; };
400 inline uint16_t getStatusStationIndicator() { return status_response.refined.STATION; };
401 inline uint16_t getStatusInformationReady() { return status_response.refined.INFORDY; };
402 inline uint16_t getStatusHostPowerUp() { return status_response.refined.HOSTPWRUP; };
403 inline uint16_t getStatusHostReset() { return status_response.refined.HOSTRST; };
404 inline uint16_t getStatusBandMode() { return status_response.refined.BANDMODE; };
405 inline uint16_t getStatusBandIndex() { return status_response.refined.BANDIDX; };
406 inline uint16_t getStatusCTS() { return status_response.refined.CTS; };
407
408
409 inline uint16_t getFirmwareReserved() { return firmware_response.refined.RESERVED; };
410 inline uint16_t getFirmwareErr() { return firmware_response.refined.ERR; };
411 inline uint16_t getFirmwareCTS() { return firmware_response.refined.CTS; };
412 inline uint16_t getFirmwarePartNumber() { return firmware_response.refined.PN; };
413 inline uint16_t getFirmwareMajorRevision() { return firmware_response.refined.FWMAJOR; };
414 inline uint16_t getFirmwareMinorRevision() { return firmware_response.refined.FWMINOR; };
415 inline uint16_t getFirmwareComponentMajorRevision() { return firmware_response.refined.CMPMAJOR; };
416 inline uint16_t getFirmwareComponentMinorRevision() { return firmware_response.refined.CMPMINOR; };
417 inline uint16_t getFirmwareChipRevision() { return firmware_response.refined.CHIPREV; };
418
419 void setResetPin(uint16_t resetPin);
420 void setInterruptPin(int interruptPin);
421
423 bool detectDevice();
424
425};
#define FM_SOFT_MUTE_RATE
Definition: SI4844.h:43
#define AM_SOFT_MUTE_SLOPE
Definition: SI4844.h:53
uint16_t value
Definition: SI4844.h:236
#define AM_SOFT_MUTE_MAX_ATTENUATION
Definition: SI4844.h:41
#define FM_STEREO_IND_BLEND_THRESHOLD
Definition: SI4844.h:45
#define RX_HARD_MUTE
Definition: SI4844.h:36
#define REFCLK_PRESCALE
Definition: SI4844.h:50
#define RX_ACTUAL_VOLUME
Definition: SI4844.h:38
#define ATDD_GET_STATUS
Definition: SI4844.h:31
#define ATDD_POWER_DOWN
Definition: SI4844.h:25
si4844_firmware_info refined
Definition: SI4844.h:187
uint8_t raw[9]
Definition: SI4844.h:188
#define FM_SOFT_MUTE_MAX_ATTENUATION
Definition: SI4844.h:40
#define SET_PROPERTY
Definition: SI4844.h:33
#define GET_REV
Definition: SI4844.h:28
#define ATDD_POWER_UP
Definition: SI4844.h:26
#define FM_DEEMPHASIS
Definition: SI4844.h:42
#define AM_SOFT_MUTE_SNR_THRESHOLD
Definition: SI4844.h:54
#define AM_SOFT_MUTE_RATE
Definition: SI4844.h:52
#define SI4844_ADDRESS
SI4844 ARDUINO LIBRARY
Definition: SI4844.h:20
#define GET_PROPERTY
Definition: SI4844.h:34
#define REFCLK_FREQ
Definition: SI4844.h:49
#define RX_VOLUME
Definition: SI4844.h:35
#define RX_BASS_TREBLE
Definition: SI4844.h:37
#define ATDD_AUDIO_MODE
Definition: SI4844.h:27
SI4844 Class.
Definition: SI4844.h:270
uint16_t getFirmwareComponentMajorRevision()
Definition: SI4844.h:415
uint16_t getStatusBCFG0()
Definition: SI4844.h:397
uint16_t getStatusHostPowerUp()
Definition: SI4844.h:402
uint16_t getFirmwareCTS()
Definition: SI4844.h:411
uint16_t getStatusBandMode()
Definition: SI4844.h:404
uint16_t getStatusCTS()
Definition: SI4844.h:406
uint16_t getStatusBandIndex()
Definition: SI4844.h:405
uint16_t getStatusStationIndicator()
Definition: SI4844.h:400
uint16_t getFirmwareChipRevision()
Definition: SI4844.h:417
uint16_t getFirmwareErr()
Definition: SI4844.h:410
uint16_t getFirmwareMinorRevision()
Definition: SI4844.h:414
uint16_t getStatusStereo()
Definition: SI4844.h:399
uint16_t getStatusHostReset()
Definition: SI4844.h:403
uint16_t getFirmwareComponentMinorRevision()
Definition: SI4844.h:416
uint16_t getFirmwareMajorRevision()
Definition: SI4844.h:413
uint16_t getFirmwarePartNumber()
Definition: SI4844.h:412
void setResetPin(uint16_t resetPin)
Definition: SI4844.cpp:180
uint16_t getStatusInformationReady()
Definition: SI4844.h:401
uint16_t getStatusBCFG1()
Definition: SI4844.h:398
void setDefaultBandIndx(uint8_t bandidx)
Definition: SI4844.cpp:276
void setInterruptPin(int interruptPin)
Definition: SI4844.cpp:187
uint16_t getFirmwareReserved()
Definition: SI4844.h:409
uint8_t raw
Definition: SI4844.h:205
uint8_t BCFG1
Definition: SI4844.h:139
uint8_t raw
Definition: SI4844.h:127
uint8_t CHIPREV
Definition: SI4844.h:179
uint8_t CMPMINOR
Definition: SI4844.h:178
uint8_t HOSTPWRUP
Definition: SI4844.h:143
uint8_t FWMAJOR
Definition: SI4844.h:175
uint8_t STEREO
Definition: SI4844.h:140
uint8_t PN
Definition: SI4844.h:174
uint8_t CMPMAJOR
Definition: SI4844.h:177
uint8_t raw[4]
Definition: SI4844.h:161
uint8_t d1
Definition: SI4844.h:149
uint8_t raw[7]
Definition: SI4844.h:108
uint8_t ERR
Definition: SI4844.h:172
uint8_t RESERVED
Definition: SI4844.h:171
uint8_t d3
Definition: SI4844.h:151
uint8_t HOSTRST
Definition: SI4844.h:144
uint8_t BANDMODE
Definition: SI4844.h:147
uint8_t d4
Definition: SI4844.h:150
si4844_get_status refined
Definition: SI4844.h:160
uint8_t raw
Definition: SI4844.h:222
uint8_t raw
Definition: SI4844.h:83
uint8_t STATION
Definition: SI4844.h:141
uint8_t BANDIDX
Definition: SI4844.h:146
uint8_t CTS
Definition: SI4844.h:173
uint8_t FWMINOR
Definition: SI4844.h:176
uint8_t d2
Definition: SI4844.h:148
uint8_t INFORDY
Definition: SI4844.h:142
uint8_t CTS
Definition: SI4844.h:145
uint8_t BCFG0
Definition: SI4844.h:138
void setAmSoftMuteMaxAttenuation(uint8_t value)
Sets AM Soft Mute Max Attenuation..
Definition: SI4844.cpp:802
float getFrequency(void)
Get the current frequency of the radio in KHz.
Definition: SI4844.cpp:669
void setFmDeemphasis(uint8_t value)
Sets de-emphasis time constant.
Definition: SI4844.cpp:825
void changeVolume(char)
Up or down the sound volume level.
Definition: SI4844.cpp:402
void setStatusInterruptFromDevice(bool value)
Set the Data Status From Device.
Definition: SI4844.h:306
si4844_firmware_response * getFirmware(void)
Get part number, chip revision, firmware, patch, and component revision numbers.
Definition: SI4844.cpp:641
void setFmSoftMuteRate(uint8_t value)
Sets the attack and decay rates when entering and leaving soft mute.
Definition: SI4844.cpp:838
void setAmSoftMuteSnrThreshold(uint8_t value)
Sets the SNR threshold to engage soft mute.
Definition: SI4844.cpp:909
void setFmSoftMuteSlope(uint8_t value)
Configures attenuation slope during soft mute in dB attenuation per dB SNR below the soft mute SNR th...
Definition: SI4844.cpp:853
bool getDataStatusInterruptFromDevice()
Get the Data Status From Device.
Definition: SI4844.h:313
void resetStatus(void)
set the interrupr status to false. It will turn true after next interrupr
Definition: SI4844.cpp:724
si4844_status_response * getStatus(void)
Get tune freq, band, and others information, status of the device.
Definition: SI4844.cpp:608
uint8_t getVolume()
Gets the current audio volume level.
Definition: SI4844.h:379
void bassTrebleUp()
More treble, less bass.
Definition: SI4844.cpp:512
void setBand(byte)
Sets a new band to the device.
Definition: SI4844.cpp:329
void setBassTreble(uint8_t bass_treble)
Set the sound volume level, bass and treble.
Definition: SI4844.cpp:493
void setReferenceClockFrequency(uint16_t value)
Sets the frequency of the REFCLK from the output of the prescaler.
Definition: SI4844.cpp:923
uint8_t getVolumeProperty()
Gets the current volume value stored in SI4844 device.
Definition: SI4844.cpp:469
void setBlendThresholdStereoIndicator(uint16_t value)
Sets the blend threshold for stereo indicator.
Definition: SI4844.cpp:866
void setCustomBand(uint8_t bandIndex, uint16_t botton, uint16_t top, uint8_t bandSpace, uint8_t dfband=0, uint8_t uni_am=0, uint8_t tvreq=0)
This method allows you to customize the frequency range of a band.
Definition: SI4844.cpp:748
void setVolume(byte)
Sets the volume level.
Definition: SI4844.cpp:452
void reset(void)
Resets the SI4844 device.
Definition: SI4844.cpp:244
void setAmSoftMuteSlope(uint8_t value)
Configures attenuation slope during soft mute in dB attenuation per dB SNR below the soft mute SNR th...
Definition: SI4844.cpp:896
char * getStereoIndicator()
Get the Stereo Indicator.
Definition: SI4844.h:394
void sendCommand(uint8_t cmd, int parameter_size, const uint8_t *parameter)
Sends a given command to the SI4844 device.
Definition: SI4844.cpp:96
char * getBandMode()
Get the Band Mode.
Definition: SI4844.h:387
void setup(uint16_t resetPin, int interruptPin, byte defaultBand)
Initiates the SI4844 instance and connect the device (SI4844) to Arduino.
Definition: SI4844.cpp:150
void powerUp(void)
Power the device up.
Definition: SI4844.cpp:286
void volumeUp(void)
Increases the volume level.
Definition: SI4844.cpp:427
void setCrystalOscillatorStabilizationWaitTime(uint8_t XOWAIT)
Sets Crystal Oscillator Stabilization Wait Time After Reset.
Definition: SI4844.cpp:315
void volumeDown(void)
Decreases the volume level.
Definition: SI4844.cpp:438
void setCrystalOscillatorEnable(uint8_t XOSCEN)
Sets Crystal Oscillator Enable.
Definition: SI4844.cpp:301
void setProperty(uint16_t propertyNumber, uint16_t parameter)
Sends (sets) property to the SI48XX.
Definition: SI4844.cpp:25
void getCommandResponse(int response_size, uint8_t *response)
Returns with the command response.
Definition: SI4844.cpp:118
void debugDevice(uint16_t resetPin, uint16_t interruptPin, uint8_t defaultBand, void(*showFunc)(char *msg))
Used to debug
Definition: SI4844.cpp:201
void audioMute(uint8_t value)
Mutes the audio output.
Definition: SI4844.cpp:581
void bassTrebleDown()
Less treble, more bass.
Definition: SI4844.cpp:501
void setFmSoftMuteMaxAttenuation(uint8_t value)
FM Soft Mute Maximum Attenuation.
Definition: SI4844.cpp:813
si4844_audiomode_status_response setAudioMode(uint8_t audiomode, uint8_t fm_mono, uint8_t adjpt_attn, uint8_t adjpt_steo, uint8_t opcode)
Set audio mode.
Definition: SI4844.cpp:544
void setReferenceClockPrescaler(uint16_t value)
Sets the number used by the prescaler to divide the external reference clock frequency down to the in...
Definition: SI4844.cpp:938
bool hasStatusChanged(void)
Checks whether the SI4844 has its status changed.
Definition: SI4844.cpp:715
void setAudioMute(bool on)
Mutes the audio output.
Definition: SI4844.cpp:592
void setAmSoftMuteRate(uint8_t value)
Sets the attack and decay rates when entering or leaving soft mute.
Definition: SI4844.cpp:882
uint16_t getProperty(uint16_t propertyNumber)
Gets a given property from the SI4844.
Definition: SI4844.cpp:54
void powerDown(void)
Power the device down.
Definition: SI4844.cpp:265
bool detectDevice()
Checks communication with SI4844 via I2C.
Definition: SI4844.cpp:952
uint8_t scanI2CBus(uint8_t *device, uint8_t limit)
Scans the I2C bus and returns the addresses of the devices found.
Definition: SI4844.cpp:968