PU2CLR SI4844 Arduino Library 1.1.8
Arduino Library for Si4844 Devices - By Ricardo Lima Caratti
Loading...
Searching...
No Matches
Receiver Functions

Functions

void SI4844::addCustomBand (int8_t bandIdx, uint32_t bottomFrequency, uint32_t topFrequency, uint8_t space)
 Add a custom band in the list of custom bands.
 
void SI4844::audioMute (uint8_t value)
 Mutes the audio output.
 
void SI4844::bassTrebleDown ()
 Less treble, more bass.
 
void SI4844::bassTrebleUp ()
 More treble, less bass.
 
void SI4844::changeVolume (char)
 Up or down the sound volume level.
 
void SI4844::debugDevice (uint16_t resetPin, uint16_t interruptPin, uint8_t defaultBand, void(*showFunc)(char *msg))
 Used to debug

 
BandNodeSI4844::findCustomBand (int8_t bandIdx)
 Find a custom band in the list of custom bands.
 
si4844_status_responseSI4844::getAllReceiverInfo (void)
 Gets all current information of the receiver (tune freq, band, and others information, status of the device).
 
char * SI4844::getBandMode ()
 Get the Band Mode.
 
uint8_t SI4844::getCurrentBand ()
 Gets the latest band set by the microcontroller.
 
si4844_firmware_responseSI4844::getFirmware (void)
 Get part number, chip revision, firmware, patch, and component revision numbers.
 
float SI4844::getFrequency (void)
 Get the current frequency of the radio in KHz.
 
uint32_t SI4844::getFrequencyInteger (void)
 Get the current frequency of the radio in KHz in uint32_t (long integer) .
 
uint16_t SI4844::getRawChannelFrequency ()
 Gets the Channel Frequency.
 
si4844_device_statusSI4844::getStatus ()
 Gets current status of the device.
 
uint16_t SI4844::getStatusBandIndex ()
 Gets the current Band Index Detected.
 
uint16_t SI4844::getStatusBandMode ()
 Gets the current Band Mode.
 
uint16_t SI4844::getStatusBCFG0 ()
 Gets Band CFG0 (Band Detection Configuration).
 
uint16_t SI4844::getStatusBCFG1 ()
 Gets Band CFG1 (Band Properties Priority)
 
uint16_t SI4844::getStatusInformationReady ()
 Gets Information Ready.
 
uint16_t SI4844::getStatusStationIndicator ()
 Gets Station Indicator.
 
uint16_t SI4844::getStatusStereo ()
 Gets Stereo indicator.
 
char * SI4844::getStereoIndicator ()
 Get the Stereo Indicator.
 
int8_t SI4844::getValidBandIndex ()
 Retrieves the current valid BAND INDEX.

 
uint8_t SI4844::getVolume ()
 Gets the current audio volume level.
 
uint8_t SI4844::getVolumeProperty ()
 Gets the current volume value stored in SI4844 device.
 
bool SI4844::hasBandChanged (void)
 Checks whether the current band detected by the device changed.
 
bool SI4844::hasStatusChanged (void)
 Checks whether the SI4844 has its status changed.
 
bool SI4844::isHostDetectionBandConfig ()
 Band CFG0 (Band Detection Configuration)
 
bool SI4844::needHostPowerUp ()
 Checks Host Power Up Status.
 
bool SI4844::needHostReset ()
 Checks HOST Reset Status

 
void SI4844::powerDown (void)
 Power the device down.
 
void SI4844::powerUp (void)
 Power the device up.
 
void SI4844::removeCustomBand (int8_t bandIdx)
 Remove a custom band in the list of custom bands.
 
void SI4844::reset (void)
 Resets the SI4844 device.
 
void SI4844::resetStatus (void)
 set the interrupr status to false. It will turn true after next interrupr

 
void SI4844::setAmSoftMuteMaxAttenuation (uint8_t value)
 Sets AM Soft Mute Max Attenuation..

 
void SI4844::setAmSoftMuteRate (uint8_t value)
 Sets the attack and decay rates when entering or leaving soft mute.
 
void SI4844::setAmSoftMuteSlope (uint8_t value)
 Configures attenuation slope during soft mute in dB attenuation per dB SNR below the soft mute SNR threshold.
 
void SI4844::setAmSoftMuteSnrThreshold (uint8_t value)
 Sets the SNR threshold to engage soft mute.
 
