From e5382e43fcc8d143db24d80833a02b44b9c0b78e Mon Sep 17 00:00:00 2001 From: John Ogness Date: Fri, 15 Feb 2019 12:50:06 +0106 Subject: schulung_tools: leds: add Qt leds application for host The leds application runs on the host and is used to simulate PCI hardware with 3 LEDs. See the README for information about how to build and use it. Signed-off-by: John Ogness --- schulung_tools/leds/leds.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 schulung_tools/leds/leds.h (limited to 'schulung_tools/leds/leds.h') diff --git a/schulung_tools/leds/leds.h b/schulung_tools/leds/leds.h new file mode 100644 index 0000000..b4fb933 --- /dev/null +++ b/schulung_tools/leds/leds.h @@ -0,0 +1,38 @@ +#ifndef LEDS_H +#define LEDS_H + +#include +#include +#include + +#include + +namespace Ui { +class Leds; +} + +struct ivmshmem { + uint8_t leds[3]; +} __attribute__((packed)); + +class Leds : public QMainWindow +{ + Q_OBJECT + +public: + explicit Leds(QWidget *parent = 0); + ~Leds(); + + int init(void); + +private: + Ui::Leds *ui; + QRadioButton *radioButton[3]; + QTimer timer; + struct ivmshmem *shm; + +public slots: + void poll_shm(void); +}; + +#endif // LEDS_H -- cgit v1.2.3