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_AVRPAR8.h (2099B)

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