si4844_audiomode_status_response SI4844::setAudioMode (uint8_t audiomode, uint8_t fm_mono, uint8_t adjpt_attn, uint8_t adjpt_steo, uint8_t opcode)
 Set audio mode.
 
void SI4844::setAudioMute (bool on)
 Mutes the audio output.
 
void SI4844::setBand (uint8_t newBand=0)
 Sets a new band to the device.
 
void SI4844::setBandSlideSwitch ()
 Sets a new band to the device configured as Slide Switch.
 
void SI4844::setBassTreble (uint8_t bass_treble)
 Set the sound volume level, bass and treble.
 
void SI4844::setBlendThresholdStereoIndicator (uint16_t value)
 Sets the blend threshold for stereo indicator.
 
void SI4844::setCrystalOscillatorEnable (uint8_t XOSCEN)
 Sets Crystal Oscillator Enable.
 
void SI4844::setCrystalOscillatorStabilizationWaitTime (uint8_t XOWAIT)
 Sets Crystal Oscillator Stabilization Wait Time After Reset.
 
void SI4844::setCustomBand (uint8_t bandIndex, uint16_t botton, uint16_t top, uint8_t bandSpace, uint8_t dfband=0, uint8_t uni_am=0, uint8_t tvreq=0)
 This method allows you to customize the frequency range of a band.
 
void SI4844::setFmDeemphasis (uint8_t value)
 Sets de-emphasis time constant.
 
void SI4844::setFmSoftMuteMaxAttenuation (uint8_t value)
 FM Soft Mute Maximum Attenuation.
 
void SI4844::setFmSoftMuteRate (uint8_t value)
 Sets the attack and decay rates when entering and leaving soft mute.
 
void SI4844::setFmSoftMuteSlope (uint8_t value)
 Configures attenuation slope during soft mute in dB attenuation per dB SNR below the soft mute SNR threshold.
 
void SI4844::setReferenceClockFrequency (uint16_t value)
 Sets the frequency of the REFCLK from the output of the prescaler.
 
void SI4844::setReferenceClockPrescaler (uint16_t value)
 Sets the number used by the prescaler to divide the external reference clock frequency down to the internal REFCLK.
 
void SI4844::setup (uint16_t resetPin, int interruptPin, int8_t defaultBand=0, uint32_t hightClockSpeed=50000)
 Initiates the SI4844 instance and connect the device (SI4844) to Arduino.
 
void SI4844::setupSlideSwitch (uint16_t resetPin, int interruptPin, uint32_t hightClockSpeed=50000)
 Initiates the SI48XX instance and connect the device (SI4844) to a microcontroller.
 
void SI4844::setVolume (byte)
 Sets the volume level.
 
void SI4844::volumeDown (void)
 Decreases the volume level.
 
void SI4844::volumeUp (void)
 Increases the volume level.
 

Detailed Description

Function Documentation

◆ addCustomBand()

void SI4844::addCustomBand ( int8_t  bandIdx,
uint32_t  bottomFrequency,
uint32_t  topFrequency,
uint8_t  space 
)

Add a custom band in the list of custom bands.

This function adds a costom band to the list of band.

ATTENTION: For now, this function only applies to the band selection mode using a Slide Switch or

Rotary Band Switch. For the band selection mode controlled by an MCU, use the setCustomBand function.

Parameters
bandIdxThe index number of the band to search for.
bottomFrequencyLower frequency limit
topFrequencyUpper frequency limit
spaceBand spacing
See also
Table 8: Pre-defined Band Table in the Si48XX ATDD Programming Guide (AN610), pages 17 and 18.

◆ audioMute()

void SI4844::audioMute ( uint8_t  value)

Mutes the audio output.

Parameters
valuevalue 0 = normal (no mute); 1 = Right side mute; 2; Left side mute; 3 = both side

◆ bassTrebleDown()

void SI4844::bassTrebleDown ( )

Less treble, more bass.

◆ bassTrebleUp()

void SI4844::bassTrebleUp ( )

More treble, less bass.

◆ changeVolume()

void SI4844::changeVolume ( char  command)

Up or down the sound volume level.

Deprecated:
Parameters
command'+' up and '-' down

◆ debugDevice()

void SI4844::debugDevice ( uint16_t  resetPin,
uint16_t  interruptPin,
uint8_t  defaultBand,
void(*)(char *msg)  showFunc 
)

