Device protocol update: support device with up to 4 ports
This commit is contained in:
parent
a0c45d3c56
commit
99c6d77ad8
BIN
Documentation/DeveloperInfo/Device_protocol_v13.pdf
Normal file
BIN
Documentation/DeveloperInfo/Device_protocol_v13.pdf
Normal file
Binary file not shown.
1392
Documentation/DeveloperInfo/Device_protocol_v13.tex
Normal file
1392
Documentation/DeveloperInfo/Device_protocol_v13.tex
Normal file
File diff suppressed because it is too large
Load Diff
@ -245,7 +245,7 @@ QString LibreVNADriver::getStatus()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0xFF:
|
case 0xFF:
|
||||||
ret.append("MCU Temp: "+QString::number(lastStatus.VFF.temp_MCU)+"°C");
|
ret.append(" MCU Temp: "+QString::number(lastStatus.VFF.temp_MCU)+"°C");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@ -358,6 +358,8 @@ bool LibreVNADriver::setVNA(const DeviceDriver::VNASettings &s, std::function<vo
|
|||||||
zerospan = (s.freqStart == s.freqStop) && (s.dBmStart == s.dBmStop);
|
zerospan = (s.freqStart == s.freqStop) && (s.dBmStart == s.dBmStop);
|
||||||
p.settings.port1Stage = find(s.excitedPorts.begin(), s.excitedPorts.end(), 1) - s.excitedPorts.begin();
|
p.settings.port1Stage = find(s.excitedPorts.begin(), s.excitedPorts.end(), 1) - s.excitedPorts.begin();
|
||||||
p.settings.port2Stage = find(s.excitedPorts.begin(), s.excitedPorts.end(), 2) - s.excitedPorts.begin();
|
p.settings.port2Stage = find(s.excitedPorts.begin(), s.excitedPorts.end(), 2) - s.excitedPorts.begin();
|
||||||
|
p.settings.port3Stage = find(s.excitedPorts.begin(), s.excitedPorts.end(), 3) - s.excitedPorts.begin();
|
||||||
|
p.settings.port4Stage = find(s.excitedPorts.begin(), s.excitedPorts.end(), 4) - s.excitedPorts.begin();
|
||||||
p.settings.syncMode = (int) sync;
|
p.settings.syncMode = (int) sync;
|
||||||
p.settings.syncMaster = syncMaster ? 1 : 0;
|
p.settings.syncMaster = syncMaster ? 1 : 0;
|
||||||
|
|
||||||
@ -411,7 +413,7 @@ bool LibreVNADriver::setSA(const DeviceDriver::SASettings &s, std::function<void
|
|||||||
p.spectrumSettings.trackingPower = s.trackingPower * 100;
|
p.spectrumSettings.trackingPower = s.trackingPower * 100;
|
||||||
|
|
||||||
p.spectrumSettings.trackingGenerator = s.trackingGenerator ? 1 : 0;
|
p.spectrumSettings.trackingGenerator = s.trackingGenerator ? 1 : 0;
|
||||||
p.spectrumSettings.trackingGeneratorPort = s.trackingPort == 2 ? 1 : 0;
|
p.spectrumSettings.trackingGeneratorPort = s.trackingPort - 1;
|
||||||
p.spectrumSettings.syncMode = (int) sync;
|
p.spectrumSettings.syncMode = (int) sync;
|
||||||
p.spectrumSettings.syncMaster = syncMaster ? 1 : 0;
|
p.spectrumSettings.syncMaster = syncMaster ? 1 : 0;
|
||||||
|
|
||||||
@ -482,8 +484,10 @@ bool LibreVNADriver::setIdle(std::function<void (bool)> cb)
|
|||||||
QStringList LibreVNADriver::availableExtRefInSettings()
|
QStringList LibreVNADriver::availableExtRefInSettings()
|
||||||
{
|
{
|
||||||
QStringList ret;
|
QStringList ret;
|
||||||
for(auto r : Reference::getReferencesIn()) {
|
if(hardwareVersion == 0x01) {
|
||||||
ret.push_back(Reference::TypeToLabel(r));
|
for(auto r : Reference::getReferencesIn()) {
|
||||||
|
ret.push_back(Reference::TypeToLabel(r));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -491,8 +495,10 @@ QStringList LibreVNADriver::availableExtRefInSettings()
|
|||||||
QStringList LibreVNADriver::availableExtRefOutSettings()
|
QStringList LibreVNADriver::availableExtRefOutSettings()
|
||||||
{
|
{
|
||||||
QStringList ret;
|
QStringList ret;
|
||||||
for(auto r : Reference::getOutFrequencies()) {
|
if(hardwareVersion == 0x01) {
|
||||||
ret.push_back(Reference::OutFreqToLabel(r));
|
for(auto r : Reference::getOutFrequencies()) {
|
||||||
|
ret.push_back(Reference::OutFreqToLabel(r));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -579,8 +585,7 @@ void LibreVNADriver::handleReceivedPacket(const Protocol::PacketInfo &packet)
|
|||||||
Feature::SA, Feature::SATrackingGenerator, Feature::SATrackingOffset,
|
Feature::SA, Feature::SATrackingGenerator, Feature::SATrackingOffset,
|
||||||
Feature::ExtRefIn, Feature::ExtRefOut,
|
Feature::ExtRefIn, Feature::ExtRefOut,
|
||||||
};
|
};
|
||||||
auto ports = packet.info.hardware_version == 0xFF ? 1 : 2;
|
info.Limits.VNA.ports = packet.info.num_ports;
|
||||||
info.Limits.VNA.ports = ports;
|
|
||||||
info.Limits.VNA.minFreq = packet.info.limits_minFreq;
|
info.Limits.VNA.minFreq = packet.info.limits_minFreq;
|
||||||
info.Limits.VNA.maxFreq = harmonicMixing ? packet.info.limits_maxFreqHarmonic : packet.info.limits_maxFreq;
|
info.Limits.VNA.maxFreq = harmonicMixing ? packet.info.limits_maxFreqHarmonic : packet.info.limits_maxFreq;
|
||||||
info.Limits.VNA.maxPoints = packet.info.limits_maxPoints;
|
info.Limits.VNA.maxPoints = packet.info.limits_maxPoints;
|
||||||
@ -589,13 +594,13 @@ void LibreVNADriver::handleReceivedPacket(const Protocol::PacketInfo &packet)
|
|||||||
info.Limits.VNA.mindBm = (double) packet.info.limits_cdbm_min / 100;
|
info.Limits.VNA.mindBm = (double) packet.info.limits_cdbm_min / 100;
|
||||||
info.Limits.VNA.maxdBm = (double) packet.info.limits_cdbm_max / 100;
|
info.Limits.VNA.maxdBm = (double) packet.info.limits_cdbm_max / 100;
|
||||||
|
|
||||||
info.Limits.Generator.ports = ports;
|
info.Limits.Generator.ports = packet.info.num_ports;
|
||||||
info.Limits.Generator.minFreq = packet.info.limits_minFreq;
|
info.Limits.Generator.minFreq = packet.info.limits_minFreq;
|
||||||
info.Limits.Generator.maxFreq = packet.info.limits_maxFreq;
|
info.Limits.Generator.maxFreq = packet.info.limits_maxFreq;
|
||||||
info.Limits.Generator.mindBm = (double) packet.info.limits_cdbm_min / 100;
|
info.Limits.Generator.mindBm = (double) packet.info.limits_cdbm_min / 100;
|
||||||
info.Limits.Generator.maxdBm = (double) packet.info.limits_cdbm_max / 100;
|
info.Limits.Generator.maxdBm = (double) packet.info.limits_cdbm_max / 100;
|
||||||
|
|
||||||
info.Limits.SA.ports = ports;
|
info.Limits.SA.ports = packet.info.num_ports;
|
||||||
info.Limits.SA.minFreq = packet.info.limits_minFreq;
|
info.Limits.SA.minFreq = packet.info.limits_minFreq;
|
||||||
info.Limits.SA.maxFreq = packet.info.limits_maxFreq;
|
info.Limits.SA.maxFreq = packet.info.limits_maxFreq;
|
||||||
info.Limits.SA.minRBW = packet.info.limits_minRBW;
|
info.Limits.SA.minRBW = packet.info.limits_minRBW;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
2F62501ED4689FB349E356AB974DBE57=EF826FD321FB312AEADE4DB74B81458C
|
2F62501ED4689FB349E356AB974DBE57=6F84FD31C089E822CF61FFCABCD0B7D1
|
||||||
66BE74F758C12D739921AEA421D593D3=2
|
66BE74F758C12D739921AEA421D593D3=2
|
||||||
8DF89ED150041C4CBC7CB9A9CAA90856=EF826FD321FB312AEADE4DB74B81458C
|
8DF89ED150041C4CBC7CB9A9CAA90856=6F84FD31C089E822CF61FFCABCD0B7D1
|
||||||
DC22A860405A8BF2F2C095E5B6529F12=A01929E06A3F8E0B7C263320E5AF494F
|
DC22A860405A8BF2F2C095E5B6529F12=A01929E06A3F8E0B7C263320E5AF494F
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
|
@ -10,7 +10,7 @@ using namespace PacketConstants;
|
|||||||
|
|
||||||
namespace Protocol {
|
namespace Protocol {
|
||||||
|
|
||||||
static constexpr uint16_t Version = 12;
|
static constexpr uint16_t Version = 13;
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
|
|
||||||
@ -158,21 +158,27 @@ using SweepSettings = struct _sweepSettings {
|
|||||||
uint16_t points;
|
uint16_t points;
|
||||||
uint32_t if_bandwidth;
|
uint32_t if_bandwidth;
|
||||||
int16_t cdbm_excitation_start; // in 1/100 dbm
|
int16_t cdbm_excitation_start; // in 1/100 dbm
|
||||||
uint16_t standby:1;
|
uint8_t standby:1;
|
||||||
uint16_t syncMaster:1;
|
uint8_t syncMaster:1;
|
||||||
uint16_t suppressPeaks:1;
|
uint8_t suppressPeaks:1;
|
||||||
uint16_t fixedPowerSetting:1; // if set the attenuator and source PLL power will not be changed across the sweep
|
uint8_t fixedPowerSetting:1; // if set the attenuator and source PLL power will not be changed across the sweep
|
||||||
uint16_t logSweep:1;
|
uint8_t logSweep:1;
|
||||||
uint16_t stages:3;
|
|
||||||
uint16_t port1Stage:3;
|
|
||||||
uint16_t port2Stage:3;
|
|
||||||
/*
|
/*
|
||||||
* 0: no synchronization
|
* 0: no synchronization
|
||||||
* 1: USB synchronization
|
* 1: USB synchronization
|
||||||
* 2: External reference synchronization
|
* 2: External reference synchronization
|
||||||
* 3: Trigger synchronization (not supported yet by hardware)
|
* 3: Trigger synchronization (not supported yet by hardware)
|
||||||
*/
|
*/
|
||||||
uint16_t syncMode:2;
|
uint8_t syncMode:2;
|
||||||
|
uint8_t unused1:1;
|
||||||
|
|
||||||
|
uint16_t stages:3;
|
||||||
|
uint16_t port1Stage:3;
|
||||||
|
uint16_t port2Stage:3;
|
||||||
|
uint16_t port3Stage:3;
|
||||||
|
uint16_t port4Stage:3;
|
||||||
|
uint16_t unused2:1;
|
||||||
|
|
||||||
int16_t cdbm_excitation_stop; // in 1/100 dbm
|
int16_t cdbm_excitation_stop; // in 1/100 dbm
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -185,8 +191,9 @@ using ReferenceSettings = struct _referenceSettings {
|
|||||||
using GeneratorSettings = struct _generatorSettings {
|
using GeneratorSettings = struct _generatorSettings {
|
||||||
uint64_t frequency;
|
uint64_t frequency;
|
||||||
int16_t cdbm_level;
|
int16_t cdbm_level;
|
||||||
uint8_t activePort :2;
|
uint8_t activePort :3;
|
||||||
uint8_t applyAmplitudeCorrection :1;
|
uint8_t applyAmplitudeCorrection :1;
|
||||||
|
uint8_t unused :4;
|
||||||
};
|
};
|
||||||
|
|
||||||
using DeviceInfo = struct _deviceInfo {
|
using DeviceInfo = struct _deviceInfo {
|
||||||
@ -207,6 +214,7 @@ using DeviceInfo = struct _deviceInfo {
|
|||||||
uint32_t limits_maxRBW;
|
uint32_t limits_maxRBW;
|
||||||
uint8_t limits_maxAmplitudePoints;
|
uint8_t limits_maxAmplitudePoints;
|
||||||
uint64_t limits_maxFreqHarmonic;
|
uint64_t limits_maxFreqHarmonic;
|
||||||
|
uint8_t num_ports;
|
||||||
};
|
};
|
||||||
|
|
||||||
using DeviceStatus = struct _deviceStatus {
|
using DeviceStatus = struct _deviceStatus {
|
||||||
@ -307,11 +315,11 @@ using ManualControl = struct _manualControl {
|
|||||||
uint8_t LOexternal :1;
|
uint8_t LOexternal :1;
|
||||||
uint64_t LOFrequency;
|
uint64_t LOFrequency;
|
||||||
// Acquisition
|
// Acquisition
|
||||||
uint8_t PortEN :1;
|
uint16_t PortEN :1;
|
||||||
uint8_t RefEN :1;
|
uint16_t RefEN :1;
|
||||||
uint8_t WindowType :2;
|
uint16_t WindowType :2;
|
||||||
uint8_t PortGain :4;
|
uint16_t PortGain :4;
|
||||||
uint8_t RefGain :4;
|
uint16_t RefGain :4;
|
||||||
uint16_t Samples;
|
uint16_t Samples;
|
||||||
} VFF;
|
} VFF;
|
||||||
};
|
};
|
||||||
@ -329,11 +337,11 @@ using SpectrumAnalyzerSettings = struct _spectrumAnalyzerSettings {
|
|||||||
uint8_t applyReceiverCorrection :1;
|
uint8_t applyReceiverCorrection :1;
|
||||||
uint8_t trackingGenerator :1;
|
uint8_t trackingGenerator :1;
|
||||||
uint8_t applySourceCorrection :1;
|
uint8_t applySourceCorrection :1;
|
||||||
uint8_t trackingGeneratorPort :1; // 0 for port1, 1 for port2
|
uint8_t trackingGeneratorPort :2; // port count starts at zero
|
||||||
/*
|
/*
|
||||||
* 0: no synchronization
|
* 0: no synchronization
|
||||||
* 1: USB synchronization
|
* 1: Protocol synchronization (via SetTrigger and ClearTrigger packets)
|
||||||
* 2: External reference synchronization
|
* 2: Reserved
|
||||||
* 3: Trigger synchronization (not supported yet by hardware)
|
* 3: Trigger synchronization (not supported yet by hardware)
|
||||||
*/
|
*/
|
||||||
uint8_t syncMode :2;
|
uint8_t syncMode :2;
|
||||||
@ -345,6 +353,8 @@ using SpectrumAnalyzerSettings = struct _spectrumAnalyzerSettings {
|
|||||||
using SpectrumAnalyzerResult = struct _spectrumAnalyzerResult {
|
using SpectrumAnalyzerResult = struct _spectrumAnalyzerResult {
|
||||||
float port1;
|
float port1;
|
||||||
float port2;
|
float port2;
|
||||||
|
float port3;
|
||||||
|
float port4;
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
// for non-zero span
|
// for non-zero span
|
||||||
@ -370,6 +380,8 @@ using AmplitudeCorrectionPoint = struct _amplitudecorrectionpoint {
|
|||||||
uint32_t freq;
|
uint32_t freq;
|
||||||
int16_t port1;
|
int16_t port1;
|
||||||
int16_t port2;
|
int16_t port2;
|
||||||
|
int16_t port3;
|
||||||
|
int16_t port4;
|
||||||
};
|
};
|
||||||
|
|
||||||
using FrequencyCorrection = struct _frequencycorrection {
|
using FrequencyCorrection = struct _frequencycorrection {
|
||||||
@ -387,7 +399,8 @@ using DeviceConfig = struct _deviceconfig {
|
|||||||
uint32_t ip;
|
uint32_t ip;
|
||||||
uint32_t mask;
|
uint32_t mask;
|
||||||
uint32_t gw;
|
uint32_t gw;
|
||||||
uint16_t dhcp :1;
|
uint8_t dhcp :1;
|
||||||
|
uint8_t unused :7;
|
||||||
uint16_t autogain :1;
|
uint16_t autogain :1;
|
||||||
uint16_t portGain :4;
|
uint16_t portGain :4;
|
||||||
uint16_t refGain :4;
|
uint16_t refGain :4;
|
||||||
|
@ -83,6 +83,7 @@ static constexpr Protocol::DeviceInfo Info = {
|
|||||||
.limits_maxRBW = (uint32_t) (DefaultADCSamplerate * 2.23f / MinSamples),
|
.limits_maxRBW = (uint32_t) (DefaultADCSamplerate * 2.23f / MinSamples),
|
||||||
.limits_maxAmplitudePoints = Cal::maxPoints,
|
.limits_maxAmplitudePoints = Cal::maxPoints,
|
||||||
.limits_maxFreqHarmonic = 18000000000,
|
.limits_maxFreqHarmonic = 18000000000,
|
||||||
|
.num_ports = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class Mode {
|
enum class Mode {
|
||||||
|
Loading…
Reference in New Issue
Block a user