Use TouchGFX
This commit is contained in:
122
TouchGFX/App/app_touchgfx.c
Normal file
122
TouchGFX/App/app_touchgfx.c
Normal file
@ -0,0 +1,122 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* File Name : app_touchgfx.c
|
||||
******************************************************************************
|
||||
* This file was created by TouchGFX Generator 4.21.2. This file is only
|
||||
* generated once! Delete this file from your project and re-generate code
|
||||
* using STM32CubeMX or change this file manually to update it.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "tx_api.h"
|
||||
#include "app_touchgfx.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
#define TOUCHGFX_STACK_SIZE (4080)
|
||||
#define TOUCHGFX_BYTE_POOL_SIZE (4096)
|
||||
|
||||
/* USER CODE BEGIN PD */
|
||||
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PM */
|
||||
|
||||
/* USER CODE END PM */
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
static TX_BYTE_POOL TouchGFXBytePool;
|
||||
static TX_THREAD TouchGFXThread;
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
/* USER CODE END PV */
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
void touchgfx_init(void);
|
||||
void touchgfx_components_init(void);
|
||||
void touchgfx_taskEntry(void);
|
||||
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
|
||||
/**
|
||||
* PreOS Initialization function
|
||||
*/
|
||||
void MX_TouchGFX_PreOSInit(void)
|
||||
{
|
||||
// Calling forward to touchgfx_init in C++ domain
|
||||
touchgfx_components_init();
|
||||
touchgfx_init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create TouchGFX Thread
|
||||
*/
|
||||
UINT MX_TouchGFX_Init(VOID *memory_ptr)
|
||||
{
|
||||
UINT ret = TX_SUCCESS;
|
||||
CHAR *pointer = 0;
|
||||
|
||||
/* Create a byte memory pool from which to allocate the thread stacks. */
|
||||
if (tx_byte_pool_create(&TouchGFXBytePool, (char *)"Byte Pool", memory_ptr,
|
||||
TOUCHGFX_BYTE_POOL_SIZE) != TX_SUCCESS)
|
||||
{
|
||||
ret = TX_POOL_ERROR;
|
||||
}
|
||||
|
||||
/* Allocate the stack for TouchGFX Thread. */
|
||||
else if (tx_byte_allocate(&TouchGFXBytePool, (VOID **) &pointer,
|
||||
TOUCHGFX_STACK_SIZE, TX_NO_WAIT) != TX_SUCCESS)
|
||||
{
|
||||
ret = TX_POOL_ERROR;
|
||||
}
|
||||
|
||||
/* Create TouchGFX Thread */
|
||||
else if (tx_thread_create(&TouchGFXThread, (CHAR *)"TouchGFX", TouchGFX_Task, 0,
|
||||
pointer, TOUCHGFX_STACK_SIZE,
|
||||
5, 5,
|
||||
TX_NO_TIME_SLICE, TX_AUTO_START) != TX_SUCCESS)
|
||||
{
|
||||
ret = TX_THREAD_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* TouchGFX application entry function
|
||||
*/
|
||||
void MX_TouchGFX_Process(void)
|
||||
{
|
||||
// Calling forward to touchgfx_taskEntry in C++ domain
|
||||
touchgfx_taskEntry();
|
||||
}
|
||||
|
||||
/**
|
||||
* TouchGFX application thread
|
||||
*/
|
||||
void TouchGFX_Task(unsigned long thread_input)
|
||||
{
|
||||
// Calling forward to touchgfx_taskEntry in C++ domain
|
||||
touchgfx_taskEntry();
|
||||
}
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
60
TouchGFX/App/app_touchgfx.h
Normal file
60
TouchGFX/App/app_touchgfx.h
Normal file
@ -0,0 +1,60 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* File Name : app_touchgfx.h
|
||||
******************************************************************************
|
||||
* This file was created by TouchGFX Generator 4.21.2. This file is only
|
||||
* generated once! Delete this file from your project and re-generate code
|
||||
* using STM32CubeMX or change this file manually to update it.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef APP_TOUCHGFX_H
|
||||
#define APP_TOUCHGFX_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN ET */
|
||||
|
||||
/* USER CODE END ET */
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EC */
|
||||
|
||||
/* USER CODE END EC */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EM */
|
||||
|
||||
/* USER CODE END EM */
|
||||
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void MX_TouchGFX_PreOSInit(void);
|
||||
UINT MX_TouchGFX_Init(VOID *memory_ptr);
|
||||
void MX_TouchGFX_Process(void);
|
||||
void TouchGFX_Task(unsigned long thread_input);
|
||||
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* APP_TOUCHGFX_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
Reference in New Issue
Block a user