Used to debug

use this function instead setup to check your implementation

Parameters
resetPinsame call setup;
interruptPinsame call setup
defaultBandsame call setup
showFuncfunction of your sketch that will be called to show something

References SI4844::getFirmware(), and SI4844::reset().

◆ findCustomBand()

BandNode * SI4844::findCustomBand ( int8_t  bandIdx)

Find a custom band in the list of custom bands.

If the specified band index is found in the list, the corresponding custom parameters will be used.

If the band index is not found, the default (Pre-defined) parameters will be applied.

Parameters
bandIdxThe index number of the band to search for.
See also
Table 8: Pre-defined Band Table in the Si48XX ATDD Programming Guide (AN610), pages 17 and 18.

◆ getAllReceiverInfo()

si4844_status_response * SI4844::getAllReceiverInfo ( void  )

Gets all current information of the receiver (tune freq, band, and others information, status of the device).

Use this method only if you want to deal with that information by yourself.

all data of the receiver is storted in "all_receiver_status" member variable

This library has other methods to get that information easier.

Returns
pointer to a structure type si4844_status_response

Referenced by SI4844::getFrequency(), SI4844::getFrequencyInteger(), SI4844::getValidBandIndex(), SI4844::hasBandChanged(), SI4844::isHostDetectionBandConfig(), SI4844::setBand(), SI4844::setBandSlideSwitch(), and SI4844::setCustomBand().

◆ getBandMode()

char * SI4844::getBandMode ( )
inline

Get the Band Mode.

Returns
char* "FM", "AM" or "SW"
See also
getStatusBandMode()

◆ getCurrentBand()

uint8_t SI4844::getCurrentBand ( )
inline

Gets the latest band set by the microcontroller.

It can be used as a feature to detect if the current band has been changed via Slide

Returns
latest band

◆ getFirmware()

si4844_firmware_response * SI4844::getFirmware ( void  )

Get part number, chip revision, firmware, patch, and component revision numbers.

You do not need to call this method. It is executed just once at setup methos.

There are other methods that give you that information.

See also
Si48XX ATDD PROGRAMMING GUIDE; AN610; page 22
Returns
a pointer to a structure type wirh the part number, chip revision, firmware revision, patch revision, and component revision numbers.

Referenced by SI4844::debugDevice(), and SI4844::setup().

◆ getFrequency()

float SI4844::getFrequency ( void  )

Get the current frequency of the radio in KHz.

For example: FM, 103900 KHz (103.9 MHz); SW, 7335 KHz (7.34 MHz, 41m)

Returns
float current frequency in KHz.

References SI4844::getAllReceiverInfo().

◆ getFrequencyInteger()

uint32_t SI4844::getFrequencyInteger ( void  )

Get the current frequency of the radio in KHz in uint32_t (long integer) .

For example: FM, 103900 KHz (103.9 MHz); SW, 7335 KHz (7.34 MHz, 41m)

It is useful to save memory

Returns
uint32_t current frequency in KHz.

References SI4844::getAllReceiverInfo().

◆ getRawChannelFrequency()

uint16_t SI4844::getRawChannelFrequency ( )
inline

Gets the Channel Frequency.

The channel frequency is a 16-bit word of 4 digits in BCD format:

FM 0640..1090 (64.0–109.0 MHz)

AM 0504..1750 (504–1750 kHz)

SW4 *0230..2850 (2.3– 28.5 MHz)

For FM band, if the China TV channel audio sub-carrier display feature is enabled, the CHFREQ bit[15] MSB = 1 means the host controller needs to add an additional 50 kHz for the channel frequency.

For SW band, the CHFREQ bit[15] MSB = 1 means the host controller needs to add an additional 5 kHz for the channel frequency.

Returns
0 = Tune info not ready yet; 1 = Tune info ready

◆ getStatus()

si4844_device_status * SI4844::getStatus ( )

Gets current status of the device.

Use this method only if you want to deal with the current status by yourself.

the status is stored in "device_status" member variable

this method updates the first byte of all_receiver_status member variable

Returns
pointer to a structure type si4844_device_status

Referenced by SI4844::setupSlideSwitch().

◆ getStatusBandIndex()

uint16_t SI4844::getStatusBandIndex ( )
inline

Gets the current Band Index Detected.

Returns
0~19: FM band; 20~24: AM band; 25~40: SW band

