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_ESP32S2PAR16.h (2164B)

      1 #include "Arduino_DataBus.h"
      2 
      3 #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3)
      4 
      5 #ifndef _ARDUINO_ESP32S2PAR16_H_
      6 #define _ARDUINO_ESP32S2PAR16_H_
      7 
      8 class Arduino_ESP32S2PAR16 : public Arduino_DataBus
      9 {
     10 public:
     11   Arduino_ESP32S2PAR16(int8_t dc, int8_t cs, int8_t wr, int8_t rd); // Constructor
     12 
     13   bool begin(int32_t speed = GFX_NOT_DEFINED, int8_t dataMode = GFX_NOT_DEFINED) override;
     14   void beginWrite() override;
     15   void endWrite() override;
     16   void writeCommand(uint8_t) override;
     17   void writeCommand16(uint16_t) override;
     18   void write(uint8_t) override;
     19   void write16(uint16_t) override;
     20   void writeRepeat(uint16_t p, uint32_t len) override;
     21   void writePixels(uint16_t *data, uint32_t len) override;
     22 
     23   void writeC8D8(uint8_t c, uint8_t d) override;
     24   void writeC8D16(uint8_t c, uint16_t d) override;
     25   void writeC8D16D16(uint8_t c, uint16_t d1, uint16_t d2) override;
     26   void writeC8D16D16Split(uint8_t c, uint16_t d1, uint16_t d2) override;
     27   void writeBytes(uint8_t *data, uint32_t len) override;
     28   void writePattern(uint8_t *data, uint8_t len, uint32_t repeat) override;
     29 
     30   void writeIndexedPixels(uint8_t *data, uint16_t *idx, uint32_t len) override;
     31   void writeIndexedPixelsDouble(uint8_t *data, uint16_t *idx, uint32_t len) override;
     32 
     33 protected:
     34 private:
     35   INLINE void WRITE(uint8_t d);
     36   INLINE void WRITE16(uint16_t d);
     37   INLINE void DC_HIGH(void);
     38   INLINE void DC_LOW(void);
     39   INLINE void CS_HIGH(void);
     40   INLINE void CS_LOW(void);
     41 
     42   int8_t _dc, _cs, _wr, _rd;
     43 
     44   PORTreg_t _dcPortSet; ///< PORT register SET
     45   PORTreg_t _dcPortClr; ///< PORT register CLEAR
     46   uint32_t _dcPinMask;  ///< Bitmask
     47 
     48   PORTreg_t _csPortSet; ///< PORT register SET
     49   PORTreg_t _csPortClr; ///< PORT register CLEAR
     50   uint32_t _csPinMask;  ///< Bitmask
     51 
     52   PORTreg_t _wrPortSet; ///< PORT register SET
     53   PORTreg_t _wrPortClr; ///< PORT register CLEAR
     54   uint32_t _wrPinMask;  ///< Bitmask
     55 
     56   PORTreg_t _dataPortSet; ///< PORT register SET
     57   PORTreg_t _dataPortClr; ///< PORT register CLEAR
     58   uint32_t _dataClrMask;
     59 };
     60 
     61 #endif // _ARDUINO_ESP32S2PAR16_H_
     62 
     63 #endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3)