Skip to content

Commit ee3587d

Browse files
authored
Merge pull request #182 from SolderedElectronics/PCAL-Support
Inkplate6 waveform table fix, code clean-up.
2 parents 66b7cd1 + 5ac09f4 commit ee3587d

File tree

4 files changed

+7
-146
lines changed

4 files changed

+7
-146
lines changed

src/boards/Inkplate6.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ bool Inkplate::begin(void)
136136
_partial = (uint8_t *)ps_malloc(E_INK_WIDTH * E_INK_HEIGHT / 8);
137137
_pBuffer = (uint8_t *)ps_malloc(E_INK_WIDTH * E_INK_HEIGHT / 4);
138138
DMemory4Bit = (uint8_t *)ps_malloc(E_INK_WIDTH * E_INK_HEIGHT / 2);
139-
GLUT = (uint32_t *)malloc(256 * 8 * sizeof(uint32_t));
140-
GLUT2 = (uint32_t *)malloc(256 * 8 * sizeof(uint32_t));
139+
GLUT = (uint32_t *)malloc(256 * 9 * sizeof(uint32_t));
140+
GLUT2 = (uint32_t *)malloc(256 * 9 * sizeof(uint32_t));
141141
if (DMemoryNew == NULL || _partial == NULL || _pBuffer == NULL || DMemory4Bit == NULL || GLUT == NULL ||
142142
GLUT2 == NULL)
143143
{
@@ -148,7 +148,7 @@ bool Inkplate::begin(void)
148148
memset(_pBuffer, 0, E_INK_WIDTH * E_INK_HEIGHT / 4);
149149
memset(DMemory4Bit, 255, E_INK_WIDTH * E_INK_HEIGHT / 2);
150150

151-
for (int i = 0; i < 8; ++i)
151+
for (int i = 0; i < 9; ++i)
152152
{
153153
for (uint32_t j = 0; j < 256; ++j)
154154
{
@@ -384,7 +384,7 @@ void Inkplate::display3b(bool leaveOn)
384384
clean(2, 1);
385385
clean(0, 12);
386386
clean(2, 1);
387-
for (int k = 0; k < 8; ++k)
387+
for (int k = 0; k < 9; ++k)
388388
{
389389
uint8_t *dp = DMemory4Bit + E_INK_WIDTH * E_INK_HEIGHT / 2;
390390

src/boards/Inkplate6.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@
3939
// Last element (index = 8) in waveform array is not used!
4040
#ifdef ARDUINO_ESP32_DEV
4141
#define WAVEFORM3BIT \
42-
{{0, 1, 1, 0, 0, 1, 1, 0}, {0, 1, 2, 1, 1, 2, 1, 0}, {1, 1, 1, 2, 2, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 2, 0}, \
43-
{2, 1, 1, 1, 2, 1, 2, 0}, {2, 2, 1, 1, 2, 1, 2, 0}, {1, 1, 1, 2, 1, 2, 2, 0}, {0, 0, 0, 0, 0, 0, 2, 0}};
42+
{{0, 1, 1, 0, 0, 1, 1, 0, 0}, {0, 1, 2, 1, 1, 2, 1, 0, 0}, {1, 1, 1, 2, 2, 1, 0, 0, 0}, \
43+
{0, 0, 0, 1, 1, 1, 2, 0, 0}, {2, 1, 1, 1, 2, 1, 2, 0, 0}, {2, 2, 1, 1, 2, 1, 2, 0, 0}, \
44+
{1, 1, 1, 2, 1, 2, 2, 0, 0}, {0, 0, 0, 0, 0, 0, 2, 0, 0}};
4445

4546
#endif
4647

src/boards/Inkplate6plus.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -524,30 +524,6 @@ uint32_t Inkplate::partialUpdate(bool _forced, bool leaveOn)
524524
delayMicroseconds(230);
525525
}
526526

527-
// for (int k = 0; k < 60; ++k)
528-
// {
529-
// uint8_t _send = B11111111;
530-
// vscan_start();
531-
532-
// writeRow(_send);
533-
// for (int i = 0; i < E_INK_HEIGHT / 2; i++)
534-
// {
535-
// hscan_start(pinLUT[_send]);
536-
// delayMicroseconds(1);
537-
// vscan_end();
538-
// }
539-
540-
// _send = B01010101;
541-
542-
// writeRow(_send);
543-
// for (int i = 0; i < E_INK_HEIGHT / 2; i++)
544-
// {
545-
// hscan_start(pinLUT[_send]);
546-
// delayMicroseconds(1);
547-
// vscan_end();
548-
// }
549-
// }
550-
551527
clean(2, 2);
552528
clean(3, 1);
553529
vscan_start();

src/boards/Inkplate6plus.h

Lines changed: 0 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -35,123 +35,7 @@
3535

3636
#define E_INK_WIDTH 1024
3737
#define E_INK_HEIGHT 758
38-
#define GPIO0_ENABLE 8
39-
#define INKPLATE_1BIT 0
40-
#define INKPLATE_3BIT 1
4138
#define FRONTLIGHT_EN 11
42-
#define PWR_GOOD_OK 0b11111010
43-
44-
#define DATA 0x0E8C0030 // D0-D7 = GPIO4 GPIO5 GPIO18 GPIO19 GPIO23 GPIO25 GPIO26 GPIO27
45-
46-
#define CL 0x01 // GPIO0
47-
#define CL_SET \
48-
{ \
49-
GPIO.out_w1ts = CL; \
50-
}
51-
#define CL_CLEAR \
52-
{ \
53-
GPIO.out_w1tc = CL; \
54-
}
55-
56-
#define LE 0x04 // GPIO2
57-
#define LE_SET \
58-
{ \
59-
GPIO.out_w1ts = LE; \
60-
}
61-
#define LE_CLEAR \
62-
{ \
63-
GPIO.out_w1tc = LE; \
64-
}
65-
66-
#define CKV 0x01 // GPIO32
67-
#define CKV_SET \
68-
{ \
69-
GPIO.out1_w1ts.val = CKV; \
70-
}
71-
#define CKV_CLEAR \
72-
{ \
73-
GPIO.out1_w1tc.val = CKV; \
74-
}
75-
76-
#define SPH 0x02 // GPIO33
77-
#define SPH_SET \
78-
{ \
79-
GPIO.out1_w1ts.val = SPH; \
80-
}
81-
#define SPH_CLEAR \
82-
{ \
83-
GPIO.out1_w1tc.val = SPH; \
84-
}
85-
86-
// I/O Expander - A Channel
87-
#define GMOD 1 // GPIOA1
88-
#define GMOD_SET \
89-
{ \
90-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, GMOD, HIGH); \
91-
}
92-
#define GMOD_CLEAR \
93-
{ \
94-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, GMOD, LOW); \
95-
}
96-
97-
#define OE 0 // GPIOA0
98-
#define OE_SET \
99-
{ \
100-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, OE, HIGH); \
101-
}
102-
#define OE_CLEAR \
103-
{ \
104-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, OE, LOW); \
105-
}
106-
107-
#define SPV 2 // GPIOA5
108-
#define SPV_SET \
109-
{ \
110-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, SPV, HIGH); \
111-
}
112-
#define SPV_CLEAR \
113-
{ \
114-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, SPV, LOW); \
115-
}
116-
117-
#define WAKEUP 3 // GPIOA3
118-
#define WAKEUP_SET \
119-
{ \
120-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, WAKEUP, HIGH); \
121-
}
122-
#define WAKEUP_CLEAR \
123-
{ \
124-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, WAKEUP, LOW); \
125-
}
126-
127-
#define PWRUP 4 // GPIOA4
128-
#define PWRUP_SET \
129-
{ \
130-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, PWRUP, HIGH); \
131-
}
132-
#define PWRUP_CLEAR \
133-
{ \
134-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, PWRUP, LOW); \
135-
}
136-
137-
#define VCOM 5 // GPIOA6
138-
#define VCOM_SET \
139-
{ \
140-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, VCOM, HIGH); \
141-
}
142-
#define VCOM_CLEAR \
143-
{ \
144-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, VCOM, LOW); \
145-
}
146-
147-
#ifndef _swap_int16_t
148-
#define _swap_int16_t(a, b) \
149-
{ \
150-
int16_t t = a; \
151-
a = b; \
152-
b = t; \
153-
}
154-
#endif
15539

15640
// Touchscreen defines
15741
#define TOUCHSCREEN_EN 12

0 commit comments

Comments
 (0)