BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: BMP SCREEN 1280X800 BT817Q  (Read 99 times)

maria@dsg-id.com

  • Newbie
  • *
  • Posts: 3
    • View Profile
BMP SCREEN 1280X800 BT817Q
« on: January 09, 2025, 08:00:54 AM »

Hello:

I am new to the forum and I am developing an application for a RVTI01HVBNWC00-B 1280 x 800 screen with a BT817Q micro this same application I already have it developed for a 800 x 480 screen with a FT813 micro.

My problem is that when I want to paint on the right edge of the screen I can't because it doesn't allow me to paint more than the 1020 chords.

I would like to know if there is a way to paint more towards the edge of the screen.

This is the code I use to paint on the screen.

Translated with DeepL.com (free version)

void EVE_Bitmap (img_info_t bmp, uint16_t x, uint16_t y, uint8_t tag_id)
{
    uint32_t stride;

//  Wait4CoProFIFO_Empty();                                                     // Wait for FIFO empty

    eve_tft_dlOffset = EVE_mem_read16(REG_CMD_DL);                              //Check for enough space in RAM DL memory, 8 KB
    if (bmp.format != EVE_PALETTED8 && (eve_tft_dlOffset + EVE_BMP_SIZE + EVE_TFT_END_SIZE) > EVE_RAM_DL_SIZE) { eve_tft_error = SSP_ERR_OUT_OF_MEMORY; return; }
    else if (bmp.format == EVE_PALETTED8 && (eve_tft_dlOffset + EVE_BMP_PAL8_SIZE + EVE_TFT_END_SIZE) > EVE_RAM_DL_SIZE) { eve_tft_error = SSP_ERR_OUT_OF_MEMORY; return; }

    if (bmp.format != EVE_PALETTED8)
        Wait4CoProFIFO_FreeSpace(EVE_BMP_SIZE);                                 // Wait for necessary space in the FIFO
    else
        Wait4CoProFIFO_FreeSpace(EVE_BMP_PAL8_SIZE);                            // Wait for necessary space in the FIFO

    _io_set_cs_lo;                                                              // CS low begins SPI transaction

    EVE_address_for_write(EVE_RAM_CMD + eve_tft_cmdOffset);                     // Send address to which first value will be written

    eve_tft_txOffset = 0x0000;

    if (eve_tft_r != 255u || eve_tft_g != 255u || eve_tft_b != 255u)
    {
        EVE_add_cmd(COLOR_RGB(255u, 255u, 255u), 4u);                           // Color del texto
        eve_tft_r = 255u;
        eve_tft_g = 255u;
        eve_tft_b = 255u;
    }

    if (x == BMP_SCRSAVER_XY && y == BMP_SCRSAVER_XY)
        EVE_add_cmd(CMD_SCREENSAVER, 4u);                                       // Command Screen Saver 0xFFFFFF2F

    EVE_add_cmd(BITMAP_HANDLE(BMP_HANDLE), 4u);                                 // Set bitmap handle
    if (bmp.format == EVE_PALETTED4444 || bmp.format == EVE_PALETTED565 || bmp.format == EVE_PALETTED8)
    {
        EVE_add_cmd(PALETTE_SOURCE(EVE_RAM_G + bmp.ram_g_add), 4u);             // Paletted data starts at add
        EVE_add_cmd(BITMAP_SOURCE(EVE_RAM_G + bmp.ram_g_add + BMP_PAL_SIZE), 4u); // Bitmap data starts at add
    }
    else
    {
        EVE_add_cmd(BITMAP_SOURCE(EVE_RAM_G + bmp.ram_g_add), 4u);              // Bitmap data starts at add
    }
    if (bmp.format == EVE_RGB565 || bmp.format == EVE_ARGB4 || bmp.format == EVE_ARGB1555)  stride = bmp.width * 2u;
    else if (bmp.format == EVE_L1)                                                          stride = bmp.width / 8u;
    else if (bmp.format == EVE_L2)                                                          stride = bmp.width / 4u;
    else if (bmp.format == EVE_L4)                                                          stride = bmp.width / 2u;
    else                                                                                    stride = bmp.width;
    EVE_add_cmd(BITMAP_LAYOUT(bmp.format, (unsigned long)(stride), (unsigned long)bmp.height), 4u);             // Tell FT8xx about the properties of the image data
    EVE_add_cmd(BITMAP_SIZE(EVE_NEAREST, EVE_BORDER, EVE_BORDER, bmp.width, bmp.height), 4u);                   // Tell FT8xx about the on-screen properties of the image   //EVE_BILINEAR


    if (tag_id > 0u)
    {
        EVE_add_cmd(TAG_MASK(1), 4u);                                           // Enable tagging
        EVE_add_cmd(TAG(tag_id), 4u);                                           // Tag of the button
    }




    if (bmp.format != EVE_PALETTED8)
    {
        EVE_add_cmd(BEGIN(EVE_BITMAPS), 4u);                                                                     // Begin drawing bitmaps
        if (x == BMP_SCRSAVER_XY && y == BMP_SCRSAVER_XY)
            EVE_add_cmd(MACRO(0), 4u);
        else
            EVE_add_cmd(VERTEX2F((unsigned long)(x * PIXEL_PRECISION), (unsigned long)(y * PIXEL_PRECISION) ), 4u);  // Top left point to print
        EVE_add_cmd(END(), 4u);

    }
    else
    {
        EVE_add_cmd(SAVE_CONTEXT(), 4u);
        EVE_add_cmd(BEGIN(EVE_BITMAPS), 4u);                                    // Begin drawing bitmaps
        EVE_add_cmd(BLEND_FUNC(EVE_ONE, EVE_ZERO), 4u);
        //Draw Alpha channel
        EVE_add_cmd(COLOR_MASK(0, 0, 0, 1), 4u);
        EVE_add_cmd(PALETTE_SOURCE((bmp.ram_g_add + 3)), 4u);
        if (x == BMP_SCRSAVER_XY && y == BMP_SCRSAVER_XY)
            EVE_add_cmd(MACRO(0), 4u);
        else
            EVE_add_cmd(VERTEX2F((unsigned long)(x * PIXEL_PRECISION), (unsigned long)(y * PIXEL_PRECISION) ), 4u);  // Top left point to print
        //Draw Red channel
        EVE_add_cmd(BLEND_FUNC(EVE_DST_ALPHA, EVE_ONE_MINUS_DST_ALPHA), 4u);
        EVE_add_cmd(COLOR_MASK(1, 0, 0, 0), 4u);
        EVE_add_cmd(PALETTE_SOURCE((bmp.ram_g_add + 2)), 4u);
        if (x == BMP_SCRSAVER_XY && y == BMP_SCRSAVER_XY)
            EVE_add_cmd(MACRO(0), 4u);
        else
            EVE_add_cmd(VERTEX2F((unsigned long)(x * PIXEL_PRECISION), (unsigned long)(y * PIXEL_PRECISION) ), 4u);  // Top left point to print
        //Draw Green channel
        EVE_add_cmd(COLOR_MASK(0, 1, 0, 0), 4u);
        EVE_add_cmd(PALETTE_SOURCE((bmp.ram_g_add + 1)), 4u);
        if (x == BMP_SCRSAVER_XY && y == BMP_SCRSAVER_XY)
            EVE_add_cmd(MACRO(0), 4u);
        else
            EVE_add_cmd(VERTEX2F((unsigned long)(x * PIXEL_PRECISION), (unsigned long)(y * PIXEL_PRECISION) ), 4u);  // Top left point to print
        //Draw Blue channel
        EVE_add_cmd(COLOR_MASK(0, 0, 1, 0), 4u);
        EVE_add_cmd(PALETTE_SOURCE(bmp.ram_g_add), 4u);
        if (x == BMP_SCRSAVER_XY && y == BMP_SCRSAVER_XY)
            EVE_add_cmd(MACRO(0), 4u);
        else
            EVE_add_cmd(VERTEX2F((unsigned long)(x * PIXEL_PRECISION), (unsigned long)(y * PIXEL_PRECISION) ), 4u);  // Top left point to print
        EVE_add_cmd(END(), 4u);
        EVE_add_cmd(RESTORE_CONTEXT(), 4u);
    }
    if (tag_id > 0u)
    {
        EVE_add_cmd(TAG_MASK(0), 4u);                                           // Tag mask - disable tagging of any subsequent items
    }

    EVE_spi_write(eve_tft_txOffset);

    _io_set_cs_hi;                                                              // Chip Select high concludes burst

    EVE_mem_write16(REG_CMD_WRITE, eve_tft_cmdOffset);                          // Manually update the ring buffer write position pointer to initiate processing of the FIFO

//  Wait4CoProFIFO_Empty();
}

