-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathepdcontrol.h
More file actions
52 lines (43 loc) · 984 Bytes
/
Copy pathepdcontrol.h
File metadata and controls
52 lines (43 loc) · 984 Bytes
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
// Copyright (C) 2023 Jeremy Nieth
#ifndef EPDCONTROL_H
#define EPDCONTROL_H
#include <QObject>
#include <QFile>
#include <QTextStream>
#include <QTimer>
#include <QVector>
#include <QRect>
#ifdef Q_OS_LINUX
#include <sys/ioctl.h>
#include <iostream>
#include <fcntl.h>
#include "include/mxcfb.h"
#include <linux/fb.h>
#include <unistd.h>
#endif
class EPDControl : public QObject
{
Q_OBJECT
public:
explicit EPDControl(QObject *parent = nullptr);
int getBrightness();
bool getBLStatus();
QVector<QRect> *updateQueue;
QTimer *screenRefreshTimer;
private:
int currentBrightness;
int lastBrightness;
QFile* brightnessFile;
public slots:
void setBrightness(int level);
void decBrightness();
void incBrightness();
void toggleBacklight();
void queueScreenUpdate(QRect rect);
private slots:
void updateScreen(QRect rect);
void refreshScreen();
signals:
void brightnessChanged(int level);
};
#endif // EPDCONTROL_H