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