我从SDCard复制了一个位图图像,以地址0xC0000000的外部SDRAM。我想使用TouchGFX函数来显示这个图像。正如我在本文件中所读的,我必须执行以下代码:
static uint32_t bmpCache = (uint32_t)(0xC0000000); // SDRAM
void touchgfx_init()
{
HAL& hal = touchgfx_generic_init<STM32F7HAL>(dma, display, tc, 480, 272, (uint16_t*)bmpCache, 232000, 1);
...
}但是,当我在编译项目时将这些代码引入到我的项目(TouchGFXConfiguration.cpp)中时,我会得到以下错误:
'STM32F7HAL' was not declared in this scope我在整个项目中搜索"STM32F7HAL“,但在搜索结果中什么也没有找到。同时,我的项目也是用STM32F779单片机和STM32F779EVAL板实现的。
发布于 2020-11-02 09:09:06
您在TouchGFX 4.15.0的文档中偶然发现了一个错误。
对touchgfx_generic_init的调用是不可取的(它只是一个助手函数)。已经为您定义的函数touchgfx_init应该对Bitmap::registerBitmapDatabase()进行显式调用。如果您使用的是CubeMX和TouchGFX生成器,那么这个调用应该已经存在了。
该函数的签名如下。最后三个参数是缓存指针、缓存大小和动态位图的数量。
/**
* Registers an array of bitmaps. All Bitmap instances are bound to this database. This
* function is called automatically from HAL::touchgfx_generic_init().
*
* @param data A reference to the BitmapData storage array.
* @param n The number of bitmaps in the array.
* @param [in] cachep (Optional) Pointer to memory region in which bitmap
* data can be cached.
* @param csize (Optional) Size of cache memory region in bytes (0 if
* unused)
* @param numberOfDynamicBitmaps (Optional) Number of dynamic bitmaps to be allowed in
* the cache.
*/
static void registerBitmapDatabase(const BitmapData* data, const uint16_t n, uint16_t* cachep = 0, uint32_t csize = 0, uint32_t numberOfDynamicBitmaps = 0);https://stackoverflow.com/questions/64387071
复制相似问题