Arduino Radio Library
0.9
A set of Arduino libraries to control diverse FM radio receiver chips in Arduino projects.
|
Library to control the SI4705 radio chip. More...
#include <SI4705.h>
Public Member Functions | |
SI4705 () | |
Initialize the extra variables in SI4705. More... | |
bool | init () |
Initialize the library and the chip. More... | |
void | term () |
Terminate all radio functions in the chip. More... | |
void | setVolume (uint8_t newVolume) |
Control the volume output of the radio chip in the range 0..15. More... | |
void | setVolumeX (uint8_t newVolume) |
Control the volume output of the radio chip in the range 0..63. More... | |
uint8_t | getVolumeX () |
Retrieve the current output volume in the range 0..63. More... | |
void | setMute (bool switchOn) |
Control the mute mode of the radio chip. More... | |
void | setSoftMute (bool switchOn) |
Control the softmute mode (mute on low signals) of the radio chip. More... | |
void | setBassBoost (bool switchOn) |
regardless of the given parameter, the Bass Boost will never switch on. More... | |
void | setMono (bool switchOn) |
Control the mono/stereo mode of the radio chip. More... | |
void | setBand (RADIO_BAND newBand) |
Control the band of the radio chip. More... | |
void | setFrequency (RADIO_FREQ newF) |
Control the frequency. More... | |
RADIO_FREQ | getFrequency (void) |
void | seekUp (bool toNextSender=true) |
Start seek mode upwards. More... | |
void | seekDown (bool toNextSender=true) |
Start seek mode downwards. More... | |
void | checkRDS () |
Retrieve the next RDS data if available. More... | |
void | getRadioInfo (RADIO_INFO *info) |
Return a filled RADIO_INFO with the status of the radio features of the chip. More... | |
void | getAudioInfo (AUDIO_INFO *info) |
Return a filled AUIO_INFO with the actual audio settings. More... | |
void | debugScan () |
void | debugStatus () |
Send the current values of all registers to the Serial port. 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 | 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... | |
const uint8_t | MAXVOLUMEX = 63 |
max volume level for the SI4705 specific implementation. More... | |
uint8_t | status |
uint8_t | resp1 |
uint8_t | resp2 |
uint8_t | rdsFifoUsed |
uint8_t | blockAH |
uint8_t | blockAL |
uint8_t | blockBH |
uint8_t | blockBL |
uint8_t | blockCH |
uint8_t | blockCL |
uint8_t | blockDH |
uint8_t | blockDL |
uint8_t | blockErrors |
uint8_t | buffer [1+12] |
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 | _sendCommand (int cnt, int cmd,...) |
send a command More... | |
void | _setProperty (uint16_t prop, uint16_t value) |
set a property More... | |
uint8_t | _readStatus () |
read the interrupt status. More... | |
void | _readStatusData (uint8_t cmd, uint8_t param, uint8_t *values, uint8_t len) |
read status information into a buffer More... | |
void | _seek (bool seekUp=true) |
void | _waitEnd () |
wait until the current seek and tune operation is over. More... | |
Private Attributes | |
uint8_t | _realVolume |
The real volume set to the chip. More... | |
uint8_t | _status |
the status after sending a command More... | |
uint8_t | tuneStatus [8] |
uint8_t | rsqStatus [1+7] |
uint8_t | rdsStatusx [1+12] |
uint8_t | agcStatus [1+2] |
union { | |
struct { | |
uint8_t status | |
uint8_t resp1 | |
uint8_t resp2 | |
uint8_t rdsFifoUsed | |
uint8_t blockAH | |
uint8_t blockAL | |
uint8_t blockBH | |
uint8_t blockBL | |
uint8_t blockCH | |
uint8_t blockCL | |
uint8_t blockDH | |
uint8_t blockDL | |
uint8_t blockErrors | |
} | |
uint8_t buffer [1+12] | |
} | rdsStatus |
structure used to read RDS information from the SI4705 radio chip. More... | |
Library to control the SI4705 radio chip.
SI4705::SI4705 | ( | ) |
Initialize the extra variables in SI4705.
|
protectedinherited |
Prints a register as 4 character hexadecimal code with leading zeros.
|
private |
read the interrupt status.
Load the status information from to the chip.
|
private |
read status information into a buffer
Load status information from to the chip.
|
private |
|
private |
send a command
Send an array of bytes to the radio chip.
|
private |
set a property
Set a property in the radio chip.
|
private |
wait until the current seek and tune operation is over.
|
virtualinherited |
Register a RDS processor function.
|
virtual |
Retrieve the next RDS data if available.
Reimplemented from RADIO.
|
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.
|
virtualinherited |
Print out all audio information.
|
virtualinherited |
Enable sending debug information to the Serial port.
|
virtualinherited |
Print out all radio information.
void SI4705::debugScan | ( | ) |
|
virtual |
Send the current values of all registers to the Serial port.
Reimplemented from RADIO.
|
virtualinherited |
Format the current frequency for display and printing.
|
virtual |
Return a filled AUIO_INFO with the actual audio settings.
Reimplemented from RADIO.
|
virtualinherited |
Retrieve the current band setting.
|
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.
|
virtual |
Retrieve the real frequency from the chip after manual or automatic tuning.
Reimplemented from RADIO.
|
virtualinherited |
Get resolution of the current selected band.
|
virtualinherited |
Get the maximum frequency of the current selected band.
|
virtualinherited |
Get the minimum frequency of the current selected band.
|
virtualinherited |
Retrieve the current mono mode setting.
The base implementation returns only the value in the internal variable.
|
virtualinherited |
Retrieve the current mute mode setting.
The base implementation returns only the value in the internal variable.
|
virtual |
Return a filled RADIO_INFO with the status of the radio features of the chip.
Reimplemented from RADIO.
|
virtualinherited |
Retrieve the current soft mute mode setting.
The base implementation returns only the value in the internal variable.
|
virtualinherited |
Retrieve the current output volume in the range 0..15.
uint8_t SI4705::getVolumeX | ( | ) |
Retrieve the current output volume in the range 0..63.
Retrieve the current output volume in the range 0..63.
|
virtual |
|
virtual |
Start seek mode downwards.
Reimplemented from RADIO.
|
virtual |
Start seek mode upwards.
Reimplemented from RADIO.
|
virtual |
Control the band of the radio chip.
Start using the new band for receiving.
newBand | The new band to be received. |
Reimplemented from RADIO.
|
virtualinherited |
Set Band and Frequency in one call.
|
virtual |
|
virtual |
Control the frequency.
Start using the new frequency for receiving.
The new frequency is stored for later retrieval by the base class.
Because the chip may change the frequency automatically (when seeking) the stored value might not be the current frequency.
newF | The new frequency to be received. |
Reimplemented from RADIO.
|
virtual |
Control the mono/stereo mode of the radio chip.
Control the mono mode of the radio chip In mono mode the stereo decoding will be switched off completely and the noise is typically reduced.
switchOn | The new state of the mono mode. True to switch on, false to switch off. |
Reimplemented from RADIO.
|
virtual |
Control the mute mode of the radio chip.
Control the mute mode of the radio chip In mute mode no output will be produced by the radio chip.
switchOn | The new state of the mute mode. True to switch on, false to switch off. |
Reimplemented from RADIO.
|
virtual |
Control the softmute mode (mute on low signals) of the radio chip.
Control the softmute mode of the radio chip If switched on the radio output is muted when no sender was found.
switchOn | The new state of the softmute mode. True to switch on, false to switch off. |
Reimplemented from RADIO.
|
virtual |
Control the volume output of the radio chip in the range 0..15.
This function maps the newVolume value in the range 0..15 to the range 0..63 that is available in this chip.
newVolume | The new volume level of audio output. |
Reimplemented from RADIO.
void SI4705::setVolumeX | ( | uint8_t | newVolume | ) |
Control the volume output of the radio chip in the range 0..63.
This function sets the volume in the range 0..63.
newVolume | The new volume level of audio output. |
|
virtual |
Terminate all radio functions in the chip.
Switch all functions of the chip off by powering down.
Reimplemented from RADIO.
|
protectedinherited |
Last set band.
|
protectedinherited |
Last set bass Boost effect.
|
protectedinherited |
Set by debugEnable() and controls debugging functionality.
|
protectedinherited |
Last set frequency.
|
protectedinherited |
Highest frequency of the current selected band.
|
protectedinherited |
Lowest frequency of the current selected band.
|
protectedinherited |
Resulution of the tuner.
|
protectedinherited |
Last set mono effect.
|
protectedinherited |
Last set mute effect.
|
private |
The real volume set to the chip.
|
protectedinherited |
Registered RDS Function that is called on new available data.
|
protectedinherited |
Last set softMute effect.
|
private |
the status after sending a command
|
protectedinherited |
Last set volume level.
|
private |
uint8_t SI4705::blockAH |
uint8_t SI4705::blockAL |
uint8_t SI4705::blockBH |
uint8_t SI4705::blockBL |
uint8_t SI4705::blockCH |
uint8_t SI4705::blockCL |
uint8_t SI4705::blockDH |
uint8_t SI4705::blockDL |
uint8_t SI4705::blockErrors |
uint8_t SI4705::buffer[1+12] |
const uint8_t SI4705::MAXVOLUME = 15 |
max volume level for radio implementations.
const uint8_t SI4705::MAXVOLUMEX = 63 |
max volume level for the SI4705 specific implementation.
uint8_t SI4705::rdsFifoUsed |
union { ... } SI4705::rdsStatus |
structure used to read RDS information from the SI4705 radio chip.
|
private |
uint8_t SI4705::resp1 |
uint8_t SI4705::resp2 |
|
private |
uint8_t SI4705::status |
|
private |