Fix generator output spikes

- Add manual overwrite in FPGA for hardware that is usually handled by sweep control
- Use static hardware configuration for generator (no sweep active anymore)
This commit is contained in:
Jan Käberich 2022-06-23 17:51:15 +02:00
parent 36f826f7a6
commit 43b588c2f6
12 changed files with 169 additions and 72 deletions

View file

@ -356,6 +356,27 @@ uint16_t FPGA::GetStatus() {
return (uint16_t) status[0] << 8 | status[1];
}
void FPGA::OverwriteHardware(uint8_t attenuation, LowpassFilter filter, bool lowband, bool port1_enabled, bool port2_enabled) {
uint16_t val = 0;
val |= 0x8000; // enable overwrite
val |= (attenuation & 0x7F) << 8;
val |= (int) filter << 6;
if (lowband) {
val |= 0x0020;
}
if (port1_enabled) {
val |= 0x0010;
}
if (port2_enabled) {
val |= 0x0008;
}
WriteRegister(Reg::HardwareOverwrite, val);
}
void FPGA::DisableHardwareOverwrite() {
WriteRegister(Reg::HardwareOverwrite, 0x0000);
}
FPGA::ADCLimits FPGA::GetADCLimits() {
uint16_t cmd = 0xE000;
SwitchBytes(cmd);