Skip to content

Commit 1396c06

Browse files
authored
Merge pull request #20 from makermelissa/master
Updated GizmoTest to work on CPX and CPB
2 parents 4b71349 + 660f921 commit 1396c06

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

Adafruit_IL0373.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ Adafruit_IL0373::Adafruit_IL0373(int width, int height, int8_t SID, int8_t SCLK,
4949
@param CS the chip select pin to use
5050
@param SRCS the SRAM chip select pin to use
5151
@param BUSY the busy pin to use
52+
@param spi the SPI bus to use
5253
*/
5354
/**************************************************************************/
5455
Adafruit_IL0373::Adafruit_IL0373(int width, int height, int8_t DC, int8_t RST,
55-
int8_t CS, int8_t SRCS, int8_t BUSY)
56-
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY) {
56+
int8_t CS, int8_t SRCS, int8_t BUSY,
57+
SPIClass *spi)
58+
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
5759
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
5860
buffer2_size = buffer1_size;
5961

Adafruit_IL0373.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Adafruit_IL0373 : public Adafruit_EPD {
4242
int8_t RST, int8_t CS, int8_t SRCS, int8_t MISO,
4343
int8_t BUSY = -1);
4444
Adafruit_IL0373(int width, int height, int8_t DC, int8_t RST, int8_t CS,
45-
int8_t SRCS, int8_t BUSY = -1);
45+
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
4646

4747
void begin(bool reset = true);
4848
void powerUp();

examples/GizmoTest/GizmoTest.ino

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@
1616
#define EPD_RESET PIN_A3 // can set to -1 and share with microcontroller Reset!
1717
#define EPD_BUSY -1 // can set to -1 to not use a pin (will wait a fixed delay)
1818

19-
Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
19+
// You will need to use Adafruit's CircuitPlayground Express Board Definition
20+
// for Gizmos rather than the Arduino version since there are additional SPI
21+
// ports exposed.
22+
#if (SPI_INTERFACES_COUNT == 1)
23+
SPIClass* spi = &SPI;
24+
#else
25+
SPIClass* spi = &SPI1;
26+
#endif
27+
28+
Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, spi);
2029

2130
float p = 3.1415926;
2231

0 commit comments

Comments
 (0)