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

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - koyocik88

#1
Discussion - EVE / Re: Load image
July 01, 2024, 08:45:20 AM
Thank you Rudolph.

File with extension .raw work fine.

I refresh my screen each 50 ms.

#2
Discussion - EVE / Re: Load image
June 26, 2024, 10:23:20 AM
Thank you Rudolph for your comprehensive answer on this topic. I will follow your guidance.

As you advised before I will use ASTC format, but I can't display picture.
1. I used EAB v2.11.1 and I converted my PNG file into ASTC_8x8 format.
2. I uploaded .astc file into screen external flash.
3. I used example generated code for displaying image on the screen.
4 The image is not displayed right way.

What is strange that's my original PNG file has dimension 75x75 pixel and generated by EAB is 80x80 pixel.   

My .map file:


bt817.blob                                           : 0    : 4096
EDF Block                                            : 4096 : 128
info_80x80_COMPRESSED_RGBA_ASTC_8x8_KHR.astc         : 4224 : 1616
info_80x80_COMPRESSED_RGBA_ASTC_8x8_KHR.astc.padding : 5840 : 48 


Below is code from sample app generated by EAB:

#define USE_BT81X_FLASH

void Load_Image_info_80x80_COMPRESSED_RGBA_ASTC_8x8_KHR(EVE_HalContext * phost)
{
    Gpu_Hal_WaitCmdfifo_empty(phost);

    Gpu_CoCmd_Dlstart(phost);
    App_WrCoCmd_Buffer(phost, CLEAR(1, 1, 1));
    App_WrCoCmd_Buffer(phost, COLOR_RGB(255, 255, 255));

    uint16_t iw = 80;
    uint16_t ih = 80;
    uint16_t format = COMPRESSED_RGBA_ASTC_8x8_KHR;

#ifdef USE_BT81X_FLASH
#define BITMAP_ADDRESS_ON_FLASH 4224  // address of bitmap file from Flash Map
#define BITMAP_SIZE_ON_FLASH    1616    // size of bitmap file from Flash Map
    /* Switch Flash to FULL Mode */
    Gpu_CoCmd_FlashHelper_SwitchFullMode(phost);

    if (format >= COMPRESSED_RGBA_ASTC_4x4_KHR && format <= COMPRESSED_RGBA_ASTC_12x12_KHR) {
        Gpu_CoCmd_SetBitmap(phost, (0x800000 | BITMAP_ADDRESS_ON_FLASH / 32), format, iw, ih);
    } else {
        Gpu_CoCmd_FlashRead(phost, RAM_G, BITMAP_ADDRESS_ON_FLASH, BITMAP_SIZE_ON_FLASH);
        Gpu_CoCmd_SetBitmap(phost, RAM_G, format, iw, ih);
    }
#else
    //load bitmap file into graphics RAM
    //RAM_G is starting address in graphics RAM, for example 00 0000h
    Gpu_Hal_LoadImageToMemory(phost, "../../../info_80x80_COMPRESSED_RGBA_ASTC_8x8_KHR.raw", RAM_G, LOAD);
    Gpu_CoCmd_SetBitmap(phost, RAM_G, format, iw, ih);
#endif
    //Start drawing bitmap
    App_WrCoCmd_Buffer(phost, BEGIN(BITMAPS));
    App_WrCoCmd_Buffer(phost, VERTEX2II(0, 0, 0, 0));
    App_WrCoCmd_Buffer(phost, END());
    App_WrCoCmd_Buffer(phost, DISPLAY());
    Gpu_CoCmd_Swap(phost);
    App_Flush_Co_Buffer(phost);
    Gpu_Hal_WaitCmdfifo_empty(phost);

}
#3
Discussion - EVE / Re: Load image
June 25, 2024, 09:58:22 AM
Hi Rudolph,

Thank you for your answer.

