Arduino Radio Library  0.9
A set of Arduino libraries to control diverse FM radio receiver chips in Arduino projects.
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
RDA5807M Class Reference

Library to control the RDA5807M radio chip. More...

#include <RDA5807M.h>

Inheritance diagram for RDA5807M:
RADIO

Public Member Functions

 RDA5807M ()
 
bool init ()
 initialize library and the chip. More...
 
void term ()
 terminate all radio functions. More...
 
void setVolume (uint8_t newVolume)
 Control the volume output of the radio chip in the range 0..15. More...
 
void setBassBoost (bool switchOn)
 Control the bass boost mode of the radio chip. More...
 
void setMono (bool switchOn)
 Control the mono mode of the radio chip. More...
 
void setMute (bool switchOn)
 Control the mute mode of the radio chip. More...
 
void setSoftMute (bool switchOn)
 Set the soft mute mode (mute on low signals) on or off. More...
 
void setBand (RADIO_BAND newBand)
 Set the current band. More...
 
void setFrequency (RADIO_FREQ newF)
 Start using the new frequency for receiving. More...
 
RADIO_FREQ getFrequency (void)
 Retrieve the current tuned frequency. More...
 
void seekUp (bool toNextSender=true)
 Start a seek upwards from the current frequency. More...
 
void seekDown (bool toNextSender=true)
 Start a seek downwards from the current frequency. More...
 
void checkRDS ()
 Check if RDS Data is available and good. More...
 
virtual void getRadioInfo (RADIO_INFO *info)
 Retrieve some information about the current radio function of the chip. More...
 
void debugScan ()
 
void debugStatus ()
 Send debug information about actual available chip functionality and other internal things. More...
 
virtual uint8_t getVolume ()
 Retrieve the current output volume in the range 0..15. More...
 
virtual bool getMute ()
 Retrieve the current mute mode setting. More...
 
virtual bool getSoftMute ()
 Retrieve the current soft mute mode setting. 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 RADIO_BAND getBand ()
 Retrieve the current band setting. More...
 
virtual void setBandFrequency (RADIO_BAND newBand, RADIO_FREQ newFreq)
 Set Band and Frequency in one call. More...
 
virtual bool getMono ()
 Retrieve the current mono mode setting. More...
 
virtual void getAudioInfo (AUDIO_INFO *info)
 Retrieve some information about the current audio function of the chip. 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...
 

Public Attributes

const uint8_t MAXVOLUME = 15
 max volume level for 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 _readRegisters ()
 
void _saveRegisters ()
 
void _saveRegister (byte regNr)
 
void _write16 (uint16_t val)
 
uint16_t _read16 (void)
 

Private Attributes

uint16_t registers [16]
 

Detailed Description

Library to control the RDA5807M radio chip.

Constructor & Destructor Documentation

RDA5807M::RDA5807M ( )

Member Function Documentation

void RADIO::_printHex4 ( uint16_t  val)
protectedinherited

Prints a register as 4 character hexadecimal code with leading zeros.

uint16_t RDA5807M::_read16 ( void  )
private
void RDA5807M::_readRegisters ( )
private
void RDA5807M::_saveRegister ( byte  regNr)
private
void RDA5807M::_saveRegisters ( )
private
void RDA5807M::_write16 ( uint16_t  val)
private
void RADIO::attachReceiveRDS ( receiveRDSFunction  newFunction)
virtualinherited

Register a RDS processor function.

void RDA5807M::checkRDS ( )
virtual

Check if RDS Data is available and good.

In the general radio implementation there is no chip for RDS. This function needs to be implemented for radio chips with RDS receiving functionality.

Reimplemented from RADIO.

void RADIO::clearRDS ( )
virtualinherited

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.

void RADIO::debugAudioInfo ( )
virtualinherited

Print out all audio information.

void RADIO::debugEnable ( bool  enable = true)
virtualinherited

Enable sending debug information to the Serial port.

void RADIO::debugRadioInfo ( )
virtualinherited

Print out all radio information.

void RDA5807M::debugScan ( )
void RDA5807M::debugStatus ( )
virtual

Send debug information about actual available chip functionality and other internal things.

The RADIO class doesn't have interesting status information so nothing is sent.

Reimplemented from RADIO.

void RADIO::formatFrequency ( char *  s,
uint8_t  length 
)
virtualinherited

Format the current frequency for display and printing.

void RADIO::getAudioInfo ( AUDIO_INFO info)
virtualinherited

Retrieve some information about the current audio function of the chip.

Return current settings as far as no chip is required. When using the radio::setXXX methods, no chip specific implementation is needed.

Reimplemented in SI4705, SI4703, TEA5767, and newchip.

RADIO_BAND RADIO::getBand ( )
virtualinherited

