首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用TouchGFX显示SDRAM中的图像

用TouchGFX显示SDRAM中的图像
EN

Stack Overflow用户
提问于 2020-10-16 10:05:34
回答 1查看 1K关注 0票数 0

我从SDCard复制了一个位图图像,以地址0xC0000000的外部SDRAM。我想使用TouchGFX函数来显示这个图像。正如我在本文件中所读的,我必须执行以下代码:

代码语言:javascript
复制
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)中时,我会得到以下错误:

代码语言:javascript
复制
'STM32F7HAL' was not declared in this scope

我在整个项目中搜索"STM32F7HAL“,但在搜索结果中什么也没有找到。同时,我的项目也是用STM32F779单片机和STM32F779EVAL板实现的。

EN

回答 1

Stack Overflow用户

发布于 2020-11-02 09:09:06

您在TouchGFX 4.15.0的文档中偶然发现了一个错误。

touchgfx_generic_init的调用是不可取的(它只是一个助手函数)。已经为您定义的函数touchgfx_init应该对Bitmap::registerBitmapDatabase()进行显式调用。如果您使用的是CubeMX和TouchGFX生成器,那么这个调用应该已经存在了。

该函数的签名如下。最后三个参数是缓存指针、缓存大小和动态位图的数量。

代码语言:javascript
复制
/**
 * 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);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64387071

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档