96 lines
2.8 KiB
C++
96 lines
2.8 KiB
C++
/**
|
|
******************************************************************************
|
|
* File Name : TouchGFXConfiguration.cpp
|
|
******************************************************************************
|
|
* This file is generated by TouchGFX Generator 4.26.1. Please, do not edit!
|
|
******************************************************************************
|
|
* @attention
|
|
*
|
|
* Copyright (c) 2026 STMicroelectronics.
|
|
* All rights reserved.
|
|
*
|
|
* This software is licensed under terms that can be found in the LICENSE file
|
|
* in the root directory of this software component.
|
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
|
*
|
|
******************************************************************************
|
|
*/
|
|
|
|
#include <texts/TypedTextDatabase.hpp>
|
|
#include <fonts/ApplicationFontProvider.hpp>
|
|
#include <gui/common/FrontendHeap.hpp>
|
|
#include <BitmapDatabase.hpp>
|
|
#include <touchgfx/VectorFontRendererImpl.hpp>
|
|
#include <touchgfx_nema/LCDGPU2D_AXI.hpp>
|
|
extern "C"
|
|
{
|
|
#include <nema_hal.h>
|
|
#include <nema_vg.h>
|
|
}
|
|
#include <STM32DMA.hpp>
|
|
#include <TouchGFXHAL.hpp>
|
|
#include <STM32TouchController.hpp>
|
|
#include <stm32h7rsxx_hal.h>
|
|
|
|
extern "C" void touchgfx_init();
|
|
extern "C" void touchgfx_taskEntry();
|
|
extern "C" void touchgfx_components_init();
|
|
|
|
static STM32TouchController tc;
|
|
static STM32DMA dma;
|
|
static LCDGPU2D_AXI display;
|
|
static VectorFontRendererImpl vectorFontRenderer;
|
|
|
|
static ApplicationFontProvider fontProvider;
|
|
static Texts texts;
|
|
static TouchGFXHAL hal(dma, display, tc, 800, 480);
|
|
|
|
void touchgfx_init()
|
|
{
|
|
Bitmap::registerBitmapDatabase(BitmapDatabase::getInstance(), BitmapDatabase::getInstanceSize());
|
|
TypedText::registerTexts(&texts);
|
|
Texts::setLanguage(0);
|
|
|
|
display.setFrameBufferFormat(Bitmap::RGB565);
|
|
|
|
display.setVectorFontRenderer(&vectorFontRenderer);
|
|
|
|
FontManager::setFontProvider(&fontProvider);
|
|
|
|
FrontendHeap& heap = FrontendHeap::getInstance();
|
|
/*
|
|
* we need to obtain the reference above to initialize the frontend heap.
|
|
*/
|
|
(void)heap;
|
|
|
|
/*
|
|
* Initialize TouchGFX
|
|
*/
|
|
hal.initialize();
|
|
}
|
|
|
|
void touchgfx_components_init()
|
|
{
|
|
nema_init();
|
|
nema_reg_write(0xFFC, 0x7E); /* Enable bus error interrupts */
|
|
nema_vg_init_stencil_pool(800, 480, 1);
|
|
nema_vg_handle_large_coords(1, 1);
|
|
nema_ext_hold_enable(2);
|
|
nema_ext_hold_irq_enable(2);
|
|
nema_ext_hold_enable(3);
|
|
nema_ext_hold_irq_enable(3);
|
|
}
|
|
|
|
void touchgfx_taskEntry()
|
|
{
|
|
/*
|
|
* Main event loop. Will wait for VSYNC signal, and then process next frame. Call
|
|
* this function from your GUI task.
|
|
*
|
|
* Note This function never returns
|
|
*/
|
|
hal.taskEntry();
|
|
}
|
|
|
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|