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_STM32PAR8.h (2008B)

      1 #ifdef ARDUINO_ARCH_STM32
      2 
      3 #ifndef _ARDUINO_STM32PAR8_H_
      4 #define _ARDUINO_STM32PAR8_H_
      5 
      6 #include "Arduino_DataBus.h"
      7 
      8 class Arduino_STM32PAR8 : public Arduino_DataBus
      9 {
     10 public:
     11   Arduino_STM32PAR8(int8_t dc, int8_t cs, int8_t wr, int8_t rd, GPIO_TypeDef* 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   void writeBytes(uint8_t *data, uint32_t len) override;
     27   void writePattern(uint8_t *data, uint8_t len, uint32_t repeat) override;
     28 
     29   void writeIndexedPixels(uint8_t *data, uint16_t *idx, uint32_t len) override;
     30   void writeIndexedPixelsDouble(uint8_t *data, uint16_t *idx, uint32_t len) override;
     31 
     32 protected:
     33 private:
     34   INLINE void WRITE(uint8_t d);
     35   INLINE void DC_HIGH(void);
     36   INLINE void DC_LOW(void);
     37   INLINE void CS_HIGH(void);
     38   INLINE void CS_LOW(void);
     39 
     40   int8_t _dc, _cs, _wr, _rd;
     41   GPIO_TypeDef* _port;
     42   GPIO_TypeDef* _dcPORT; 
     43   GPIO_TypeDef* _csPORT;
     44   GPIO_TypeDef* _wrPORT;
     45   GPIO_TypeDef* _rdPORT;
     46 
     47   ARDUINOGFX_PORT_t _dcPinMaskSet;   ///< Bitmask for data/command SET (OR)
     48   ARDUINOGFX_PORT_t _csPinMaskSet;   ///< Bitmask for data/command SET (OR)
     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   ARDUINOGFX_PORT_t _rdPinMaskSet;   ///< Bitmask for data/command SET (OR)
     53 };
     54 
     55 #endif // _ARDUINO_STM32PAR8_H_
     56 
     57 #endif // #ifdef ARDUINO_ARCH_STM32