17 #ifndef _ADAFRUIT_TFTDMA_H_ 18 #define _ADAFRUIT_TFTDMA_H_ 20 #define TFT_INTERFACE_8 0 21 #define TFT_INTERFACE_16 1 22 #define TFT_INTERFACE_SPI 2 25 #define TFT_INTERFACE TFT_INTERFACE_8 29 #include <Adafruit_ZeroDMA.h> 88 Adafruit_TFTDMA(int8_t tc, int8_t reset, int8_t cs, int8_t cd, int8_t rd,
89 int8_t wr, int8_t d0, _EPioType periph);
99 #if TFT_INTERFACE == TFT_INTERFACE_8 104 #elif TFT_INTERFACE == TFT_INTERFACE_16 107 volatile uint16_t *
dirSet;
108 volatile uint16_t *
dirClr;
136 void writeReg8(uint8_t reg, uint8_t value);
161 void setAddrWindow(int16_t x1, int16_t y1, int16_t x2, int16_t y2);
168 uint32_t readID(
void);
226 TFT_framebuffer(int8_t tc, int8_t reset, int8_t cs, int8_t cd, int8_t rd,
227 int8_t wr, int8_t d0, _EPioType periph);
247 void waitForUpdate(
void);
257 void sully(int16_t x, int16_t y);
263 uint16_t *getBuffer(
void);
280 bool getDirtyRect(int16_t *x1, int16_t *y1, int16_t *x2, int16_t *y2);
291 inline void rawPixel(int16_t x, int16_t y, uint16_t color);
299 void drawPixel(int16_t x, int16_t y, uint16_t color);
309 void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
314 void fillScreen(uint16_t color = 0);
317 DmacDescriptor *dptr;
318 DmacDescriptor descriptor[
TFTHEIGHT] __attribute__((aligned(16)));
320 int16_t minx, miny, maxx, maxy;
384 TFT_segmented(int8_t tc, int8_t reset, int8_t cs, int8_t cd, int8_t rd,
385 int8_t wr, int8_t d0, _EPioType periph);
444 void update(int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t *buf,
445 uint16_t maxSegmentSize,
446 int16_t (*userCallback)(uint16_t *dest, uint16_t len,
454 void waitForUpdate(
void);
465 inline void rawPixel(int16_t x, int16_t y, uint16_t color);
473 void drawPixel(int16_t x, int16_t y, uint16_t color);
483 void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
488 void fillScreen(uint16_t color = 0);
491 DmacDescriptor *descriptor;
493 int16_t xoffset, yoffset, width, height;
554 TFT_scanline(int8_t tc, int8_t reset, int8_t cs, int8_t cd, int8_t rd,
555 int8_t wr, int8_t d0, _EPioType periph);
589 void update(int16_t x1, int16_t y1, int16_t x2, int16_t y2,
590 void (*userCallback)(uint16_t *dest,
void *udPtr),
612 void addSpan(uint16_t *addr, int16_t w,
bool inc = 1);
617 DmacDescriptor *dptr;
619 DmacDescriptor descriptor[
TFTWIDTH] __attribute__((aligned(16)));
624 #endif // _ADAFRUIT_TFTDMA_H_ Adafruit_TFTDMA(int8_t tc, int8_t reset, int8_t cs, int8_t cd, int8_t rd, int8_t wr, int8_t d0, _EPioType periph)
Constructor. Takes note of the hardware configuration to use, but does not itself initialize any hard...
Definition: Adafruit_TFTDMA.cpp:168
Adafruit_ZeroDMA dma
DMA instance.
Definition: Adafruit_TFTDMA.h:130
volatile uint32_t * rdPortSet
Pointer to RD pin PORT SET register.
Definition: Adafruit_TFTDMA.h:114
void writeReg16(uint8_t reg, uint16_t value)
Writes a 16-bit value to an ILI9341 configuration register.
Definition: Adafruit_TFTDMA.cpp:473
volatile uint32_t * csPortClr
Pointer to CS pin PORT CLEAR register.
Definition: Adafruit_TFTDMA.h:111
A base class that interfaces with the SAMD51 hardware, including PORTs, timer/counters, DMA and other operipherals. Unlikely to be instantiated on its own, a few subclasses are provided that represent the display and graphics memory in different ways. Applications must be designed around ONE of these subclasses and stick with it; can't toggle among them.
Definition: Adafruit_TFTDMA.h:40
void setAddrWindow(int16_t x1, int16_t y1, int16_t x2, int16_t y2)
Sets the ILI9341 'address window' for subsequent graphics operations. This also issues a MEMORYWRITE ...
Definition: Adafruit_TFTDMA.cpp:492
volatile uint8_t * dirSet
8-bit PORT direction set
Definition: Adafruit_TFTDMA.h:102
int8_t cdPin
Index of CD pin.
Definition: Adafruit_TFTDMA.h:123
volatile uint32_t * cdPortSet
Pointer to CD pin PORT SET register.
Definition: Adafruit_TFTDMA.h:112
int8_t csPin
Index of CS pin (or -1)
Definition: Adafruit_TFTDMA.h:122
void writeReg32(uint8_t reg, uint32_t value)
Writes a 32-bit value to an ILI9341 configuration register.
Definition: Adafruit_TFTDMA.cpp:481
int8_t rdPin
Index of RD pin.
Definition: Adafruit_TFTDMA.h:124
int8_t tcNum
Timer/Counter number.
Definition: Adafruit_TFTDMA.h:128
volatile uint8_t * readPort
Pointer to 8-bit PORT IN.
Definition: Adafruit_TFTDMA.h:101
uint32_t cdPinMask
Bitmask for CD pin PORT.
Definition: Adafruit_TFTDMA.h:119
int8_t d0Pin
Index of data bit 0 pin.
Definition: Adafruit_TFTDMA.h:127
uint32_t wrPinMask
Bitmask for WR pin PORT.
Definition: Adafruit_TFTDMA.h:121
volatile uint8_t * writePort
Pointer to 8-bit PORT OUT.
Definition: Adafruit_TFTDMA.h:100
int8_t resetPin
Index of RESET pin (or -1)
Definition: Adafruit_TFTDMA.h:126
uint32_t rdPinMask
Bitmask for RD pin PORT.
Definition: Adafruit_TFTDMA.h:120
volatile uint32_t * csPortSet
Pointer to CS pin PORT SET register.
Definition: Adafruit_TFTDMA.h:110
volatile uint8_t * dirClr
8-bit Port direction clear
Definition: Adafruit_TFTDMA.h:103
Subclass of Adafruit_TFTDMA providing a whole-screen contiguous framebuffer. This is probably the eas...
Definition: Adafruit_TFTDMA.h:178
_EPioType wrPeripheral
WR strobe peripheral type.
Definition: Adafruit_TFTDMA.h:129
int8_t wrPin
Index of WR pin.
Definition: Adafruit_TFTDMA.h:125
#define TFTWIDTH
Display width in pixels.
Definition: Adafruit_TFTDMA.h:26
Subclass of Adafruit_TFTDMA in which display (or section thereof) is generated one scanline at a time...
Definition: Adafruit_TFTDMA.h:506
volatile uint32_t * wrPortIdle
Pointer to WR pin PORT idle register.
Definition: Adafruit_TFTDMA.h:117
Subclass of Adafruit_TFTDMA that does not provide a contiguous framebuffer. Instead, application provides a buffer for graphics operations, which are divided into segments and redrawn as needed. Uses less RAM that TFT_framebuffer – only as much as one wants to allocate to it (minimum of TFTWIDTH*2 16-bit pixels, or 1,280 bytes, up to a maximum of 65,535 bytes). Invokes a user callback to draw graphics into this buffer before issuing to the screen. There is no permanent framebuffer; graphics are disposed after each update, and dirty rectangle handling is the application;s responsibility (or update the full screen or sections as needed).
Definition: Adafruit_TFTDMA.h:336
uint32_t csPinMask
Bitmask for CS pin PORT.
Definition: Adafruit_TFTDMA.h:118
#define TFTHEIGHT
Display height in pixels.
Definition: Adafruit_TFTDMA.h:27
void writeReg8(uint8_t reg, uint8_t value)
Writes an 8-bit value to an ILI9341 configuration register.
Definition: Adafruit_TFTDMA.cpp:466
volatile uint32_t * wrPortActive
Pointer to WR pin PORT active register.
Definition: Adafruit_TFTDMA.h:116
volatile uint32_t * cdPortClr
Pointer to CD pin PORT CLEAR register.
Definition: Adafruit_TFTDMA.h:113
volatile uint32_t * rdPortClr
Pointer to RD pin PORT CLEAR register.
Definition: Adafruit_TFTDMA.h:115
bool begin(void)
Initializes all pins and peripherals used by the library.
Definition: Adafruit_TFTDMA.cpp:243