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 uint16_t BANDBOT : 16; // 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 uint16_t BANDTOP : 16; // 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)
100 uint8_t CHSPC : 8; // 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)
101 uint8_t DUMMY : 5; // Set it to 00000
102 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)
103 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
104 uint16_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
105 } refined;
107} SI4844_arg_band;
108
109/**
110 * @ingroup GA1
111 * @brief Status
112 * @details Represents searching for a valid frequency data type.
113 */
114typedef union {
115 struct
116 {
117 uint8_t D_0 : 1;
118 uint8_t D_1 : 1;
119 uint8_t D_2 : 1;
120 uint8_t D_3 : 1;
121 uint8_t D_4 : 1;
122 uint8_t ERR : 1; //!< 1 = Error.
123 uint8_t CTS : 1; //!< 0 = Wait before sending next command; 1 = Clear to send next command.
124 } refined;
126} si4844_status;
127
128/**
129 * @ingroup GA1
130 * @brief Device Status
131 * @details The structure below represents the four bytes response got by command ATDD_GET_STATUS
132 * @see PROGRAMMING GUIDE, pages 14 and 15
133 */
134typedef struct
135{
136 uint8_t BCFG0 : 1; // Bit 0
137 uint8_t BCFG1 : 1; // bit 1
138 uint8_t STEREO : 1; // bit 2
139 uint8_t STATION : 1; // bit 3
140 uint8_t INFORDY : 1; // bit 4
141 uint8_t HOSTPWRUP : 1; // bit 5
142 uint8_t HOSTRST : 1; // bit 6
143 uint8_t CTS : 1; // bit 7
144 uint8_t BANDIDX : 6; // Form bit 0 to 5
145 uint8_t BANDMODE : 2; // From bit 6 to 7
146 uint8_t d2 : 4; // Frequency digit 2
147 uint8_t d1 : 4; // Frequency digit 1
148 uint8_t d4 : 4; // Frequency digit 4
149 uint8_t d3 : 4; // frequency digit 3
150} si4844_get_status;
151
152/**
153 * @ingroup GA1
154 * @brief Status response
155 * @see See Si48XX ATDD PROGRAMMING GUIDE, pages 14 and 15
156*/
157typedef union {
158 si4844_get_status refined;
160} si4844_status_response;
161
162/**
163 * @ingroup GA1
164 * @brief Firmware Information
165 * @see Si48XX ATDD PROGRAMMING GUIDE, page 22.
166 */
167typedef struct
168{
169 uint8_t RESERVED : 6; // Bit 0 to 5
170 uint8_t ERR : 1; // bit 6
171 uint8_t CTS : 1; // bit 2
172 uint8_t PN; // Final 2 digits of Part Number (HEX).
173 uint8_t FWMAJOR; // Firmware Major Revision (ASCII).
174 uint8_t FWMINOR; // Firmware Minor Revision (ASCII).
175 uint8_t CMPMAJOR; // Component Major Revision (ASCII).
176 uint8_t CMPMINOR; // Component Minor Revision (ASCII).
177 uint8_t CHIPREV; // Chip Revision (ASCII).
178} si4844_firmware_info;
179
180/**
181 * @brief Firmware Response
182 *
183 */
184typedef union {
185 si4844_firmware_info refined;
187} si4844_firmware_response;
188
189/**
190 * @ingroup GA1
191 * @brief Audio Mode
192 */
193typedef union {
194 struct
195 {
196 uint8_t AUDIOMODE : 2;
197 uint8_t FM_MONO : 1;
198 uint8_t ADJPT_ATTN : 1;
199 uint8_t ADJPT_STEO : 1;
200 uint8_t Reserved : 2;
201 uint8_t OPCODE : 1;
202 } arg1;
204} si4844_audiomode;
205
206/**
207 * @ingroup GA1
208 * @brief Audio Status Response
209 */
210typedef union {
211 struct {
212 uint8_t AUDIOMODE:2;
213 uint8_t FM_MONO:1;
214 uint8_t ADJPT_ATTN:1;
215 uint8_t ADJPT_STEO:1;
216 uint8_t Reserved:1;
217 uint8_t ERR:1;
218 uint8_t CTS:1;
219 } status;
221} si4844_audiomode_status_response;
222
223/**
224 * @brief Data type to deal with SET_PROPERTY command
225 *
226 * @details Property Data type (help to deal with SET_PROPERTY command on si473X)
227 */
228typedef union {
229 struct
230 {
231 uint8_t byteLow;
232 uint8_t byteHigh;
233 } raw;
235} si4844_property;
236
237/**
238 * @brief Interrupt status
239 * @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.
240 * @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).
241 */
242volatile static bool data_from_device;
243
244/**
245 * @brief Library handle interrupt
246 * @details Handling interruptions.
247 * @details Whenever the status of the ATDD changes, a hardware interrupt is triggered. For example, when you move the tuner
248 * @details potenciometer, the ATDD sends a signal to the Arduino pin (INTERRUPT_PIN). The same is true when the ATDD is capturing
249 * @details mono FM signal and has switched to stereo.
250 * @details You can control the interrupt process via your sketch intead of this library.
251 * @see setStatusInterruptFromDevice, getStatusInterruptFromDevice, setup
252 */
253static void interrupt_hundler()
254{
255 data_from_device = true;
256}
257
258
259/**
260 * @brief SI4844 Class
261 *
262 * @details This class implements all functions to help you to control the Si4844 devices.
263 */
264
266{
267
268private:
269
270 si4844_status_response status_response;
271 si4844_firmware_response firmware_response;
272 uint16_t resetPin;
273 uint16_t interruptPin;
274 uint8_t currentBand = 0;
275
276 uint8_t xoscen = 1;
277 uint8_t xowait = 0;
278
279
280 inline void setClockLow(void) { Wire.setClock(10000); };
281 inline void setClockHigh(void) { Wire.setClock(50000); };
282 inline void waitInterrupt(void);
283 inline bool isClearToSend(void);
284 inline void waitToSend(void);
285
286 // SI4844 band description (FM = 0; AM = 1; SW = 2)
287 const char *bandmode_table[3] = {"FM", "AM", "SW"};
288 const char *stereo_indicator_table[2] = {"Off","On "};
289
290 uint8_t volume = 30;
291 uint8_t bassTreble = 4;
292
293public :
294 /**
295 * @ingroup GB
296 * @brief Set the Data Status From Device
297 * @details It is a flag that means the device triggered an interrupt.
298 * @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.
299 * @details It is very useful when the user wants to control the interrupt instead of give this control to the library.
300 * @param value true or false
301 */
302 inline void setStatusInterruptFromDevice( bool value ) { data_from_device = value; };
303 /**
304 * @ingroup GB
305 * @brief Get the Data Status From Device
306 * @details It returns true when the device has triggered an interrupt.
307 * @return true or false
308 */
309 inline bool getDataStatusInterruptFromDevice() { return data_from_device; };
310
311
312 void setProperty(uint16_t propertyNumber, uint16_t parameter);
314 void sendCommand(uint8_t cmd, int parameter_size, const uint8_t *parameter);
315 void getCommandResponse(int response_size, uint8_t *response);
316
317 void setup(uint16_t resetPin, int interruptPin, byte defaultBand);
318 void debugDevice(uint16_t resetPin, uint16_t interruptPin, uint8_t defaultBand, void (*showFunc)(char *msg));
319 void reset(void );
320 void setBand(byte);
321
322 void changeVolume(char); // deprecated
323 void volumeUp(void);
324 void volumeDown(void);
325 void setVolume(byte);
326 void setBassTreble(uint8_t bass_treble);
327 void bassTrebleUp();
328 void bassTrebleDown();
329 void audioMute(uint8_t value);
330 void setAudioMute(bool on);
331
332 void setAmSoftMuteMaxAttenuation(uint8_t value);
333 void setFmSoftMuteMaxAttenuation(uint8_t value);
334 void setFmDeemphasis(uint8_t value);
335 void setFmSoftMuteRate(uint8_t value);
336 void setFmSoftMuteSlope(uint8_t value);
337
338 void setAmSoftMuteRate(uint8_t value);
339 void setAmSoftMuteSlope(uint8_t value);
340 void setAmSoftMuteSnrThreshold(uint8_t value);
341
342
343 void setBlendThresholdStereoIndicator(uint16_t value);
344
345 void setCrystalOscillatorEnable(uint8_t XOSCEN );
347 void setReferenceClockFrequency(uint16_t value);
348 void setReferenceClockPrescaler(uint16_t value);
349
350
351
352 si4844_audiomode_status_response
353 setAudioMode(uint8_t audiomode, uint8_t fm_mono, uint8_t adjpt_attn, uint8_t adjpt_steo, uint8_t opcode);
354
355 si4844_status_response *getStatus(void);
356 si4844_firmware_response *getFirmware(void);
357 // customize the frequency range of a band
358 void setCustomBand(uint8_t bandIndex, uint16_t botton, uint16_t top, uint8_t bandSpace);
359 void setCustomBand(uint8_t bandIndex, uint16_t botton, uint16_t top, uint8_t bandSpace, uint8_t dfband, uint8_t uni_am, uint8_t tvreq );
360
361 void setDefaultBandIndx( uint8_t bandidx);
362
363 void powerDown(void);
364 void powerUp(void);
365
366 float getFrequency(void);
367 bool hasStatusChanged(void);
368 void resetStatus(void);
369
370 /**
371 * @ingroup GB
372 * @brief Gets the current audio volume level
373 *
374 * @return Volume level
375 */
376 inline uint8_t getVolume() {return volume; };
378
379 /**
380 * @ingroup GB
381 * @brief Get the Band Mode
382 * @return char* "FM", "AM" or "SW"
383 */
384 inline char * getBandMode(){ return (char *) bandmode_table[status_response.refined.BANDMODE]; };
385
386 /**
387 * @ingroup GB
388 * @brief Get the Stereo Indicator
389 * @return char* "ON" or "OFF"
390 */
391 inline char * getStereoIndicator(){ return (char *) stereo_indicator_table[status_response.refined.STATION]; };
392
393
394 inline uint16_t getStatusBCFG0() { return status_response.refined.BCFG0; };
395 inline uint16_t getStatusBCFG1() { return status_response.refined.BCFG1; };
396 inline uint16_t getStatusStereo() { return status_response.refined.STEREO; };
397 inline uint16_t getStatusStationIndicator() { return status_response.refined.STATION; };
398 inline uint16_t getStatusInformationReady() { return status_response.refined.INFORDY; };
399 inline uint16_t getStatusHostPowerUp() { return status_response.refined.HOSTPWRUP; };
400 inline uint16_t getStatusHostReset() { return status_response.refined.HOSTRST; };
401 inline uint16_t getStatusBandMode() { return status_response.refined.BANDMODE; };
402 inline uint16_t getStatusBandIndex() { return status_response.refined.BANDIDX; };
403 inline uint16_t getStatusCTS() { return status_response.refined.CTS; };
404
405
406 inline uint16_t getFirmwareReserved() { return firmware_response.refined.RESERVED; };
407 inline uint16_t getFirmwareErr() { return firmware_response.refined.ERR; };
408 inline uint16_t getFirmwareCTS() { return firmware_response.refined.CTS; };
409 inline uint16_t getFirmwarePartNumber() { return firmware_response.refined.PN; };
410 inline uint16_t getFirmwareMajorRevision() { return firmware_response.refined.FWMAJOR; };
411 inline uint16_t getFirmwareMinorRevision() { return firmware_response.refined.FWMINOR; };
412 inline uint16_t getFirmwareComponentMajorRevision() { return firmware_response.refined.CMPMAJOR; };
413 inline uint16_t getFirmwareComponentMinorRevision() { return firmware_response.refined.CMPMINOR; };
414 inline uint16_t getFirmwareChipRevision() { return firmware_response.refined.CHIPREV; };
415
416 void setResetPin(uint16_t resetPin);
417 void setInterruptPin(int interruptPin);
418
420 bool detectDevice();
421
422};
#define FM_SOFT_MUTE_RATE
Definition: SI4844.h:43
#define AM_SOFT_MUTE_SLOPE
Definition: SI4844.h:53
uint16_t value
Definition: SI4844.h:234
#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:185
uint8_t raw[9]
Definition: SI4844.h:186
#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:266
uint16_t getFirmwareComponentMajorRevision()
Definition: SI4844.h:412
uint16_t getStatusBCFG0()
Definition: SI4844.h:394
uint16_t getStatusHostPowerUp()
Definition: SI4844.h:399
uint16_t getFirmwareCTS()
Definition: SI4844.h:408
uint16_t getStatusBandMode()
Definition: SI4844.h:401
uint16_t getStatusCTS()
Definition: SI4844.h:403
uint16_t getStatusBandIndex()
Definition: SI4844.h:402
uint16_t getStatusStationIndicator()
Definition: SI4844.h:397
uint16_t getFirmwareChipRevision()
Definition: SI4844.h:414
uint16_t getFirmwareErr()
Definition: SI4844.h:407
uint16_t getFirmwareMinorRevision()
Definition: SI4844.h:411
uint16_t getStatusStereo()
Definition: SI4844.h:396
uint16_t getStatusHostReset()
Definition: SI4844.h:400
uint16_t getFirmwareComponentMinorRevision()
Definition: SI4844.h:413
uint16_t getFirmwareMajorRevision()
Definition: SI4844.h:410
uint16_t getFirmwarePartNumber()
Definition: SI4844.h:409
void setResetPin(uint16_t resetPin)
Definition: SI4844.cpp:180
uint16_t getStatusInformationReady()
Definition: SI4844.h:398
uint16_t getStatusBCFG1()
Definition: SI4844.h:395
void setDefaultBandIndx(uint8_t bandidx)
Definition: SI4844.cpp:276
void setInterruptPin(int interruptPin)
Definition: SI4844.cpp:187
uint16_t getFirmwareReserved()
Definition: SI4844.h:406
uint8_t raw
Definition: SI4844.h:203
uint8_t BCFG1
Definition: SI4844.h:137
uint8_t raw
Definition: SI4844.h:125
uint8_t CHIPREV
Definition: SI4844.h:177
uint8_t CMPMINOR
Definition: SI4844.h:176
uint8_t HOSTPWRUP
Definition: SI4844.h:141
uint8_t FWMAJOR
Definition: SI4844.h:173
uint8_t STEREO
Definition: SI4844.h:138
uint8_t PN
Definition: SI4844.h:172
uint8_t CMPMAJOR
Definition: SI4844.h:175
uint8_t raw[4]
Definition: SI4844.h:159
uint8_t d1
Definition: SI4844.h:147
uint8_t raw[7]
Definition: SI4844.h:106
uint8_t ERR
Definition: SI4844.h:170
uint8_t RESERVED
Definition: SI4844.h:169
uint8_t d3
Definition: SI4844.h:149
uint8_t HOSTRST
Definition: SI4844.h:142
uint8_t BANDMODE
Definition: SI4844.h:145
uint8_t d4
Definition: SI4844.h:148
si4844_get_status refined
Definition: SI4844.h:158
uint8_t raw
Definition: SI4844.h:220
uint8_t raw
Definition: SI4844.h:83
uint8_t STATION
Definition: SI4844.h:139
uint8_t BANDIDX
Definition: SI4844.h:144
uint8_t CTS
Definition: SI4844.h:171
uint8_t FWMINOR
Definition: SI4844.h:174
uint8_t d2
Definition: SI4844.h:146
uint8_t INFORDY
Definition: SI4844.h:140
uint8_t CTS
Definition: SI4844.h:143
uint8_t BCFG0
Definition: SI4844.h:136
void setAmSoftMuteMaxAttenuation(uint8_t value)
Sets AM Soft Mute Max Attenuation..
Definition: SI4844.cpp:855
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:878
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:302
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:891
void setAmSoftMuteSnrThreshold(uint8_t value)
Sets the SNR threshold to engage soft mute.
Definition: SI4844.cpp:962
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:906
bool getDataStatusInterruptFromDevice()
Get the Data Status From Device.
Definition: SI4844.h:309
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:376
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:976
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:919
void setVolume(byte)
Sets the volume level.
Definition: SI4844.cpp:452
void setCustomBand(uint8_t bandIndex, uint16_t botton, uint16_t top, uint8_t bandSpace)
This method allows you to customize the frequency range of a band.
Definition: SI4844.cpp:744
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:949
char * getStereoIndicator()
Get the Stereo Indicator.
Definition: SI4844.h:391
void sendCommand(uint8_t cmd, int parameter_size, const uint8_t *parameter)
Sends a given command to the SI4844 device.
Definition: SI4844.cpp:96
void setCustomBand(uint8_t bandIndex, uint16_t botton, uint16_t top, uint8_t bandSpace, uint8_t dfband, uint8_t uni_am, uint8_t tvreq)
This method allows you to customize the frequency range of a band.
Definition: SI4844.cpp:802
char * getBandMode()
Get the Band Mode.
Definition: SI4844.h:384
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:866
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:991
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:935
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:1005
uint8_t scanI2CBus(uint8_t *device, uint8_t limit)
Scans the I2C bus and returns the addresses of the devices found.
Definition: SI4844.cpp:1021