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_AVRPAR16.h (2305B)

      1 #ifdef __AVR__
      2 
      3 #ifndef _ARDUINO_AVRPAR16_H_
      4 #define _ARDUINO_AVRPAR16_H_
      5 
      6 #include "Arduino_DataBus.h"
      7 
      8 class Arduino_AVRPAR16 : public Arduino_DataBus
      9 {
     10 public:
     11   Arduino_AVRPAR16(int8_t dc, int8_t cs, int8_t wr, int8_t rd, uint8_t portLow, uint8_t portHigh); // 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 
     28 protected:
     29 private:
     30   INLINE void WRITE16(uint16_t d);
     31   INLINE void WRITEREPEAT(uint16_t p, uint32_t len);
     32   INLINE void DC_HIGH(void);
     33   INLINE void DC_LOW(void);
     34   INLINE void CS_HIGH(void);
     35   INLINE void CS_LOW(void);
     36 
     37   int8_t _dc, _cs, _wr, _rd;
     38   uint8_t _portLow;
     39   uint8_t _portHigh;
     40 
     41   PORTreg_t _dcPort;               ///< PORT register for data/command
     42   ARDUINOGFX_PORT_t _dcPinMaskSet; ///< Bitmask for data/command SET (OR)
     43   ARDUINOGFX_PORT_t _dcPinMaskClr; ///< Bitmask for data/command CLEAR (AND)
     44 
     45   PORTreg_t _csPort;               ///< PORT register for data/command
     46   ARDUINOGFX_PORT_t _csPinMaskSet; ///< Bitmask for data/command SET (OR)
     47   ARDUINOGFX_PORT_t _csPinMaskClr; ///< Bitmask for data/command CLEAR (AND)
     48 
     49   PORTreg_t _wrPort;               ///< PORT register for data/command
     50   ARDUINOGFX_PORT_t _wrPinMaskSet; ///< Bitmask for data/command SET (OR)
     51   ARDUINOGFX_PORT_t _wrPinMaskClr; ///< Bitmask for data/command CLEAR (AND)
     52 
     53   PORTreg_t _rdPort;               ///< PORT register for data/command
     54   ARDUINOGFX_PORT_t _rdPinMaskSet; ///< Bitmask for data/command SET (OR)
     55   ARDUINOGFX_PORT_t _rdPinMaskClr; ///< Bitmask for data/command CLEAR (AND)
     56 
     57   PORTreg_t _dataPortLow;  ///< PORT register for data/command
     58   PORTreg_t _dataPortHigh; ///< PORT register for data/command
     59 };
     60 
     61 #endif // _ARDUINO_AVRPAR16_H_
     62 
     63 #endif // #ifdef __AVR__