| 387 | } |
| 388 | |
| 389 | void ssd1306Begin(void *refcon, CommodettoCoordinate x, CommodettoCoordinate y, CommodettoDimension w, CommodettoDimension h) |
| 390 | { |
| 391 | ssd1606 ssd = refcon; |
| 392 | |
| 393 | doCmd(ssd, SSD1306_COLUMNADDR); |
| 394 | doCmd(ssd, 0); // Column start address (0 = reset) |
| 395 | doCmd(ssd, ssd->width - 1); // Column end address (127 = reset) |
| 396 | |
| 397 | doCmd(ssd, SSD1306_PAGEADDR); |
| 398 | doCmd(ssd, 0); // Page start address (0 = reset) |
| 399 | |
| 400 | doCmd(ssd, (ssd->height >> 3) - 1); // Page end address |
| 401 | |
| 402 | #if MODDEF_SSD1306_DITHER |
| 403 | c_memset(ssd->ditherA, 0, sizeof(ssd->ditherA)); |
| 404 | c_memset(ssd->ditherB, 0, sizeof(ssd->ditherB)); |
| 405 | ssd->ditherPhase = 0; |
| 406 | #endif |
| 407 | |
| 408 | #if MODDEF_SSD1306_SPI |
| 409 | SCREEN_CS_DEACTIVE; // inactive in sample when toggling DC |
| 410 | SCREEN_DC_DATA; |
| 411 | SCREEN_CS_ACTIVE; |
| 412 | #endif |
| 413 | |
| 414 | ssd->pixel = 0; |
| 415 | } |
| 416 | |
| 417 | void ssd1306Continue(void *refcon) |
| 418 | { |
no test coverage detected