@@ -44,7 +44,7 @@ namespace pimoroni {
44
44
};
45
45
46
46
bool Inky73::is_busy () {
47
- return !(sr. read () & 128 );
47
+ return !gpio_get (BUSY );
48
48
}
49
49
50
50
void Inky73::busy_wait (uint timeout_ms) {
@@ -75,6 +75,10 @@ namespace pimoroni {
75
75
gpio_set_dir (RESET, GPIO_OUT);
76
76
gpio_put (RESET, 1 );
77
77
78
+ gpio_set_function (BUSY, GPIO_FUNC_SIO);
79
+ gpio_set_dir (BUSY, GPIO_IN);
80
+ gpio_set_pulls (BUSY, true , false );
81
+
78
82
gpio_set_function (SCK, GPIO_FUNC_SPI);
79
83
gpio_set_function (MOSI, GPIO_FUNC_SPI);
80
84
};
@@ -164,6 +168,12 @@ namespace pimoroni {
164
168
gpio_put (CS, 0 );
165
169
spi_write_blocking (spi, (const uint8_t *)graphics->frame_buffer , graphics->bounds .w * graphics->bounds .h / 2 );
166
170
gpio_put (CS, 1 );
171
+ } else if (graphics->pen_type == PicoGraphics::PEN_3BIT) {
172
+ graphics->frame_convert (PicoGraphics::PEN_P4, [this ](void *buf, size_t length) {
173
+ if (length > 0 ) {
174
+ spi_write_blocking (spi, (const uint8_t *)buf, length);
175
+ }
176
+ });
167
177
} else {
168
178
graphics->frame_convert (PicoGraphics::PEN_INKY7, [this , &totalLength](void *buf, size_t length) {
169
179
if (length > 0 ) {
@@ -175,7 +185,7 @@ namespace pimoroni {
175
185
});
176
186
}
177
187
178
- gpio_put (DC, 0 ); // data mode
188
+ gpio_put (DC, 0 ); // command mode
179
189
180
190
gpio_put (CS, 1 );
181
191
@@ -194,7 +204,8 @@ namespace pimoroni {
194
204
}
195
205
196
206
bool Inky73::is_pressed (Button button) {
197
- return sr.read () & button;
207
+ // return sr.read() & button;
208
+ return false ;
198
209
}
199
210
200
211
}
0 commit comments