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

BMP SCREEN 1280X800 BT817Q

Started by maria@dsg-id.com, January 09, 2025, 08:00:54 AM

Previous topic - Next topic

maria@dsg-id.com

#15
 Hello:

Sorry for the delay but I've had other projects come up and since yesterday I've picked this one back up.
I'm trying to use CMD_SETBITMAP as the comapñero told me but when I use it it doesn't paint on screen neither the image I call nor the next thing to paint.

EVE_add_cmd(BITMAP_HANDLE(BMP_HANDLE), 4u);
EVE_add_cmd(SET_BITMAP, 4u);
EVE_add_cmd(0, 4u);
EVE_add_cmd(COMPRESSED_RGBA_ASTC_8x8_KHR, 2u);
EVE_add_cmd(40, 2u);
EVE_add_cmd(40, 2u);
EVE_add_cmd(BEGIN(EVE_BITMAPS), 4u);
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 FUNCTION CODE:

void EVE_add_cmd(uint32_t command, uint8_t num_bytes)
{
    if (num_bytes == 4u)
    {
        eve_tft_tx_buffer[eve_tft_txOffset++] =  (uint8_t)(command);            // Send command 32 bits
        eve_tft_tx_buffer[eve_tft_txOffset++] = ((uint8_t)(command >> 8 ));
        eve_tft_tx_buffer[eve_tft_txOffset++] = ((uint8_t)(command >> 16));
        eve_tft_tx_buffer[eve_tft_txOffset++] = ((uint8_t)(command >> 24));
    }
    else if (num_bytes == 2u)
    {
        eve_tft_tx_buffer[eve_tft_txOffset++] =  (uint8_t)(command);            // Send command 16 bits
        eve_tft_tx_buffer[eve_tft_txOffset++] = ((uint8_t)(command >> 8 ));
    }
    else if (num_bytes == 1u)
    {
        eve_tft_tx_buffer[eve_tft_txOffset++] =  (uint8_t)(command);            // Send command 8 bits
    }
    eve_tft_cmdOffset = (uint16_t)(eve_tft_cmdOffset + num_bytes);              // Calculate new offset
    eve_tft_cmdOffset &= 0x0FFF;                                                // ... roll over
}

can you tell me some more help.

Rudolph

That really is an odd way to implement this, but this is not why it is not working.
EVE_add_cmd(SET_BITMAP, 4u);
EVE_add_cmd(0, 4u);
EVE_add_cmd(COMPRESSED_RGBA_ASTC_8x8_KHR, 2u);
EVE_add_cmd(40, 2u);
EVE_add_cmd(40, 2u);

This does not work because it is adding up to 14 bytes, you need two more, the commands always need to be 4 byte aligned.
Add:
EVE_add_cmd(0, 2u); // send dummy bytes to make the command 4 byte aligned


BRT Community

Good catch Rudolph, yes any command which is not multiple of 4 bytes should be padded so that the next command starts at an offset of multiple 4 bytes

(unless you start a new SPI transfer for each command by de-asserting and re-asserting CS and sending the address again but this is much less efficient - the way you are doing it looks good but need the padding added)

maria@dsg-id.com

Hello:

Thank you very much for all your help, now I can see the images and work with them.
Best regards.

BRT Community

Hi,

Great to hear that it is all working well now

Best Regards, BRT Community