◆ getStatusBandMode()

uint16_t SI4844::getStatusBandMode ( )
inline

Gets the current Band Mode.

Returns
0 = FM mode; 1 = AM mode; 2 = SW mode
See also
getBandMode()

◆ getStatusBCFG0()

uint16_t SI4844::getStatusBCFG0 ( )
inline

Gets Band CFG0 (Band Detection Configuration).

0 = ATDD device detects band; 1 = Host detects band

Call getStatus or getAllReceiverInfo before calling this function

Returns
0 = ATDD device detects band; 1 = Host detects band

◆ getStatusBCFG1()

uint16_t SI4844::getStatusBCFG1 ( )
inline

Gets Band CFG1 (Band Properties Priority)

Call getStatus or getAllReceiverInfo before calling this function

Returns
0 = ATDD device accepts host customized band properties; 1 = ATDD device ignores host customized band properties

◆ getStatusInformationReady()

uint16_t SI4844::getStatusInformationReady ( )
inline

Gets Information Ready.

During power up case, the system controller should not display any of the channel frequency, band mode, band index,

station, or stereo statuses until the INFORDY bit is set.

The host controller should not display the channel frequency when CHFREQ remains zero even when INFORDY=1.

0 = Tune info not ready yet; 1 = Tune info ready (i.e., Band mode, band index, channel frequency, sta-tion, and stereo indicators)

Call getStatus or getAllReceiverInfo before calling this function

Returns
0 = Tune info not ready yet; 1 = Tune info ready

◆ getStatusStationIndicator()

uint16_t SI4844::getStatusStationIndicator ( )
inline

Gets Station Indicator.

Call getStatus or getAllReceiverInfo before calling this function

Returns
0 = Invalid Station; 1 = Valid Station

◆ getStatusStereo()

uint16_t SI4844::getStatusStereo ( )
inline

Gets Stereo indicator.

Applicable to Si4840/44 parts FM function only (id does not make sense for Si4827).

Call getStatus or getAllReceiverInfo before calling this function

Returns
0 = Stereo off; 1 = Stereo on
See also
getStereoIndicator()

◆ getStereoIndicator()

char * SI4844::getStereoIndicator ( )
inline

Get the Stereo Indicator.

Call getStatus or getAllReceiverInfo before calling this function

Returns
char* "ON" or "OFF"
See also
getStatusStereo()

◆ getValidBandIndex()

int8_t SI4844::getValidBandIndex ( )

Retrieves the current valid BAND INDEX.

Waits until INFORDY is set to 1.

Once INFORDY is 1, the host can read and display the current status, including band mode, station, and stereo states.

Returns
The current valid BANDIDX.

References SI4844::getAllReceiverInfo().

◆ getVolume()

uint8_t SI4844::getVolume ( )
inline

Gets the current audio volume level.

Returns
Volume level

◆ getVolumeProperty()

byte SI4844::getVolumeProperty ( )

Gets the current volume value stored in SI4844 device.

Use getVolume instead.

Returns
byte

◆ hasBandChanged()

bool SI4844::hasBandChanged ( void  )

Checks whether the current band detected by the device changed.

When the Slide Switch is moved by the user, the system have to process it

Returns
True if the user moved the Slide Switch

References SI4844::getAllReceiverInfo().

◆ hasStatusChanged()

bool SI4844::hasStatusChanged ( void  )

Checks whether the SI4844 has its status changed.

Actually it checks if the device triggered an external interruption due to some internal event.

For example: If you move the tuner, the status of the device is changed.

Returns
true or false

◆ isHostDetectionBandConfig()

bool SI4844::isHostDetectionBandConfig ( )

Band CFG0 (Band Detection Configuration)

The ATDD device has two operating modes of band detection configuration options:

either the ATDD device detects the band or the system controller detects and controls

the band by its own mechanism.

For the ATDD device, the BAND pin of the device must be connected to the band switch resistor.

Returns
false = ATDD device detects band; True = Host detects band

References SI4844::getAllReceiverInfo().

◆ needHostPowerUp()

bool SI4844::needHostPowerUp ( )
inline

Checks Host Power Up Status.

if True, the system needs to Power Up the device

Call getStatus or getAllReceiverInfo before calling this function

Returns
True: issue the ATDD_POWER_UP command with the valid band index detected.

◆ needHostReset()

