forked from moononournation/Arduino_GFX
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArduino_SSD1351.h
More file actions
70 lines (62 loc) · 2.1 KB
/
Arduino_SSD1351.h
File metadata and controls
70 lines (62 loc) · 2.1 KB
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
68
69
70
/*
* start rewrite from:
* https://github.com/adafruit/Adafruit-GFX-Library.git
* https://github.com/adafruit/Adafruit-SSD1351-library.git
*/
#ifndef _ARDUINO_SSD1351_H_
#define _ARDUINO_SSD1351_H_
#include "Arduino.h"
#include "Print.h"
#include "Arduino_GFX.h"
#include "Arduino_TFT.h"
#define SSD1351_TFTWIDTH 128 ///< SSD1351 max TFT width
#define SSD1351_TFTHEIGHT 128 ///< SSD1351 max TFT height
#define SSD1351_SETCOLUMN 0x15
#define SSD1351_SETROW 0x75
#define SSD1351_WRITERAM 0x5C
#define SSD1351_READRAM 0x5D
#define SSD1351_SETREMAP 0xA0
#define SSD1351_STARTLINE 0xA1
#define SSD1351_DISPLAYOFFSET 0xA2
#define SSD1351_DISPLAYALLOFF 0xA4
#define SSD1351_DISPLAYALLON 0xA5
#define SSD1351_NORMALDISPLAY 0xA6
#define SSD1351_INVERTDISPLAY 0xA7
#define SSD1351_FUNCTIONSELECT 0xAB
#define SSD1351_DISPLAYOFF 0xAE
#define SSD1351_DISPLAYON 0xAF
#define SSD1351_PRECHARGE 0xB1
#define SSD1351_DISPLAYENHANCE 0xB2
#define SSD1351_CLOCKDIV 0xB3
#define SSD1351_SETVSL 0xB4
#define SSD1351_SETGPIO 0xB5
#define SSD1351_PRECHARGE2 0xB6
#define SSD1351_SETGRAY 0xB8
#define SSD1351_USELUT 0xB9
#define SSD1351_PRECHARGELEVEL 0xBB
#define SSD1351_VCOMH 0xBE
#define SSD1351_CONTRASTABC 0xC1
#define SSD1351_CONTRASTMASTER 0xC7
#define SSD1351_MUXRATIO 0xCA
#define SSD1351_COMMANDLOCK 0xFD
#define SSD1351_HORIZSCROLL 0x96
#define SSD1351_STOPSCROLL 0x9E
#define SSD1351_STARTSCROLL 0x9F
class Arduino_SSD1351 : public Arduino_TFT
{
public:
Arduino_SSD1351(
Arduino_DataBus *bus, int8_t rst = -1, uint8_t r = 0,
int16_t w = SSD1351_TFTWIDTH, int16_t h = SSD1351_TFTHEIGHT,
uint8_t col_offset1 = 0, uint8_t row_offset1 = 0, uint8_t col_offset2 = 0, uint8_t row_offset2 = 0);
virtual void begin(int32_t 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