MCPcopy Create free account
hub / github.com/cbm80amiga/Arduino_ST7789_Fast / setRotation

Method setRotation

Arduino_ST7789_Fast.cpp:346–372  ·  view source on GitHub ↗

----------------------------------------------------------

Source from the content-addressed store, hash-verified

344
345// ----------------------------------------------------------
346void Arduino_ST7789::setRotation(uint8_t m)
347{
348 writeCmd(ST7789_MADCTL);
349 rotation = m & 3;
350 switch (rotation) {
351 case 0:
352 writeData(ST7789_MADCTL_MX | ST7789_MADCTL_MY | ST7789_MADCTL_RGB);
353 _xstart = _colstart;
354 _ystart = _rowstart;
355 break;
356 case 1:
357 writeData(ST7789_MADCTL_MY | ST7789_MADCTL_MV | ST7789_MADCTL_RGB);
358 _ystart = _colstart;
359 _xstart = _rowstart;
360 break;
361 case 2:
362 writeData(ST7789_MADCTL_RGB);
363 _xstart = 0;
364 _ystart = 0;
365 break;
366 case 3:
367 writeData(ST7789_MADCTL_MX | ST7789_MADCTL_MV | ST7789_MADCTL_RGB);
368 _xstart = 0;
369 _ystart = 0;
370 break;
371 }
372}
373
374// ----------------------------------------------------------
375void Arduino_ST7789::setAddrWindow(uint16_t xs, uint16_t ys, uint16_t xe, uint16_t ye)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected