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_SSD1283A.h (2835B)

      1 /*
      2  * start rewrite from:
      3  * https://github.com/adafruit/Adafruit-GFX-Library.git
      4  * https://github.com/gitcnd/LCDWIKI_SPI.git
      5  */
      6 #ifndef _ARDUINO_SSD1283A_H_
      7 #define _ARDUINO_SSD1283A_H_
      8 
      9 #include <Arduino.h>
     10 #include <Print.h>
     11 #include "../Arduino_GFX.h"
     12 #include "../Arduino_TFT.h"
     13 
     14 #define SSD1283A_TFTWIDTH 130  ///< SSD1283A max TFT width
     15 #define SSD1283A_TFTHEIGHT 130 ///< SSD1283A max TFT height
     16 
     17 #define SSD1283A_RST_DELAY 120
     18 
     19 // http://www.lcdwiki.com/res/MSP1601/SSD1283A%20Datasheet.pdf
     20 #define SSD1283A_OSCILLATOR 0x00
     21 #define SSD1283A_DRIVER_OUTPUT_CONTROL 0x01
     22 #define SSD1283A_LCD_DRIVING_WAVEFORM_CONTROL 0x02
     23 #define SSD1283A_ENTRY_MODE 0x03
     24 #define SSD1283A_COMPARE_REGISTER_1 0x04
     25 #define SSD1283A_COMPARE_REGISTER_2 0x05
     26 #define SSD1283A_DISPLAY_CONTROL 0x07
     27 #define SSD1283A_FRAME_CYCLE_CONTROL 0x0B
     28 #define SSD1283A_POWER_CONTROL_1 0x10
     29 #define SSD1283A_POWER_CONTROL_2 0x11
     30 #define SSD1283A_POWER_CONTROL_3 0x12
     31 #define SSD1283A_POWER_CONTROL_4 0x13
     32 #define SSD1283A_HORIZONTAL_PORCH 0x16
     33 #define SSD1283A_VERTICAL_PORCH 0x17
     34 #define SSD1283A_POWER_CONTROL_5 0x1E
     35 #define SSD1283A_POWER_CONTROL_6 0x1F
     36 #define SSD1283A_RAM_ADDRESS_SET 0x21
     37 #define SSD1283A_WRITE_DATA_TO_GRAM 0x22
     38 #define SSD1283A_READ_DATA_TO_GRAM 0x22
     39 #define SSD1283A_RAM_WRITE_DATA_MASK_1 0x23
     40 #define SSD1283A_RAM_WRITE_DATA_MASK_2 0x24
     41 #define SSD1283A_VCOM_OTP_1 0x28
     42 #define SSD1283A_VCOM_OTP_2 0x29
     43 #define SSD1283A_GAMMA_CONTROL_01 0x30
     44 #define SSD1283A_GAMMA_CONTROL_02 0x31
     45 #define SSD1283A_GAMMA_CONTROL_03 0x32
     46 #define SSD1283A_GAMMA_CONTROL_04 0x33
     47 #define SSD1283A_GAMMA_CONTROL_05 0x34
     48 #define SSD1283A_GAMMA_CONTROL_06 0x35
     49 #define SSD1283A_GAMMA_CONTROL_07 0x36
     50 #define SSD1283A_GAMMA_CONTROL_08 0x37
     51 #define SSD1283A_GAMMA_CONTROL_09 0x38
     52 #define SSD1283A_GAMMA_CONTROL_10 0x39
     53 #define SSD1283A_GATE_SCAN_POSITION 0x40
     54 #define SSD1283A_VERTICAL_SCROLL_CONTROL 0x41
     55 #define SSD1283A_1ST_SCREEN_DRIVING_POSITION 0x42
     56 #define SSD1283A_2ND_SCREEN_DRIVING_POSITION 0x43
     57 #define SSD1283A_HORIZONTAL_RAM_ADDRESS_POSITION 0x44
     58 #define SSD1283A_VERTICAL_RAM_ADDRESS_POSITION 0x45
     59 #define SSD1283A_FURTHER_BIAS_CURRENT_SETTING 0x27
     60 #define SSD1283A_OSCILLATOR_FREQUENCY 0x2C
     61 
     62 class Arduino_SSD1283A : public Arduino_TFT
     63 {
     64 public:
     65   Arduino_SSD1283A(
     66       Arduino_DataBus *bus, int8_t rst = GFX_NOT_DEFINED, uint8_t r = 0,
     67       int16_t w = SSD1283A_TFTWIDTH, int16_t h = SSD1283A_TFTHEIGHT,
     68       uint8_t col_offset1 = 2, uint8_t row_offset1 = 2, uint8_t col_offset2 = 2, uint8_t row_offset2 = 2);
     69 
     70   bool begin(int32_t speed = GFX_NOT_DEFINED) override;
     71   void writeAddrWindow(int16_t x, int16_t y, uint16_t w, uint16_t h) override;
     72   void setRotation(uint8_t r) override;
     73   void invertDisplay(bool) override;
     74   void displayOn() override;
     75   void displayOff() override;
     76 
     77 protected:
     78   void tftInit() override;
     79 
     80 private:
     81 };
     82 
     83 #endif