初级会员
- 积分
- 116
- 金钱
- 116
- 注册时间
- 2018-11-29
- 在线时间
- 26 小时
|
发表于 2022-5-10 15:22:19
|
显示全部楼层
#include <TouchGFXHAL.hpp>
/* USER CODE BEGIN TouchGFXHAL.cpp */
#include <fonts/GeneratedFont.hpp>
#include <fonts/ApplicationFontProvider.hpp>
#include <texts/TypedTextDatabase.hpp>
#include <new>
#include <BitmapDatabase.hpp>
#include "KeyController.hpp"
#include "stm32h7xx.h"
#include "main.h"
#include "sdram.h"
#include "w25qxx.h"
using namespace touchgfx;
static KeyController kc;//°′¼ü¿ØÖÆÆ÷
static BinaryFont bf;
extern const uint8_t Font_simhei_20_4bpp_bin_start[];
extern const uint8_t Font_simhei_20_4bpp_bin_end[];
void TouchGFXHAL::initialize()
{
TouchGFXGeneratedHAL::initialize();
uint32_t frameSize = DISPLAY_HEIGHT*DISPLAY_WIDTH*2;
setFrameBufferStartAddresses((void *)SDRAM_START_ADDR,(void *)(SDRAM_START_ADDR + frameSize),(void *)(SDRAM_START_ADDR + frameSize*2));
setFrameRateCompensation(true);
// LED_Init();//LED3õê¼»ˉ
kc.init();
setButtonController(&kc);
#define BITMAP_CACHE_SIZE 0x1400000
W25QXX_Init();
Bitmap::setCache((uint16_t*)(SDRAM_START_ADDR+ frameSize*3),BITMAP_CACHE_SIZE);
Bitmap::cacheAll();
//¼óÔØò»¸öè«ÖDÎÄ×Ö¿a Heiti20
uint8_t * fontCacheAddr = (uint8_t *)(SDRAM_START_ADDR + frameSize*3 + BITMAP_CACHE_SIZE);
W25QXX_Read(fontCacheAddr,(uint32_t)(Font_simhei_20_4bpp_bin_start - EX_FLASH_START_ADDR),(uint32_t)(Font_simhei_20_4bpp_bin_end - Font_simhei_20_4bpp_bin_start));
//placement new
new (&bf)BinaryFont((const touchgfx::BinaryFontData *)fontCacheAddr);
TypedTextDatabase::setFont(Typography::TYPOGRAPHY_00,&bf);
}
我感觉我的一直没有错误啊 |
|