bool SI4844::needHostReset ( )
inline

Checks HOST Reset Status

Check if the host (microcontroler) needs to reset the device.

Call getStatus or getAllReceiverInfo before calling this function

Returns
True or False.

◆ powerDown()

void SI4844::powerDown ( void  )

Power the device down.

Moves the SI4844 device from power up to power down mode.

See also
Si48XX ATDD PROGRAMMING GUIDE; AN610; page 45

◆ powerUp()

void SI4844::powerUp ( void  )

Power the device up.

Todo:
UNDER CONSTRUCTION

Moves the SI4844 device from power down to power up

See also
Si48XX ATDD PROGRAMMING GUIDE; AN610; page 45

Referenced by SI4844::setupSlideSwitch().

◆ removeCustomBand()

void SI4844::removeCustomBand ( int8_t  bandIdx)

Remove a custom band in the list of custom bands.

Parameters
bandIdxThe index number of the band to search for.
See also
Table 8: Pre-defined Band Table in the Si48XX ATDD Programming Guide (AN610), pages 17 and 18.

◆ reset()

void SI4844::reset ( void  )

Resets the SI4844 device.

Prepares the system to be started.

See also
pages 7, 8, 9 and 10 of the programming guide.

Referenced by SI4844::debugDevice(), SI4844::setBand(), SI4844::setBandSlideSwitch(), SI4844::setCustomBand(), SI4844::setup(), and SI4844::setupSlideSwitch().

◆ resetStatus()

void SI4844::resetStatus ( void  )

set the interrupr status to false. It will turn true after next interrupr

◆ setAmSoftMuteMaxAttenuation()

void SI4844::setAmSoftMuteMaxAttenuation ( uint8_t  value)

Sets AM Soft Mute Max Attenuation..

Maximum attenuation to apply when in soft mute. Specified in units of dB. Default maximum attenuation is 16 dB.

Set to 0 to disable soft mute. Valid range: 0 - 63.

Parameters
valuenumber between 0 and 63

◆ setAmSoftMuteRate()

void SI4844::setAmSoftMuteRate ( uint8_t  value)

Sets the attack and decay rates when entering or leaving soft mute.

The value specified is multiplied by 4.35 dB/s to come up with the actual attack rate. The CTS bit is set when it is safe to send the next command.

This property may only be set or read when in power up mode. The default rate is 278 dB/s.

Determines how quickly the AM goes into soft mute when soft mute is enabled. The actual rate is calculated by taking the value written to the field

and multiplying it with 4.35 dB/s. The default rate is 278 dB/s (SMRATE[15:0] = 0x0040).

Default: 0x0040; Actual Rate: SMRATE x 4.35; Units: dB/s

Parameters
value1–255

◆ setAmSoftMuteSlope()

void SI4844::setAmSoftMuteSlope ( uint8_t  value)

Configures attenuation slope during soft mute in dB attenuation per dB SNR below the soft mute SNR threshold.

Soft mute attenuation is the minimum of SMSLOPE x (SMTHR – SNR) and SMATTN. The recommended SMSLOPE value is CEILING(SMATTN/SMTHR).

SMATTN and SMTHR are set via the AM_SOFT_MUTE_MAX_ATTENUATION and AM_SOFT_MUTE_SNR_THRESHOLD properties. The CTS bit is

set when it is safe to send the next command. This property may only be set or read when in power up mode. The

default slope is 2 dB/dB. Default: 0x0001 Units: dB/dB

Parameters
value1–5

◆ setAmSoftMuteSnrThreshold()

void SI4844::setAmSoftMuteSnrThreshold ( uint8_t  value)

Sets the SNR threshold to engage soft mute.

Whenever the SNR for a tuned frequency drops below this threshold the AM reception will go in soft mute, provided soft mute max attenuation property is non-zero. The CTS bit is set when it is safe to send the next command.

This property may only be set or read when in power up mode. The default SNR threshold is 8.

Default: 0x0008; Units: dB;

Parameters
value0–63

◆ setAudioMode()

si4844_audiomode_status_response SI4844::setAudioMode ( uint8_t  audiomode,
uint8_t  fm_mono,
uint8_t  adjpt_attn,
uint8_t  adjpt_steo,
uint8_t  opcode 
)

Set audio mode.

