24 #ifndef _ADAFRUIT_ST7735H_ 25 #define _ADAFRUIT_ST7735H_ 29 #include <Adafruit_GFX.h> 31 #if defined(__AVR__) || defined(CORE_TEENSY) 32 #include <avr/pgmspace.h> 34 typedef volatile uint8_t RwReg;
35 #elif defined(ARDUINO_STM32_FEATHER) 36 typedef volatile uint32 RwReg;
38 #elif defined(ARDUINO_FEATHER52) 39 typedef volatile uint32_t RwReg;
41 #elif defined(ESP8266) 43 #elif defined(__SAM3X8E__) 44 #undef __FlashStringHelper::F(string_literal) 45 #define F(string_literal) string_literal 46 #include <include/pio.h> 48 #define pgm_read_byte(addr) (*(const unsigned char *)(addr)) 49 #define pgm_read_word(addr) (*(const unsigned short *)(addr)) 50 typedef unsigned char prog_uchar;
54 #define INITR_GREENTAB 0x0 55 #define INITR_REDTAB 0x1 56 #define INITR_BLACKTAB 0x2 58 #define INITR_18GREENTAB INITR_GREENTAB 59 #define INITR_18REDTAB INITR_REDTAB 60 #define INITR_18BLACKTAB INITR_BLACKTAB 61 #define INITR_144GREENTAB 0x1 62 #define INITR_MINI160x80 0x4 66 #define ST7735_TFTWIDTH_128 128 68 #define ST7735_TFTWIDTH_80 80 70 #define ST7735_TFTHEIGHT_128 128 72 #define ST7735_TFTHEIGHT_160 160 74 #define ST7735_NOP 0x00 75 #define ST7735_SWRESET 0x01 76 #define ST7735_RDDID 0x04 77 #define ST7735_RDDST 0x09 79 #define ST7735_SLPIN 0x10 80 #define ST7735_SLPOUT 0x11 81 #define ST7735_PTLON 0x12 82 #define ST7735_NORON 0x13 84 #define ST7735_INVOFF 0x20 85 #define ST7735_INVON 0x21 86 #define ST7735_DISPOFF 0x28 87 #define ST7735_DISPON 0x29 88 #define ST7735_CASET 0x2A 89 #define ST7735_RASET 0x2B 90 #define ST7735_RAMWR 0x2C 91 #define ST7735_RAMRD 0x2E 93 #define ST7735_PTLAR 0x30 94 #define ST7735_COLMOD 0x3A 95 #define ST7735_MADCTL 0x36 97 #define ST7735_FRMCTR1 0xB1 98 #define ST7735_FRMCTR2 0xB2 99 #define ST7735_FRMCTR3 0xB3 100 #define ST7735_INVCTR 0xB4 101 #define ST7735_DISSET5 0xB6 103 #define ST7735_PWCTR1 0xC0 104 #define ST7735_PWCTR2 0xC1 105 #define ST7735_PWCTR3 0xC2 106 #define ST7735_PWCTR4 0xC3 107 #define ST7735_PWCTR5 0xC4 108 #define ST7735_VMCTR1 0xC5 110 #define ST7735_RDID1 0xDA 111 #define ST7735_RDID2 0xDB 112 #define ST7735_RDID3 0xDC 113 #define ST7735_RDID4 0xDD 115 #define ST7735_PWCTR6 0xFC 117 #define ST7735_GMCTRP1 0xE0 118 #define ST7735_GMCTRN1 0xE1 121 #define ST7735_BLACK 0x0000 122 #define ST7735_BLUE 0x001F 123 #define ST7735_RED 0xF800 124 #define ST7735_GREEN 0x07E0 125 #define ST7735_CYAN 0x07FF 126 #define ST7735_MAGENTA 0xF81F 127 #define ST7735_YELLOW 0xFFE0 128 #define ST7735_WHITE 0xFFFF 135 Adafruit_ST7735(int8_t CS, int8_t RS, int8_t SID, int8_t SCLK, int8_t RST = -1);
139 initR(uint8_t options = INITR_GREENTAB),
140 setAddrWindow(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1),
141 pushColor(uint16_t color),
142 fillScreen(uint16_t color),
143 drawPixel(int16_t x, int16_t y, uint16_t color),
144 drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color),
145 drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color),
146 fillRect(int16_t x, int16_t y, int16_t w, int16_t h,
148 setRotation(uint8_t r),
149 invertDisplay(
boolean i);
150 uint16_t Color565(uint8_t r, uint8_t g, uint8_t b);
163 void spiwrite(uint8_t),
164 writecommand(uint8_t c),
165 writedata(uint8_t d),
166 commandList(
const uint8_t *addr),
167 commonInit(
const uint8_t *cmdList);
171 inline void CS_HIGH(
void);
172 inline void CS_LOW(
void);
173 inline void DC_HIGH(
void);
174 inline void DC_LOW(
void);
178 int8_t _cs, _dc, _rst, _sid, _sclk;
179 uint8_t colstart, rowstart, xstart, ystart;
181 #if defined(USE_FAST_IO) 182 volatile RwReg *dataport, *clkport, *csport, *dcport;
184 #if defined(__AVR__) || defined(CORE_TEENSY) // 8 bit! 185 uint8_t datapinmask, clkpinmask, cspinmask, dcpinmask;
187 uint32_t datapinmask, clkpinmask, cspinmask, dcpinmask;
Definition: Adafruit_GFX.h:13
Definition: Adafruit_ST7735.h:131