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

Radio implementation using the Serial communication. More...

#include <LiquidCrystal.h>
#include <Wire.h>
#include <radio.h>
#include <rda5807M.h>
#include <si4703.h>
#include <si4705.h>
#include <tea5767.h>
#include <RDSParser.h>

Enumerations

enum  KEYSTATE
 
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

enum KEYSTATE __attribute__ ((packed))
 
KEYSTATE getLCDKeypadKey ()
 
LiquidCrystal lcd (8, 9, 4, 5, 6, 7)
 
void DisplayFrequency (RADIO_FREQ f)
 
void DisplayServiceName (char *name)
 
void DisplayTime (uint8_t hour, uint8_t minute)
 
void RDS_process (uint16_t block1, uint16_t block2, uint16_t block3, uint16_t block4)
 
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

 KEYSTATE_NONE
 
 KEYSTATE_SELECT
 
 KEYSTATE_LEFT
 
 KEYSTATE_UP
 
 KEYSTATE_DOWN
 
 KEYSTATE_RIGHT
 
RADIO_FREQ preset []
 
int i_sidx =5
 Start at Station with index=5. More...
 
SI4705 radio
 Create an instance of a SI4705 chip radio. More...
 
RDSParser rds
 get a RDS parser More...
 
enum RADIO_STATE __attribute__
 
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 GND GND
3.3V VCC -
5V - VCC
A5 SCLK SCLK
A4 SDIO SDIO
D2 RST -

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

History:

Enumeration Type Documentation

enum KEYSTATE

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

enum KEYSTATE __attribute__ ( (packed)  )
void DisplayFrequency ( RADIO_FREQ  f)

This function will be when a new frequency is received. Update the Frequency on the LCD display.

void DisplayServiceName ( char *  name)

This function will be called by the RDS module when a new ServiceName is available. Update the LCD to display the ServiceName in row 1 chars 0 to 7.

void DisplayTime ( uint8_t  hour,
uint8_t  minute 
)

This function will be called by the RDS module when a rds time message was received. Update the LCD to display the time in right upper corner.

KEYSTATE getLCDKeypadKey ( )

This function determines the current pressed key but

  • doesn't return short key down situations that are key bouncings.
  • returns a specific key down only once.
LiquidCrystal lcd ( ,
,
,
,
,
 
)
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 setup ( )

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

Variable Documentation

enum RADIO_STATE __attribute__
int i_sidx =5

Start at Station with index=5.

KEYSTATE_DOWN
KEYSTATE_LEFT
KEYSTATE_NONE
KEYSTATE_RIGHT
KEYSTATE_SELECT
KEYSTATE_UP
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
}
SI4705 radio

Create an instance of a SI4705 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.