Skip to content

Commit

Permalink
Add information about the antenna capacitor
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed Aug 17, 2020
1 parent 1612e8e commit ee46be4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion plugin_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function OnConnectionChanged() {
<p>Power (88-115, 116-120<sup>*</sup>): <?php PrintSettingTextSaved("Power", 2, 0, 3, 3, "fpp-vastfmt", "110"); ?>dB&mu;V
<br /><sup>*</sup>Can be set as high as 120dB&mu;V, but voltage accuracy above 115dB&mu;V is not guaranteed.</p>
<p>Preemphasis: <?php PrintSettingSelect("Preemphasis", "Preemphasis", 2, 0, "75us", Array("50&mu;s (Europe, Australia, Japan)"=>"50us", "75&mu;s (USA, default)"=>"75us"), "fpp-vastfmt", ""); ?></p>
<p>Antenna Tuning Capacitor (0=Auto, 1-191): <?php PrintSettingTextSaved("AntCap", 2, 0, 3, 3, "fpp-vastfmt", "0"); ?> * 0.25pF </p>
<p>Antenna Tuning Capacitor (0=Auto, 1-191): <?php PrintSettingTextSaved("AntCap", 2, 0, 3, 3, "fpp-vastfmt", "0"); ?> * 0.25pF (If set to 0 and no FM signal detected, try a value around 50-80)</p>
<p>Enable Audio Limitter: <?php PrintSettingCheckbox("AudioLimitter", "AudioLimitter", 2, 0, "True", "False", "fpp-vastfmt", "", "True"); ?></p>
<p>Enable Audio Compression: <?php PrintSettingCheckbox("AudioCompression", "AudioCompression", 2, 0, "True", "False", "fpp-vastfmt", "", "True"); ?></p>
<p>Audio Compression Threshold (-64 - 0 db): <?php PrintSettingTextSaved("AudioCompressionThreshold", 2, 0, 3, 3, "fpp-vastfmt", "-15"); ?></p>
Expand Down
19 changes: 9 additions & 10 deletions src/FPPVastFM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ class FPPVastFMPlugin : public FPPPlugin {
si4713->enableAudioLimitter(settings["AudioLimitter"] == "True");
si4713->setAudioGain(std::stoi(settings["AudioGain"]));
si4713->setAudioCompressionThreshold(std::stoi(settings["AudioCompressionThreshold"]));

if (settings["Preemphasis"] == "50us") {
si4713->setEUPreemphasis();
}

si4713->Init();

std::string rev = si4713->getRev();
Expand All @@ -96,18 +99,14 @@ class FPPVastFMPlugin : public FPPPlugin {
void startVast() {
if (si4713 == nullptr) {
if (initVast()) {
if (settings["Preemphasis"] == "50us") {
si4713->setEUPreemphasis();
}

float f = std::stoi(settings["AntCap"]);
si4713->setTXPower(std::stoi(settings["Power"]), f);

std::string freq = settings["Frequency"];
f = std::stof(freq);
float f = std::stof(freq);
f *= 100;

si4713->setFrequency(f);

f = std::stoi(settings["AntCap"]);
si4713->setTXPower(std::stoi(settings["Power"]), f);

si4713->setPTY(std::stoi(settings["Pty"]));

std::string asq = si4713->getASQ();
Expand Down
3 changes: 1 addition & 2 deletions src/I2CSi4713.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ I2CSi4713::I2CSi4713(const std::string &gpioPin) {
}
}
I2CSi4713::~I2CSi4713() {

if (i2c) {
//sendSi4711Command(SI4710_CMD_POWER_DOWN, {});
delete i2c;
}

}


Expand Down
5 changes: 4 additions & 1 deletion src/Si4713.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ void Si4713::setFrequency(int frequency) {
sendSi4711Command(TX_TUNE_FREQ, {0x00, ft, fl});
}
void Si4713::setTXPower(int power, double antCap) {
uint8_t rfcap0 = antCap/0.25;
uint8_t rfcap0 = antCap;
if (rfcap0 > 191) {
rfcap0 = 191;
}
uint8_t p = power & 0xff;
sendSi4711Command(TX_TUNE_POWER, {0x00, 0x00, p, rfcap0});
}
Expand Down

0 comments on commit ee46be4

Please sign in to comment.