touchgfx compilation attempt

This commit is contained in:
2025-04-03 01:59:14 +02:00
parent c30b708f92
commit dcd04e2a96
689 changed files with 122200 additions and 842 deletions

View File

@ -2,7 +2,7 @@
******************************************************************************
* File Name : OSWrappers.cpp
******************************************************************************
* This file is generated by TouchGFX Generator 4.21.0. Please, do not edit!
* This file is generated by TouchGFX Generator 4.25.0. Please, do not edit!
******************************************************************************
* @attention
*
@ -16,7 +16,6 @@
******************************************************************************
*/
#include <cassert>
#include <touchgfx/hal/HAL.hpp>
#include <touchgfx/hal/OSWrappers.hpp>
@ -42,7 +41,7 @@ void OSWrappers::initialize()
*/
void OSWrappers::takeFrameBufferSemaphore()
{
while(fb_sem);
while (fb_sem);
fb_sem = 1;
}
@ -118,7 +117,7 @@ bool OSWrappers::isVSyncAvailable()
*/
void OSWrappers::waitForVSync()
{
if(vsync_sem)
if (vsync_sem)
{
vsync_sem = 0;
HAL::getInstance()->backPorchExited();
@ -159,4 +158,3 @@ void OSWrappers::taskYield()
}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,7 +2,7 @@
******************************************************************************
* File Name : STM32DMA.cpp
******************************************************************************
* This file is generated by TouchGFX Generator 4.21.0. Please, do not edit!
* This file is generated by TouchGFX Generator 4.25.0. Please, do not edit!
******************************************************************************
* @attention
*

View File

@ -2,7 +2,7 @@
******************************************************************************
* File Name : STM32DMA.hpp
******************************************************************************
* This file is generated by TouchGFX Generator 4.21.0. Please, do not edit!
* This file is generated by TouchGFX Generator 4.25.0. Please, do not edit!
******************************************************************************
* @attention
*

View File

@ -2,7 +2,7 @@
******************************************************************************
* File Name : TouchGFXConfiguration.cpp
******************************************************************************
* This file is generated by TouchGFX Generator 4.21.0. Please, do not edit!
* This file is generated by TouchGFX Generator 4.25.0. Please, do not edit!
******************************************************************************
* @attention
*
@ -69,10 +69,10 @@ void touchgfx_taskEntry()
*
* Note This function returns immediately if there is no VSYNC signal.
*/
if (OSWrappers::isVSyncAvailable())
{
hal.backPorchExited();
}
if (OSWrappers::isVSyncAvailable())
{
hal.backPorchExited();
}
}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,7 +2,7 @@
******************************************************************************
* File Name : TouchGFXGeneratedHAL.cpp
******************************************************************************
* This file is generated by TouchGFX Generator 4.21.0. Please, do not edit!
* This file is generated by TouchGFX Generator 4.25.0. Please, do not edit!
******************************************************************************
* @attention
*
@ -30,12 +30,11 @@ using namespace touchgfx;
namespace
{
// Use the section "TouchGFX_Framebuffer" in the linker script to specify the placement of the buffer
LOCATION_PRAGMA_NOLOAD("TouchGFX_Framebuffer")
uint32_t frameBuf[(1024 * 600 * 3 + 3) / 4] LOCATION_ATTRIBUTE_NOLOAD("TouchGFX_Framebuffer");
static volatile bool refreshRequested = false;
static uint16_t lcd_int_active_line;
static uint16_t lcd_int_porch_line;
// Use the section "TouchGFX_Framebuffer" in the linker script to specify the placement of the buffer
LOCATION_PRAGMA_NOLOAD("TouchGFX_Framebuffer")
uint32_t frameBuf[(1024 * 600 * 3 + 3) / 4] LOCATION_ATTRIBUTE_NOLOAD("TouchGFX_Framebuffer");
static uint16_t lcd_int_active_line;
static uint16_t lcd_int_porch_line;
}
void TouchGFXGeneratedHAL::initialize()
@ -43,7 +42,10 @@ void TouchGFXGeneratedHAL::initialize()
HAL::initialize();
registerEventListener(*(Application::getInstance()));
registerTaskDelayFunction(&OSWrappers::taskDelay);
setFrameRefreshStrategy(HAL::REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL);
if (!setFrameRefreshStrategy(HAL::REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL))
{
while (1);
}
enableLCDControllerInterrupt();
enableInterrupts();
setFrameBufferStartAddresses((void*)frameBuf, (void*)0, (void*)0);
@ -66,8 +68,8 @@ void TouchGFXGeneratedHAL::disableInterrupts()
void TouchGFXGeneratedHAL::enableLCDControllerInterrupt()
{
lcd_int_active_line = (LTDC->BPCR & 0x7FF) - 1;
lcd_int_porch_line = (LTDC->AWCR & 0x7FF) - 1;
lcd_int_active_line = (LTDC->BPCR & LTDC_BPCR_AVBP_Msk) - 1;
lcd_int_porch_line = (LTDC->AWCR & LTDC_AWCR_AAH_Msk) - 1;
/* Sets the Line Interrupt position */
LTDC->LIPCR = lcd_int_active_line;
@ -82,10 +84,6 @@ bool TouchGFXGeneratedHAL::beginFrame()
void TouchGFXGeneratedHAL::endFrame()
{
if (frameBufferUpdatedThisFrame)
{
refreshRequested = true;
}
HAL::endFrame();
touchgfx::OSWrappers::signalRenderingDone();
}
@ -119,8 +117,8 @@ uint16_t TouchGFXGeneratedHAL::getTFTCurrentLine()
// on LTDC display is being used (REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL).
// The CPSR register (bits 15:0) specify current line of TFT controller.
uint16_t curr = (uint16_t)(LTDC->CPSR & 0xffff);
uint16_t backPorchY = (uint16_t)(LTDC->BPCR & 0x7FF) + 1;
uint16_t curr = (uint16_t)(LTDC->CPSR & LTDC_CPSR_CYPOS_Msk);
uint16_t backPorchY = (uint16_t)(LTDC->BPCR & LTDC_BPCR_AVBP_Msk) + 1;
// The semantics of the getTFTCurrentLine() function is to return a value
// in the range of 0-totalheight. If we are still in back porch area, return 0.
@ -129,10 +127,11 @@ uint16_t TouchGFXGeneratedHAL::getTFTCurrentLine()
void TouchGFXGeneratedHAL::InvalidateCache()
{
// If the framebuffer is placed in Write Through cached memory (e.g. SRAM) then
// the DCache must be flushed prior to DMA2D accessing it. That's done
// using the function SCB_CleanInvalidateDCache(). Remember to enable "CPU Cache" in the
// "System Core" settings for "Cortex M7" in CubeMX in order for this function call to work.
// Because DMA2D access main memory directly, the DCache must be invalidated
// becuase it could hold a wrong image of the framebuffer. That's done
// using the function SCB_CleanInvalidateDCache(). Remember to enable
// "CPU Cache" in the "System Core" settings for "Cortex M7" in CubeMX
// in order for this function call to work.
if (SCB->CCR & SCB_CCR_DC_Msk)
{
SCB_CleanInvalidateDCache();
@ -141,10 +140,11 @@ void TouchGFXGeneratedHAL::InvalidateCache()
void TouchGFXGeneratedHAL::FlushCache()
{
// If the framebuffer is placed in Write Through cached memory (e.g. SRAM) then
// If the framebuffer is placed in Write-Back cached memory (e.g. SRAM) then
// the DCache must be flushed prior to DMA2D accessing it. That's done
// using the function SCB_CleanInvalidateDCache(). Remember to enable "CPU Cache" in the
// "System Core" settings for "Cortex M7" in CubeMX in order for this function call to work.
// using the function SCB_CleanInvalidateDCache(). Remember to enable
// "CPU Cache" in the "System Core" settings for "Cortex M7" in CubeMX in
// order for this function call to work.
if (SCB->CCR & SCB_CCR_DC_Msk)
{
SCB_CleanInvalidateDCache();

View File

@ -2,7 +2,7 @@
******************************************************************************
* File Name : TouchGFXGeneratedHAL.hpp
******************************************************************************
* This file is generated by TouchGFX Generator 4.21.0. Please, do not edit!
* This file is generated by TouchGFX Generator 4.25.0. Please, do not edit!
******************************************************************************
* @attention
*
@ -60,27 +60,27 @@ public:
/**
* @fn virtual void TouchGFXGeneratedHAL::configureInterrupts();
*
* @brief Sets the DMA and LCD interrupt priorities.
* @brief Sets the DMA, LCD, and GPU2D (if enabled) interrupt priorities.
*
* Sets the DMA and LCD interrupt priorities.
* Sets the DMA, LCD, and GPU2D (if enabled) interrupt priorities.
*/
virtual void configureInterrupts();
/**
* @fn virtual void TouchGFXGeneratedHAL::enableInterrupts();
*
* @brief Enables the DMA and LCD interrupts.
* @brief Enables the DMA, LCD, and GPU2D (if enabled) interrupts.
*
* Enables the DMA and LCD interrupts.
* Enables the DMA, LCD, and GPU2D (if enabled) interrupts.
*/
virtual void enableInterrupts();
/**
* @fn virtual void TouchGFXGeneratedHAL::disableInterrupts();
*
* @brief Disables the DMA and LCD interrupts.
* @brief Disables the DMA, LDC, and GPU2D (if enabled) interrupts.
*
* Disables the DMA and LCD interrupts.
* Disables the DMA, LDC, and GPU2D (if enabled) interrupts.
*/
virtual void disableInterrupts();
@ -114,8 +114,6 @@ public:
* @brief This function is called whenever the framework has performed a partial draw.
*
* This function is called whenever the framework has performed a partial draw.
* On the STM32F7, make sure to clean and invalidate the data cache. This is to
* ensure that LTDC sees correct data when transferring to the display.
*
* @param rect The area of the screen that has been drawn, expressed in absolute coordinates.
*