Skip to content

Commit

Permalink
SI473X Arduino Library
Browse files Browse the repository at this point in the history
  • Loading branch information
pu2clr committed Mar 30, 2022
1 parent cddcf2d commit 4fbacdf
Show file tree
Hide file tree
Showing 161 changed files with 2,055 additions and 3,246 deletions.
35 changes: 18 additions & 17 deletions SI4735.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1405,12 +1405,12 @@ void SI4735::setSeekFmSpacing(uint16_t spacing)
}

/**
* @ingroup group08 Seek
*
* @brief Sets the SNR threshold for a valid AM Seek/Tune.
*
* @ingroup group08 Seek
*
* @brief Sets the SNR threshold for a valid AM Seek/Tune.
*
* @details If the value is zero then SNR threshold is not considered when doing a seek. Default value is 5 dB.
*
* @details please, call setSeekAmSNRThreshold instead setSeekAmSrnThreshold
* @see Si47XX PROGRAMMING GUIDE; (REV 1.0); page 127
*/
void SI4735::setSeekAmSrnThreshold(uint16_t value)
Expand All @@ -1419,14 +1419,14 @@ void SI4735::setSeekAmSrnThreshold(uint16_t value)
}

/**
* @ingroup group08 Seek
*
* @brief Sets the SNR threshold for a valid FM Seek/Tune.
*
* @ingroup group08 Seek
*
* @brief Sets the SNR threshold for a valid FM Seek/Tune.
*
* @details SNR Threshold which determines if a valid channel has been found during Seek/Tune. Specified in units of dB in 1 dB steps (0–127). Default is 3 dB
*
* @details please, call setSeekFmSNRThreshold instead setSeekFmSrnThreshold
* @see Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 102
*
*
* @param value between 0 and 127.
*/
void SI4735::setSeekFmSrnThreshold(uint16_t value)
Expand Down Expand Up @@ -2874,17 +2874,18 @@ void SI4735::setSSBAvcDivider(uint8_t AVC_DIVIDER)
sendSSBModeProperty();
}

/**
/**
* @ingroup group17 Patch and SSB support
*
*
* @brief Sets SBB Sideband Cutoff Filter for band pass and low pass filters.
*
*
* @details 0 = Band pass filter to cutoff both the unwanted side band and high frequency components > 2.0 kHz of the wanted side band. (default)
* @details 1 = Low pass filter to cutoff the unwanted side band.
* @details 1 = Low pass filter to cutoff the unwanted side band.
* Other values = not allowed.
* @details please call setSSBSidebandCutoffFilter instead setSBBSidebandCutoffFilter
*
* @see AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 24
*
* @see AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 24
*
* @param SBCUTFLT 0 or 1; see above
*/
void SI4735::setSBBSidebandCutoffFilter(uint8_t SBCUTFLT)
Expand Down
5 changes: 5 additions & 0 deletions SI4735.h
Original file line number Diff line number Diff line change
Expand Up @@ -2257,12 +2257,15 @@ class SI4735
void setSeekAmLimits(uint16_t bottom, uint16_t top);
void setSeekAmSpacing(uint16_t spacing);
void setSeekAmSrnThreshold(uint16_t value);
void inline setSeekAmSNRThreshold(uint16_t value) { setSeekAmSrnThreshold(value); }; // Fixing the function name

void setSeekAmRssiThreshold(uint16_t value);

// FM Seek property configurations
void setSeekFmLimits(uint16_t bottom, uint16_t top);
void setSeekFmSpacing(uint16_t spacing);
void setSeekFmSrnThreshold(uint16_t value);
void inline setSeekFmSNRThreshold(uint16_t value) { setSeekFmSrnThreshold(value); }; // Fixing the function name
void setSeekFmRssiThreshold(uint16_t value);

void setFmBlendStereoThreshold(uint8_t parameter);
Expand Down Expand Up @@ -2486,6 +2489,8 @@ class SI4735
void setSSBAudioBandwidth(uint8_t AUDIOBW);
void setSSBAutomaticVolumeControl(uint8_t AVCEN);
void setSBBSidebandCutoffFilter(uint8_t SBCUTFLT);
void inline setSSBSidebandCutoffFilter(uint8_t SBCUTFLT) { setSBBSidebandCutoffFilter(SBCUTFLT); }; // Fixing the function name

void setSSBAvcDivider(uint8_t AVC_DIVIDER);
void setSSBDspAfc(uint8_t DSP_AFCDIS);
void setSSBSoftMute(uint8_t SMUTESEL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void loop()
case 'F':
rx.setFM(8600, 10800, 10390, 50);
rx.setSeekAmRssiThreshold(0);
rx.setSeekAmSrnThreshold(10);
rx.setSeekAmSNRThreshold(10);
break;
case '1':
rx.setAM(100, 30000, 7200, 5);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ void loop()
si4735.setSSBAudioBandwidth(bandwidthIdx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthIdx == 0 || bandwidthIdx == 4 || bandwidthIdx == 5)
si4735.setSBBSidebandCutoffFilter(0);
si4735.setSSBSidebandCutoffFilter(0);
else
si4735.setSBBSidebandCutoffFilter(1);
si4735.setSSBSidebandCutoffFilter(1);
showStatus();
}
else if (key == '>' || key == '.') // goes to the next band
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void loop()
case 'F':
si47xx.setFM(8600, 10800, 10390, 50);
si47xx.setSeekAmRssiThreshold(0);
si47xx.setSeekAmSrnThreshold(10);
si47xx.setSeekAmSNRThreshold(10);
break;
case '1':
si47xx.setAM(100, 30000, 7200, 5);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,9 @@ void loop()
si4735.setSSBAudioBandwidth(bandwidthIdx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthIdx == 0 || bandwidthIdx == 4 || bandwidthIdx == 5)
si4735.setSBBSidebandCutoffFilter(0);
si4735.setSSBSidebandCutoffFilter(0);
else
si4735.setSBBSidebandCutoffFilter(1);
si4735.setSSBSidebandCutoffFilter(1);
showStatus();
}
else if (key == '>' || key == '.') // goes to the next band
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,9 @@ void loop()
si4735.setSSBAudioBandwidth(bwIdxSSB);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bwIdxSSB == 0 || bwIdxSSB == 4 || bwIdxSSB == 5)
si4735.setSBBSidebandCutoffFilter(0);
si4735.setSSBSidebandCutoffFilter(0);
else
si4735.setSBBSidebandCutoffFilter(1);
si4735.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,9 @@ void doBandwidth(int8_t v)
rx.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
rx.setSBBSidebandCutoffFilter(0);
rx.setSSBSidebandCutoffFilter(0);
else
rx.setSBBSidebandCutoffFilter(1);
rx.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,9 @@ void readAllReceiverInformation()
rx.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
rx.setSBBSidebandCutoffFilter(0);
rx.setSSBSidebandCutoffFilter(0);
else
rx.setSBBSidebandCutoffFilter(1);
rx.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down Expand Up @@ -916,9 +916,9 @@ void doBandwidth(int8_t v)
rx.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
rx.setSBBSidebandCutoffFilter(0);
rx.setSSBSidebandCutoffFilter(0);
else
rx.setSBBSidebandCutoffFilter(1);
rx.setSSBSidebandCutoffFilter(1);

band[bandIdx].bandwidthIdx = bwIdxSSB;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,9 @@ void readAllReceiverInformation()
rx.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
rx.setSBBSidebandCutoffFilter(0);
rx.setSSBSidebandCutoffFilter(0);
else
rx.setSBBSidebandCutoffFilter(1);
rx.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down Expand Up @@ -862,9 +862,9 @@ void doBandwidth(int8_t v)
rx.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
rx.setSBBSidebandCutoffFilter(0);
rx.setSSBSidebandCutoffFilter(0);
else
rx.setSBBSidebandCutoffFilter(1);
rx.setSSBSidebandCutoffFilter(1);