Retrieve the current band setting.

bool RADIO::getBassBoost ( )
virtualinherited

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.

RADIO_FREQ RDA5807M::getFrequency ( void  )
virtual

Retrieve the current tuned frequency.

Reimplemented from RADIO.

RADIO_FREQ RADIO::getFrequencyStep ( )
virtualinherited

Get resolution of the current selected band.

RADIO_FREQ RADIO::getMaxFrequency ( )
virtualinherited

Get the maximum frequency of the current selected band.

RADIO_FREQ RADIO::getMinFrequency ( )
virtualinherited

Get the minimum frequency of the current selected band.

bool RADIO::getMono ( )
virtualinherited

Retrieve the current mono mode setting.

The base implementation returns only the value in the internal variable.

bool RADIO::getMute ( )
virtualinherited

Retrieve the current mute mode setting.

The base implementation returns only the value in the internal variable.

void RDA5807M::getRadioInfo ( RADIO_INFO info)
virtual

Retrieve some information about the current radio function of the chip.

Retrieve all the information related to the current radio receiving situation.

Reimplemented from RADIO.

bool RADIO::getSoftMute ( )
virtualinherited

Retrieve the current soft mute mode setting.

The base implementation returns only the value in the internal variable.

uint8_t RADIO::getVolume ( )
virtualinherited

Retrieve the current output volume in the range 0..15.

bool RDA5807M::init ( )
virtual

initialize library and the chip.

The RADIO class doesn't implement a concrete chip so nothing has to be initialized.

Reimplemented from RADIO.

void RDA5807M::seekDown ( bool  toNextSender = true)
virtual

Start a seek downwards from the current frequency.

Reimplemented from RADIO.

void RDA5807M::seekUp ( bool  toNextSender = true)
virtual

Start a seek upwards from the current frequency.

Reimplemented from RADIO.

void RDA5807M::setBand ( RADIO_BAND  newBand)
virtual

Set the current band.

Start using the new band for receiving.

Reimplemented from RADIO.

void RADIO::setBandFrequency ( RADIO_BAND  newBand,
RADIO_FREQ  newFreq 
)
virtualinherited

Set Band and Frequency in one call.

void RDA5807M::setBassBoost ( bool  switchOn)
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.

Parameters
switchOntrue to switch bassBoost mode on, false to switch bassBoost mode off.

Reimplemented from RADIO.

void RDA5807M::setFrequency ( RADIO_FREQ  newFreq)
virtual

Start using the new frequency for receiving.

Start using the new frequency for receiving. The new frequency is stored for later retrieval.

Reimplemented from RADIO.

void RDA5807M::setMono ( bool  switchOn)
virtual

Control the mono mode of the radio chip.

The base implementation ony stores the value to the internal variable.

Reimplemented from RADIO.

void RDA5807M::setMute ( bool  switchOn)
virtual

Control the mute mode of the radio chip.

The base implementation ony stores the value to the internal variable.

Reimplemented from RADIO.

void RDA5807M::setSoftMute ( bool  switchOn)
virtual

Set the soft mute mode (mute on low signals) on or off.

Reimplemented from RADIO.

void RDA5807M::setVolume ( uint8_t  newVolume)
virtual

Control the volume output of the radio chip in the range 0..15.

Reimplemented from RADIO.

void RDA5807M::term ( )
virtual

terminate all radio functions.

switch the power off The RADIO class doesn't implement a concrete chip so nothing has to be terminated.

Reimplemented from RADIO.

Member Data Documentation

RADIO_BAND RADIO::_band
protectedinherited

Last set band.

bool RADIO::_bassBoost
protectedinherited

Last set bass Boost effect.

bool RADIO::_debugEnabled
protectedinherited

Set by debugEnable() and controls debugging functionality.

RADIO_FREQ RADIO::_freq
protectedinherited

Last set frequency.

RADIO_FREQ RADIO::_freqHigh
protectedinherited

Highest frequency of the current selected band.

RADIO_FREQ RADIO::_freqLow
protectedinherited

Lowest frequency of the current selected band.

RADIO_FREQ RADIO::_freqSteps
protectedinherited

Resulution of the tuner.

bool RADIO::_mono
protectedinherited

Last set mono effect.

bool RADIO::_mute
protectedinherited

Last set mute effect.

receiveRDSFunction RADIO::_sendRDS
protectedinherited

Registered RDS Function that is called on new available data.

bool RADIO::_softMute
protectedinherited

Last set softMute effect.

uint8_t RADIO::_volume
protectedinherited

Last set volume level.

const uint8_t RDA5807M::MAXVOLUME = 15

max volume level for radio implementations.

uint16_t RDA5807M::registers[16]
private

The documentation for this class was generated from the following files: