diff options
| author | John Ogness <john.ogness@linutronix.de> | 2019-02-15 12:50:06 +0106 |
|---|---|---|
| committer | John Ogness <john.ogness@linutronix.de> | 2019-02-15 12:50:06 +0106 |
| commit | e5382e43fcc8d143db24d80833a02b44b9c0b78e (patch) | |
| tree | 3057ebdfaa833808265501e4b3173ce20d39ab21 /schulung_tools/leds/leds.h | |
| parent | e46aa51aa27833e44975b24842e8175c4a0a54da (diff) | |
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 <john.ogness@linutronix.de>
Diffstat (limited to 'schulung_tools/leds/leds.h')
| -rw-r--r-- | schulung_tools/leds/leds.h | 38 |
1 files changed, 38 insertions, 0 deletions
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 <QMainWindow> +#include <QTimer> +#include <QRadioButton> + +#include <stdint.h> + +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 |
