• AVR Freaks

Hot!Legato label widget rotatable?

Author
Ragz
New Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2020/04/13 09:37:46
  • Location: 0
  • Status: offline
2020/05/13 14:47:10 (permalink)
0

Legato label widget rotatable?

I am using harmony V3 and the Legato graphics library. I have most of the proof of concept design working. Now I am trying to add some text to the screen.
 
My LCD is oriented in landscape mode in the physical design, but is laid out in portrait in the graphics editor. Therefore, to have text oriented correctly in the physical LCD, the text needs to be rotated 90 degrees. I do not see an orientation option for any of the texts. Am I missing something, or is orientation not an option with the text. If it is not an option, are there plans to make orientation an option? I have attached a screen shot of the test layout from the graphics composer.
 
The LCD is a newhaven 320x240 using the ST7789VI driver in 16bit parallel mode.
 

Attached Image(s)

#1

4 Replies Related Threads

    Ed@Microchip
    Super Member
    • Total Posts : 162
    • Reward points : 0
    • Joined: 2017/04/06 09:39:29
    • Location: 0
    • Status: offline
    Re: Legato label widget rotatable? 2020/05/13 15:06:32 (permalink)
    0
    Have you tried configuring your composer project for landscape aspect ratio WxH = 320x240 (instead of 240x320), and swap the row/columns in the ST7789 driver? That way your graphics composer project is oriented properly.
     
    You may also need to set the column-address order to Left-To-Right and Row Address order to Bottom-to-Top. You can look at the Legato Cooker or the Legato Showcase demo for examples. The display for those demos use the ILI9488 controller oriented in portrait mode, but the demos are in landscape. I believe the ST7789 command set is identical to ILI9488.
    #2
    Ragz
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2020/04/13 09:37:46
    • Location: 0
    • Status: offline
    Re: Legato label widget rotatable? 2020/05/13 15:28:09 (permalink)
    0
    Thanks for the response, I have considered doing that. I had a lot of struggles getting the display to work with the legato library in the first place and was/am nervous to change anything. I will give it a go though.
     
    I can still think of many scenarios where I would want to rotate the text though and feel that this should be an option. Is it on the roadmap?
    #3
    MHGC
    Super Member
    • Total Posts : 247
    • Reward points : 0
    • Status: offline
    Re: Legato label widget rotatable? 2020/05/13 18:01:35 (permalink)
    0
    Hi,
     
    Currrently, label rotation is not an option. However, unlike Aria, the generated font data in Legato contains kerning information that supporting this feature possible.
     
    There are plans to add this feature in a future release.   Just to be clear, I am talking about full text orientation (0, 90, 180, 270).  Vertical text, where it isn't rotated but the glyphs are stacked on top of each other, may not be possible, as it requires additional kerning data that many fonts do not provide.
    #4
    marelcom
    Starting Member
    • Total Posts : 38
    • Reward points : 0
    • Joined: 2018/01/17 03:18:47
    • Location: 0
    • Status: offline
    Re: Legato label widget rotatable? 2020/06/19 07:24:21 (permalink)
    0
    Hi

    with ST7789 controller you can rotate (90 degree) and flip the content of the display with the command 0x36


     
    static int DRV_ST7789_Configure(ST7789_DRV *drv)
    {
        GFX_Disp_Intf intf = (GFX_Disp_Intf) drv->port_priv;
        uint8_t cmd;
        uint8_t parms[16];

        DRV_ST7789_NCSAssert(intf);

        //Software Reset
        cmd = 0x1;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        DRV_ST7789_DelayMS(5);

        //Display Off
        cmd = 0x28;
        GFX_Disp_Intf_WriteCommand(intf, cmd);

        //Sleep Out
        cmd = 0x11;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        DRV_ST7789_DelayMS(120);

        //Memory Data Access Control
        cmd = 0x36;
        parms[0] = 0x20;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 1);

        //Interface Pixel Format
        cmd = 0x3a;
        parms[0] = 0x55;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 1);

        //RAM Control
        cmd = 0xb0;
        parms[0] = 0x0;
        parms[1] = 0x24;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 2);

        //RGB Interface Control
        cmd = 0xb1;
        parms[0] = 0x0;
        parms[1] = 0x0;
        parms[2] = 0x0;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 3);

        //Porch Setting
        cmd = 0xb2;
        parms[0] = 0xc;
        parms[1] = 0xc;
        parms[2] = 0x0;
        parms[3] = 0x33;
        parms[4] = 0x33;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 5);

        //Gate Control
        cmd = 0xb7;
        parms[0] = 0x75;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 1);

        //VCOM Setting
        cmd = 0xbb;
        parms[0] = 0x13;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 1);

        //LCM Control
        cmd = 0xc0;
        parms[0] = 0x6c;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 1);

        //VDV and VRH Command Enable
        cmd = 0xc2;
        parms[0] = 0x1;
        parms[1] = 0xff;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 2);

        //VRH Set
        cmd = 0xc3;
        parms[0] = 0x13;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 1);

        //VDV Set
        cmd = 0xc4;
        parms[0] = 0x20;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 1);

        //Frame Rate Control in Normal Mode
        cmd = 0xc6;
        parms[0] = 0xf;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 1);

        //Power Contol 1
        cmd = 0xd0;
        parms[0] = 0xa4;
        parms[1] = 0xa1;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 2);

        //Positive Voltage Gemma Control
        cmd = 0xe0;
        parms[0] = 0xd0;
        parms[1] = 0x8;
        parms[2] = 0x10;
        parms[3] = 0xd;
        parms[4] = 0xc;
        parms[5] = 0x7;
        parms[6] = 0x37;
        parms[7] = 0x53;
        parms[8] = 0x4c;
        parms[9] = 0x39;
        parms[10] = 0x15;
        parms[11] = 0x15;
        parms[12] = 0x2a;
        parms[13] = 0x2d;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 14);

        //Negative Voltage Gamma Control
        cmd = 0xe1;
        parms[0] = 0xd0;
        parms[1] = 0xd;
        parms[2] = 0x12;
        parms[3] = 0x8;
        parms[4] = 0x8;
        parms[5] = 0x15;
        parms[6] = 0x34;
        parms[7] = 0x34;
        parms[8] = 0x4a;
        parms[9] = 0x36;
        parms[10] = 0x12;
        parms[11] = 0x13;
        parms[12] = 0x2b;
        parms[13] = 0x2f;
        GFX_Disp_Intf_WriteCommand(intf, cmd);
        GFX_Disp_Intf_WriteData(intf, parms, 14);

        //Display Inversion On
        cmd = 0x21;
        GFX_Disp_Intf_WriteCommand(intf, cmd);

        //Display On
        cmd = 0x29;
        GFX_Disp_Intf_WriteCommand(intf, cmd);

        //Memory Write
        cmd = 0x2c;
        GFX_Disp_Intf_WriteCommand(intf, cmd);

        DRV_ST7789_NCSDeassert(intf);

        return 0;
    }
     

     
    regards Markus
    #5
    Jump to:
    © 2020 APG vNext Commercial Version 4.5