I'm sorry but I'm beginner in this field. Could you show example how should looks right code?
I mean this:
Quote
However, I see that you are mixing utility commands with display list commands.
Try to make things a bit cleaner first, do not throw everything between one pair of Gpu_CoCmd_Dlstart (phost); / Gpu_Hal_WaitCmdfifo_empty(phost); calls.

I use Riverdi library and their example doesn't consist CMD_SETBITMAP. Below is example from them for loading image:

static void Load_Jpeg(Gpu_Hal_Context_t *phost, uint32_t adr)
{
Gpu_CoCmd_Dlstart(phost);

App_WrCoCmd_Buffer(phost, CLEAR(1, 1, 1));

App_WrCoCmd_Buffer(phost, COLOR_RGB(255, 255, 255));

//Gpu_CoCmd_FlashHelper_SwitchFullMode(&host);

Gpu_CoCmd_FlashSource(phost, adr);

Gpu_CoCmd_LoadImage(phost, 0, OPT_FLASH );

//Start drawing bitmap

App_WrCoCmd_Buffer(phost, BEGIN(BITMAPS));

App_WrCoCmd_Buffer(phost, VERTEX2II(0, 0, 0, 0));

App_WrCoCmd_Buffer(phost, END());

App_WrCoCmd_Buffer(phost, RESTORE_CONTEXT());

App_WrCoCmd_Buffer(phost, DISPLAY());

Gpu_CoCmd_Swap(phost);

App_Flush_Co_Buffer(phost);

Gpu_Hal_WaitCmdfifo_empty(phost);

//platform_sleep_ms(3000);

}


Thank you for advice for using ASTC format. I will do like that.
#4
Discussion - EVE / Load image
June 24, 2024, 07:42:31 AM
Hello,

I want load different icons to the screen. I uploaded PNG into the flash memory. When I try display two different icons are displayed two the same icons (see attachment).
Additional are displayed artifacts on both icons.

I use also append feature for display this part of screen as static part. I tried display icons without append feature. The icons have no artifact that way, but also
are displayed same icons instead two different.

Has any one idea where is the problem?

Below part of my code:


#define SETTINGS_ADDRESS_MEM         22976
#define NEXT_ADDRESS_MEM24576

// Clear the first 10K of RAM_G where we will store the static part of the DL #######
Gpu_CoCmd_Dlstart (phost); // Start co-pro list
Gpu_CoCmd_MemSet (phost, 0, 0, 10 * 1024); // Set a block of memory to zeros between address 0 and address 10*1024
App_Flush_Co_Buffer (phost); // Send the above co-pro commands off to the FT800 ...
Gpu_Hal_WaitCmdfifo_empty (phost); // ... and wait for them to be processed

// Create the static part of the display and store it within the FT800's RAM_G
// Create a co-processor list which displays the Static (non-changing) part of the final screen #######

Gpu_CoCmd_Dlstart (phost); //Start the display list

App_WrCoCmd_Buffer (phost, CLEAR(1, 1, 1)); //Command CLEAR is recommended to be used before any other drawing operation,
//in order to put the graphics engine in a known state.
//The end of the display list is always flagged with the command DISPLAY
// Draw background
App_WrCoCmd_Buffer (phost, SCISSOR_XY(0, 0));
App_WrCoCmd_Buffer (phost, SCISSOR_SIZE(240, 320));
Gpu_CoCmd_Gradient (phost, 0, 0, 0x323232, 0, 320, 0x666666);

// Return the stencil and scissor to normal
App_WrCoCmd_Buffer (phost, STENCIL_FUNC(ALWAYS, 1, 255));
App_WrCoCmd_Buffer (phost, SCISSOR_SIZE(240, 320));
App_WrCoCmd_Buffer (phost, SCISSOR_XY(0, 0));

// Draw parameters button menu
Gpu_CoCmd_FlashHelper_SwitchFullMode(&host);
Gpu_CoCmd_FlashSource(phost, PARAMETERS_ADDRESS_MEM);
Gpu_CoCmd_LoadImage(phost, 0, OPT_FLASH );

