Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

otSi4703 Class Reference
[Si4703 - FM radio receiversSi4703 - FM radio receivers]

FM radio receivers.

#include <otSi4703.h>


Public Types

typedef otSi4703::RadioBand RadioBand
typedef otSi4703::FreqSpacing FreqSpacing
enum  RadioBand { BAND_WEST, BAND_WORLD = 64, BAND_EAST = 128 }
enum  FreqSpacing { SP_200KHZ, SP_100KHZ, SP_50KHZ }
enum  StatusBit {
  ST_RDSR = 0x8000, ST_STC = 0x4000, ST_SFBL = 0x2000, ST_AFCRL = 0x1000,
  ST_RDSS = 0x0800, ST_ST = 0x0100
}

Public Member Functions

 otSi4703 ()
bool init (RadioBand band=BAND_WEST)
U16 getFrequency ()
void setFrequency (U16 freq)
void setChannelSpacing (FreqSpacing fs)
FreqSpacing channelSpacing ()
void setVolume (U8 dBFS)
U8 volume ()
void unlock ()
void seekUp (bool wrap=true)
void seekDown (bool wrap=true)
U8 getRSSI ()
bool volumeUp ()
bool volumeDown (bool alsomute=false)
void mute ()
void unMute (bool minvol=false)
void end ()
void setProperty (U16 property, U16 value)
U16 getProperty (U16 property)
U16 getStatus ()
bool readRDSGroup (U16 *block)
void readRDS (char *message, U32 timeout, U8 timer=TIMER0)


Member Typedef Documentation

typedef otSi4703::FreqSpacing otSi4703.FreqSpacing
 

typedef otSi4703::RadioBand otSi4703.RadioBand
 


Member Enumeration Documentation

enum otSi4703::FreqSpacing
 

Enumeration values:
SP_200KHZ  200 kHz (USA, Australia) (default)
SP_100KHZ  100 kHz (Europe, Japan)
SP_50KHZ  50 kHz

enum otSi4703::RadioBand
 

Enumeration values:
BAND_WEST  87.5–108 MHz (USA, Europe)
BAND_WORLD  76–108 MHz (Japan wide band)
BAND_EAST  76–90 MHz (Japan)

enum otSi4703::StatusBit
 

Enumeration values:
ST_RDSR  RDS ready.
ST_STC  Seek/Tune Complete.
ST_SFBL  Seek Fail/Band Limit.
ST_AFCRL  AFC Rail.
ST_RDSS  RDS Synchronized.
ST_ST  Stereo Indicator.


Constructor & Destructor Documentation

otSi4703.otSi4703  ) 
 

Create the class.


Member Function Documentation

FreqSpacing otSi4703.channelSpacing  ) 
 

Read channel spacing

Returns:
Frequency channel spacing

void otSi4703.end  ) 
 

Mutes and disables the chip.

U16 otSi4703.getFrequency  ) 
 

Gets the frequency the chip is currently tuned to.

Returns:
frequency in 10kHz units.

U16 otSi4703.getProperty U16  property  ) 
 

Gets a property value, see the SI4703_PROP_* constants and the Si4703 Datasheet for more information.

Parameters:
property Property identifier
Returns:
The current value of property.

U8 otSi4703.getRSSI  ) 
 

Retrieves the Received Signal Strength Indication measurement for the currently tuned station. Return a maximum of approximately 75 dBµV

Returns:
Received Signal Strength Indication

U16 otSi4703.getStatus  ) 
 

Accessor for the status register. See StatusBit for interpreting all bits

Returns:
Status

bool otSi4703.init RadioBand  band = BAND_WEST  ) 
 

Init the class

Parameters:
band 

void otSi4703.mute  ) 
 

Mutes the audio output.

void otSi4703.readRDS char *  message,
U32  timeout,
U8  timer = TIMER0
 

Read a RDS message

Parameters:
message Message should be at least 9 chars, result will be null terminated
timeout Timeout in milliseconds
timer Used timer for timing

bool otSi4703.readRDSGroup U16 block  ) 
 

If the chip has received any valid RDS group, fetch it off the chip and fill word block[4] with it, returning true; otherwise returnfalse without side-effects. As RDS has a [mandated by standard] constant transmission rate of 11.4 groups per second, you should actively call this function (e.g.from loop()) so that you read most if not all of the error-corrected RDS groups received. For example:

        loop() 
        {
                if(otSi4703::readRDSGroup(data))
                        RDSDecoder::decodeRDSGroup(data);
        }
Parameters:
block Where to store RDS data
Returns:
True if RDS data is available

void otSi4703.seekDown bool  wrap = true  ) 
 

Commands the radio to seek down to the next valid channel.

Parameters:
wrap Set to true to allow the seek to wrap around the current

void otSi4703.seekUp bool  wrap = true  ) 
 

Commands the radio to seek up to the next valid channel.

Parameters:
wrap Set to true to allow the seek to wrap around the current

void otSi4703.setChannelSpacing FreqSpacing  fs  ) 
 

Set the channel spacing

Parameters:
fs Value of channel spacing see FreqSpacing

void otSi4703.setFrequency U16  freq  ) 
 

Set the receiver frequency

Parameters:
freq Frequency as MHz x 10. Example a radio station at 92.9 MHz will be specified as 929

void otSi4703.setProperty U16  property,
U16  value
 

Sets a property value, see the SI4703_PROP_* constants and the Si4703 Datasheet for more information.

Parameters:
property Property identifier
value Property value to set

void otSi4703.setVolume U8  dBFS  ) 
 

Set the volume with a logarithmic scale from 0 = (mute), 1 = -28dBFS, ..., 14 = -2 dBFS, 15 = 0 dBFS

Parameters:
dBFS Volume attenuation

void otSi4703.unlock  ) 
 

Free search engine

void otSi4703.unMute bool  minvol = false  ) 
 

Unmutes the audio output.

Parameters:
minvol Set the volume to minimum value before unmuting if true, otherwise leave it untouched causing the chip to blast audio out at whatever the previous volume level was.

U8 otSi4703.volume  ) 
 

Read volume set

Returns:
Volume as dBFS

bool otSi4703.volumeDown bool  alsomute = false  ) 
 

Decrease the volume by 1. If the minimum volume has been reached, no further decrease will take place and returns false; otherwise true.

Parameters:
alsomute Mute the output when reaching minimum volume, in addition to returning false
Returns:
False on no further decrease.

bool otSi4703.volumeUp  ) 
 

Increase the volume by 1. If the maximum volume has been reached, no further increase will take place and returns false; otherwise true.

Returns:
False on no further increase.


The documentation for this class was generated from the following file: footer
otStudio - Library Reference - (C) 2020-23 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0