Arduino Radio Library  0.9
A set of Arduino libraries to control diverse FM radio receiver chips in Arduino projects.
SI4703.h
Go to the documentation of this file.
1 
18 
19 #ifndef SI4703_h
20 #define SI4703_h
21 
22 #include <arduino.h>
23 #include <Wire.h>
24 
25 #include <radio.h>
26 
27 // ----- library definition -----
28 
29 
31 class SI4703 : public RADIO {
32  public:
33  const uint8_t MAXVOLUME = 15;
34 
35  SI4703();
36 
37  bool init(); // initialize library and the chip.
38  void term(); // terminate all radio functions.
39 
40  // Control of the audio features
41 
42  // Control the volume output of the radio chip
43  void setVolume(uint8_t newVolume);
44 
45  // Control mono/stereo mode of the radio chip
46  void setMono(bool switchOn); // Switch to mono mode.
47 
48  // Control the mute function of the radio chip
49  void setMute(bool switchOn); // Switch to mute mode.
50 
51  // Control the softMute function of the radio chip
52  void setSoftMute(bool switchOn); // Switch to soft mute mode.
53 
54 
55  // Control of the core receiver
56 
57  // Control the frequency
58  void setBand(RADIO_BAND newBand);
59 
60  void setFrequency(RADIO_FREQ newF);
62 
63  void seekUp(bool toNextSender = true); // start seek mode upwards
64  void seekDown(bool toNextSender = true); // start seek mode downwards
65 
66  void checkRDS(); // read RDS data from the current station and process when data available.
67 
68  // ----- combined status functions -----
69 
70  virtual void getRadioInfo(RADIO_INFO *info);
71 
72  virtual void getAudioInfo(AUDIO_INFO *info);
73 
74  // ----- debug Helpers send information to Serial port
75 
76  void debugScan(); // Scan all frequencies and report a status
77  void debugStatus(); // Report Info about actual Station
78 
79  // ----- read/write registers of the chip
80 
81  void _readRegisters(); // read all status & data registers
82  void _saveRegisters(); // Save writable registers back to the chip
83 
84  private:
85  // ----- local variables
86 
87  // store the current values of the 16 chip internal 16-bit registers
88  uint16_t registers[16];
89 
90  // ----- low level communication to the chip using I2C bus
91 
92  void _write16(uint16_t val); // Write 16 Bit Value on I2C-Bus
93  uint16_t _read16(void);
94 
95  void _seek(bool seekUp = true);
96  void _waitEnd();
97 };
98 
99 #endif
void _saveRegisters()
Definition: SI4703.cpp:347
void seekDown(bool toNextSender=true)
Start a seek downwards from the current frequency.
Definition: SI4703.cpp:318
RADIO_FREQ getFrequency(void)
Retrieve the real frequency from the chip after automatic tuning.
Definition: SI4703.cpp:280
virtual void getRadioInfo(RADIO_INFO *info)
Retrieve some information about the current radio function of the chip.
Definition: SI4703.cpp:393
void checkRDS()
Check if RDS Data is available and good.
Definition: SI4703.cpp:418
RADIO_BAND
Definition: radio.h:98
uint16_t _read16(void)
Definition: SI4703.cpp:383
void setFrequency(RADIO_FREQ newF)
Change the frequency in the chip.
Definition: SI4703.cpp:293
Library header file for the radio libraries to control radio chips.
void _readRegisters()
Definition: SI4703.cpp:326
virtual void getAudioInfo(AUDIO_INFO *info)
Retrieve some information about the current audio function of the chip.
Definition: SI4703.cpp:407
void setVolume(uint8_t newVolume)
Control the volume output of the radio chip in the range 0..15.
Definition: SI4703.cpp:191
void debugStatus()
Send the current values of all registers to the Serial port.
Definition: SI4703.cpp:435
void seekUp(bool toNextSender=true)
Start a seek upwards from the current frequency.
Definition: SI4703.cpp:311
const uint8_t MAXVOLUME
max volume level for radio implementations.
Definition: SI4703.h:33
uint16_t RADIO_FREQ
Definition: radio.h:112
SI4703()
Definition: SI4703.cpp:112
void _seek(bool seekUp=true)
Seeks out the next available station.
Definition: SI4703.cpp:450
bool init()
initialize library and the chip.
Definition: SI4703.cpp:116
uint16_t registers[16]
Definition: SI4703.h:88
void setMute(bool switchOn)
Switch mute mode.
Definition: SI4703.cpp:220
void _write16(uint16_t val)
Definition: SI4703.cpp:376
void setSoftMute(bool switchOn)
Switch soft mute mode.
Definition: SI4703.cpp:237
Library to control radio chips in general. This library acts as a base library for the chip specific ...
Definition: radio.h:137
void setBand(RADIO_BAND newBand)
Set the current band.
Definition: SI4703.cpp:257
void term()
terminate all radio functions.
Definition: SI4703.cpp:183
A structure that contains information about the radio features from the chip.
Definition: radio.h:116
Library to control the SI4703 radio chip.
Definition: SI4703.h:31
void setMono(bool switchOn)
Control the mono mode of the radio chip.
Definition: SI4703.cpp:204
a structure that contains information about the audio features
Definition: radio.h:127
void debugScan()
void _waitEnd()
wait until the current seek and tune operation is over.
Definition: SI4703.cpp:470