See also
Si48XX ATDD PROGRAMMING GUIDE; AN610; page 21
Parameters
byteaudio_mode 0 = Digital volume mode (no bass/treble effect, volume levels from 0 to 63) 1 = Bass/treble mode (no digital volume control, fixed volume level at 59) 2 = Mixed mode 1 (bass/treble and digital volume coexist, max volume = 59) 3 = Mixed mode 2 (bass/treble and digital volume coexist, max volume = 63) Default is 3 (Mixed mode 2).
bytefm_mono 0 = Stereo audio output (default) 1 = Mono audio output
byteadjpt_attn Audio attention of adjacent tune wheel positions of a station 0 = {–2 dB, -0dB, –2 dB} i.e., adjacent points volume levels –2 dB (default) 1 = {–0 dB, -0dB, –0 dB} i.e., adjacent points same volume levels
byteadjpt_steo 0 = Adjacent points allow stereo separation and stereo indicator on (default) 1 = Adjacent points disable stereo separation and stereo indicator are off
byteopcode 0 = Set audio mode and settings 1 = Get current audio mode and settings without setting

◆ setAudioMute()

void SI4844::setAudioMute ( bool  on)

Mutes the audio output.

Parameters
boolon false = normal (no mute); true = mute

◆ setBand()

void SI4844::setBand ( uint8_t  bandIndex = 0)

Sets a new band to the device.

This method is used to select a band

If a band is defined in the custom band list, the specified band will be configured;

otherwise, the predefined band set by the device will be applied.

The main difference between this function and the setBand function (used in MCU band selection mode) is that,

in the Slide Switch band selection mode, the selected band is not known in advance. It is necessary to detect

the band first, and then select it.

See also
See Table 8. Pre-defined Band Table in Si48XX ATDD PROGRAMMING GUIDE; AN610; pages 17 and 18
Parameters
new_bandband number.
Todo:
The functions setBand and setBandSlideSwitch will be rewritten with the goal of improving the final code.

References SI4844::getAllReceiverInfo(), and SI4844::reset().

◆ setBandSlideSwitch()

void SI4844::setBandSlideSwitch ( )

Sets a new band to the device configured as Slide Switch.

If a band is defined in the custom band list, the specified band will be configured;

otherwise, the predefined band set by the device will be applied.

See also
See Table 8. Pre-defined Band Table in Si48XX ATDD PROGRAMMING GUIDE; AN610; pages 17 and 18
Parameters
bandband index number.
See also
Si4822/26/27/40/44 A NTENNA , SCHEMATIC , LAYOUT, AND DESIGN GUIDELINES
Todo:
The functions setBand and setBandSlideSwitch will be rewritten with the goal of improving the final code.

References SI4844::getAllReceiverInfo(), and SI4844::reset().

Referenced by SI4844::setupSlideSwitch().

◆ setBassTreble()

void SI4844::setBassTreble ( uint8_t  bass_treble)

Set the sound volume level, bass and treble.

bass_treble Description
0 Bass boost +4 (max)
1 Bass boost +3
2 Bass boost +2
3 Bass boost +1 (min)
4 Normal (No Bass/Treble effect) (Default) 5- Treble boost +1 (min)
6 Treble boost +2
7 Treble boost +3
8 Treble boost +4 (max)
See also
Si48XX ATDD PROGRAMMING GUIDE; AN610; pages 29, 35, 65 and 67
Parameters
bass_treblebass and treble (domain: 0 to 8). See table above

◆ setBlendThresholdStereoIndicator()

void SI4844::setBlendThresholdStereoIndicator ( uint16_t  value)

Sets the blend threshold for stereo indicator.

The CTS bit is set when it is safe to send the next command. This property may only be set or read when in powerup mode.

The default value is band dependent (either 0x9F or 0xB2)

Default: 0x009F or 0x00B2 (Band dependent)

Parameters
value0–0xFF

◆ setCrystalOscillatorEnable()

void SI4844::setCrystalOscillatorEnable ( uint8_t  XOSCEN)

Sets Crystal Oscillator Enable.

0 = Use external RCLK (crystal oscillator disabled).

1 = Use crystal oscillator (XTALI and XTALO with external 32.768 kHz crystal).

See the SI48XX Data Sheet Application Schematic for external BOM details.

See also
See Table 8. Pre-defined Band Table in Si48XX ATDD PROGRAMMING GUIDE; AN610; pages 17 and 18
Parameters
XOSCEN1 = Enable (XTALI and XTALO with external 32.768 kHz crystal)

