acid-drop- Hacking the planet from a LilyGo T-Deck using custom firmware |
git clone git://git.acid.vegas/acid-drop.git |
Log | Files | Refs | Archive | README | LICENSE |
Arduino_SSD1331.h (1924B)
1 /* 2 * start rewrite from: 3 * https://github.com/adafruit/Adafruit-GFX-Library.git 4 */ 5 #ifndef _ARDUINO_SSD1331_H_ 6 #define _ARDUINO_SSD1331_H_ 7 8 #include <Arduino.h> 9 #include <Print.h> 10 #include "../Arduino_GFX.h" 11 #include "../Arduino_TFT.h" 12 13 #define SSD1331_TFTWIDTH 96 ///< SSD1331 max TFT width 14 #define SSD1331_TFTHEIGHT 64 ///< SSD1331 max TFT height 15 16 #define SSD1331_RST_DELAY 120 17 18 #define SSD1331_DRAWLINE 0x21 19 #define SSD1331_DRAWRECT 0x22 20 #define SSD1331_FILL 0x26 21 #define SSD1331_SETCOLUMN 0x15 22 #define SSD1331_SETROW 0x75 23 #define SSD1331_CONTRASTA 0x81 24 #define SSD1331_CONTRASTB 0x82 25 #define SSD1331_CONTRASTC 0x83 26 #define SSD1331_MASTERCURRENT 0x87 27 #define SSD1331_SETREMAP 0xA0 28 #define SSD1331_STARTLINE 0xA1 29 #define SSD1331_DISPLAYOFFSET 0xA2 30 #define SSD1331_NORMALDISPLAY 0xA4 31 #define SSD1331_DISPLAYALLON 0xA5 32 #define SSD1331_DISPLAYALLOFF 0xA6 33 #define SSD1331_INVERTDISPLAY 0xA7 34 #define SSD1331_SETMULTIPLEX 0xA8 35 #define SSD1331_SETMASTER 0xAD 36 #define SSD1331_DISPLAYOFF 0xAE 37 #define SSD1331_DISPLAYON 0xAF 38 #define SSD1331_POWERMODE 0xB0 39 #define SSD1331_PRECHARGE 0xB1 40 #define SSD1331_CLOCKDIV 0xB3 41 #define SSD1331_PRECHARGEA 0x8A 42 #define SSD1331_PRECHARGEB 0x8B 43 #define SSD1331_PRECHARGEC 0x8C 44 #define SSD1331_PRECHARGELEVEL 0xBB 45 #define SSD1331_VCOMH 0xBE 46 47 class Arduino_SSD1331 : public Arduino_TFT 48 { 49 public: 50 Arduino_SSD1331( 51 Arduino_DataBus *bus, int8_t rst = GFX_NOT_DEFINED, uint8_t r = 0, 52 int16_t w = SSD1331_TFTWIDTH, int16_t h = SSD1331_TFTHEIGHT, 53 uint8_t col_offset1 = 0, uint8_t row_offset1 = 0, uint8_t col_offset2 = 0, uint8_t row_offset2 = 0); 54 55 bool begin(int32_t speed = GFX_NOT_DEFINED) override; 56 void writeAddrWindow(int16_t x, int16_t y, uint16_t w, uint16_t h) override; 57 void setRotation(uint8_t r) override; 58 void invertDisplay(bool) override; 59 void displayOn() override; 60 void displayOff() override; 61 62 protected: 63 void tftInit() override; 64 65 private: 66 }; 67 68 #endif