![]() |
Arduino Radio Library
0.9
A set of Arduino libraries to control diverse FM radio receiver chips in Arduino projects.
|
Library to control radio chips in general. This library acts as a base library for the chip specific implementations. More...
#include <radio.h>
Public Member Functions | |
| RADIO () | |
| create a new object from this class. More... | |
| virtual bool | init () |
| initialize library and the chip. More... | |
| virtual void | term () |
| terminate all radio functions. More... | |
| virtual void | setVolume (uint8_t newVolume) |
| Control the volume output of the radio chip in the range 0..15. More... | |
| virtual uint8_t | getVolume () |
| Retrieve the current output volume in the range 0..15. More... | |
| virtual void | setMute (bool switchOn) |
| Control the mute mode of the radio chip. More... | |
| virtual bool | getMute () |
| Retrieve the current mute mode setting. More... | |
| virtual void | setSoftMute (bool switchOn) |
| Control the softmute mode (mute on low signals) of the radio chip. More... | |
| virtual bool | getSoftMute () |
| Retrieve the current soft mute mode setting. More... | |
| virtual void | setBassBoost (bool switchOn) |
| Control the bass boost mode of the radio chip. More... | |
| virtual bool | getBassBoost () |
| Retrieve the current bass boost mode setting. More... | |
| virtual RADIO_FREQ | getMinFrequency () |
| Get the minimum frequency of the current selected band. More... | |
| virtual RADIO_FREQ | getMaxFrequency () |
| Get the maximum frequency of the current selected band. More... | |
| virtual RADIO_FREQ | getFrequencyStep () |
| Get resolution of the current selected band. More... | |
| virtual void | setBand (RADIO_BAND newBand) |
| Set the current band. More... | |
| virtual RADIO_BAND | getBand () |
| Retrieve the current band setting. More... | |
| virtual void | setFrequency (RADIO_FREQ newF) |
| Start using the new frequency for receiving. More... | |
| virtual RADIO_FREQ | getFrequency (void) |
| Retrieve the current tuned frequency. More... | |
| virtual void | setBandFrequency (RADIO_BAND newBand, RADIO_FREQ newFreq) |
| Set Band and Frequency in one call. More... | |
| virtual void | seekUp (bool toNextSender=true) |
| Start a seek upwards from the current frequency. More... | |
| virtual void | seekDown (bool toNextSender=true) |
| Start a seek downwards from the current frequency. More... | |
| virtual void | setMono (bool switchOn) |
| Control the mono mode of the radio chip. More... | |
| virtual bool | getMono () |
| Retrieve the current mono mode setting. More... | |
| virtual void | getRadioInfo (RADIO_INFO *info) |
| Retrieve some information about the current radio function of the chip. More... | |
| virtual void | getAudioInfo (AUDIO_INFO *info) |
| Retrieve some information about the current audio function of the chip. More... | |
| virtual void | checkRDS () |
| Check if RDS Data is available and good. More... | |
| virtual void | clearRDS () |
| Clear RDS data in the attached RDS Receiver by sending 0,0,0,0. More... | |
| virtual void | attachReceiveRDS (receiveRDSFunction newFunction) |
| Register a RDS processor function. More... | |
| virtual void | formatFrequency (char *s, uint8_t length) |
| Format the current frequency for display and printing. More... | |
| virtual void | debugEnable (bool enable=true) |
| Enable sending debug information to the Serial port. More... | |
| virtual void | debugRadioInfo () |
| Print out all radio information. More... | |
| virtual void | debugAudioInfo () |
| Print out all audio information. More... | |
| virtual void | debugStatus () |
| Send debug information about actual available chip functionality and other internal things. More... | |
Public Attributes | |
| const uint8_t | MAXVOLUME = 15 |
| max volume level for all radio implementations. More... | |
Protected Member Functions | |
| void | _printHex4 (uint16_t val) |
| Prints a register as 4 character hexadecimal code with leading zeros. More... | |
Protected Attributes | |
| bool | _debugEnabled |
| Set by debugEnable() and controls debugging functionality. More... | |
| uint8_t | _volume |
| Last set volume level. More... | |
| bool | _bassBoost |
| Last set bass Boost effect. More... | |
| bool | _mono |
| Last set mono effect. More... | |
| bool | _mute |
| Last set mute effect. More... | |
| bool | _softMute |
| Last set softMute effect. More... | |
| RADIO_BAND | _band |
| Last set band. More... | |
| RADIO_FREQ | _freq |
| Last set frequency. More... | |
| RADIO_FREQ | _freqLow |
| Lowest frequency of the current selected band. More... | |
| RADIO_FREQ | _freqHigh |
| Highest frequency of the current selected band. More... | |
| RADIO_FREQ | _freqSteps |
| Resulution of the tuner. More... | |
| receiveRDSFunction | _sendRDS |
| Registered RDS Function that is called on new available data. More... | |
Private Member Functions | |
| void | int16_to_s (char *s, uint16_t val) |
More... | |
Library to control radio chips in general. This library acts as a base library for the chip specific implementations.
| RADIO::RADIO | ( | ) |
create a new object from this class.
Setup the radio object and initialize private variables to 0. Don't change the radio chip (yet).
|
protected |
Prints a register as 4 character hexadecimal code with leading zeros.
|
virtual |
Register a RDS processor function.
|
virtual |
|
virtual |
Clear RDS data in the attached RDS Receiver by sending 0,0,0,0.
Send a 0.0.0.0 to the RDS receiver if there is any attached. This is to point out that there is a new situation and all existing data should be invalid from now on.
|
virtual |
Print out all audio information.
|
virtual |
Enable sending debug information to the Serial port.
|
virtual |
Print out all radio information.
|
virtual |
|
virtual |
Format the current frequency for display and printing.
|
virtual |
|
virtual |
Retrieve the current band setting.
|
virtual |
Retrieve the current bass boost mode setting.
Retrieve the current bass boost mode setting. The base implementation returns only the value in the internal variable.
|
virtual |
|
virtual |
Get resolution of the current selected band.
|
virtual |
Get the maximum frequency of the current selected band.
|
virtual |
Get the minimum frequency of the current selected band.
|
virtual |
Retrieve the current mono mode setting.
The base implementation returns only the value in the internal variable.
|
virtual |
Retrieve the current mute mode setting.
The base implementation returns only the value in the internal variable.
|
virtual |
|
virtual |
Retrieve the current soft mute mode setting.
The base implementation returns only the value in the internal variable.
|
virtual |
Retrieve the current output volume in the range 0..15.
|
virtual |
|
private |
Prints a register as 4 character hexadecimal code with leading zeros.
Converts a int16 number to a string, similar to itoa, but using the format "00000".
This is a special format routine used to format frequencies as strings with leading blanks. up to 5 digits only (" 0".."99999") *s MUST be able to hold the characters
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Set Band and Frequency in one call.
|
virtual |
Control the bass boost mode of the radio chip.
Control the bass boost mode of the radio chip. The base implementation ony stores the value to the internal variable.
| switchOn | true to switch bassBoost mode on, false to switch bassBoost mode off. |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
protected |
Last set band.
|
protected |
Last set bass Boost effect.
|
protected |
Set by debugEnable() and controls debugging functionality.
|
protected |
Last set frequency.
|
protected |
Highest frequency of the current selected band.
|
protected |
Lowest frequency of the current selected band.
|
protected |
Resulution of the tuner.
|
protected |
Last set mono effect.
|
protected |
Last set mute effect.
|
protected |
Registered RDS Function that is called on new available data.
|
protected |
Last set softMute effect.
|
protected |
Last set volume level.
| const uint8_t RADIO::MAXVOLUME = 15 |
max volume level for all radio implementations.
1.8.8