band[bandIdx].bandwidthIdx = bwIdxSSB;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,9 @@ void loop()
si4735.setSSBAudioBandwidth(bwIdxSSB);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bwIdxSSB == 0 || bwIdxSSB == 4 || bwIdxSSB == 5)
si4735.setSBBSidebandCutoffFilter(0);
si4735.setSSBSidebandCutoffFilter(0);
else
si4735.setSBBSidebandCutoffFilter(1);
si4735.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,9 @@ void doBandwidth(int8_t v)
rx.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
rx.setSBBSidebandCutoffFilter(0);
rx.setSSBSidebandCutoffFilter(0);
else
rx.setSBBSidebandCutoffFilter(1);
rx.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@ void readAllReceiverInformation() {
si4735.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
si4735.setSBBSidebandCutoffFilter(0);
si4735.setSSBSidebandCutoffFilter(0);
else
si4735.setSBBSidebandCutoffFilter(1);
si4735.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM) {
bwIdxAM = bwIdx;
Expand Down Expand Up @@ -829,9 +829,9 @@ void loop()
si4735.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
si4735.setSBBSidebandCutoffFilter(0);
si4735.setSSBSidebandCutoffFilter(0);
else
si4735.setSBBSidebandCutoffFilter(1);
si4735.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ void readAllReceiverInformation()
si4735.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
si4735.setSBBSidebandCutoffFilter(0);
si4735.setSSBSidebandCutoffFilter(0);
else
si4735.setSBBSidebandCutoffFilter(1);
si4735.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down Expand Up @@ -958,9 +958,9 @@ void doBandwidth(uint8_t v)
si4735.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
si4735.setSBBSidebandCutoffFilter(0);
si4735.setSSBSidebandCutoffFilter(0);
else
si4735.setSBBSidebandCutoffFilter(1);
si4735.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,9 @@ void loop()
si4735.setSSBAudioBandwidth(bwIdxSSB);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bwIdxSSB == 0 || bwIdxSSB == 4 || bwIdxSSB == 5)
si4735.setSBBSidebandCutoffFilter(0);
si4735.setSSBSidebandCutoffFilter(0);
else
si4735.setSBBSidebandCutoffFilter(1);
si4735.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -915,9 +915,9 @@ void loop(void)
si4735.setSSBAudioBandwidth(bwIdxSSB);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bwIdxSSB == 0 || bwIdxSSB == 4 || bwIdxSSB == 5)
si4735.setSBBSidebandCutoffFilter(0);
si4735.setSSBSidebandCutoffFilter(0);
else
si4735.setSBBSidebandCutoffFilter(1);
si4735.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,9 @@ void doBandwidth(int8_t v) {
rx.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
rx.setSBBSidebandCutoffFilter(0);
rx.setSSBSidebandCutoffFilter(0);
else
rx.setSBBSidebandCutoffFilter(1);
rx.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,9 @@ void loop()
si4735.setSSBAudioBandwidth(bwIdxSSB);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bwIdxSSB == 0 || bwIdxSSB == 4 || bwIdxSSB == 5)
si4735.setSBBSidebandCutoffFilter(0);
si4735.setSSBSidebandCutoffFilter(0);
else
si4735.setSBBSidebandCutoffFilter(1);
si4735.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ void readAllReceiverInformation()
rx.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
rx.setSBBSidebandCutoffFilter(0);
rx.setSSBSidebandCutoffFilter(0);
else
rx.setSBBSidebandCutoffFilter(1);
rx.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down Expand Up @@ -908,9 +908,9 @@ void doBandwidth(int8_t v)
rx.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
rx.setSBBSidebandCutoffFilter(0);
rx.setSSBSidebandCutoffFilter(0);
else
rx.setSBBSidebandCutoffFilter(1);
rx.setSSBSidebandCutoffFilter(1);

band[bandIdx].bandwidthIdx = bwIdxSSB;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ void readAllReceiverInformation()
rx.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
rx.setSBBSidebandCutoffFilter(0);
rx.setSSBSidebandCutoffFilter(0);
else
rx.setSBBSidebandCutoffFilter(1);
rx.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down Expand Up @@ -850,9 +850,9 @@ void doBandwidth(int8_t v)
rx.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
rx.setSBBSidebandCutoffFilter(0);
rx.setSSBSidebandCutoffFilter(0);
else
rx.setSBBSidebandCutoffFilter(1);
rx.setSSBSidebandCutoffFilter(1);

band[bandIdx].bandwidthIdx = bwIdxSSB;
}
Expand Down
8 changes: 4 additions & 4 deletions examples/SI47XX_06_ESP32/OLED_ALL_IN_ONE/OLED_ALL_IN_ONE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,9 @@ void readAllReceiverInformation()
rx.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
rx.setSBBSidebandCutoffFilter(0);
rx.setSSBSidebandCutoffFilter(0);
else
rx.setSBBSidebandCutoffFilter(1);
rx.setSSBSidebandCutoffFilter(1);
}
else if (currentMode == AM)
{
Expand Down Expand Up @@ -766,9 +766,9 @@ void doBandwidth(int8_t v)
rx.setSSBAudioBandwidth(bandwidthSSB[bwIdxSSB].idx);
// If audio bandwidth selected is about 2 kHz or below, it is recommended to set Sideband Cutoff Filter to 0.
if (bandwidthSSB[bwIdxSSB].idx == 0 || bandwidthSSB[bwIdxSSB].idx == 4 || bandwidthSSB[bwIdxSSB].idx == 5)
rx.setSBBSidebandCutoffFilter(0);
rx.setSSBSidebandCutoffFilter(0);
else
rx.setSBBSidebandCutoffFilter(1);
rx.setSSBSidebandCutoffFilter(1);

band[bandIdx].bandwidthIdx = bwIdxSSB;
}
Expand Down
Loading

0 comments on commit 4fbacdf

Please sign in to comment.