STM32开发板电容触摸屏驱动,单点有效
头文件touch.h:
u8 ft5x0x_read_data(void);
void ft5x0x_i2c_init(void);
struct _ts_event
{
u16 x1;
u16 y1;
u16 x2;
u16 y2;
u16 x3;
u16 y3;
u16 x4;
u16 y4;
u16 x5;
u16 y5;
u8 touch_point;
};
extern struct _ts_event ts_event;
源文件cap_touch.c
#include <stm32f10x_map.h>
#include "lcd.h"
#include "delay.h"
#include "stdlib.h"
#include "gui.h"
#include "myiic.h"
#include "touch.h"
struct _ts_event ts_event;
u8 ft5x0x_i2c_txdata(u8 *txdata, u8 length)
{
u8 ret =0;