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_ESP32PAR8.h (2371B)

      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_ESP32PAR8_H_
      6 #define _ARDUINO_ESP32PAR8_H_
      7 
      8 class Arduino_ESP32PAR8 : public Arduino_DataBus
      9 {
     10 public:
     11   Arduino_ESP32PAR8(
     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); // Constructor
     14 
     15   bool begin(int32_t speed = GFX_NOT_DEFINED, int8_t dataMode = GFX_NOT_DEFINED) override;
     16   void beginWrite() override;
     17   void endWrite() override;
     18   void writeCommand(uint8_t) override;
     19   void writeCommand16(uint16_t) override;
     20   void write(uint8_t) override;
     21   void write16(uint16_t) override;
     22   void writeRepeat(uint16_t p, uint32_t len) override;
     23   void writePixels(uint16_t *data, uint32_t len) override;
     24 
     25   void writeC8D8(uint8_t c, uint8_t d) override;
     26   void writeC8D16(uint8_t c, uint16_t d) override;
     27   void writeC8D16D16(uint8_t c, uint16_t d1, uint16_t d2) override;
     28   void writeC8D16D16Split(uint8_t c, uint16_t d1, uint16_t d2) override;
     29   void writeBytes(uint8_t *data, uint32_t len) override;
     30   void writePattern(uint8_t *data, uint8_t len, uint32_t repeat) override;
     31 
     32   void writeIndexedPixels(uint8_t *data, uint16_t *idx, uint32_t len) override;
     33   void writeIndexedPixelsDouble(uint8_t *data, uint16_t *idx, uint32_t len) override;
     34 
     35 protected:
     36 private:
     37   INLINE void WRITE(uint8_t d);
     38   INLINE void DC_HIGH(void);
     39   INLINE void DC_LOW(void);
     40   INLINE void CS_HIGH(void);
     41   INLINE void CS_LOW(void);
     42 
     43   int8_t _dc, _cs, _wr, _rd;
     44   int8_t _d0, _d1, _d2, _d3, _d4, _d5, _d6, _d7;
     45 
     46   PORTreg_t _dcPortSet; ///< PORT register SET
     47   PORTreg_t _dcPortClr; ///< PORT register CLEAR
     48   uint32_t _dcPinMask;  ///< Bitmask
     49 
     50   PORTreg_t _csPortSet; ///< PORT register SET
     51   PORTreg_t _csPortClr; ///< PORT register CLEAR
     52   uint32_t _csPinMask;  ///< Bitmask
     53 
     54   PORTreg_t _wrPortSet; ///< PORT register SET
     55   PORTreg_t _wrPortClr; ///< PORT register CLEAR
     56   uint32_t _wrPinMask;  ///< Bitmask
     57 
     58   uint32_t _data1ClrMask;
     59   uint32_t _data2ClrMask;
     60   // Lookup table for ESP32 parallel bus interface uses 1kbyte RAM,
     61   uint32_t _xset_mask1[256];
     62   uint32_t _xset_mask2[256];
     63 };
     64 
     65 #endif // _ARDUINO_ESP32PAR8_H_
     66 
     67 #endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3)