implement sweep standby configuration
This commit is contained in:
parent
e35766c7b8
commit
08fa3fa0a0
@ -183,6 +183,11 @@ inline void App_Process() {
|
||||
Communication::SendWithoutPayload(Protocol::PacketType::Ack);
|
||||
}
|
||||
break;
|
||||
case Protocol::PacketType::InitiateSweep: {
|
||||
VNA::InitiateSweep();
|
||||
Communication::SendWithoutPayload(Protocol::PacketType::Ack);
|
||||
}
|
||||
break;
|
||||
case Protocol::PacketType::SetIdle:
|
||||
HW::SetMode(HW::Mode::Idle);
|
||||
sweepActive = false;
|
||||
@ -314,7 +319,7 @@ inline void App_Process() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(HW::TimedOut()) {
|
||||
if(!VNA::GetStandbyMode() && HW::TimedOut()) {
|
||||
HW::SetMode(HW::Mode::Idle);
|
||||
// insert the last received packet (restarts the timed out operation)
|
||||
Communication::BlockNextAck();
|
||||
|
@ -125,6 +125,7 @@ uint16_t Protocol::EncodePacket(const PacketInfo &packet, uint8_t *dest, uint16_
|
||||
case PacketType::ClearTrigger:
|
||||
case PacketType::StopStatusUpdates:
|
||||
case PacketType::StartStatusUpdates:
|
||||
case PacketType::InitiateSweep:
|
||||
// no payload
|
||||
break;
|
||||
case PacketType::VNADatapoint: payload_size = packet.VNAdatapoint->requiredBufferSize(); break;
|
||||
|
@ -159,7 +159,7 @@ using SweepSettings = struct _sweepSettings {
|
||||
uint16_t points;
|
||||
uint32_t if_bandwidth;
|
||||
int16_t cdbm_excitation_start; // in 1/100 dbm
|
||||
uint16_t unused:1;
|
||||
uint16_t standby:1;
|
||||
uint16_t syncMaster:1;
|
||||
uint16_t suppressPeaks:1;
|
||||
uint16_t fixedPowerSetting:1; // if set the attenuator and source PLL power will not be changed across the sweep
|
||||
@ -366,6 +366,7 @@ enum class PacketType : uint8_t {
|
||||
ClearTrigger = 29,
|
||||
StopStatusUpdates = 30,
|
||||
StartStatusUpdates = 31,
|
||||
InitiateSweep = 32
|
||||
};
|
||||
|
||||
using PacketInfo = struct _packetinfo {
|
||||
|
@ -258,12 +258,26 @@ bool VNA::Setup(Protocol::SweepSettings s) {
|
||||
// Enable new data and sweep halt interrupt
|
||||
FPGA::EnableInterrupt(FPGA::Interrupt::NewData);
|
||||
FPGA::EnableInterrupt(FPGA::Interrupt::SweepHalted);
|
||||
// Start the sweep
|
||||
// Start the sweep if not configured for standby
|
||||
firstPoint = true;
|
||||
FPGA::StartSweep();
|
||||
if(!settings.standby){
|
||||
FPGA::StartSweep();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void VNA::InitiateSweep() {
|
||||
// Invoked by a host via InitiateSweep packet
|
||||
if(settings.standby){
|
||||
// make sure that SweepSettings have been configured for standby operation
|
||||
FPGA::StartSweep();
|
||||
}
|
||||
}
|
||||
|
||||
bool VNA::GetStandbyMode() {
|
||||
return settings.standby;
|
||||
}
|
||||
|
||||
static void PassOnData() {
|
||||
Protocol::PacketInfo info;
|
||||
info.type = Protocol::PacketType::VNADatapoint;
|
||||
@ -330,8 +344,11 @@ void VNA::Work() {
|
||||
Communication::Send(packet);
|
||||
}
|
||||
// do not reset unlevel flag here, as it is calculated only once at the setup of the sweep
|
||||
// Start next sweep
|
||||
FPGA::StartSweep();
|
||||
// Start next sweep if not configured for standby
|
||||
if (!settings.standby){
|
||||
FPGA::StartSweep();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void VNA::SweepHalted() {
|
||||
|
@ -7,6 +7,8 @@
|
||||
namespace VNA {
|
||||
|
||||
bool Setup(Protocol::SweepSettings s);
|
||||
void InitiateSweep();
|
||||
bool GetStandbyMode();
|
||||
bool MeasurementDone(const FPGA::SamplingResult &result);
|
||||
void Work();
|
||||
void SweepHalted();
|
||||
|
Loading…
Reference in New Issue
Block a user