Adafruit ST77XX Display Library
Adafruit_ST7735.h
1 #ifndef _ADAFRUIT_ST7735H_
2 #define _ADAFRUIT_ST7735H_
3 
4 #include "Adafruit_ST77xx.h"
5 
6 // some flags for initR() :(
7 #define INITR_GREENTAB 0x00
8 #define INITR_REDTAB 0x01
9 #define INITR_BLACKTAB 0x02
10 #define INITR_18GREENTAB INITR_GREENTAB
11 #define INITR_18REDTAB INITR_REDTAB
12 #define INITR_18BLACKTAB INITR_BLACKTAB
13 #define INITR_144GREENTAB 0x01
14 #define INITR_MINI160x80 0x04
15 #define INITR_HALLOWING 0x05
16 #define INITR_MINI160x80_PLUGIN 0x06
17 
18 // Some register settings
19 #define ST7735_MADCTL_BGR 0x08
20 #define ST7735_MADCTL_MH 0x04
21 
22 #define ST7735_FRMCTR1 0xB1
23 #define ST7735_FRMCTR2 0xB2
24 #define ST7735_FRMCTR3 0xB3
25 #define ST7735_INVCTR 0xB4
26 #define ST7735_DISSET5 0xB6
27 
28 #define ST7735_PWCTR1 0xC0
29 #define ST7735_PWCTR2 0xC1
30 #define ST7735_PWCTR3 0xC2
31 #define ST7735_PWCTR4 0xC3
32 #define ST7735_PWCTR5 0xC4
33 #define ST7735_VMCTR1 0xC5
34 
35 #define ST7735_PWCTR6 0xFC
36 
37 #define ST7735_GMCTRP1 0xE0
38 #define ST7735_GMCTRN1 0xE1
39 
40 // Some ready-made 16-bit ('565') color settings:
41 #define ST7735_BLACK ST77XX_BLACK
42 #define ST7735_WHITE ST77XX_WHITE
43 #define ST7735_RED ST77XX_RED
44 #define ST7735_GREEN ST77XX_GREEN
45 #define ST7735_BLUE ST77XX_BLUE
46 #define ST7735_CYAN ST77XX_CYAN
47 #define ST7735_MAGENTA ST77XX_MAGENTA
48 #define ST7735_YELLOW ST77XX_YELLOW
49 #define ST7735_ORANGE ST77XX_ORANGE
50 
53 public:
54  Adafruit_ST7735(int8_t cs, int8_t dc, int8_t mosi, int8_t sclk, int8_t rst);
55  Adafruit_ST7735(int8_t cs, int8_t dc, int8_t rst);
56 #if !defined(ESP8266)
57  Adafruit_ST7735(SPIClass *spiClass, int8_t cs, int8_t dc, int8_t rst);
58 #endif // end !ESP8266
59 
60  // Differences between displays (usu. identified by colored tab on
61  // plastic overlay) are odd enough that we need to do this 'by hand':
62  void initB(void); // for ST7735B displays
63  void initR(uint8_t options = INITR_GREENTAB); // for ST7735R
64 
65  void setRotation(uint8_t m);
66 
67 private:
68  uint8_t tabcolor;
69 };
70 
71 #endif // _ADAFRUIT_ST7735H_
Adafruit_ST7735(int8_t cs, int8_t dc, int8_t mosi, int8_t sclk, int8_t rst)
Instantiate Adafruit ST7735 driver with software SPI.
Definition: Adafruit_ST7735.cpp:14
Subclass of ST77XX for ST7735B and ST7735R TFT Drivers:
Definition: Adafruit_ST7735.h:52
void setRotation(uint8_t m)
Set origin of (0,0) and orientation of TFT display.
Definition: Adafruit_ST7735.cpp:285
Subclass of SPITFT for ST77xx displays (lots in common!)
Definition: Adafruit_ST77xx.h:89
void initR(uint8_t options=INITR_GREENTAB)
Initialization code common to all ST7735R displays.
Definition: Adafruit_ST7735.cpp:229
void initB(void)
Initialization code common to all ST7735B displays.
Definition: Adafruit_ST7735.cpp:218