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

Function doCmd

modules/drivers/ssd1306/modSsd1306.c:526–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526void doCmd(ssd1606 ssd, uint8_t cmd)
527{
528#if MODDEF_SSD1306_SPI
529 SCREEN_CS_DEACTIVE; // inactive in sample when toggling DC
530 SCREEN_DC_COMMAND;
531 SCREEN_CS_ACTIVE;
532 modSPITx(&ssd->config.spi, &cmd, 1);
533 modSPIFlush();
534#elif MODDEF_SSD1306_I2C
535 uint8_t data[2] = {0, cmd};
536 uint8_t err = modI2CWrite(&ssd->config.i2c, data, 2, true);
537 if (err) {
538 xsMachine *the = ssd->the;
539 xsUnknownError("command failed");
540 }
541#endif
542}
543
544#if MODDEF_SSD1306_SPI
545void ssd1306ChipSelect(uint8_t active, modSPIConfiguration config)

Callers 2

xs_SSD1306Function · 0.70
ssd1306BeginFunction · 0.70

Calls 3

modSPITxFunction · 0.50
modSPIFlushFunction · 0.50
modI2CWriteFunction · 0.50

Tested by

no test coverage detected