Arduino Radio Library  0.9
A set of Arduino libraries to control diverse FM radio receiver chips in Arduino projects.
Enumerations | Functions | Variables
SerialRadio.ino File Reference

Radio implementation using the Serial communication. More...

#include <Wire.h>
#include <RADIO.h>
#include <RDA5807M.h>
#include <SI4703.h>
#include <SI4705.h>
#include <TEA5767.h>
#include <RDSParser.h>

Enumerations

enum  RADIO_STATE {
  STATE_PARSECOMMAND, STATE_PARSEINT, STATE_EXEC, STATE_NONE = 0,
  STATE_PARSECOMMAND, STATE_PARSEINT, STATE_EXEC, STATE_FREQ,
  STATE_VOL, STATE_MONO, STATE_SMUTE, STATE_PARSECOMMAND,
  STATE_PARSEINT, STATE_EXEC, STATE_NONE = 0, STATE_PARSECOMMAND,
  STATE_PARSEINT, STATE_EXEC, STATE_FREQ, STATE_VOL,
  STATE_MONO, STATE_SMUTE
}
 State definition for this radio implementation. More...
 

Functions

void DisplayFrequency (RADIO_FREQ f)
 Update the Frequency on the LCD display. More...
 
void DisplayServiceName (char *name)
 Update the ServiceName text on the LCD display. More...
 
void RDS_process (uint16_t block1, uint16_t block2, uint16_t block3, uint16_t block4)
 
void runSerialCommand (char cmd, int16_t value)
 
void setup ()
 Setup a FM only radio configuration with I/O for commands and debugging on the Serial port. More...
 
void loop ()
 Constantly check for serial input commands and trigger command execution. More...
 

Variables

RADIO_FREQ preset []
 
int i_sidx = 5
 Start at Station with index=5. More...
 
RDA5807M radio
 Create an instance of a RDA5807 chip radio. More...
 
RDSParser rds
 get a RDS parser More...
 
RADIO_STATE state
 The state variable is used for parsing input characters. More...
 

Detailed Description

Radio implementation using the Serial communication.

Author
Matthias Hertel, http://www.mathertel.de

This is a full function radio implementation that uses a LCD display to show the current station information.
It can be used with various chips after adjusting the radio object definition.
Open the Serial console with 57600 baud to see current radio information and change various settings.

Wiring

The necessary wiring of the various chips are described in the Testxxx example sketches. The boards have to be connected by using the following connections:

Arduino port SI4703 signal RDA5807M signal
GND (black) GND GND
3.3V (red) VCC VCC
5V (red) - -
A5 (yellow) SCLK SCLK
A4 (blue) SDIO SDIO
D2 RST -

More documentation and source code is available at http://www.mathertel.de/Arduino

History:

Enumeration Type Documentation

State definition for this radio implementation.

Enumerator
STATE_PARSECOMMAND 

waiting for a new command character.

STATE_PARSEINT 

waiting for digits for the parameter.

STATE_EXEC 

executing the command.

STATE_NONE 
STATE_PARSECOMMAND 

waiting for a new command character.

STATE_PARSEINT 

waiting for digits for the parameter.

STATE_EXEC 

executing the command.

STATE_FREQ 
STATE_VOL 
STATE_MONO 
STATE_SMUTE 
STATE_PARSECOMMAND 

waiting for a new command character.

STATE_PARSEINT 

waiting for digits for the parameter.

STATE_EXEC 

executing the command.

STATE_NONE 
STATE_PARSECOMMAND 

waiting for a new command character.

STATE_PARSEINT 

waiting for digits for the parameter.

STATE_EXEC 

executing the command.

STATE_FREQ 
STATE_VOL 
STATE_MONO 
STATE_SMUTE 

Function Documentation

void DisplayFrequency ( RADIO_FREQ  f)

Update the Frequency on the LCD display.

void DisplayServiceName ( char *  name)

Update the ServiceName text on the LCD display.

void loop ( )

Constantly check for serial input commands and trigger command execution.

void RDS_process ( uint16_t  block1,
uint16_t  block2,
uint16_t  block3,
uint16_t  block4 
)
void runSerialCommand ( char  cmd,
int16_t  value 
)

Execute a command identified by a character and an optional number. See the "?" command for available commands.

Parameters
cmdThe command character.
valueAn optional parameter for the command.
void setup ( )

Setup a FM only radio configuration with I/O for commands and debugging on the Serial port.

Variable Documentation

int i_sidx = 5

Start at Station with index=5.

RADIO_FREQ preset[]
Initial value:
= {
8770,
8810,
8820,
8850,
8890,
8930,
8980,
9180,
9220, 9350,
9440,
9510,
9530,
9560,
9680, 9880,
10020,
10090,
10110,
10030, 10260, 10380, 10400,
10500
}
RDA5807M radio

Create an instance of a RDA5807 chip radio.

The radio object has to be defined by using the class corresponding to the used chip. by uncommenting the right radio object definition.

RDSParser rds

get a RDS parser

RADIO_STATE state

The state variable is used for parsing input characters.