Hello,
I'm currently trying to write an image to RAM_G and display it on a display using BT817. I've converted the png to and EVE bitmap and then a C array using EAB, but I think I'm missing something when loading it into RAM_G.
void write_ram_g(uint32_t image_size)
{
printf("Writing to RAM_G... ");
cmd_loadimage(RAM_G, OPT_FULLSCREEN);
for (int i = 0; i < image_size; i += 4)
{
uint32_t write_data = (flash_image[i+3] >> 24) | (flash_image[i+2] >> 16) | (flash_image[i+1] >> 8) | flash_image[i];
Send_CMD(write_data);
}
UpdateFIFO();
Wait4CoProFIFOEmpty();
printf("complete\n");
}
void verify_ram(uint32_t image_size)
{
for (int i = 0; i < image_size; i++)
{
printf("%d\n", rd8(RAM_G + i));
}
}
void screen_logo()
{
printf("Writing...\n");
write_ram_g(4250);
printf("Displaying... ");
Send_CMD(CMD_DLSTART);
Send_CMD(CLEAR_COLOR_RGB(255, 255, 255));
Send_CMD(CLEAR(1, 1, 1));
cmd_setbitmap(RAM_G, ARGB1555, 252, 72);
Send_CMD(BEGIN(BITMAPS));
Send_CMD(VERTEX2II(10, 10, 0, 0));
Send_CMD(END());
Send_CMD(DISPLAY());
Send_CMD(CMD_SWAP);
UpdateFIFO();
printf("done\n");
}
I'm using write_ram_g() to cycle through the bytes in the C array and write them starting at address 0, verify_ram() to print the relevant RAM_G to TeraTerm, and screen_logo() to display the image with a white background. I can see the white background, but the printed RAM_G is the same as default and no image appears.
It's clear to me that the image isn't being loaded into RAM_G, does anyone have an in-depth example they could point me to to load a C array into RAM like this? I am new to loading anything into RAM/flash with the BT817.