Skip to content

Commit 641f162

Browse files
committed
Add push color to ILI9341 and prepare for release
1 parent 2cd69cd commit 641f162

5 files changed

+30
-4
lines changed

library.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Mini Grafx",
3-
"version": "0.0.19",
3+
"version": "1.0.0",
44
"keywords": "embedded, graphics, tft, oled, e-paper",
55
"description": "A generic graphics library containing several drivers for TFT, OLED and e-paper displays",
66
"repository":

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Mini Grafx
2-
version=0.0.19
2+
version=1.0.0
33
author=Daniel Eichhorn
44
maintainer=Daniel Eichhorn <[email protected]>
55
sentence=Graphics Library for embedded devices with a framebuffer

src/EPD_WaveShare_42.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,20 @@ void EPD_WaveShare42::SpiTransfer(unsigned char data) {
122122
}
123123

124124
int EPD_WaveShare42::IfInit(void) {
125+
Serial.println("Setting pin modes");
126+
digitalWrite(this->csPin, HIGH);
125127
pinMode(this->csPin, OUTPUT);
128+
digitalWrite(this->rstPin, HIGH);
126129
pinMode(this->rstPin, OUTPUT);
130+
digitalWrite(this->dcPin, HIGH);
127131
pinMode(this->dcPin, OUTPUT);
128-
pinMode(this->busyPin, INPUT);
129-
SPI.beginTransaction(SPISettings(2000000, MSBFIRST, SPI_MODE0));
132+
digitalWrite(this->busyPin, HIGH);
133+
pinMode(this->busyPin, OUTPUT);
134+
Serial.println("Starting SPI transaction");
130135
SPI.begin();
136+
SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0));
137+
Serial.println("Beginning SPI");
138+
131139
return 0;
132140
}
133141

src/ILI9341_SPI.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,23 @@ void ILI9341_SPI::setRotation(uint8_t m) {
408408
if (hwSPI) spi_end();
409409
}
410410

411+
void ILI9341_SPI::pushColor(uint16_t color) {
412+
if (hwSPI) spi_begin();
413+
414+
digitalWrite(_dc, HIGH);
415+
digitalWrite(_cs, LOW);
416+
417+
418+
spiwrite(color >> 8);
419+
spiwrite(color);
420+
421+
422+
digitalWrite(_cs, HIGH);
423+
424+
if (hwSPI) spi_end();
425+
426+
}
427+
411428
void ILI9341_SPI::writeBuffer(uint8_t *buffer, uint8_t bitsPerPixel, uint16_t *palette, uint16_t xPos, uint16_t yPos, uint16_t bufferWidth, uint16_t bufferHeight) {
412429

413430
if (hwSPI) spi_begin();

src/ILI9341_SPI.h

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ class ILI9341_SPI : public DisplayDriver {
125125
void setRotation(uint8_t r);
126126

127127
void writeBuffer(uint8_t *buffer, uint8_t bitsPerPixel, uint16_t *palette, uint16_t x, uint16_t y, uint16_t bufferWidth, uint16_t bufferHeight);
128+
void pushColor(uint16_t color);
128129
void setFastRefresh(boolean isFastRefreshEnabled);
129130

130131
void spiwrite(uint8_t);

0 commit comments

Comments
 (0)