summaryrefslogtreecommitdiffstats
path: root/utils/regtools/qeditor/std_analysers.cpp
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-09-18 13:37:25 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-09-18 13:37:25 +0200
commitb8c98a86fb18adf475d56872bf4b30c4fe67d751 (patch)
tree5e5afd986c23944985015667f239dd8192cd61b9 /utils/regtools/qeditor/std_analysers.cpp
parent963dfc529cd836beb8c19ae458a7d2cc0a465565 (diff)
downloadrockbox-b8c98a86fb18adf475d56872bf4b30c4fe67d751.tar.gz
rockbox-b8c98a86fb18adf475d56872bf4b30c4fe67d751.zip
regtools/qeditor: improve pinctrl analyser display
Change-Id: I45850f4f0213aac5f0538c865cfa84137fcb83e3
Diffstat (limited to 'utils/regtools/qeditor/std_analysers.cpp')
-rw-r--r--utils/regtools/qeditor/std_analysers.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/utils/regtools/qeditor/std_analysers.cpp b/utils/regtools/qeditor/std_analysers.cpp
index ba33d723b9..76ee070710 100644
--- a/utils/regtools/qeditor/std_analysers.cpp
+++ b/utils/regtools/qeditor/std_analysers.cpp
@@ -741,13 +741,14 @@ void PinAnalyser::FillList()
for(int bank = 0; bank < 4; bank++)
{
QTableWidget *table = new QTableWidget;
- table->setColumnCount(6);
+ table->setColumnCount(7);
table->setHorizontalHeaderItem(0, new QTableWidgetItem("Pin"));
table->setHorizontalHeaderItem(1, new QTableWidgetItem("Function"));
- table->setHorizontalHeaderItem(2, new QTableWidgetItem("Drive"));
- table->setHorizontalHeaderItem(3, new QTableWidgetItem("Voltage"));
- table->setHorizontalHeaderItem(4, new QTableWidgetItem("Value"));
+ table->setHorizontalHeaderItem(2, new QTableWidgetItem("Direction"));
+ table->setHorizontalHeaderItem(3, new QTableWidgetItem("Drive"));
+ table->setHorizontalHeaderItem(4, new QTableWidgetItem("Voltage"));
table->setHorizontalHeaderItem(5, new QTableWidgetItem("Pull"));
+ table->setHorizontalHeaderItem(6, new QTableWidgetItem("Value"));
table->verticalHeader()->setVisible(false);
table->horizontalHeader()->setStretchLastSection(true);
m_panel->addItem(table, QString("Bank %1").arg(bank));
@@ -792,24 +793,27 @@ void PinAnalyser::FillList()
table->setItem(row, 1, new QTableWidgetItem(QString(map[bank].pins[pin].function[fn].name)));
table->item(row, 1)->setBackground(QBrush(color_map[map[bank].pins[pin].function[fn].group]));
table->item(row, 1)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
+ /* direction */
+ table->setItem(row, 2, new QTableWidgetItem(fn != 3 ? "" : (oe & (1 << pin)) ? "Output" : "Input"));
+ table->item(row, 2)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
/* drive */
int drv = (drive[pin / 8] >> ((pin % 8) * 4)) & 3;
const char *strength[4] = {"4 mA", "8 mA", "12 mA", "16 mA"};
- table->setItem(row, 2, new QTableWidgetItem(QString(strength[drv])));
- table->item(row, 2)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
+ table->setItem(row, 3, new QTableWidgetItem(QString(strength[drv])));
+ table->item(row, 3)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
/* voltage */
int volt = (drive[pin / 8] >> (((pin % 8) * 4) + 2)) & 1;
if(m_io_backend->GetSocName() == "imx233")
volt = 1; /* cannot change voltage on imx233 */
const char *voltage[2] = {"1.8 V", "3.3 V"};
- table->setItem(row, 3, new QTableWidgetItem(QString(voltage[volt])));
- table->item(row, 3)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
- /* value */
- table->setItem(row, 4, new QTableWidgetItem(QString("%1").arg((in >> pin) & 1)));
+ table->setItem(row, 4, new QTableWidgetItem(QString(voltage[volt])));
table->item(row, 4)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
/* pull */
table->setItem(row, 5, new QTableWidgetItem(QString("%1").arg((pull >> pin) & 1)));
table->item(row, 5)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
+ /* input */
+ table->setItem(row, 6, new QTableWidgetItem(QString("%1").arg((in >> pin) & 1)));
+ table->item(row, 6)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
}
}
}