aboutsummaryrefslogtreecommitdiffstats
path: root/source/sharp.hpp
blob: 277571189fdc73df942b074de95f5a1db8d0fb9d (plain)
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
#ifndef SHARP_HPP_
#define SHARP_HPP_

#include "sharp/Adafruit_SharpMem.h"
#include "widget.hpp"

#include <vector>

#define BLACK 0
#define WHITE 1

class Sharp {
private:
	static Adafruit_SharpMem display;
	static TaskHandle_t taskHandle;

	static std::vector<Widget *> widgets;
public:
	static void begin(void);

	template<class T, typename... Args>
	inline static void addWidget(Args... args) {
		widgets.emplace_back(new T(args...));
	}

private:
	static void updateTask(void *);
};

#endif // SHARP_HPP_