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