C++ 使用TouchGFX显示来自SDRAM的图像

C++ 使用TouchGFX显示来自SDRAM的图像,c++,stm32,touchgfx,C++,Stm32,Touchgfx,我将一个位图图像从SD卡复制到外部SDRAM的地址0xC0000000。我想使用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

我将一个位图图像从SD卡复制到外部SDRAM的地址0xC0000000。我想使用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);
  ...
}
我在整个项目中搜索了“STM32F7HAL”,但在搜索结果中什么也没找到。
另外,我的项目是用STM32F779微控制器和STM32F779EVAL板实现的。

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

touchgfx\u generic\u init的调用已被弃用(它只是一个辅助函数)。已经为您定义的函数
touchgfx_init
应该显式调用
Bitmap::registerbitmap数据库()
。如果您使用的是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);
/**
 * 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);