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_SSD1351.h (2087B)

      1 /*
      2  * start rewrite from:
      3  * https://github.com/adafruit/Adafruit-GFX-Library.git
      4  * https://github.com/adafruit/Adafruit-SSD1351-library.git
      5  */
      6 #ifndef _ARDUINO_SSD1351_H_
      7 #define _ARDUINO_SSD1351_H_
      8 
      9 #include <Arduino.h>
     10 #include <Print.h>
     11 #include "../Arduino_GFX.h"
     12 #include "../Arduino_TFT.h"
     13 
     14 #define SSD1351_TFTWIDTH 128  ///< SSD1351 max TFT width
     15 #define SSD1351_TFTHEIGHT 128 ///< SSD1351 max TFT height
     16 
     17 #define SSD1351_RST_DELAY 120
     18 
     19 #define SSD1351_SETCOLUMN 0x15
     20 #define SSD1351_SETROW 0x75
     21 #define SSD1351_WRITERAM 0x5C
     22 #define SSD1351_READRAM 0x5D
     23 #define SSD1351_SETREMAP 0xA0
     24 #define SSD1351_STARTLINE 0xA1
     25 #define SSD1351_DISPLAYOFFSET 0xA2
     26 #define SSD1351_DISPLAYALLOFF 0xA4
     27 #define SSD1351_DISPLAYALLON 0xA5
     28 #define SSD1351_NORMALDISPLAY 0xA6
     29 #define SSD1351_INVERTDISPLAY 0xA7
     30 #define SSD1351_FUNCTIONSELECT 0xAB
     31 #define SSD1351_DISPLAYOFF 0xAE
     32 #define SSD1351_DISPLAYON 0xAF
     33 #define SSD1351_PRECHARGE 0xB1
     34 #define SSD1351_DISPLAYENHANCE 0xB2
     35 #define SSD1351_CLOCKDIV 0xB3
     36 #define SSD1351_SETVSL 0xB4
     37 #define SSD1351_SETGPIO 0xB5
     38 #define SSD1351_PRECHARGE2 0xB6
     39 #define SSD1351_SETGRAY 0xB8
     40 #define SSD1351_USELUT 0xB9
     41 #define SSD1351_PRECHARGELEVEL 0xBB
     42 #define SSD1351_VCOMH 0xBE
     43 #define SSD1351_CONTRASTABC 0xC1
     44 #define SSD1351_CONTRASTMASTER 0xC7
     45 #define SSD1351_MUXRATIO 0xCA
     46 #define SSD1351_COMMANDLOCK 0xFD
     47 #define SSD1351_HORIZSCROLL 0x96
     48 #define SSD1351_STOPSCROLL 0x9E
     49 #define SSD1351_STARTSCROLL 0x9F
     50 
     51 class Arduino_SSD1351 : public Arduino_TFT
     52 {
     53 public:
     54   Arduino_SSD1351(
     55       Arduino_DataBus *bus, int8_t rst = GFX_NOT_DEFINED, uint8_t r = 0,
     56       int16_t w = SSD1351_TFTWIDTH, int16_t h = SSD1351_TFTHEIGHT,
     57       uint8_t col_offset1 = 0, uint8_t row_offset1 = 0, uint8_t col_offset2 = 0, uint8_t row_offset2 = 0);
     58 
     59   bool begin(int32_t speed = GFX_NOT_DEFINED) override;
     60   void writeAddrWindow(int16_t x, int16_t y, uint16_t w, uint16_t h) override;
     61   void setRotation(uint8_t r) override;
     62   void invertDisplay(bool) override;
     63   void displayOn() override;
     64   void displayOff() override;
     65 
     66 protected:
     67   void tftInit() override;
     68 
     69 private:
     70 };
     71 
     72 #endif