Thank you Rudolph.
File with extension .raw work fine.
I refresh my screen each 50 ms.
File with extension .raw work fine.
I refresh my screen each 50 ms.
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
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
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
#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);
}
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.
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);
}
#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
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);
}