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 SI4844, 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
43#define FM_SOFT_MUTE_RATE 0x1300
44#define FM_SOFT_MUTE_SLOPE 0x1301
45#define FM_STEREO_IND_BLEND_THRESHOLD 0x1207
46#define FM_BLEND_RSSI_STEREO_THRESHOLD 0x1800
47#define FM_BLEND_RSSI_MONO_THRESHOLD 0x1801
48
49#define REFCLK_FREQ 0x0201
50#define REFCLK_PRESCALE 0x0202
51
52
53/** @defgroup GA1 Union and Structures
54 * @section GA1
55 *
56 * @brief SI4844 data representation
57 *
58 * @details The goal of this approach is separating data from code.
59 * The SI4844 works with many internal data that can be represented by data structure
60 * or defined data type in C/C++.
61 */
62
63
64/**
65 * @ingroup GA1
66 * @brief Configures band parameter
67 * @details Represents searching for a valid frequency data type.
68 * @see Page 18 of the Si48XX ATDD PROGRAMMING GUIDE - AN610
69 */
70
71typedef union {
72 struct {
73 uint8_t BANDIDX:6; // Band Index to Set. See Table 8. Pre-defined Band Table
74 uint8_t XOWAIT: 1; // Crystal Oscillator Stabilization Wait Time After Reset. 0 = 600 ms; 1 = 900 ms
75 uint8_t XOSCEN: 1; // Crystal Oscillator Enable. 0 = Use external RCLK; 1 = Use crystal oscillator (XTALI and XTALO with external 32.768 kHz crystal).
76 } refined;
78} si4844_arg_band_index;
79
80/**
81 * @ingroup GA1
82 * @brief Configures all SI48XX parameters
83 * @details Represents searching for a valid frequency data type.
84 * @see Page 18 of the Si48XX ATDD PROGRAMMING GUIDE - AN610
85 */
86typedef union {
87 struct
88 {
89 uint8_t BANDIDX : 6; // Band Index to Set. See Table 8. Pre-defined Band Table
90 uint8_t XOWAIT : 1; // Crystal Oscillator Stabilization Wait Time After Reset. 0 = 600 ms; 1 = 900 ms
91 uint8_t XOSCEN : 1; // Crystal Oscillator Enable. 0 = Use external RCLK; 1 = Use crystal oscillator (XTALI and XTALO with external 32.768 kHz crystal).
92 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)
93 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)
94 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)
95 uint8_t DUMMY : 5; // Set it to 00000
96 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)
97 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
98 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
99 } refined;
101} SI4844_arg_band;
102
103/**
104 * @ingroup GA1
105 * @brief Status
106 * @details Represents searching for a valid frequency data type.
107 */
108typedef union {
109 struct
110 {
111 uint8_t D_0 : 1;
112 uint8_t D_1 : 1;
113 uint8_t D_2 : 1;
114 uint8_t D_3 : 1;
115 uint8_t D_4 : 1;
116 uint8_t ERR : 1; //!< 1 = Error.
117 uint8_t CTS : 1; //!< 0 = Wait before sending next command; 1 = Clear to send next command.
118 } refined;
120} si4844_status;
121
122/**
123 * @ingroup GA1
124 * @brief Device Status
125 * @details The structure below represents the four bytes response got by command ATDD_GET_STATUS
126 * @see PROGRAMMING GUIDE, pages 14 and 15
127 */
128typedef struct
129{
130 uint8_t BCFG0 : 1; // Bit 0
131 uint8_t BCFG1 : 1; // bit 1
132 uint8_t STEREO : 1; // bit 2
133 uint8_t STATION : 1; // bit 3
134 uint8_t INFORDY : 1; // bit 4
135 uint8_t HOSTPWRUP : 1; // bit 5
136 uint8_t HOSTRST : 1; // bit 6
137 uint8_t CTS : 1; // bit 7
138 uint8_t BANDIDX : 6; // Form bit 0 to 5
139 uint8_t BANDMODE : 2; // From bit 6 to 7
140 uint8_t d2 : 4; // Frequency digit 2
141 uint8_t d1 : 4; // Frequency digit 1
142 uint8_t d4 : 4; // Frequency digit 4
143 uint8_t d3 : 4; // frequency digit 3
144} si4844_get_status;
145
146/**
147 * @ingroup GA1
148 * @brief Status response
149 * @see See Si48XX ATDD PROGRAMMING GUIDE, pages 14 and 15
150*/
151typedef union {
152 si4844_get_status refined;
154} si4844_status_response;
155
156/**
157 * @ingroup GA1
158 * @brief Firmware Information
159 * @see Si48XX ATDD PROGRAMMING GUIDE, page 22.
160 */
161typedef struct
162{
163 uint8_t RESERVED : 6; // Bit 0 to 5
164 uint8_t ERR : 1; // bit 6
165 uint8_t CTS : 1; // bit 2
166 uint8_t PN; // Final 2 digits of Part Number (HEX).
167 uint8_t FWMAJOR; // Firmware Major Revision (ASCII).
168 uint8_t FWMINOR; // Firmware Minor Revision (ASCII).
169 uint8_t CMPMAJOR; // Component Major Revision (ASCII).
170 uint8_t CMPMINOR; // Component Minor Revision (ASCII).
171 uint8_t CHIPREV; // Chip Revision (ASCII).
172} si4844_firmware_info;
173
174/**
175 * @brief Firmware Response
176 *
177 */
178typedef union {
179 si4844_firmware_info refined;
181} si4844_firmware_response;
182
183/**
184 * @ingroup GA1
185 * @brief Audio Mode
186 */
187typedef union {
188 struct
189 {
190 uint8_t AUDIOMODE : 2;
191 uint8_t FM_MONO : 1;
192 uint8_t ADJPT_ATTN : 1;
193 uint8_t ADJPT_STEO : 1;
194 uint8_t Reserved : 2;
195 uint8_t OPCODE : 1;
196 } arg1;
198} si4844_audiomode;
199
200/**
201 * @ingroup GA1
202 * @brief Audio Status Response
203 */
204typedef union {
205 struct {
206 uint8_t AUDIOMODE:2;
207 uint8_t FM_MONO:1;
208 uint8_t ADJPT_ATTN:1;
209 uint8_t ADJPT_STEO:1;
210 uint8_t Reserved:1;
211 uint8_t ERR:1;
212 uint8_t CTS:1;
213 } status;
215} si4844_audiomode_status_response;
216
217/**
218 * @brief Data type to deal with SET_PROPERTY command
219 *
220 * @details Property Data type (help to deal with SET_PROPERTY command on si473X)
221 */
222typedef union {
223 struct
224 {
225 uint8_t byteLow;
226 uint8_t byteHigh;
227 } raw;
229} si4844_property;
230
231/**
232 * @brief Interrupt status
233 * @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.
234 * @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).
235 */
236volatile static bool data_from_device;
237
238/**
239 * @brief Library handle interrupt
240 * @details Handling interruptions.
241 * @details Whenever the status of the ATDD changes, a hardware interrupt is triggered. For example, when you move the tuner
242 * @details potenciometer, the ATDD sends a signal to the Arduino pin (INTERRUPT_PIN). The same is true when the ATDD is capturing
243 * @details mono FM signal and has switched to stereo.
244 * @details You can control the interrupt process via your sketch intead of this library.
245 * @see setStatusInterruptFromDevice, getStatusInterruptFromDevice, setup
246 */
247static void interrupt_hundler()
248{
249 data_from_device = true;
250}
251
252
253/**
254 * @brief SI4844 Class
255 *
256 * @details This class implements all functions to help you to control the Si4844 devices.
257 */
258
260{
261
262private:
263
264 si4844_status_response status_response;
265 si4844_firmware_response firmware_response;
266 uint16_t resetPin;
267 uint16_t interruptPin;
268 uint8_t currentBand = 0;
269
270 uint8_t xoscen = 1;
271 uint8_t xowait = 0;
272
273
274 inline void setClockLow(void) { Wire.setClock(10000); };
275 inline void setClockHigh(void) { Wire.setClock(50000); };
276 inline void waitInterrupt(void);
277 inline bool isClearToSend(void);
278 inline void waitToSend(void);
279
280 // SI4844 band description (FM = 0; AM = 1; SW = 2)
281 const char *bandmode_table[3] = {"FM", "AM", "SW"};
282 const char *stereo_indicator_table[2] = {"Off","On "};
283
284 uint8_t volume = 30;
285 uint8_t bassTreble = 4;
286
287public :
288 /**
289 * @ingroup GB
290 * @brief Set the Data Status From Device
291 * @details It is a flag that means the device triggered an interrupt.
292 * @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.
293 * @details It is very useful when the user wants to control the interrupt instead of give this control to the library.
294 * @param value true or false
295 */
296 inline void setStatusInterruptFromDevice( bool value ) { data_from_device = value; };
297 /**
298 * @ingroup GB
299 * @brief Get the Data Status From Device
300 * @details It returns true when the device has triggered an interrupt.
301 * @return true or false
302 */
303 inline bool getDataStatusInterruptFromDevice() { return data_from_device; };
304
305
306 void setProperty(uint16_t propertyNumber, uint16_t parameter);
308 void sendCommand(uint8_t cmd, int parameter_size, const uint8_t *parameter);
309 void getCommandResponse(int response_size, uint8_t *response);
310
311 void setup(uint16_t resetPin, int interruptPin, byte defaultBand);
312 void debugDevice(uint16_t resetPin, uint16_t interruptPin, uint8_t defaultBand, void (*showFunc)(char *msg));
313 void reset(void );
314 void setBand(byte);
315
316 void changeVolume(char); // deprecated
317 void volumeUp(void);
318 void volumeDown(void);
319 void setVolume(byte);
320 void setBassTreble(uint8_t bass_treble);
321 void bassTrebleUp();
322 void bassTrebleDown();
323 void audioMute(uint8_t value);
324 void setAudioMute(bool on);
325
326 void setAmSoftMuteMaxAttenuation(uint8_t value);
327 void setFmSoftMuteMaxAttenuation(uint8_t value);
328 void setFmDeemphasis(uint8_t value);
329 void setFmSoftMuteRate(uint8_t value);
330 void setFmSoftMuteSlope(uint8_t value);
331 void setBlendThresholdStereoIndicator(uint16_t value);
332
333 void setCrystalOscillatorEnable(uint8_t XOSCEN );
335 void setReferenceClockFrequency(uint16_t value);
336 void setReferenceClockPrescaler(uint16_t value);
337
338
339
340 si4844_audiomode_status_response
341 setAudioMode(uint8_t audiomode, uint8_t fm_mono, uint8_t adjpt_attn, uint8_t adjpt_steo, uint8_t opcode);
342
343 si4844_status_response *getStatus(void);
344 si4844_firmware_response *getFirmware(void);
345 // customize the frequency range of a band
346 void setCustomBand(uint8_t bandIndex, uint16_t botton, uint16_t top, uint8_t bandSpace);
347 void setCustomBand(uint8_t bandIndex, uint16_t botton, uint16_t top, uint8_t bandSpace, uint8_t dfband, uint8_t uni_am, uint8_t tvreq );
348
349 void setDefaultBandIndx( uint8_t bandidx);
350
351 void powerDown(void);
352 void powerUp(void);
353
354 float getFrequency(void);
355 bool hasStatusChanged(void);
356 void resetStatus(void);
357
358 /**
359 * @ingroup GB
360 * @brief Gets the current audio volume level
361 *
362 * @return Volume level
363 */
364 inline uint8_t getVolume() {return volume; };
366
367 /**
368 * @ingroup GB
369 * @brief Get the Band Mode
370 * @return char* "FM", "AM" or "SW"
371 */
372 inline char * getBandMode(){ return (char *) bandmode_table[status_response.refined.BANDMODE]; };
373
374 /**
375 * @ingroup GB
376 * @brief Get the Stereo Indicator
377 * @return char* "ON" or "OFF"
378 */
379 inline char * getStereoIndicator(){ return (char *) stereo_indicator_table[status_response.refined.STATION]; };
380
381
382 inline uint16_t getStatusBCFG0() { return status_response.refined.BCFG0; };
383 inline uint16_t getStatusBCFG1() { return status_response.refined.BCFG1; };
384 inline uint16_t getStatusStereo() { return status_response.refined.STEREO; };
385 inline uint16_t getStatusStationIndicator() { return status_response.refined.STATION; };
386 inline uint16_t getStatusInformationReady() { return status_response.refined.INFORDY; };
387 inline uint16_t getStatusHostPowerUp() { return status_response.refined.HOSTPWRUP; };
388 inline uint16_t getStatusHostReset() { return status_response.refined.HOSTRST; };
389 inline uint16_t getStatusBandMode() { return status_response.refined.BANDMODE; };
390 inline uint16_t getStatusBandIndex() { return status_response.refined.BANDIDX; };
391 inline uint16_t getStatusCTS() { return status_response.refined.CTS; };
392
393
394 inline uint16_t getFirmwareReserved() { return firmware_response.refined.RESERVED; };
395 inline uint16_t getFirmwareErr() { return firmware_response.refined.ERR; };
396 inline uint16_t getFirmwareCTS() { return firmware_response.refined.CTS; };
397 inline uint16_t getFirmwarePartNumber() { return firmware_response.refined.PN; };
398 inline uint16_t getFirmwareMajorRevision() { return firmware_response.refined.FWMAJOR; };
399 inline uint16_t getFirmwareMinorRevision() { return firmware_response.refined.FWMINOR; };
400 inline uint16_t getFirmwareComponentMajorRevision() { return firmware_response.refined.CMPMAJOR; };
401 inline uint16_t getFirmwareComponentMinorRevision() { return firmware_response.refined.CMPMINOR; };
402 inline uint16_t getFirmwareChipRevision() { return firmware_response.refined.CHIPREV; };
403
404 void setResetPin(uint16_t resetPin);
405 void setInterruptPin(int interruptPin);
406
408 bool detectDevice();
409
410};
#define FM_SOFT_MUTE_RATE
Definition: SI4844.h:43
uint16_t value
Definition: SI4844.h:228
#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:179
uint8_t raw[9]
Definition: SI4844.h:180
#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 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:260
uint16_t getFirmwareComponentMajorRevision()
Definition: SI4844.h:400
uint16_t getStatusBCFG0()
Definition: SI4844.h:382
uint16_t getStatusHostPowerUp()
Definition: SI4844.h:387
uint16_t getFirmwareCTS()
Definition: SI4844.h:396
uint16_t getStatusBandMode()
Definition: SI4844.h:389
uint16_t getStatusCTS()
Definition: SI4844.h:391
uint16_t getStatusBandIndex()
Definition: SI4844.h:390
uint16_t getStatusStationIndicator()
Definition: SI4844.h:385
uint16_t getFirmwareChipRevision()
Definition: SI4844.h:402
uint16_t getFirmwareErr()
Definition: SI4844.h:395
uint16_t getFirmwareMinorRevision()
Definition: SI4844.h:399
uint16_t getStatusStereo()
Definition: SI4844.h:384
uint16_t getStatusHostReset()
Definition: SI4844.h:388
uint16_t getFirmwareComponentMinorRevision()
Definition: SI4844.h:401
uint16_t getFirmwareMajorRevision()
Definition: SI4844.h:398
uint16_t getFirmwarePartNumber()
Definition: SI4844.h:397
void setResetPin(uint16_t resetPin)
Definition: SI4844.cpp:180
uint16_t getStatusInformationReady()
Definition: SI4844.h:386
uint16_t getStatusBCFG1()
Definition: SI4844.h:383
void setDefaultBandIndx(uint8_t bandidx)
Definition: SI4844.cpp:276
void setInterruptPin(int interruptPin)
Definition: SI4844.cpp:187
uint16_t getFirmwareReserved()
Definition: SI4844.h:394
uint8_t raw
Definition: SI4844.h:197
uint8_t BCFG1
Definition: SI4844.h:131
uint8_t raw
Definition: SI4844.h:119
uint8_t CHIPREV
Definition: SI4844.h:171
uint8_t CMPMINOR
Definition: SI4844.h:170
uint8_t HOSTPWRUP
Definition: SI4844.h:135
uint8_t FWMAJOR
Definition: SI4844.h:167
uint8_t STEREO
Definition: SI4844.h:132
uint8_t PN
Definition: SI4844.h:166
uint8_t CMPMAJOR
Definition: SI4844.h:169
uint8_t raw[4]
Definition: SI4844.h:153
uint8_t d1
Definition: SI4844.h:141
uint8_t raw[7]
Definition: SI4844.h:100
uint8_t ERR
Definition: SI4844.h:164
uint8_t RESERVED
Definition: SI4844.h:163
uint8_t d3
Definition: SI4844.h:143
uint8_t HOSTRST
Definition: SI4844.h:136
uint8_t BANDMODE
Definition: SI4844.h:139
uint8_t d4
Definition: SI4844.h:142
si4844_get_status refined
Definition: SI4844.h:152
uint8_t raw
Definition: SI4844.h:214
uint8_t raw
Definition: SI4844.h:77
uint8_t STATION
Definition: SI4844.h:133
uint8_t BANDIDX
Definition: SI4844.h:138
uint8_t CTS
Definition: SI4844.h:165
uint8_t FWMINOR
Definition: SI4844.h:168
uint8_t d2
Definition: SI4844.h:140
uint8_t INFORDY
Definition: SI4844.h:134
uint8_t CTS
Definition: SI4844.h:137
uint8_t BCFG0
Definition: SI4844.h:130
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:296
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 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:303
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:364
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:933
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
char * getStereoIndicator()
Get the Stereo Indicator.
Definition: SI4844.h:379
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:372
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:948
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
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:962
uint8_t scanI2CBus(uint8_t *device, uint8_t limit)
Scans the I2C bus and returns the addresses of the devices found.
Definition: SI4844.cpp:978