diff --git a/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/librevnadriver.cpp b/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/librevnadriver.cpp index 70919f3..71b29c2 100644 --- a/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/librevnadriver.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/librevnadriver.cpp @@ -310,6 +310,17 @@ std::set LibreVNADriver::getFlags() ret.insert(Flag::Overload); } break; + case 0xD0: + if(!lastStatus.VD0.source_locked || !lastStatus.VD0.LO_locked) { + ret.insert(Flag::Unlocked); + } + if(lastStatus.VD0.unlevel) { + ret.insert(Flag::Unlevel); + } + if(lastStatus.VD0.ADC_overload) { + ret.insert(Flag::Overload); + } + break; case 0xFE: if(!lastStatus.VFE.source_locked || !lastStatus.VFE.LO_locked) { ret.insert(Flag::Unlocked); @@ -355,6 +366,19 @@ QString LibreVNADriver::getStatus() } } break; + case 0xD0: + ret.append(" Temps MCU: "+QString::number(lastStatus.VD0.temp_MCU)+"°C"); + ret.append(" Supply: "+Unit::ToString((float) lastStatus.VD0.supply_voltage / 1000.0, "V", "m ", 3) + " " + Unit::ToString((float) lastStatus.VD0.supply_current / 1000.0, "A", "m ", 3)); + ret.append(" Reference:"); + if(lastStatus.VD0.extRefInUse) { + ret.append("External"); + } else { + ret.append("Internal"); + if(lastStatus.VD0.extRefAvailable) { + ret.append(" (External available)"); + } + } + break; case 0xFE: ret.append(" MCU Temp: "+QString::number(lastStatus.VFE.temp_MCU)+"°C"); ret.append(" eCal Temp: "+QString::number(lastStatus.VFE.temp_eCal / 100.0)+"°C"); @@ -804,6 +828,7 @@ QString LibreVNADriver::hardwareVersionToString(uint8_t version) { switch(version) { case 0x01: return "1"; + case 0xD0: return "HAR0"; case 0xE0: return "SAP1"; case 0xFE: return "P2"; case 0xFF: return "PT"; diff --git a/Software/VNA_embedded/Application/Communication/Protocol.hpp b/Software/VNA_embedded/Application/Communication/Protocol.hpp index b614dd9..de12395 100644 --- a/Software/VNA_embedded/Application/Communication/Protocol.hpp +++ b/Software/VNA_embedded/Application/Communication/Protocol.hpp @@ -249,6 +249,18 @@ using DeviceStatus = struct _deviceStatus { uint16_t temp_eCal; // in 1/100 °C uint16_t power_heater; // in mW } VFE; + struct { + uint8_t extRefAvailable:1; + uint8_t extRefInUse:1; + uint8_t FPGA_configured:1; + uint8_t source_locked:1; + uint8_t LO_locked:1; + uint8_t ADC_overload:1; + uint8_t unlevel:1; + uint8_t temp_MCU; + uint16_t supply_voltage; + uint16_t supply_current; + } VD0; }; };