forked from moononournation/Arduino_GFX
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArduino_GC9A01.h
More file actions
72 lines (57 loc) · 1.84 KB
/
Arduino_GC9A01.h
File metadata and controls
72 lines (57 loc) · 1.84 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
71
72
#ifndef _ARDUINO_GC9A01_H_
#define _ARDUINO_GC9A01_H_
#include "Arduino.h"
#include "Print.h"
#include "Arduino_GFX.h"
#include "Arduino_TFT.h"
#define GC9A01_TFTWIDTH 240
#define GC9A01_TFTHEIGHT 240
#define GC9A01_RST_DELAY 100 ///< delay ms wait for reset finish
#define GC9A01_SLPIN_DELAY 120 ///< delay ms wait for sleep in finish
#define GC9A01_SLPOUT_DELAY 120 ///< delay ms wait for sleep out finish
#define GC9A01_NOP 0x00
#define GC9A01_SWRESET 0x01
#define GC9A01_RDDID 0x04
#define GC9A01_RDDST 0x09
#define GC9A01_SLPIN 0x10
#define GC9A01_SLPOUT 0x11
#define GC9A01_PTLON 0x12
#define GC9A01_NORON 0x13
#define GC9A01_INVOFF 0x20
#define GC9A01_INVON 0x21
#define GC9A01_DISPOFF 0x28
#define GC9A01_DISPON 0x29
#define GC9A01_CASET 0x2A
#define GC9A01_RASET 0x2B
#define GC9A01_RAMWR 0x2C
#define GC9A01_RAMRD 0x2E
#define GC9A01_PTLAR 0x30
#define GC9A01_COLMOD 0x3A
#define GC9A01_MADCTL 0x36
#define GC9A01_MADCTL_MY 0x80
#define GC9A01_MADCTL_MX 0x40
#define GC9A01_MADCTL_MV 0x20
#define GC9A01_MADCTL_ML 0x10
#define GC9A01_MADCTL_RGB 0x00
#define GC9A01_RDID1 0xDA
#define GC9A01_RDID2 0xDB
#define GC9A01_RDID3 0xDC
#define GC9A01_RDID4 0xDD
class Arduino_GC9A01 : public Arduino_TFT
{
public:
Arduino_GC9A01(
Arduino_DataBus *bus, int8_t rst = -1, uint8_t r = 0,
bool ips = false, int16_t w = GC9A01_TFTWIDTH, int16_t h = GC9A01_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