Use TouchGFX
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "app_threadx.h"
|
||||
#include "app_touchgfx.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
@ -45,6 +46,8 @@
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
||||
CRC_HandleTypeDef hcrc;
|
||||
|
||||
DMA2D_HandleTypeDef hdma2d;
|
||||
|
||||
FDCAN_HandleTypeDef hfdcan1;
|
||||
@ -62,7 +65,7 @@ TIM_HandleTypeDef htim2;
|
||||
TIM_HandleTypeDef htim4;
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
volatile int ltdc_cb_triggered;
|
||||
/* USER CODE END PV */
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
@ -77,6 +80,7 @@ static void MX_SPI3_Init(void);
|
||||
static void MX_TIM1_Init(void);
|
||||
static void MX_TIM2_Init(void);
|
||||
static void MX_TIM4_Init(void);
|
||||
static void MX_CRC_Init(void);
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
@ -123,6 +127,9 @@ int main(void) {
|
||||
MX_TIM1_Init();
|
||||
MX_TIM2_Init();
|
||||
MX_TIM4_Init();
|
||||
MX_CRC_Init();
|
||||
/* Call PreOsInit function */
|
||||
MX_TouchGFX_PreOSInit();
|
||||
/* USER CODE BEGIN 2 */
|
||||
if (HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4) != HAL_OK) {
|
||||
Error_Handler();
|
||||
@ -207,6 +214,34 @@ void SystemClock_Config(void) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief CRC Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_CRC_Init(void) {
|
||||
|
||||
/* USER CODE BEGIN CRC_Init 0 */
|
||||
|
||||
/* USER CODE END CRC_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN CRC_Init 1 */
|
||||
|
||||
/* USER CODE END CRC_Init 1 */
|
||||
hcrc.Instance = CRC;
|
||||
hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE;
|
||||
hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE;
|
||||
hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE;
|
||||
hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE;
|
||||
hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES;
|
||||
if (HAL_CRC_Init(&hcrc) != HAL_OK) {
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN CRC_Init 2 */
|
||||
|
||||
/* USER CODE END CRC_Init 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DMA2D Initialization Function
|
||||
* @param None
|
||||
@ -360,7 +395,8 @@ static void MX_LTDC_Init(void) {
|
||||
pLayerCfg.Alpha0 = 0;
|
||||
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
|
||||
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
|
||||
pLayerCfg.FBStartAdress = (uint32_t)&image_data_ft_logo_rainbow_rgb565;
|
||||
// pLayerCfg.FBStartAdress = (uint32_t)&image_data_ft_logo_rainbow_rgb565;
|
||||
pLayerCfg.FBStartAdress = (uint32_t)0x24040000;
|
||||
pLayerCfg.ImageWidth = 320;
|
||||
pLayerCfg.ImageHeight = 480;
|
||||
pLayerCfg.Backcolor.Blue = 0;
|
||||
|
||||
Reference in New Issue
Block a user