and this is the call to the previous function :

EVE_Bitmap(g_bmp_info[CS5_LOGO_ARGUSA], 1000u, 40u, 0u);

THIS IS THE CONFIGURATION OF THE SCREEN:

/* tested with RVT101HVBNWC00-B */
/* RVT101HVBxxxxx 1280x800 10.1" Riverdi, various options, BT817 */
/* RVT121HVBxxxxx 1280x800 12.1" Riverdi, various options, BT817 */
#if defined (EVE_RVT101H)
#define     EVE_HSIZE       (1280L)
#define     EVE_VSIZE       (800L)
#define     EVE_HCYCLE      (1440L)
#define     EVE_HOFFSET     (88L)
#define     EVE_HSYNC0      (0L)
#define     EVE_HSYNC1      (20L)
#define     EVE_VCYCLE      (838L)
#define     EVE_VOFFSET     (23L)
#define     EVE_VSYNC0      (0L)
#define     EVE_VSYNC1      (10L)
#define     EVE_PCLK        (1L)//(1L)
#define     EVE_SWIZZLE     (0L)
#define     EVE_PCLKPOL     (1L)
#define     EVE_CSPREAD     (0L)
#define     EVE_DITHER      (0L)
#define     EVE_PCLK_FREQ   (0x08C1U) /* value to be put into REG_PCLK_FREQ -> 72MHz, REG_PCLK is set to 1 */
#define     EVE_PCLK_2X     (0L)
#define     EVE_TOUCH_RZTHRESH  (1200L)
#define     EVE_HAS_CRYSTAL
#define     EVE_FLASH_AVAILABLE
#if !defined (EVE_BACKLIGHT_FREQ)
#define EVE_BACKLIGHT_FREQ (4000U) /* if not overwritten in the project options, set 4kHz as recommended by Riverdi */
#endif
#define     BT81X_ENABLE
#endif

