-
Notifications
You must be signed in to change notification settings - Fork 0
/
BW8DisplayAdaptor.h
49 lines (34 loc) · 1.16 KB
/
BW8DisplayAdaptor.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
#pragma once
#include <Arduino.h>
/* The page is the group of 8 consecutive rows */
#define DISP_PG_SZ 8
/*
* B/W display with 8-pixel height 'pages'
*/
class BW8DisplayAdaptor {
public:
BW8DisplayAdaptor() {}
virtual ~BW8DisplayAdaptor() {}
/* Initialize interface port */
virtual void begin() {}
/* Returns display width */
virtual uint8_t width() const = 0;
/* Returns display height */
virtual uint8_t height() const = 0;
/* Initialize display */
virtual void init() = 0;
/* Enable / disable display */
virtual void enable(bool on) = 0;
/* Switch all pixels to active state */
virtual void light_all(bool active) = 0;
/* Set inverse / normal display */
virtual void set_inverse(bool active) = 0;
/* Set brightness value */
virtual void set_brightness(uint8_t val) = 0;
/* Clear display memory */
virtual void clear() = 0;
/* Clear certain region (note that the row coordinate is in page units) */
virtual void clear_region(uint8_t col, uint8_t pg, uint8_t w, uint8_t h) = 0;
/* Write data to display memory (note that the row coordinate is in page units) */
virtual void write(uint8_t col, uint8_t pg, uint8_t const* data, unsigned len) = 0;
};