//Start drawing bitmap
App_WrCoCmd_Buffer(phost, BEGIN(BITMAPS));
App_WrCoCmd_Buffer(phost, VERTEX2II(15, 15, 0, 0));
App_WrCoCmd_Buffer(phost, END());


// Draw parameters button menu
Gpu_CoCmd_FlashHelper_SwitchFullMode(&host);
Gpu_CoCmd_FlashSource(phost, NEXT_ADDRESS_MEM);
Gpu_CoCmd_LoadImage(phost, 0, OPT_FLASH );

//Start drawing bitmap
App_WrCoCmd_Buffer(phost, BEGIN(BITMAPS));
App_WrCoCmd_Buffer(phost, VERTEX2II(130, 15, 0, 0));
App_WrCoCmd_Buffer(phost, END());

dloffset = Gpu_Hal_Rd16 (phost, REG_CMD_DL); // Reading the REG_CMD_DL tells us where the end of the new DL is in
// RAM_DL and therefore the size of our new 'static' display list
Gpu_Hal_WrCmd32 (phost, CMD_MEMCPY); // Command to copy a block of memory within the FT800
Gpu_Hal_WrCmd32 (phost, 1000L); // First parameter is destination, copy to address 1,000 decimal
Gpu_Hal_WrCmd32 (phost, RAM_DL); // Second parameter is the source, here we copy from start of RAM_DL
Gpu_Hal_WrCmd32 (phost, dloffset); // Third parameter is length of data to copy, as determined above

App_WrCoCmd_Buffer(phost, DISPLAY()); // Display command finished the Display List
Gpu_CoCmd_Swap(phost); // Swap to make the new DL active
App_Flush_Co_Buffer(phost); // Send the above co-pro commands off to the FT800 ...
Gpu_Hal_WaitCmdfifo_empty(phost); // ... and wait for them to be processed



Thank you in advance!
#5
Discussion - EVE / Re: Screen updates
March 27, 2024, 09:13:56 AM
Hello,

I tested append technique, as you suggested. It is really the best way.

Thank you!
#6
Discussion - EVE / Screen updates
March 11, 2024, 10:32:59 AM
Hello!

I'm trying to find a way how to update part of displayed screen (i.e. change only some values on displayed screen or status of displayed button). I don't want each time send whole display list. I found a document "APPLICATION NOTE AN_340 FT800_Optimising screen updates with Macro and Append" given by Bridgtech.
In my example I want change only values for displayed labels. Could you advise me if gives other possibility how to update choose parts of the showed screen ?


void showScreen ()
{
uint32_t coordinates = Gpu_Hal_Rd32(phost, REG_TOUCH_SCREEN_XY);
uint8_t Read_tag = Gpu_Hal_Rd8(phost, REG_TOUCH_TAG);
uint16_t x_coordinate, y_coordinate;

x_coordinate = (coordinates >> 16);
y_coordinate = coordinates;

Gpu_CoCmd_Dlstart(phost); //Start the display list

App_WrCoCmd_Buffer(phost, CLEAR(1, 1, 1)); //Command CLEAR is recommended to be used before any other drawing operation,
//in order to put the graphics engine in a known state.
//The end of the display list is always flagged with the command DISPLAY


Gpu_CoCmd_Gradient(phost,0, 0, 0x636363UL, 0, DispHeight, 0x222222UL);

Gpu_CoCmd_Number(phost, 20, 20, 28 , 0, coordinates);
Gpu_CoCmd_Number(phost, 20, 40, 28 , 0, x_coordinate);
Gpu_CoCmd_Number(phost, 20, 60, 28 , 0, y_coordinate);
Gpu_CoCmd_Number(phost, 20, 80, 28 , 0, Read_tag);

App_WrCoCmd_Buffer(phost, DISPLAY()); //instruct the graphics processor to show the list
Gpu_CoCmd_Swap(phost); //make this list active
App_Flush_Co_Buffer(phost);
Gpu_Hal_WaitCmdfifo_empty(phost);
}


Thank you in advance!