Files
player/Project/Src/Drive/Include/touch_043.h
andy 045cff4cc6 整理代码
1.解决一些编译警告
2.发现png因为文件api不支持而不能使用
2025-10-18 13:58:40 +08:00

44 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __TOUCH_H
#define __TOUCH_H
#include "stdint.h"
#include "touch_iic.h"
#include "usart.h"
/*------------------------------------ 相关定义
* -----------------------------------*/
#define TOUCH_MAX 5 // 最大触摸点数
typedef struct {
uint8_t flag; // 触摸标志位为1时表示有触摸操作
uint8_t num; // 触摸点数
uint16_t x[TOUCH_MAX]; // x坐标
uint16_t y[TOUCH_MAX]; // y坐标
} TouchStructure;
extern TouchStructure touchInfo; // 触摸数据结构体声明
/*------------------------------------ 寄存定义
* -----------------------------------*/
#define GT9XX_IIC_RADDR 0xBB // IIC初始化地址
#define GT9XX_IIC_WADDR 0xBA
#define GT9XX_CFG_ADDR 0x8047 // 固件配置信息寄存器和配置起始地址
#define GT9XX_READ_ADDR 0x814E // 触摸信息寄存器
#define GT9XX_ID_ADDR 0x8140 // 触摸面板ID寄存器
/*------------------------------------ 函数声明
* -----------------------------------*/
uint8_t Touch_Init(void); // 触摸屏初始化
void Touch_Scan(void); // 触摸扫描
void GT9XX_Reset(void); // 执行复位操作
void GT9XX_SendCfg(void); // 发送GT9147配置参数
void GT9XX_ReadCfg(void); // 读取GT9147配置参数
TouchStructure *Touch_GetState(void);
#endif