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_ESP32LCD8.h (1807B)
1 /* 2 * start rewrite from: 3 * https://github.com/lovyan03/LovyanGFX/blob/master/src/lgfx/v0/platforms/LGFX_PARALLEL_ESP32.hpp 4 */ 5 #include "Arduino_DataBus.h" 6 7 #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3) 8 9 #ifndef _ARDUINO_ESP32LCD8_H_ 10 #define _ARDUINO_ESP32LCD8_H_ 11 12 class Arduino_ESP32LCD8 : public Arduino_DataBus 13 { 14 public: 15 Arduino_ESP32LCD8( 16 int8_t dc, int8_t cs, int8_t wr, int8_t rd, 17 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 18 19 bool begin(int32_t speed = GFX_NOT_DEFINED, int8_t dataMode = GFX_NOT_DEFINED) override; 20 void beginWrite() override; 21 void endWrite() override; 22 void writeCommand(uint8_t) override; 23 void writeCommand16(uint16_t) override; 24 void write(uint8_t) override; 25 void write16(uint16_t) override; 26 void writeRepeat(uint16_t p, uint32_t len) override; 27 void writePixels(uint16_t *data, uint32_t len) override; 28 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 INLINE void WRITECOMMAND(uint8_t c); 37 INLINE void WRITECOMMAND16(uint16_t c); 38 INLINE void WRITE(uint8_t d); 39 INLINE void WRITE16(uint16_t d); 40 INLINE void CS_HIGH(void); 41 INLINE void CS_LOW(void); 42 43 private: 44 int8_t _dc, _cs, _wr, _rd; 45 int8_t _d0, _d1, _d2, _d3, _d4, _d5, _d6, _d7; 46 47 PORTreg_t _csPortSet; ///< PORT register SET 48 PORTreg_t _csPortClr; ///< PORT register CLEAR 49 uint32_t _csPinMask; ///< Bitmask 50 51 esp_lcd_i80_bus_handle_t _i80_bus = nullptr; 52 }; 53 54 #endif // _ARDUINO_ESP32LCD8_H_ 55 56 #endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)