Hi to all,
I need to draw several images saved on SPI flash.
With GUIBuilder I converted the images into arrays and saved they in flash.
Every image has an start address like
unsigned long ADDR_IMMAGE1 = 0x00000000;
unsigned long ADDR_IMMAGE2 = 0x00002000;
I understood that the function to use is GUI_BMP_DrawEx() but I have some questions:
1) How to chose which image to show ?
2) How do I indicate th size of the image ( in flash I only have an array) ?
3) How do I define the function GUI_DTA_FUNC () ?
I saw several post on this forum like :
Loading images from external SPI flash (not addressable)
C stream
GUI_DrawStreamedBitmapEX()
but no solution is given.
For the third question I wrote the function like this:
Display All
where I assumed that "void *p" is usable at will.
And calling GUI_BMP_DrawEx() like:
GUI_BMP_DrawEx(GUI_ReadFromFlash, (void *)&ADDR_IMMAGE1, 0, 0);
It the correct way ?
Can you give me some tips ?
Thanks to all.
I need to draw several images saved on SPI flash.
With GUIBuilder I converted the images into arrays and saved they in flash.
Every image has an start address like
unsigned long ADDR_IMMAGE1 = 0x00000000;
unsigned long ADDR_IMMAGE2 = 0x00002000;
I understood that the function to use is GUI_BMP_DrawEx() but I have some questions:
1) How to chose which image to show ?
2) How do I indicate th size of the image ( in flash I only have an array) ?
3) How do I define the function GUI_DTA_FUNC () ?
I saw several post on this forum like :
Loading images from external SPI flash (not addressable)
C stream
GUI_DrawStreamedBitmapEX()
but no solution is given.
For the third question I wrote the function like this:
C Source Code
- int GUI_ReadFromFlash(void * p, const U8 ** ppData, unsigned NumBytes, U32 Off){
- unsigned long start_ADDR;
- if (NumBytes > SIZE_FLASHBUFFER) {
- NumBytes = SIZE_FLASHBUFFER;
- }
- start_ADDR = *(unsigned long * )p;
- M25P80_Read_Data_Bytes((start_ADDR + Off), FlashBuffer, NumBytes);
- *ppData = FlashBuffer;
- return NumBytes;
- }
where I assumed that "void *p" is usable at will.
And calling GUI_BMP_DrawEx() like:
GUI_BMP_DrawEx(GUI_ReadFromFlash, (void *)&ADDR_IMMAGE1, 0, 0);
It the correct way ?
Can you give me some tips ?
Thanks to all.