lpc_lib_touch.h

来自「使用embest IDE开发工具开发的基于LPC2294 的触摸屏开发」· C头文件 代码 · 共 69 行

H
69
字号



#ifndef lpc_lib_touch
	#define lpc_lib_touch
	
/*-------------------------------------------------------------------*/
/*                    function/variable declare                      */
/*-------------------------------------------------------------------*/
/*
  void init_ext(void)
  void irq_eint0_svr(void)
  INT8U touch_read()
*/

/*-------------------------------------------------------------------*/
/*                       include files                               */
/*---------------------------------------------------------------- --*/
#include	"..\..\com\type_redefine.h"
#include	"..\..\com\lpc22xx_register.h"
#include	"..\..\com\lpc_lib_spi\lpc_lib_spi.h"


/*-------------------------------------------------------------------*/
/*                      constant define                              */
/*---------------------------------------------------------------- --*/
//P0.28->busy
#define   P0_28_BUSY_GPIO          (0x0<<24) //00
#define   P0_28_BUSY_GPIO_MASK     (0x3<<24) //11

//p0_27->cs_7843
#define   P0_27_CS_7843_GPIO       (0x0<<22)  //00
#define   P0_27_CS_7843_GPIO_MASK  (0x3<<22) //11

//p0_18->io1_7843
#define   P0_18_IO1_7843_GPIO      (0x0<<4)   //00
#define   P0_18_IO1_7843_GPIO_MASK (0x3<<4)   //11

//P0_16->GPIO
#define   P0_16_GPIO               (0x0)  //00
#define   P0_16_GPIO_MASK          (0x3) //11

//P0_16->EINT0
#define   P0_16_EINT0              (0x1) //
#define   P0_16_EINT0_MASK         (0x3) //11

//设置7843的BUSY,CS,IO1
#define   _7843_BUSY_CS_IO1   (P0_28_BUSY_GPIO+P0_27_CS_7843_GPIO+P0_18_IO1_7843_GPIO)
#define   _7843_BUSY_CS_IO1_MASK  (P0_28_BUSY_GPIO_MASK+P0_27_CS_7843_GPIO_MASK+P0_18_IO1_7843_GPIO_MASK)


/*-------------------------------------------------------------------*/
/*                    function/variable declare                      */
/*-------------------------------------------------------------------*/

INT8U spi_data_receive_7843();
void spi_data_send_7843(INT8U data_send);
INT8U get_value(INT8U com);
void cs_set(INT8U on_off);
void io1_set(INT8U on_off);
void touch_init();
INT8U touch_read();
INT8U mytouch_get_key(void);
INT8U mytouch_moni_key();




#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?