forked from moononournation/Arduino_GFX
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathArduino_SSD1331.h
67 lines (58 loc) · 1.91 KB
/
Arduino_SSD1331.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
64
65
66
67
/*
* start rewrite from:
* https://github.com/adafruit/Adafruit-GFX-Library.git
*/
#ifndef _ARDUINO_SSD1331_H_
#define _ARDUINO_SSD1331_H_
#include "Arduino.h"
#include "Print.h"
#include "Arduino_GFX.h"
#include "Arduino_TFT.h"
#define SSD1331_TFTWIDTH 96 ///< SSD1331 max TFT width
#define SSD1331_TFTHEIGHT 64 ///< SSD1331 max TFT height
#define SSD1331_DRAWLINE 0x21
#define SSD1331_DRAWRECT 0x22
#define SSD1331_FILL 0x26
#define SSD1331_SETCOLUMN 0x15
#define SSD1331_SETROW 0x75
#define SSD1331_CONTRASTA 0x81
#define SSD1331_CONTRASTB 0x82
#define SSD1331_CONTRASTC 0x83
#define SSD1331_MASTERCURRENT 0x87
#define SSD1331_SETREMAP 0xA0
#define SSD1331_STARTLINE 0xA1
#define SSD1331_DISPLAYOFFSET 0xA2
#define SSD1331_NORMALDISPLAY 0xA4
#define SSD1331_DISPLAYALLON 0xA5
#define SSD1331_DISPLAYALLOFF 0xA6
#define SSD1331_INVERTDISPLAY 0xA7
#define SSD1331_SETMULTIPLEX 0xA8
#define SSD1331_SETMASTER 0xAD
#define SSD1331_DISPLAYOFF 0xAE
#define SSD1331_DISPLAYON 0xAF
#define SSD1331_POWERMODE 0xB0
#define SSD1331_PRECHARGE 0xB1
#define SSD1331_CLOCKDIV 0xB3
#define SSD1331_PRECHARGEA 0x8A
#define SSD1331_PRECHARGEB 0x8B
#define SSD1331_PRECHARGEC 0x8C
#define SSD1331_PRECHARGELEVEL 0xBB
#define SSD1331_VCOMH 0xBE
class Arduino_SSD1331 : public Arduino_TFT
{
public:
Arduino_SSD1331(
Arduino_DataBus *bus, int8_t rst = -1, uint8_t r = 0,
int16_t w = SSD1331_TFTWIDTH, int16_t h = SSD1331_TFTHEIGHT,
uint8_t col_offset1 = 0, uint8_t row_offset1 = 0, uint8_t col_offset2 = 0, uint8_t row_offset2 = 0);
virtual void begin(int speed = 0);
virtual void writeAddrWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
virtual void setRotation(uint8_t r);
virtual void invertDisplay(bool);
virtual void displayOn();
virtual void displayOff();
protected:
virtual void tftInit();
private:
};
#endif