(x, y, w, h, color)
| 178 | } while (true); |
| 179 | } |
| 180 | fillArea(x, y, w, h, color) { |
| 181 | if (w & 3) |
| 182 | throw new Error; |
| 183 | |
| 184 | if ((color < 0) || (color > 15)) |
| 185 | throw new Error; |
| 186 | |
| 187 | this.setTargetMemoryAddress(this._tar_memaddr); |
| 188 | this.setArea(x, y, w, h); |
| 189 | |
| 190 | const pixels = new Uint16Array(w >> 2); |
| 191 | pixels.fill(color | (color << 4) | (color << 8) | (color << 12)); |
| 192 | const buffer = pixels.buffer, spi = this.spi; |
| 193 | |
| 194 | this.select.write(0); |
| 195 | spi.write(Uint16Array.of(0)) |
| 196 | while (h--) |
| 197 | spi.write(buffer); |
| 198 | this.select.write(1); |
| 199 | |
| 200 | this.writeCommand(IT8951_TCON_LD_IMG_END); |
| 201 | } |
| 202 | updateArea(x, y, w, h, mode) { |
| 203 | if (UpdateMode.NONE === mode) |
| 204 | return; |
nothing calls this directly
no test coverage detected