2020-07-06 04:09 AM
I’m using STM32CubeIDE 1.2.1 and TouchGFX 4.13.0 with STM32F746G-DISC0 kit.
I would like to calculate an image at runtime and then display it. Is there a manual or something similar? I have tried the AnimationStorage, unfortunately getAnimationStorage() always returns a Zero.
2020-07-06 06:41 AM
(add: Animation storage must be configured when TouchGFX is set up)
/Martin
2020-07-06 07:03 AM
Thanks for the help, but I still have some questions about the article:
For the bitmap caching I have to use the function touchgfx_generic_init, which parameters do I need here for the board (cacheStartAddr, <STM32F7HAL>, ...) how exactly does the function call look like?
Does this call have to be in the TouchGFXConfiguration.cpp?
Which includes do I Need?
2020-07-10 06:26 AM
Hello,
Here is the description of the function available in TouchGFXInit.hpp file
/**
* @fn template <class HALType> HAL& touchgfx_generic_init(DMA_Interface& dma, LCD& display, TouchController& tc, int16_t width, int16_t height, uint16_t* bitmapCache, uint32_t bitmapCacheSize, uint32_t numberOfDynamicBitmaps = 0)
*
* @brief TouchGFX generic initialize.
*
* TouchGFX generic initialize.
*
* @tparam HALType The class type of the HAL subclass used for this port.
* @param [in] dma Reference to the DMA implementation object to use. Can be of type
* NoDMA to disable the use of DMA for rendering.
* @param [in] display Reference to the LCD renderer implementation (subclass of LCD).
* Could be either LCD16bpp for RGB565 UIs, or LCD1bpp for
* monochrome UIs or LCD24bpp for 24bit displays using RGB888 UIs.
* @param [in] tc Reference to the touch controller driver (or NoTouchController to
* disable touch input).
* @param width The \a native display width of the actual display, in pixels.
* This value is irrespective of whether the concrete UI should be
* portrait or landscape mode. It must match what the display itself
* is configured as.
* @param height The \a native display height of the actual display, in pixels.
* This value is irrespective of whether the concrete UI should be
* portrait or landscape mode. It must match what the display itself
* is configured as.
* @param [in] bitmapCache Optional pointer to starting address of a memory region in which
* to place the bitmap cache. Usually in external RAM. Pass 0 if
* bitmap caching is not used.
* @param bitmapCacheSize Size of bitmap cache in bytes. Pass 0 if bitmap cache is not used.
* @param numberOfDynamicBitmaps Number of dynamic bitmaps.
*
* @return A reference to the allocated (and initialized) HAL object.
*/
"Does this call have to be in the TouchGFXConfiguration.cpp?"
Yes
"Which includes do I Need?"
No additional include necessary I believe
/Alexandre
2020-07-13 01:05 AM
thank you,
it works, i had to adjust the parameters of the call: Bitmap::registerBitmapDatabase in the file TouchGFXConfiguration.cpp in the function touchgfx_init()
2020-07-14 01:12 AM
Unfortunately there are still some questions left, if I execute the configuration accordingly, it works with one image, if I want to create two images (2 x bmpId_i = Bitmap::dynamicBitmapCreate(400, 200, Bitmap::RGB565);) the STM freezes. Works if I use Bitmap::cache(BitmapId id) for the images...
Where exactly can I get more information about caching bitmaps? At: https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/caching-bitmaps/ I can't find this information.
2020-07-14 01:32 AM
Anything you do inside TouchGFXConfiguration.cpp will be overridden when you re-generate code from CubeMX. We removed the dynamic bitmap cache configuartion from the Generator because we were getting a lot of settings that smelled too much like application configuration.
You have to write your custom code inside TouchGFXHAL.cpp - initialize() function.
Here's soem more information: https://support.touchgfx.com/docs/development/ui-development/scenarios/loading-images-at-runtime/
/Martin
2020-07-14 01:46 AM
I understand that I better not make any changes in the generated data. But how should I get to TouchGFXHAL.cpp? Can I read something like that somewhere or do I have to go through the structure completely? I can't find any point in the given links.
And what exactly do I have to call in the initialize()? Bitmap::registerBitmapDatabase? touchgfx_generic_init?...
2020-07-14 02:00 AM
TouchGFXHAL.cpp is a file generated for you by the TouchGFX Generator (in CubeMX). The structure is explained in the HAL Development documentation:
https://support.touchgfx.com/docs/development/touchgfx-hal-development/touchgfx-generator
There's a point at the bottom about modifying the code after generation.
/Martin
2020-07-14 02:08 AM
Thank you, I'll work through it.