mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-05 14:35:23 +00:00
bugfixes STW81200
This commit is contained in:
parent
9dfafe6042
commit
7a9d4ddf7c
13 changed files with 214 additions and 24 deletions
|
|
@ -31,6 +31,10 @@ RawRegisterDialog::RawRegisterDialog(Device *dev, QWidget *parent) :
|
|||
// trigger extraction of device information, this will trigger the receivedDirectRegisterInfo slot which will further populate the dialog
|
||||
dev->SendCommandWithoutPayload(Protocol::PacketType::RequestDirectRegisterInfo);
|
||||
|
||||
connect(ui->reload, &QPushButton::clicked, [=](){
|
||||
devices[ui->tabs->currentIndex()]->reloadRegisters();
|
||||
});
|
||||
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Save), &QPushButton::clicked, [=](){
|
||||
auto filename = QFileDialog::getSaveFileName(this, "Save register settigns", "", "Raw register file (*.regs)", nullptr, QFileDialog::DontUseNativeDialog);
|
||||
if(filename.length() > 0) {
|
||||
|
|
|
|||
|
|
@ -25,14 +25,31 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Open|QDialogButtonBox::Save</set>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="reload">
|
||||
<property name="text">
|
||||
<string>Reload Registers</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="view-refresh"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Open|QDialogButtonBox::Save</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
|
|||
|
|
@ -25,13 +25,7 @@ RegisterDevice *RegisterDevice::create(Device *dev, int number, QString partnumb
|
|||
regdev->name = name;
|
||||
|
||||
// read initial register content
|
||||
Protocol::PacketInfo p;
|
||||
p.type = Protocol::PacketType::DirectRegisterRead;
|
||||
p.directRegRead.device = number;
|
||||
for(unsigned int i=0;i<regdev->regs.size();i++) {
|
||||
p.directRegRead.address = regdev->regs[i]->getAddress();
|
||||
dev->SendPacket(p);
|
||||
}
|
||||
regdev->reloadRegisters();
|
||||
}
|
||||
return regdev;
|
||||
}
|
||||
|
|
@ -60,6 +54,17 @@ QString RegisterDevice::getName() const
|
|||
return name;
|
||||
}
|
||||
|
||||
void RegisterDevice::reloadRegisters()
|
||||
{
|
||||
Protocol::PacketInfo p;
|
||||
p.type = Protocol::PacketType::DirectRegisterRead;
|
||||
p.directRegRead.device = number;
|
||||
for(unsigned int i=0;i<regs.size();i++) {
|
||||
p.directRegRead.address = regs[i]->getAddress();
|
||||
dev->SendPacket(p);
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterDevice::addPossibleInputs(RegisterDevice *inputDevice)
|
||||
{
|
||||
for(auto o : inputDevice->outputs) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ public:
|
|||
QWidget *getWidget() const;
|
||||
QString getPartnumber() const;
|
||||
QString getName() const;
|
||||
void reloadRegisters();
|
||||
|
||||
virtual void addPossibleInputs(RegisterDevice *inputDevice);
|
||||
|
||||
|
|
|
|||
|
|
@ -446,7 +446,7 @@ SI5332::SI5332()
|
|||
switch(sel0->currentIndex()) {
|
||||
case 0: group = ui->freqPLLref->value(); break;
|
||||
case 1: group = ui->freqPLLref->value() / ui->PDIV_DIV->value(); break;
|
||||
case 2: group = ui->ref->value();
|
||||
case 2: group = ui->ref->value(); break;
|
||||
case 3: group = 0; // CLKIN_3, not available at this part
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ STW81200::STW81200()
|
|||
addRegister(new Register("ST8", 8, 26));
|
||||
addRegister(new Register("ST9", 9, 26));
|
||||
addRegister(new Register("ST10", 10, 26));
|
||||
addRegister(new Register("ST11", 11, 26));
|
||||
|
||||
ui = new Ui::STW81200Widget;
|
||||
ui->setupUi(widget);
|
||||
|
|
@ -44,9 +45,6 @@ STW81200::STW81200()
|
|||
regs[3]->assignUI(ui->PFD_DEL_MODE, 15, 2);
|
||||
regs[3]->assignUI(ui->REF_PATH_SEL, 13, 2);
|
||||
regs[3]->assignUI(ui->R, 0, 12);
|
||||
regs[3]->assignUI(ui->RF1_OUT_PD, 24, true);
|
||||
regs[3]->assignUI(ui->RF1_DIV_SEL, 21, 3);
|
||||
regs[3]->assignUI(ui->frac, 0, 21);
|
||||
|
||||
regs[4]->assignUI(ui->RF_OUT_PWR, 23, 2);
|
||||
regs[4]->assignUI(ui->VCO_2V5_MODE, 22);
|
||||
|
|
@ -90,7 +88,7 @@ STW81200::STW81200()
|
|||
regs[7]->assignUI(ui->LD_SDO_SEL, 21, 2);
|
||||
regs[7]->assignUI(ui->CYCLE_SLIP_EN, 19);
|
||||
regs[7]->assignUI(ui->FSTLCK_EN, 18);
|
||||
regs[7]->assignUI(ui->CP_SEL, 13, 5);
|
||||
regs[7]->assignUI(ui->CP_SEL_FL, 13, 5);
|
||||
regs[7]->assignUI(ui->FSTLCK_CNT, 0, 13);
|
||||
|
||||
regs[8]->assignUI(ui->PD_RF2_DISABLE, 26);
|
||||
|
|
@ -103,7 +101,7 @@ STW81200::STW81200()
|
|||
regs[8]->assignUI(ui->REG_VCO_PD, 6);
|
||||
regs[8]->assignUI(ui->REG_VCO_VOUT, 4, 2);
|
||||
regs[8]->assignUI(ui->REG_VCO_4V5_PD, 2);
|
||||
regs[8]->assignUI(ui->REG_VCO_4V5_OCP, 0, 2);
|
||||
regs[8]->assignUI(ui->REG_VCO_4V5_VOUT, 0, 2);
|
||||
|
||||
regs[10]->assignUI(ui->REG_DIG_STARTUP, 17);
|
||||
regs[10]->assignUI(ui->REG_REF_STARTUP, 16);
|
||||
|
|
|
|||
|
|
@ -990,7 +990,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="REG_VC_4V5_VOUT">
|
||||
<widget class="QComboBox" name="REG_VCO_4V5_VOUT">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>5.0V</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue