43 lines
716 B
C
43 lines
716 B
C
/*
|
|
* touch.h
|
|
*
|
|
* Created on: 2021Äê8ÔÂ7ÈÕ
|
|
* Author: wuwenfeng
|
|
*/
|
|
|
|
#ifndef TOUCH_H_
|
|
#define TOUCH_H_
|
|
#include "main.h"
|
|
|
|
|
|
#define TCLK(x) HAL_GPIO_WritePin(TCLK_GPIO_Port,TCLK_Pin,x)
|
|
#define TCS(x) HAL_GPIO_WritePin(TCS_GPIO_Port,TCS_Pin,x)
|
|
#define TDIN(x) HAL_GPIO_WritePin(TDIN_GPIO_Port,TDIN_Pin,x)
|
|
#define TDOUT HAL_GPIO_ReadPin(TDOUT_GPIO_Port,TDOUT_Pin)
|
|
#define TPEN HAL_GPIO_ReadPin(TPEN_GPIO_Port,TPEN_Pin)
|
|
|
|
typedef struct
|
|
{
|
|
char begin;
|
|
float x_acc;
|
|
float y_acc;
|
|
int x_offset;
|
|
int y_offset;
|
|
char end;
|
|
}touch_config;
|
|
|
|
typedef struct
|
|
{
|
|
uint16_t adc_x;
|
|
uint16_t adc_y;
|
|
int pix_x;
|
|
int pix_y;
|
|
char move_flag;
|
|
}touch_device;
|
|
|
|
|
|
void TP_Server();
|
|
void TP_adjustment();
|
|
|
|
#endif /* TOUCH_H_ */
|