首先感谢大佬手把手操作,我们做下来,不出意外的话编译没有错误,我们也需要根据大佬的文章进行操作,但是有一个问题就是ART-Pi中Touchgfx默认的是GT9147触摸屏,如果使用其它的触摸屏就需要在
中适配,由于时间原因长话短说,完成大佬的操作后,可以看到显示屏上显示demo但是并不能进行触摸操作,我们需要在
这个文件中适配修改,比方说我使用的GT1151,先把GT1151的示例在工程中注释掉,然后根据GT1151的示例进行修改。
直接上代码:使用其它的触摸屏应该也是一样的方法。
/**
******************************************************************************
* File Name : STM32TouchController.cpp
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Ultimate Liberty license
* SLA0044, the "License"; You may not use this file except in compliance with
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
******************************************************************************
*/
/* USER CODE BEGIN STM32TouchController */
#include <STM32TouchController.hpp>
#include <rtthread.h>
#include "gt1151.h"
#include <touch.h>
#include <rtdevice.h>
#define DBG_TAG "gt1151_sample"
#define DBG_LVL DBG_LOG
#include <rtdbg.h>
#ifdef PKG_USING_GT1151
int gt1151_init(void)
{