FTDI Community

General Category => Discussion - Software => Topic started by: jberkhout on July 06, 2018, 09:51:38 AM

Title: ME813A-WH50C Display - Orientation portrait - height limited to 511 pixels
Post by: jberkhout on July 06, 2018, 09:51:38 AM
Hi,

I just discovered a problem using the 800x480 display in portait mode:

BITMAP_LAYOUT and BITMAP_SIZE have only 8 bits for specifying the height, which gives a maximum of 511 pixels in height.
BITMAP_SIZE also has a limited width of 511 resolution.
So bitmaps that are bigger has greater resolution will not be handled correctly.

This is a limitation that should be addressed in the future of EVE, would it be able to support bigger displays (and portrait mode).

To work around this, I will try to cut my images so they don't exceed 511 pixels.

Hope this helps others.

Kind regards,
Jack.
Title: Re: ME813A-WH50C Display - Orientation portrait - height limited to 511 pixels
Post by: Rudolph on July 06, 2018, 11:24:57 AM
BITMAP_SIZE_H and BITMAP_LAYOUT_H is what you are looking for.
But you really want to check out CMD_SETBITMAP.
Title: Re: ME813A-WH50C Display - Orientation portrait - height limited to 511 pixels
Post by: jberkhout on July 06, 2018, 02:23:19 PM
Thank you very much!

Way to go, it works great! I see what has been done to make FT81x support greater resolutions now!

Super!

Code: [Select]
// Set up display list for bitmap - Cmd_SetBitmap - generate DL commands for bitmap parms
// FT81x Series Programmers Guide Section 5.65
ft_void_t FT813::SetBitmap(ft_int32_t addr, ft_int16_t fmt, ft_uint16_t width, ft_uint16_t height)
{
    StartFunc(FT_CMD_SIZE*4);
    SendCmd(CMD_SETBITMAP);
    SendCmd(addr);
    SendCmd((((ft_uint32_t)width<<16)|(fmt & 0xffff)));
    SendCmd((((ft_uint32_t)0<<16)|(height & 0xffff)));
    EndFunc();
}

void FT813::ShowBitmapAtAddress(ft_uint32_t addr, ft_int16_t fmt, ft_uint16_t x, ft_uint16_t y, ft_uint16_t width, ft_uint16_t height)
{
    DL(BITMAP_SOURCE(addr));
    SetBitmap(addr, fmt, width, height);  // Stil 511 pixel limit, somehow, need to check my code
    DL(VERTEX2F(x * 16, y * 16));    // Works fine
}


    // Load the image into GRAM (works fine)
    TFT.LoadInflateFile(0, "/fs/BACKGROUND_01.bin");
    TFT.Swap();                                 // Swap the current display list
    TFT.Flush_Co_Buffer();                      // Download the command list into fifo
    TFT.WaitCmdfifo_empty();                    // Wait till coprocessor completes the operation


    // Display the image above, it does display, but only a part of it
    TFT.DLstart();                              // start a new display command list
    TFT.DL(CLEAR_COLOR_RGB(0x10, 0x10, 0x10));  // set the clear color to white
    TFT.DL(CLEAR(1, 1, 1));                     // clear buffers -> color buffer,stencil buffer, tag buffer
    TFT.DL(COLOR_RGB(0xff, 0xff, 0xff));  // set the clear color to white
    TFT.DL(BEGIN(BITMAPS));

    TFT.ShowBitmapAtAddress(0, L8, 0, 0, 480, 800); // bitmap, fmt, x, y, w, h

    TFT.DL(DISPLAY());                          // Display the image
    TFT.Swap();                                 // Swap the current display list
    TFT.Flush_Co_Buffer();                      // Download the command list into fifo
    TFT.WaitCmdfifo_empty();                    // Wait till coprocessor completes the operation

VERTEX2II is also limited to 511 pixels for position, but I now use VERTEX2F for that one.

Hope this helps others!
Title: Re: ME813A-WH50C Display - Orientation portrait - height limited to 511 pixels
Post by: FTDI Community on July 06, 2018, 04:37:40 PM
Hi Jack,

Yes, Vertex2F can handle the full range of coordinates so that you can use the full width of the 800x480 screen.

You can use VERTEX_TRANSLATE_X and _Y to add an offset to Vertex2II too which normally goes up to 511. If you call the VERTEX_TRANSLATE_X command as shown below, it will add an offset of 250 to any following VERTEX2II commands. You can call VERTEX_TRANSLATE_X again after this to set a different offset or to set the offset back to 0 as shown below.

VERTEX_TRANSLATE_X(250*16);
VERTEX2II(500,100,30,0x43); // Letter C from font 30 at ((500+250),100)
VERTEX_TRANSLATE_X(0*16);
VERTEX2II(500,200,30,0x45); // Letter E at (500,200)

Vertex2F can be used in most cases but if you wanted to use bitmap cells then you would use VERTEX2II and the VERTEX_TRANSLATE might come in handy.

Best Regards,
FTDI Community

 
Title: Re: ME813A-WH50C Display - Orientation portrait - height limited to 511 pixels
Post by: jberkhout on July 08, 2018, 05:05:06 PM
This is very useful information! Thank you very much!