MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / ssd1306Begin

Function ssd1306Begin

modules/drivers/ssd1306/modSsd1306.c:389–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389void 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
417void ssd1306Continue(void *refcon)
418{

Callers 1

xs_SSD1306_beginFunction · 0.85

Calls 1

doCmdFunction · 0.70

Tested by

no test coverage detected