◆ setCrystalOscillatorStabilizationWaitTime()

void SI4844::setCrystalOscillatorStabilizationWaitTime ( uint8_t  XOWAIT)

Sets Crystal Oscillator Stabilization Wait Time After Reset.

0 = 600 ms (for typical crystal)

1 = 900 ms (for crystal requiring extra stabilization time)

Note: Applicable to Si4822/26/40/44A parts only. Later Si4827/44B parts don’t care this bit and will wait till crystal oscillation is stable unconditionally.

See also
See Table 8. Pre-defined Band Table in Si48XX ATDD PROGRAMMING GUIDE; AN610; pages 17 and 18
Parameters
XOSCEN1 = Enable (XTALI and XTALO with external 32.768 kHz crystal)

◆ setCustomBand()

void SI4844::setCustomBand ( uint8_t  bandIndex,
uint16_t  botton,
uint16_t  top,
uint8_t  bandSpace,
uint8_t  dfband = 0,
uint8_t  uni_am = 0,
uint8_t  tvreq = 0 
)

This method allows you to customize the frequency range of a band.

Lagacy - See setBand, addCustomBand, and setUserDefinedBand.

The SI4844 can work from 2.3–28.5 MHz on SW, 64.0–109.0MHz on FM

You can configure the band index 40, for example, to work between 27 to 28 MHz.

This function works only in MCU band select mode.

See also
Si48XX ATDD PROGRAMMING GUIDE, pages 17, 18, 19 and 20.
setBand, addCustomBand, setUserDefinedBand

(top – button)/(bandSpace) must be betwenn 50 and 230

Parameters
bandIndesPredefined band index (valid values: betwenn 0 and 40)
buttonBand Bottom Frequency Limit
topBand Top Frequency Limit
bandSpaceChannel Spacing (use 5 or 10 - On FM 10 = 100KHz)
dfbandDefault Band Settings; 0 = Allow host controller to override the band property settings; 1 = Force to use tuner default band property settings (Applicable to Si4827 part only)
uni_amUniversal AM Band. 0 = Disable universal AM band (default AFC range of 1.1 kHz); 1 = Enable universal AM band (wider AFC range in tuning); Applicable to Si4827 and Si4844B parts and AMRX mode only
tvreqTV Audio Channel Frequency Display; 0 = Disable TV audio channel frequency display format; 1 = Enable TV audio channel frequency display format; Applicable to Si4827 and Si4844B parts and FMRX mode only

References SI4844::getAllReceiverInfo(), and SI4844::reset().

◆ setFmDeemphasis()

void SI4844::setFmDeemphasis ( uint8_t  value)

Sets de-emphasis time constant.

Sets the FM Receive de-emphasis to 50 or 75 μs. Default is 75 μs.

Parameters
value1 = 50 μs. Used in Europe, Australia, Japan, China; 2 = 75 μs. Used in USA

◆ setFmSoftMuteMaxAttenuation()

void SI4844::setFmSoftMuteMaxAttenuation ( uint8_t  value)

FM Soft Mute Maximum Attenuation.

Maximum attenuation to apply when in soft mute. Specified in units of dB. Default maximum attenuation is 16 dB.

Set to 0 to disable soft mute. Valid range: 0 - 31.

Parameters
valuenumber between 0 and 31

◆ setFmSoftMuteRate()

void SI4844::setFmSoftMuteRate ( uint8_t  value)

Sets the attack and decay rates when entering and leaving soft mute.

Later values increase rates, and lower values decrease rates.

The CTS is set when it is safe to send the next command. This property may only be set or read when in powerup mode. The default is 64.

Parameters
value1—255 (default 64)

◆ setFmSoftMuteSlope()

void SI4844::setFmSoftMuteSlope ( uint8_t  value)

Configures attenuation slope during soft mute in dB attenuation per dB SNR below the soft mute SNR threshold.

Soft mute attenuation is the minimum of SMSLOPE x (SMTHR – SNR) and SMATTN.

The recommended SMSLOPE value is CEILING(SMATTN/SMTHR). SMATTN and SMTHR are set via the FM_SOFT_MUTE_MAX_ATTENUATION and FM_SOFT_MUTE_SNR_THRESHOLD properties.

The CTS bit is set when it is safe to send the next command. This property may only be set or read when in power up mode.

