-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlcdemu.h
63 lines (55 loc) · 1.46 KB
/
lcdemu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef LCDEMU_H
#define LCDEMU_H
#include <QWidget>
#include <QPainter>
#include <QKeyEvent>
#include <QTimer>
#include "swi2c.h"
#include "swspi.h"
#include "lcd_fonts.h"
#include "ssd1306.h"
#include "IP2365.h"
#include "sw35xx_s.h"
#include "INA3221.h"
using namespace std;
class LCDemu : public QWidget {
Q_OBJECT
public:
explicit LCDemu(QWidget *parent);
~LCDemu(void);
void update();
void setlcd(SSD1306_t *p);
void start(void);
void task_key1(void);
void task_key2(void);
void task_key3(void);
void task_key4(void);
swi2c_t *m_pSWi2c[4];
swspi_t *m_pSWspi1;
SSD1306_t *m_pSSD1306;
ina3221_t *m_pINA3221;
IP2365_t *m_pIP2365[2];
sw35xx_t *m_pSW3518[4];
lcddev_t *m_pLCD;
public slots:
void TimeEvent(void);
protected:
void paintEvent(QPaintEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
//bool event(QEvent *event) override;
private:
QTimer m_qTimer;
//SSD1306_t *lcddev;
QPixmap m_pixmap;
QImage *m_pQimage;
uint32_t m_scale_w;
uint32_t m_scale_h;
SSD1306_t m_tSSD1306;
swi2c_t m_tSWi2c[4];
swspi_t m_tSWspi1;
ina3221_t m_tINA3221;
IP2365_t m_tIP2365[2];
sw35xx_t m_tSW3518[4];
int m_nWidx;
};
#endif // LCDEMU_H