THANK YOU VERY MUCH IN ADVANCE.

A SALUTE .

PD. MY IMAGES ARE IN PALETTED4444 AND PALETTED8
« Last Edit: January 09, 2025, 08:27:13 AM by maria@dsg-id.com »
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 788
    • View Profile
Re: BMP SCREEN 1280X800 BT817Q
« Reply #1 on: January 09, 2025, 02:23:18 PM »

Hi,

Welcome to the BRT Community,

Could you advise what size your image is?
Also, would it be possible for you to send a photo of the image being displayed as the issue happens and we'll help to check.

Was the issue only with screensaver or was it with images in general?

Best Regards, BRT Community
Logged

maria@dsg-id.com

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: BMP SCREEN 1280X800 BT817Q
« Reply #2 on: January 10, 2025, 06:24:45 AM »

Hello:

The problem I have is with any image regardless of the size if I paint beyond the position 1020 the image disappears from the screen and if what I paint is a geometric figure like a rectangle it overflows and paints on the other side of the screen.

Investigating I have seen that I use vertex2f which has a pixel precision of 16 i.e. my x and y position are multiplied by 16 and when the resulting size is greater than 16383 it overflows the missing paint and paints it on the other side of the screen as in the case of geometric figures or disappears and does not paint it as in the case of images.

I don't know how I could paint to not have this limitation of vertex2f.

The screensaver paints the image well and reaches all the sides, but the images painted in fixed position I don't know how to do it.

For the screensaver I use CMD_SCREENSAVER which is internal, from the eve library.

The text I have no problem either, I can also paint up to the same position 1200.

Greetings


Thank you very much.
Logged

maria@dsg-id.com

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: BMP SCREEN 1280X800 BT817Q
« Reply #3 on: January 10, 2025, 06:54:52 AM »

Hello:

In the image we can see how in the buttons I have painted in position 1180 the image is not painted while in the one I have in position 1000 the image appears without problem. The size of the image is a paletted4444 of size 70x70.
Logged