#ifndef __LCD_TOUCH_H_
#define __LCD_TOUCH_H_

#include "lcd_2inch.h"

// Touch status masks
#define TP_PRESS_DOWN    0x80      // Touch pressed

// I2C device address for CST816S
#define CST816S_ADDR     0x15

typedef struct 
{
  uint16_t x[5];        // x[0] stores current x coordinate
  uint16_t y[5];        // y[0] stores current y coordinate
  uint8_t  statu;       // Touch status 
  uint16_t paint_color; // Current drawing color
} tp_dev_t;

extern tp_dev_t tp_dev;  

void TP_Init(void);
uint8_t TP_Scan(uint8_t mode);
void TP_test(void);
void Load_Touch_Draw(void);

#endif