how can i use touchgfx_generic_init in cubemxide STM32F429I_DISC1
- May 20, 2020
- 2 replies
- 1595 views
Hi all.
I used STM32CubeIDE 1.3.0 with TouchGFX 4.13.0 Designer on STM32F429I_DISC1.
I am testing load bmp file from USB disk. project is made from cubeide.
I followed below doc.
touchgfx-engine-features/caching-bitmaps
and i added touchgfx_generic_init into TouchGFXConfiguration.cpp.
uint16_t* cacheStartAddr = (uint16_t*)0xD0030000;
uint32_t cacheSize = 0x300000; //3 MB, as example
void touchgfx_init()
{
Bitmap::registerBitmapDatabase(BitmapDatabase::getInstance(), BitmapDatabase::getInstanceSize());
TypedText::registerTexts(&texts);
Texts::setLanguage(0);
FontManager::setFontProvider(&fontProvider);
FrontendHeap& heap = FrontendHeap::getInstance();
(void)heap; // we need to obtain the reference above to initialize the frontend heap.
hal.initialize();
HAL& hal = touchgfx_generic_init<TouchGFXHAL>(dma, display, tc, 240, 320, cacheStartAddr, cacheSize, 1);
}but it makes some errors and memory full, anyway i tried but could not.
so i founded function Bitmap::setCache.
Bitmap::setCache((uint16_t*)cacheStartAddr, cacheSize, 30);
bmpId = Bitmap::dynamicBitmapCreate(240, 320, Bitmap::RGB565);it is working well..
but i want to know how to use touchgfx_generic_init function.
and now i want to know that Bitmap::setCache is correct way or not.
source code is attached.
actually i have used just c language for a long time. i have not used c++ language.
and this code is test code. so source code is not good for sharing to others.
please consider that
but let me know how to add touchgfx_generic_init function into source code.
Thanks.
