Skip to content

Commit 4b43acb

Browse files
committed
adrv9009: adrv9009 advanced JESD204 settings, framer and deframer widgets
Signed-off-by: IonutMuthi <ionut.muthi@analog.com>
1 parent 1796ddf commit 4b43acb

File tree

8 files changed

+1053
-5
lines changed

8 files changed

+1053
-5
lines changed

packages/adrv9009/plugins/adrv9009plugin/include/adrv9009plugin/adrv9009advanced.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
#include <animatedrefreshbtn.h>
3232
#include <iio.h>
3333

34+
// JESD widget includes
35+
#include "advanced/jesdsettingswidget.h"
36+
#include "advanced/jesdframerwidget.h"
37+
#include "advanced/jesddeframerwidget.h"
38+
3439
namespace scopy::adrv9009 {
3540

3641
class SCOPY_ADRV9009PLUGIN_EXPORT Adrv9009Advanced : public QWidget
@@ -50,7 +55,7 @@ class SCOPY_ADRV9009PLUGIN_EXPORT Adrv9009Advanced : public QWidget
5055
AnimatedRefreshBtn *m_refreshButton;
5156
QStackedWidget *m_centralWidget;
5257

53-
// Navigation buttons (13 sections)
58+
// Navigation buttons (15 sections)
5459
QPushButton *m_clkSettingsBtn = nullptr;
5560
QPushButton *m_calibrationsBtn = nullptr;
5661
QPushButton *m_txSettingsBtn = nullptr;
@@ -63,6 +68,8 @@ class SCOPY_ADRV9009PLUGIN_EXPORT Adrv9009Advanced : public QWidget
6368
QPushButton *m_gpioConfigBtn = nullptr;
6469
QPushButton *m_auxDacBtn = nullptr;
6570
QPushButton *m_jesd204SettingsBtn = nullptr;
71+
QPushButton *m_jesdFramerBtn = nullptr;
72+
QPushButton *m_jesdDeframerBtn = nullptr;
6673
QPushButton *m_bistBtn = nullptr;
6774

6875
// Navigation layout widgets (created once, reused)
@@ -84,7 +91,9 @@ class SCOPY_ADRV9009PLUGIN_EXPORT Adrv9009Advanced : public QWidget
8491
QWidget *m_agcSetup = nullptr;
8592
QWidget *m_gpioConfig = nullptr;
8693
QWidget *m_auxDac = nullptr;
87-
QWidget *m_jesd204Settings = nullptr;
94+
JesdSettingsWidget *m_jesd204Settings = nullptr;
95+
JesdFramerWidget *m_jesdFramer = nullptr;
96+
JesdDeframerWidget *m_jesdDeframer = nullptr;
8897
QWidget *m_bist = nullptr;
8998

9099
void setupUi();
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright (c) 2025 Analog Devices Inc.
3+
*
4+
* This file is part of Scopy
5+
* (see https://www.github.com/analogdevicesinc/scopy).
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
*/
20+
21+
#ifndef JESDDEFRAMERWIDGET_H
22+
#define JESDDEFRAMERWIDGET_H
23+
24+
#include <QWidget>
25+
#include <iio.h>
26+
#include <gui/widgets/menusectionwidget.h>
27+
#include <menuonoffswitch.h>
28+
29+
namespace scopy {
30+
namespace adrv9009 {
31+
32+
class JesdDeframerWidget : public QWidget
33+
{
34+
Q_OBJECT
35+
36+
public:
37+
explicit JesdDeframerWidget(iio_device *device, QWidget *parent = nullptr);
38+
~JesdDeframerWidget();
39+
40+
Q_SIGNALS:
41+
void readRequested();
42+
43+
private:
44+
void setupUi();
45+
QWidget *createDeframerColumn(const QString &columnType, const QString &attrPrefix, QWidget *parent);
46+
47+
iio_device *m_device;
48+
};
49+
50+
} // namespace adrv9009
51+
} // namespace scopy
52+
53+
#endif // JESDDEFRAMERWIDGET_H
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright (c) 2025 Analog Devices Inc.
3+
*
4+
* This file is part of Scopy
5+
* (see https://www.github.com/analogdevicesinc/scopy).
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
*/
20+
21+
#ifndef JESDFRAMERWIDGET_H
22+
#define JESDFRAMERWIDGET_H
23+
24+
#include <QWidget>
25+
#include <iio.h>
26+
#include <gui/widgets/menusectionwidget.h>
27+
#include <menuonoffswitch.h>
28+
29+
namespace scopy {
30+
namespace adrv9009 {
31+
32+
class JesdFramerWidget : public QWidget
33+
{
34+
Q_OBJECT
35+
36+
public:
37+
explicit JesdFramerWidget(iio_device *device, QWidget *parent = nullptr);
38+
~JesdFramerWidget();
39+
40+
Q_SIGNALS:
41+
void readRequested();
42+
43+
private:
44+
void setupUi();
45+
QWidget *createFramerColumn(const QString &columnType, const QString &attrPrefix, QWidget *parent);
46+
47+
iio_device *m_device;
48+
};
49+
50+
} // namespace adrv9009
51+
} // namespace scopy
52+
53+
#endif // JESDFRAMERWIDGET_H
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright (c) 2025 Analog Devices Inc.
3+
*
4+
* This file is part of Scopy
5+
* (see https://www.github.com/analogdevicesinc/scopy).
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
*/
20+
21+
#ifndef JESDSETTINGSWIDGET_H
22+
#define JESDSETTINGSWIDGET_H
23+
24+
#include <QWidget>
25+
#include <iio.h>
26+
#include <gui/widgets/menusectionwidget.h>
27+
#include <menuonoffswitch.h>
28+
29+
namespace scopy {
30+
namespace adrv9009 {
31+
32+
class JesdSettingsWidget : public QWidget
33+
{
34+
Q_OBJECT
35+
36+
public:
37+
explicit JesdSettingsWidget(iio_device *device, QWidget *parent = nullptr);
38+
~JesdSettingsWidget();
39+
40+
Q_SIGNALS:
41+
void readRequested();
42+
43+
private:
44+
void setupUi();
45+
QWidget *createLaneCheckboxGroup(const QString &groupLabel, const QString &baseAttr, QWidget *parent);
46+
47+
iio_device *m_device;
48+
};
49+
50+
} // namespace adrv9009
51+
} // namespace scopy
52+
53+
#endif // JESDSETTINGSWIDGET_H

packages/adrv9009/plugins/adrv9009plugin/src/adrv9009advanced.cpp

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ void Adrv9009Advanced::createNavigationButtons()
148148
Style::setStyle(m_jesd204SettingsBtn, style::properties::button::blueGrayButton);
149149
m_jesd204SettingsBtn->setCheckable(true);
150150

151+
m_jesdFramerBtn = new QPushButton("JESD Framer", this);
152+
Style::setStyle(m_jesdFramerBtn, style::properties::button::blueGrayButton);
153+
m_jesdFramerBtn->setCheckable(true);
154+
155+
m_jesdDeframerBtn = new QPushButton("JESD Deframer", this);
156+
Style::setStyle(m_jesdDeframerBtn, style::properties::button::blueGrayButton);
157+
m_jesdDeframerBtn->setCheckable(true);
158+
151159
m_bistBtn = new QPushButton("BIST", this);
152160
Style::setStyle(m_bistBtn, style::properties::button::blueGrayButton);
153161
m_bistBtn->setCheckable(true);
@@ -165,6 +173,8 @@ void Adrv9009Advanced::createNavigationButtons()
165173
navigationButtons->addButton(m_gpioConfigBtn);
166174
navigationButtons->addButton(m_auxDacBtn);
167175
navigationButtons->addButton(m_jesd204SettingsBtn);
176+
navigationButtons->addButton(m_jesdFramerBtn);
177+
navigationButtons->addButton(m_jesdDeframerBtn);
168178
navigationButtons->addButton(m_bistBtn);
169179

170180
// Create main navigation widget with vertical layout for rows
@@ -238,12 +248,16 @@ void Adrv9009Advanced::createNavigationButtons()
238248
connect(m_auxDacBtn, &QPushButton::clicked, this, [this]() { m_centralWidget->setCurrentWidget(m_auxDac); });
239249
connect(m_jesd204SettingsBtn, &QPushButton::clicked, this,
240250
[this]() { m_centralWidget->setCurrentWidget(m_jesd204Settings); });
251+
connect(m_jesdFramerBtn, &QPushButton::clicked, this,
252+
[this]() { m_centralWidget->setCurrentWidget(m_jesdFramer); });
253+
connect(m_jesdDeframerBtn, &QPushButton::clicked, this,
254+
[this]() { m_centralWidget->setCurrentWidget(m_jesdDeframer); });
241255
connect(m_bistBtn, &QPushButton::clicked, this, [this]() { m_centralWidget->setCurrentWidget(m_bist); });
242256
}
243257

244258
void Adrv9009Advanced::createContentWidgets()
245259
{
246-
// Create placeholder widgets for all 13 sections
260+
// Create widgets (15 sections)
247261
m_clkSettings = createPlaceholderWidget("CLK Settings");
248262
m_calibrations = createPlaceholderWidget("Calibrations");
249263
m_txSettings = createPlaceholderWidget("TX Settings");
@@ -255,7 +269,12 @@ void Adrv9009Advanced::createContentWidgets()
255269
m_agcSetup = createPlaceholderWidget("AGC Setup");
256270
m_gpioConfig = createPlaceholderWidget("GPIO Config");
257271
m_auxDac = createPlaceholderWidget("AUX DAC");
258-
m_jesd204Settings = createPlaceholderWidget("JESD204 Settings");
272+
273+
// JESD204 widgets (real implementations)
274+
m_jesd204Settings = new JesdSettingsWidget(m_device, this);
275+
m_jesdFramer = new JesdFramerWidget(m_device, this);
276+
m_jesdDeframer = new JesdDeframerWidget(m_device, this);
277+
259278
m_bist = createPlaceholderWidget("BIST");
260279

261280
// Add all widgets to stacked widget
@@ -271,10 +290,23 @@ void Adrv9009Advanced::createContentWidgets()
271290
m_centralWidget->addWidget(m_gpioConfig);
272291
m_centralWidget->addWidget(m_auxDac);
273292
m_centralWidget->addWidget(m_jesd204Settings);
293+
m_centralWidget->addWidget(m_jesdFramer);
294+
m_centralWidget->addWidget(m_jesdDeframer);
274295
m_centralWidget->addWidget(m_bist);
275296

276297
// Set first widget as current (CLK Settings)
277298
m_centralWidget->setCurrentWidget(m_clkSettings);
299+
300+
// Connect JESD widget signals
301+
if(m_jesd204Settings) {
302+
connect(this, &Adrv9009Advanced::readRequested, m_jesd204Settings, &JesdSettingsWidget::readRequested);
303+
}
304+
if(m_jesdFramer) {
305+
connect(this, &Adrv9009Advanced::readRequested, m_jesdFramer, &JesdFramerWidget::readRequested);
306+
}
307+
if(m_jesdDeframer) {
308+
connect(this, &Adrv9009Advanced::readRequested, m_jesdDeframer, &JesdDeframerWidget::readRequested);
309+
}
278310
}
279311

280312
void Adrv9009Advanced::updateNavigationButtonsLayout()
@@ -289,7 +321,7 @@ void Adrv9009Advanced::updateNavigationButtonsLayout()
289321
QList<QPushButton *> allButtons = {m_clkSettingsBtn, m_calibrationsBtn, m_txSettingsBtn, m_rxSettingsBtn,
290322
m_orxSettingsBtn, m_fhmSetupBtn, m_paProtectionBtn, m_gainSetupBtn,
291323
m_agcSetupBtn, m_gpioConfigBtn, m_auxDacBtn, m_jesd204SettingsBtn,
292-
m_bistBtn};
324+
m_jesdFramerBtn, m_jesdDeframerBtn, m_bistBtn};
293325

294326
// Step 2: Calculate button distribution (same logic as before)
295327
QList<QPushButton *> firstRowButtons;

0 commit comments

Comments
 (0)