| 407 | this.#buffer.position = 0; |
| 408 | } |
| 409 | send(src, offset, byteLength) { |
| 410 | const filter = this.#filter, buffer = this.#buffer; |
| 411 | let position = buffer.position; |
| 412 | |
| 413 | while (byteLength) { |
| 414 | let use = byteLength; |
| 415 | if (use > 1024 - position) |
| 416 | use = 1024 - position; |
| 417 | |
| 418 | applyFilter(filter, src, offset, use, buffer, position); |
| 419 | |
| 420 | byteLength -= use; |
| 421 | offset += use; |
| 422 | position += use; |
| 423 | if (1024 === position) { |
| 424 | this.#epd.spi.write(buffer); |
| 425 | position = 0; |
| 426 | } |
| 427 | } |
| 428 | buffer.position = position; |
| 429 | } |
| 430 | end() { |
| 431 | const epd = this.#epd; |
| 432 | |