64 #define DEBUG_STR(txt) if (_debugEnabled) { Serial.println(txt); }
67 #define DEBUG_VAL(label, val) if (_debugEnabled) { Serial.print(label); Serial.print(':'); Serial.println(val); }
68 #define DEBUG_VALX(label, val) if (_debugEnabled) { Serial.print(label); Serial.print(':'); Serial.println(val, HEX); }
71 #define DEBUG_FUNC0(fn) if (_debugEnabled) { Serial.print(fn); Serial.println("()"); }
74 #define DEBUG_FUNC1(fn, p1) if (_debugEnabled) { Serial.print(fn); Serial.print('('); Serial.print(p1); Serial.println(')'); }
77 #define DEBUG_FUNC1X(fn, p1) if (_debugEnabled) { Serial.print(fn); Serial.print("(0x"); Serial.print(p1, HEX); Serial.println(')'); }
80 #define DEBUG_FUNC2(fn, p1, p2) if (_debugEnabled) { Serial.print(fn); Serial.print('('); Serial.print(p1); Serial.print(", "); Serial.print(p2); Serial.println(')'); }
83 #define DEBUG_FUNC2X(fn, p1, p2) if (_debugEnabled) { Serial.print(fn); Serial.print("(0x"); Serial.print(p1, HEX); Serial.print(", 0x"); Serial.print(p2, HEX); Serial.println(')'); }
90 typedef void(*
receiveRDSFunction)(uint16_t block1, uint16_t block2, uint16_t block3, uint16_t block4);
149 virtual void setVolume(uint8_t newVolume);
152 virtual void setMute(
bool switchOn);
175 virtual void seekUp(
bool toNextSender =
true);
176 virtual void seekDown(
bool toNextSender =
true);
178 virtual void setMono(
bool switchOn);
bool softmute
Definition: radio.h:130
void int16_to_s(char *s, uint16_t val)
Prints a register as 4 character hexadecimal code with leading zeros.
Definition: radio.cpp:284
bool active
receiving is active.
Definition: radio.h:117
virtual uint8_t getVolume()
Retrieve the current output volume in the range 0..15.
Definition: radio.cpp:59
RADIO_BAND
Definition: radio.h:98
virtual RADIO_BAND getBand()
Retrieve the current band setting.
Definition: radio.cpp:160
Maximal band enumeration value.
Definition: radio.h:106
virtual void attachReceiveRDS(receiveRDSFunction newFunction)
Register a RDS processor function.
Definition: radio.cpp:211
virtual void setBassBoost(bool switchOn)
Control the bass boost mode of the radio chip.
Definition: radio.cpp:69
RADIO()
create a new object from this class.
Definition: radio.cpp:35
virtual RADIO_FREQ getFrequencyStep()
Get resolution of the current selected band.
Definition: radio.cpp:164
RADIO_FREQ _freqHigh
Highest frequency of the current selected band.
Definition: radio.h:218
uint8_t volume
Definition: radio.h:128
FM band 87.5 – 108 MHz (USA, Europe) selected.
Definition: radio.h:101
bool mute
Definition: radio.h:129
virtual void debugEnable(bool enable=true)
Enable sending debug information to the Serial port.
Definition: radio.cpp:245
virtual bool init()
initialize library and the chip.
Definition: radio.cpp:41
virtual bool getMute()
Retrieve the current mute mode setting.
Definition: radio.cpp:104
virtual void debugRadioInfo()
Print out all radio information.
Definition: radio.cpp:251
bool tuned
A stable frequency is tuned.
Definition: radio.h:120
virtual RADIO_FREQ getFrequency(void)
Retrieve the current tuned frequency.
Definition: radio.cpp:161
virtual void term()
terminate all radio functions.
Definition: radio.cpp:48
virtual void setSoftMute(bool switchOn)
Control the softmute mode (mute on low signals) of the radio chip.
Definition: radio.cpp:112
virtual void debugStatus()
Send debug information about actual available chip functionality and other internal things...
Definition: radio.cpp:276
virtual void clearRDS()
Clear RDS data in the attached RDS Receiver by sending 0,0,0,0.
Definition: radio.cpp:203
virtual void seekDown(bool toNextSender=true)
Start a seek downwards from the current frequency.
Definition: radio.cpp:158
uint16_t RADIO_FREQ
Definition: radio.h:112
FM band 76 – 108 MHz (Japan, Worldwide) selected.
Definition: radio.h:102
virtual void debugAudioInfo()
Print out all audio information.
Definition: radio.cpp:264
bool _softMute
Last set softMute effect.
Definition: radio.h:212
virtual void setBandFrequency(RADIO_BAND newBand, RADIO_FREQ newFreq)
Set Band and Frequency in one call.
Definition: radio.cpp:151
uint8_t rssi
Radio Station Strength Information.
Definition: radio.h:118
bool _mono
Last set mono effect.
Definition: radio.h:210
virtual bool getMono()
Retrieve the current mono mode setting.
Definition: radio.cpp:90
virtual void setBand(RADIO_BAND newBand)
Set the current band.
Definition: radio.cpp:128
RADIO_FREQ _freqLow
Lowest frequency of the current selected band.
Definition: radio.h:217
const uint8_t MAXVOLUME
max volume level for all radio implementations.
Definition: radio.h:140
bool rds
RDS information is available.
Definition: radio.h:119
receiveRDSFunction _sendRDS
Registered RDS Function that is called on new available data.
Definition: radio.h:221
KW band selected.
Definition: radio.h:104
virtual void setVolume(uint8_t newVolume)
Control the volume output of the radio chip in the range 0..15.
Definition: radio.cpp:54
virtual void seekUp(bool toNextSender=true)
Start a seek upwards from the current frequency.
Definition: radio.cpp:157
bool _debugEnabled
Set by debugEnable() and controls debugging functionality.
Definition: radio.h:206
virtual void formatFrequency(char *s, uint8_t length)
Format the current frequency for display and printing.
Definition: radio.cpp:218
RADIO_BAND _band
Last set band.
Definition: radio.h:214
uint8_t _volume
Last set volume level.
Definition: radio.h:208
Library to control radio chips in general. This library acts as a base library for the chip specific ...
Definition: radio.h:137
AM band selected.
Definition: radio.h:103
virtual void setMute(bool switchOn)
Control the mute mode of the radio chip.
Definition: radio.cpp:98
bool mono
Mono mode is on.
Definition: radio.h:121
virtual void setMono(bool switchOn)
Control the mono mode of the radio chip.
Definition: radio.cpp:84
RADIO_FREQ _freq
Last set frequency.
Definition: radio.h:215
void(* receiveRDSFunction)(uint16_t block1, uint16_t block2, uint16_t block3, uint16_t block4)
callback function for passing RDS data.
Definition: radio.h:90
bool _bassBoost
Last set bass Boost effect.
Definition: radio.h:209
A structure that contains information about the radio features from the chip.
Definition: radio.h:116
virtual bool getBassBoost()
Retrieve the current bass boost mode setting.
Definition: radio.cpp:76
bool _mute
Last set mute effect.
Definition: radio.h:211
void _printHex4(uint16_t val)
Prints a register as 4 character hexadecimal code with leading zeros.
Definition: radio.cpp:301
virtual RADIO_FREQ getMinFrequency()
Get the minimum frequency of the current selected band.
Definition: radio.cpp:162
virtual RADIO_FREQ getMaxFrequency()
Get the maximum frequency of the current selected band.
Definition: radio.cpp:163
RADIO_FREQ _freqSteps
Resulution of the tuner.
Definition: radio.h:219
virtual void getAudioInfo(AUDIO_INFO *info)
Retrieve some information about the current audio function of the chip.
Definition: radio.cpp:184
bool bassBoost
Definition: radio.h:131
virtual void getRadioInfo(RADIO_INFO *info)
Retrieve some information about the current radio function of the chip.
Definition: radio.cpp:169
virtual void setFrequency(RADIO_FREQ newF)
Start using the new frequency for receiving.
Definition: radio.cpp:146
a structure that contains information about the audio features
Definition: radio.h:127
bool stereo
Stereo audio is available.
Definition: radio.h:122
virtual void checkRDS()
Check if RDS Data is available and good.
Definition: radio.cpp:198
virtual bool getSoftMute()
Retrieve the current soft mute mode setting.
Definition: radio.cpp:118
No band selected.
Definition: radio.h:99