Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: ST7789 Mirror screen

  1. #1

    ST7789 Mirror screen

    Im using this 1.3" ST7789 Display with with the suggested ST7798_t3 library and currently running the graphictest example.
    my question is, is there a inbuild way to mirror the screen (flip the X or the Y axis).

    If not did someone do that (if possible without modifying the library)?

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    This looks like another one of the displays without a chip select pin?

    Is the issue that you are simply wanting to mirror or that your display is showing stuff mirrored?

    Anyway most of that stuff is controlled by the method setRotation(m) where m is 0-3 to rotate the screen in 4 orientations.

    for each orientation it sets up the displays register MADCTL which controls how things are stored in memory and when it increments how it increments...

    So you can take a look at void ST7789_t3::setRotation(uint8_t m)
    And see how it is currently set and experiment some.

    You can either change these sources and/or create your own subclass of it.

    That is the ST7789 code is 99% the same as the ST7735, mainly only some defines different and a couple functions, including the rotation function.

    So you could simply subclass this class and overwrite the setRotation method.

  3. #3
    I want to mirror it, because you look through a mirror ot the screen.
    So the library dont have a funktion for that and I have to write my own?

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Probably you will need to do. Again just look at the rotate function and experiment with the different MADCTL settings and see if one works for your case.

    Don't know of anyone doing it, but hopefully not too hard. You might download a copy of the ST7789 pdf and look at sections like in the version I am looking at 8.12 Address Control which discuss things like mirroring

  5. #5
    I managed to rotate an mirror the screen, but now I get the first 24 lines (viewed from the original berspective) artifacts. the positioning of the data (lines eg.) isnt shiftet...
    the artifact get less when I refresh parts of the screen fast fith a delay of 10ms.

    What I done is added 5th option to SetRotation within the library:

    case 4:
         writedata_last(ST77XX_MADCTL_MV | ST77XX_MADCTL_RGB);
         _xstart = 0;
         _ystart = 0;
         _height = _screenWidth;
         _width = _screenHeight;

  6. #6
    I fixed the issue by using the framebuffer.

    thanks for help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts