-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDisplay.h
More file actions
33 lines (27 loc) · 688 Bytes
/
Display.h
File metadata and controls
33 lines (27 loc) · 688 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
#pragma once
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
#include <gfxfont.h>
class Display
{
public:
static Adafruit_SSD1306 & GetInstance()
{
static Adafruit_SSD1306 Instance(/* D/C */ 6, /* Reset */ 10, /* Slave-Select */ 7);
return Instance;
}
static void begin()
{
GetInstance().begin(SSD1306_SWITCHCAPVCC);
}
static void ClearNonHeaderArea()
{
Display::GetInstance().fillRect(0, 16, SSD1306_LCDWIDTH, SSD1306_LCDHEIGHT - 16, 0);
}
static void ClearHeaderArea()
{
Display::GetInstance().fillRect(0, 0, SSD1306_LCDWIDTH, 8, 0);
}
Display(Display const &) = delete;
void operator=(Display const &) = delete;
};