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_ESP32PAR16QQ.h (2653B)

      1 #include "Arduino_DataBus.h"
      2 
      3 #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3)
      4 
      5 #ifndef _ARDUINO_ESP32PAR16QQ_H_
      6 #define _ARDUINO_ESP32PAR16QQ_H_
      7 
      8 class Arduino_ESP32PAR16QQ : public Arduino_DataBus
      9 {
     10 public:
     11   Arduino_ESP32PAR16QQ(
     12       int8_t dc, int8_t cs, int8_t wr, int8_t rd,
     13       int8_t d0, int8_t d1, int8_t d2, int8_t d3, int8_t d4, int8_t d5, int8_t d6, int8_t d7,
     14       int8_t d8, int8_t d9, int8_t d10, int8_t d11, int8_t d12, int8_t d13, int8_t d14, int8_t d15); // Constructor
     15 
     16   bool begin(int32_t speed = GFX_NOT_DEFINED, int8_t dataMode = GFX_NOT_DEFINED) override;
     17   void beginWrite() override;
     18   void endWrite() override;
     19   void writeCommand(uint8_t) override;
     20   void writeCommand16(uint16_t) override;
     21   void write(uint8_t) override;
     22   void write16(uint16_t) override;
     23   void writeRepeat(uint16_t p, uint32_t len) override;
     24   void writePixels(uint16_t *data, uint32_t len) override;
     25 
     26   void writeC8D8(uint8_t c, uint8_t d) override;
     27   void writeC8D16(uint8_t c, uint16_t d) override;
     28   void writeC8D16D16(uint8_t c, uint16_t d1, uint16_t d2) override;
     29   void writeC8D16D16Split(uint8_t c, uint16_t d1, uint16_t d2) override;
     30   void writeBytes(uint8_t *data, uint32_t len) override;
     31   void writePattern(uint8_t *data, uint8_t len, uint32_t repeat) override;
     32 
     33   void writeIndexedPixels(uint8_t *data, uint16_t *idx, uint32_t len) override;
     34   void writeIndexedPixelsDouble(uint8_t *data, uint16_t *idx, uint32_t len) override;
     35 
     36 protected:
     37 private:
     38   INLINE void WRITE(uint8_t d);
     39   INLINE void WRITE16(uint16_t d);
     40   INLINE void DC_HIGH(void);
     41   INLINE void DC_LOW(void);
     42   INLINE void CS_HIGH(void);
     43   INLINE void CS_LOW(void);
     44 
     45   int8_t _dc, _cs, _wr, _rd;
     46   int8_t _d0, _d1, _d2, _d3, _d4, _d5, _d6, _d7;
     47   int8_t _d8, _d9, _d10, _d11, _d12, _d13, _d14, _d15;
     48 
     49   PORTreg_t _dcPortSet; ///< PORT register SET
     50   PORTreg_t _dcPortClr; ///< PORT register CLEAR
     51   uint32_t _dcPinMask;  ///< Bitmask
     52 
     53   PORTreg_t _csPortSet; ///< PORT register SET
     54   PORTreg_t _csPortClr; ///< PORT register CLEAR
     55   uint32_t _csPinMask;  ///< Bitmask
     56 
     57   PORTreg_t _wrPortSet; ///< PORT register SET
     58   PORTreg_t _wrPortClr; ///< PORT register CLEAR
     59   uint32_t _wrPinMask;  ///< Bitmask
     60 
     61   PORTreg_t _dataPortSet; ///< PORT register SET
     62   PORTreg_t _dataPortClr; ///< PORT register CLEAR
     63   uint32_t _dataClrMask;
     64   // Lookup table for ESP32 parallel bus interface uses 2kbyte RAM,
     65   uint32_t _xset_mask_lo[256];
     66   uint32_t _xset_mask_hi[256];
     67 };
     68 
     69 #endif // _ARDUINO_ESP32PAR16QQ_H_
     70 
     71 #endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3)