Parameters
value0–63 (default 2)

◆ setReferenceClockFrequency()

void SI4844::setReferenceClockFrequency ( uint16_t  value)

Sets the frequency of the REFCLK from the output of the prescaler.

The REFCLK range is 31130 to 34406 Hz (32768 ±5% Hz) in 1 Hz steps, or 0 (to disable AFC).

For example, an reference clock at XTALI pin of 13 MHz would require a prescaler value of 400 to divide it to 32500 Hz REFCLK.

The reference clock frequency property would then need to be set to 32500 Hz. Reference clock frequencies between 31130 Hz and 40 MHz are supported, however, there are gaps in frequency coverage for prescaler values ranging from 1 to 10, or frequencies up to 311300 Hz.

Parameters
value31130-34406 (default 32768)
See also
SI48XX ATDD Programming Guide (AN610) page 26.

◆ setReferenceClockPrescaler()

void SI4844::setReferenceClockPrescaler ( uint16_t  value)

Sets the number used by the prescaler to divide the external reference clock frequency down to the internal REFCLK.

The range may be between 1 and 4095 in 1 unit steps. For example, an XTALI reference clock of 13 MHz would require a prescaler value of 400 to divide it to 3250 Hz.

The reference clock frequency property would then need to be set to 32500 Hz. The reference clock must be valid 10 ns before the chip reset signal. In addition, the reference clock must be valid at all times for proper tuning and AFC operations.

XTALI reference clock input frequency could be changed but is not recommended and REFCLK properties values need to be reconfigured accordingly.

Prescaler for Reference Clock is an integer number used to divide clock frequency down to REFCLK frequency. The allowed REFCLK frequency range is between 31130 and 34406 Hz (32768 5%), or 0 (to disable AFC).

Parameters
value1-4095 (default 1)
See also
SI48XX ATDD Programming Guide (AN610) page 27.

◆ setup()

void SI4844::setup ( uint16_t  resetPin,
int  interruptPin,
int8_t  defaultBand = 0,
uint32_t  hightClockSpeed = 50000 
)

Initiates the SI4844 instance and connect the device (SI4844) to Arduino.

Calling this library should be the first thing to do to control the SI4844.

If interruptPin is -1, it means you will control interrupt in your sketch.

In this case, you have to call interrupt_hundler() (see SI4844.h)

Parameters
resetPinarduino pin used to reset the device
interruptPininterruprPin arduino pin used to handle interrupt
defaultBandband that the radio should start. If -1 no band is selected and you must select one after starting. Default 0 = FM.
hightClockSpeedhight I2C clock speed to be used by the system (optional - default 50000 - 50kHz).

References SI4844::getFirmware(), and SI4844::reset().

◆ setupSlideSwitch()

void SI4844::setupSlideSwitch ( uint16_t  resetPin,
int  interruptPin,
uint32_t  hightClockSpeed = 50000 
)

Initiates the SI48XX instance and connect the device (SI4844) to a microcontroller.

Todo:
UNDER CONSTRUCTION

This function initializes the Si48XX with the "Slide Switch Selects Band" configuration, where a resistor

network (voltage divider) is connected to the BAND pin of the device (Si4844, Si4826, or Si4827).

While in the setup function the band control is managed by the microcontroller, the setupSlideSwitch

function assumes that you are using a mechanical band selector.

Calling this library should be the first thing to do to control the SI48XX.

If interruptPin is -1, it means you will control interrupt in your sketch.

In this case, you have to call interrupt_hundler() (see SI4844.h)

Parameters
resetPinarduino pin used to reset the device
interruptPininterruprPin arduino pin used to handle interrupt
hightClockSpeedhight I2C clock speed to be used by the system (optional - default 50000 - 50kHz).

References SI4844::getStatus(), SI4844::powerUp(), SI4844::reset(), and SI4844::setBandSlideSwitch().

◆ setVolume()

void SI4844::setVolume ( byte  volumeLavel)

Sets the volume level.

Sets a value to the audio volume.

See also
Table 4, Si48XX ATDD PROGRAMMING GUIDE; AN610; page 11
Parameters
bytevolumeLevel (domain: 0 to 63)

◆ volumeDown()

void SI4844::volumeDown ( void  )

Decreases the volume level.

◆ volumeUp()

void SI4844::volumeUp ( void  )

Increases the volume level.