Skip to content

Commit 8f7a0b6

Browse files
Added pushColors() to ILI9341 library to better support the OV7670 camera
1 parent df9476c commit 8f7a0b6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

STM32F1/libraries/Adafruit_ILI9341_STM/Adafruit_ILI9341_STM.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,23 @@ void Adafruit_ILI9341_STM::pushColor(uint16_t color) {
386386
if (hwSPI) spi_end();
387387
}
388388

389+
void Adafruit_ILI9341_STM::pushColors(void * colorBuffer, uint16_t nr_pixels, uint8_t async)
390+
{
391+
*dcport |= dcpinmask;
392+
*csport &= ~cspinmask;
393+
394+
if (async==0)
395+
{
396+
SPI.dmaSend(colorBuffer, nr_pixels, 1);
397+
*csport |= cspinmask;
398+
}
399+
else
400+
{
401+
SPI.dmaSendAsync(colorBuffer, nr_pixels, 1);
402+
}
403+
404+
}
405+
389406
void Adafruit_ILI9341_STM::drawPixel(int16_t x, int16_t y, uint16_t color) {
390407

391408
if ((x < 0) || (x >= _width) || (y < 0) || (y >= _height)) return;

STM32F1/libraries/Adafruit_ILI9341_STM/Adafruit_ILI9341_STM.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class Adafruit_ILI9341_STM : public Adafruit_GFX {
107107
void begin(void),
108108
setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1),
109109
pushColor(uint16_t color),
110+
pushColors(void * colorBuffer, uint16_t nr_pixels, uint8_t async),
110111
fillScreen(uint16_t color),
111112
#if defined (__STM32F1__)
112113
drawLine(int16_t x0, int16_t y0,int16_t x1, int16_t y1, uint16_t color),

0 commit comments

Comments
 (0)