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_ILI9481_18bit.h (2267B)

      1 /*
      2  * start rewrite from:
      3  * https://github.com/adafruit/Adafruit-GFX-Library.git
      4  */
      5 #ifndef _ARDUINO_ILI9481_18BIT_H_
      6 #define _ARDUINO_ILI9481_18BIT_H_
      7 
      8 #include <Arduino.h>
      9 #include <Print.h>
     10 #include "../Arduino_GFX.h"
     11 #include "../Arduino_TFT_18bit.h"
     12 
     13 #define ILI9481_TFTWIDTH 320  ///< ILI9481 max TFT width
     14 #define ILI9481_TFTHEIGHT 480 ///< ILI9481 max TFT height
     15 
     16 #define ILI9481_RST_DELAY 150    ///< delay ms wait for reset finish
     17 #define ILI9481_SLPIN_DELAY 150  ///< delay ms wait for sleep in finish
     18 #define ILI9481_SLPOUT_DELAY 150 ///< delay ms wait for sleep out finish
     19 
     20 #define ILI9481_NOP 0x00     ///< No-op register
     21 #define ILI9481_SWRESET 0x01 ///< Software reset register
     22 
     23 #define ILI9481_SLPIN 0x10  ///< Enter Sleep Mode
     24 #define ILI9481_SLPOUT 0x11 ///< Sleep Out
     25 #define ILI9481_NORON 0x13  ///< Normal Display Mode ON
     26 
     27 #define ILI9481_INVOFF 0x20  ///< Display Inversion OFF
     28 #define ILI9481_INVON 0x21   ///< Display Inversion ON
     29 #define ILI9481_DISPOFF 0x28 ///< Display OFF
     30 #define ILI9481_DISPON 0x29  ///< Display ON
     31 
     32 #define ILI9481_CASET 0x2A ///< Column Address Set
     33 #define ILI9481_PASET 0x2B ///< Page Address Set
     34 #define ILI9481_RAMWR 0x2C ///< Memory Write
     35 #define ILI9481_RAMRD 0x2E ///< Memory Read
     36 
     37 #define ILI9481_MADCTL 0x36 ///< Memory Access Control
     38 #define ILI9481_PIXFMT 0x3A ///< COLMOD: Pixel Format Set
     39 
     40 #define ILI9481_MADCTL_MY 0x80  ///< Bottom to top
     41 #define ILI9481_MADCTL_MX 0x40  ///< Right to left
     42 #define ILI9481_MADCTL_MV 0x20  ///< Reverse Mode
     43 #define ILI9481_MADCTL_ML 0x10  ///< LCD refresh Bottom to top
     44 #define ILI9481_MADCTL_RGB 0x00 ///< Red-Green-Blue pixel order
     45 #define ILI9481_MADCTL_BGR 0x08 ///< Blue-Green-Red pixel order
     46 #define ILI9481_MADCTL_HF 0x02
     47 #define ILI9481_MADCTL_VF 0x01
     48 
     49 class Arduino_ILI9481_18bit : public Arduino_TFT_18bit
     50 {
     51 public:
     52   Arduino_ILI9481_18bit(Arduino_DataBus *bus, int8_t rst = GFX_NOT_DEFINED, uint8_t r = 0, bool ips = false);
     53 
     54   bool begin(int32_t speed = GFX_NOT_DEFINED) override;
     55   void writeAddrWindow(int16_t x, int16_t y, uint16_t w, uint16_t h) override;
     56   void setRotation(uint8_t r) override;
     57   void invertDisplay(bool) override;
     58   void displayOn() override;
     59   void displayOff() override;
     60 
     61 protected:
     62   void tftInit() override;
     63 
     64 private:
     65 };
     66 
     67 #endif