Adafruit Si4713 Library
Public Member Functions | Public Attributes | List of all members
Adafruit_Si4713 Class Reference

Class that stores state and functions for interacting with Si4713 breakout. More...

#include <Adafruit_Si4713.h>

Public Member Functions

 Adafruit_Si4713 (int8_t rstpin=-1)
 Instantiates a new Si4713 class. More...
 
bool begin (uint8_t addr=SI4710_ADDR1, TwoWire *theWire=&Wire)
 Setups the i2c and calls powerUp function. More...
 
void reset ()
 Resets the registers to default settings and puts chip in powerdown mode.
 
void powerUp ()
 Sends power up command to the breakout, than CTS and GPO2 output is disabled and than enable xtal oscilator. Also It sets properties: SI4713_PROP_REFCLK_FREQ: 32.768 SI4713_PROP_TX_PREEMPHASIS: 74uS pre-emph (USA standard) SI4713_PROP_TX_ACOMP_GAIN: max gain SI4713_PROP_TX_ACOMP_ENABLE: turned on limiter and AGC.
 
uint8_t getRev ()
 Get the hardware revision code from the device using SI4710_CMD_GET_REV. More...
 
void tuneFM (uint16_t freqKHz)
 Tunes to given transmit frequency. More...
 
uint8_t getStatus (void)
 Read interrupt status bits. More...
 
void readTuneStatus (void)
 Queries the status of a previously sent TX Tune Freq, TX Tune Power, or TX Tune Measure using SI4710_CMD_TX_TUNE_STATUS command.
 
void readTuneMeasure (uint16_t freq)
 Measure the received noise level at the specified frequency using SI4710_CMD_TX_TUNE_MEASURE command. More...
 
void setTXpower (uint8_t pwr, uint8_t antcap=0)
 Sets the output power level and tunes the antenna capacitor. More...
 
void readASQ (void)
 Queries the TX status and input audio signal metrics.
 
void setProperty (uint16_t p, uint16_t v)
 Set chip property over I2C. More...
 
void beginRDS (uint16_t programID=0xADAF)
 Begin RDS Sets properties as follows: SI4713_PROP_TX_AUDIO_DEVIATION: 66.25KHz, SI4713_PROP_TX_RDS_DEVIATION: 2KHz, SI4713_PROP_TX_RDS_INTERRUPT_SOURCE: 1, SI4713_PROP_TX_RDS_PS_MIX: 50% mix (default value), SI4713_PROP_TX_RDS_PS_MISC: 0x1008, SI4713_PROP_TX_RDS_PS_REPEAT_COUNT: 3, SI4713_PROP_TX_RDS_MESSAGE_COUNT: 1, SI4713_PROP_TX_RDS_PS_AF: 0xE0E0, SI4713_PROP_TX_RDS_FIFO_SIZE: 0, SI4713_PROP_TX_COMPONENT_ENABLE: 7. More...
 
void setRDSstation (const char *s)
 Set up the RDS station string. More...
 
void setRDSbuffer (const char *s)
 Queries the status of the RDS Group Buffer and loads new data into buffer. More...
 
void setGPIO (uint8_t x)
 Sets GP1 / GP2 output level (low or high). More...
 
void setGPIOctrl (uint8_t x)
 Configures GP1 / GP2 as output or Hi-Z. More...
 

Public Attributes

uint16_t currFreq
 current frequency
 
uint8_t currdBuV
 current BuV
 
uint8_t currAntCap
 current antenna capacitor
 
uint8_t currNoiseLevel
 current noise level
 
uint8_t currASQ
 current ASQ
 
int8_t currInLevel
 current IN level
 

Detailed Description

Class that stores state and functions for interacting with Si4713 breakout.

Constructor & Destructor Documentation

◆ Adafruit_Si4713()

Adafruit_Si4713::Adafruit_Si4713 ( int8_t  resetpin = -1)

Instantiates a new Si4713 class.

Parameters
resetpinnumber of pin where reset is connected

Member Function Documentation

◆ begin()

bool Adafruit_Si4713::begin ( uint8_t  addr = SI4710_ADDR1,
TwoWire *  theWire = &Wire 
)

Setups the i2c and calls powerUp function.

Parameters
addri2c address
theWirewire object
Returns
True if initialization was successful, otherwise false.

◆ getRev()

uint8_t Adafruit_Si4713::getRev ( )

Get the hardware revision code from the device using SI4710_CMD_GET_REV.

Returns
revision number

◆ tuneFM()

void Adafruit_Si4713::tuneFM ( uint16_t  freqKHz)

Tunes to given transmit frequency.

Parameters
freqKHzfrequency in KHz

◆ getStatus()

uint8_t Adafruit_Si4713::getStatus ( void  )

Read interrupt status bits.

Returns
status bits

◆ readTuneMeasure()

void Adafruit_Si4713::readTuneMeasure ( uint16_t  freq)

Measure the received noise level at the specified frequency using SI4710_CMD_TX_TUNE_MEASURE command.

Parameters
freqfrequency

◆ setTXpower()

void Adafruit_Si4713::setTXpower ( uint8_t  pwr,
uint8_t  antcap = 0 
)

Sets the output power level and tunes the antenna capacitor.

Parameters
pwrpower value
antcapantenna capacitor (default to 0)

◆ setProperty()

void Adafruit_Si4713::setProperty ( uint16_t  property,
uint16_t  value 
)

Set chip property over I2C.

Parameters
propertyprooperty that will be set
valuevalue of property

◆ beginRDS()

void Adafruit_Si4713::beginRDS ( uint16_t  programID = 0xADAF)

Begin RDS Sets properties as follows: SI4713_PROP_TX_AUDIO_DEVIATION: 66.25KHz, SI4713_PROP_TX_RDS_DEVIATION: 2KHz, SI4713_PROP_TX_RDS_INTERRUPT_SOURCE: 1, SI4713_PROP_TX_RDS_PS_MIX: 50% mix (default value), SI4713_PROP_TX_RDS_PS_MISC: 0x1008, SI4713_PROP_TX_RDS_PS_REPEAT_COUNT: 3, SI4713_PROP_TX_RDS_MESSAGE_COUNT: 1, SI4713_PROP_TX_RDS_PS_AF: 0xE0E0, SI4713_PROP_TX_RDS_FIFO_SIZE: 0, SI4713_PROP_TX_COMPONENT_ENABLE: 7.

Parameters
programIDsets SI4713_PROP_TX_RDS_PI to parameter value

◆ setRDSstation()

void Adafruit_Si4713::setRDSstation ( const char *  s)

Set up the RDS station string.

Parameters
*sstring to load

◆ setRDSbuffer()

void Adafruit_Si4713::setRDSbuffer ( const char *  s)

Queries the status of the RDS Group Buffer and loads new data into buffer.

Parameters
*sstring to load

◆ setGPIO()

void Adafruit_Si4713::setGPIO ( uint8_t  x)

Sets GP1 / GP2 output level (low or high).

Parameters
xbit value

◆ setGPIOctrl()

void Adafruit_Si4713::setGPIOctrl ( uint8_t  x)

Configures GP1 / GP2 as output or Hi-Z.

Parameters
xbit value

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