⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 toucher.h~

📁 触摸屏的相关代码 经过测试 于单片机相关
💻 H~
📖 第 1 页 / 共 2 页
字号:
#define uchar unsigned char
#define uint  unsigned int   
#define lcd_busy     0x01
#define lcd_regnada  PORTD
#define lcd_data     PORTD
#define lcd_regname  PORTD
#define lcd_regdata  PORTD
#define lcd_control  PORTA



#define def    0x00
#define def0    0x01
#define def1    0x02
#define def2    0x04
#define def3    0x08
#define def4    0x10
#define def5    0x20
#define def6    0x40
#define def7    0x80

#define shield0  0xfe
#define shield1  0xfd
#define shield2  0xfb
#define shield3  0xf7 

#define ads7843_clk_h    (PORTC|=(1<<4))//
#define ads7843_clk_l    (PORTC&=~(1<<4))//
#define ads7843_cs_h     (PORTC|=(1<<5))//
#define ads7843_cs_l     (PORTC&=~(1<<5))//
#define ads7843_in_h     (PORTC|=(1<<7))//
#define ads7843_in_l     (PORTC&=~(1<<7))//
#define ads_7843_out     (PINC&0x08)//
//#define ads_7843_busy     PC7

void delay(int k);
void delayms(int ms);
void PrintStr(char *ptr,int delay_time);  
 extern void gotoxy(uchar x,uchar y);
void lcd_photo(flash  const uchar *pho); 
void lcd_character(flash const uchar *cha, int count);
void lcd_character1(flash const uchar *cha, int count); 
void PrintStr(char *ptr,int delay_time);
void putHEX2(unsigned char var);
void lcd_regwr(uchar regnada);
void GUI_Point(unsigned int px, unsigned int py);
void PutBCD(unsigned char x,unsigned char y,unsigned char var); 
void GUI_Point1(unsigned int px1, unsigned int py1);
//void lcd_character1(int count);
void ErectCoordinate(void);
void lcd_datawrite(uchar wrdata);
uchar ReadFromCharFrom7843(void);
void WriteCharTo7843(uchar write_7843data);
void PutBMP(flash  const unsigned char *puts);
void PutStr(unsigned char x,unsigned char y,unsigned char *ptr);
unsigned char const Pointmov[] = {0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01}; 

flash const uchar tab1[]={
"成都恒达化工自控研究所同步电机励磁控制系"
"成都恒达化工自控研究所同步电机励磁控制系"
"定子电流"
"可使用3V/5V 供电而不需外接负电压        "};      

flash const uchar welcome[]={"欢迎使用成都恒达励磁控制系统"};
flash const uchar voltage[]={"定子电压:"};
flash const uchar electricity[]={"定子电流:"};
flash const uchar excitation[]={"励磁电压:"};
flash const uchar excitationEY[]={"励磁电流:"};
flash const uchar meshworkVE[]={"网端电压:"};
flash const uchar engineVE[]={"机端电压:"};
flash const uchar degree[]={"控制角:"};
flash const uchar startupDegree[]={"起励角度:"};
flash const uchar phasicDegree[]={"移相角度:"}; 
flash const uchar frequency[]={"电机频率:"}; 
flash const uchar AssemblePower[]={"总功率:"}; 
flash const uchar EnsPower[]={"有功功率:"}; 
flash const uchar ZeroPower[]={"无功功率:"};
flash const uchar factPower[]={"实际功因:"};

uchar const tab[]={
"田"
};

/***************************** 
触摸屏测试

****************************/  

uchar demonstrate[]={"演示"};
uchar touch[]={"触摸屏显示测试"};

 uchar  X1[]={"X="};
 uchar  Y1[]={"Y="};
 uchar Ydoesnot[]={"Y无键按下"};
 uchar Yhave[]={"Y有按键"};
 
 uchar Xdoesnot[]={"X无键按下"};
 uchar Xhave[]={"X有按键"};
 
 

uchar lackof[] ={"欠励:"};
uchar over[]={"过励:"};
uchar lackofa[]={"控制角度:"};
//flash const uchar factPowera[]={"调节"};
flash const uchar factPowera[]={"田甲"};

flash const uchar  controlmode[]={"控制方式:"};
flash const uchar DegreeIntercalate[]={"角度设置:"}; 
flash const uchar Process[]={"参数调节:"};
flash const uchar ProcessParameter[]={"参数设置:"};


flash const uchar tab2[]={
 /*--  调入了一幅图像:这是您新建的图像  --*/
/*--  宽度x高度=16x16  --*/
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC0,0x3F,0xF8,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
0x80,0x7F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x80,0x00,
0x0F,0xFF,0x00,0x01,0x80,0x7F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x00,0x80,0x00,0x0F,0xFF,0x00,0x01,0x80,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0C,0x43,0x01,0x80,0x00,0x7F,0xFF,0xF0,0x01,0x80,0xFF,0xFF,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x43,0x01,0x80,0x00,0x7F,0xFF,0xF0,0x01,
0x83,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0xFF,0x07,0x00,0x07,
0xFF,0xFF,0xFE,0x01,0x83,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,
0xFF,0x07,0x00,0x07,0xFF,0xFF,0xFE,0x01,0x87,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0x3F,0xFC,0x1E,0x00,0x1F,0xFF,0xFF,0xFF,0x81,0x87,0xFF,0xFF,0x80,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x3F,0xFC,0x1E,0x00,0x1F,0xFF,0xFF,0xFF,0x81,
0x8F,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xBF,0xFF,0xFC,0x00,0x7F,
0xFC,0x00,0x7F,0xC1,0x8F,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xBF,
0xFF,0xFC,0x00,0x7F,0xFC,0x00,0x7F,0xC1,0x9F,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0xFF,0xFF,0xF0,0x00,0xFF,0xC0,0x00,0x0F,0xE1,0x9F,0xFF,0xFF,0xE0,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0xF0,0x00,0xFF,0xC0,0x00,0x0F,0xE1,
0x97,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0xE0,0x03,0xFF,
0xFF,0xFC,0x01,0xF1,0x97,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,
0xFF,0xE0,0x03,0xFF,0xFF,0xFC,0x01,0xF1,0x9F,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0xDF,0xFF,0xC0,0x07,0xFF,0xFF,0xFF,0x80,0xF1,0x9F,0xFF,0xFF,0xF0,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xDF,0xFF,0xC0,0x07,0xFF,0xFF,0xFF,0x80,0xF1,
0x97,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0x00,0x0F,0xFF,
0xFF,0xFF,0xE0,0x39,0x97,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,
0xFF,0x00,0x0F,0xFF,0xFF,0xFF,0xE0,0x39,0x9F,0x7F,0xFF,0xFC,0x00,0x00,0x00,0x00,
0x00,0x00,0x07,0xFF,0xF8,0x00,0x1F,0xFF,0xF0,0x03,0xF8,0x39,0x9F,0x7F,0xFF,0xFC,
0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xF8,0x00,0x1F,0xFF,0xF0,0x03,0xF8,0x39,
0x8B,0x7F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xE0,0x00,0x3F,0xFF,
0xFF,0xC0,0x7C,0x19,0x8B,0x7F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,
0xE0,0x00,0x3F,0xFF,0xFF,0xC0,0x7C,0x19,0x87,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,
0x00,0x00,0x04,0x7F,0xF0,0x00,0x3F,0xFF,0xFF,0xF8,0x1E,0x09,0x87,0xFF,0xFF,0xFC,
0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x7F,0xF0,0x00,0x3F,0xFF,0xFF,0xF8,0x1E,0x09,
0x8B,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xF8,0x00,0x7F,0xFF,
0xFF,0xFE,0x0F,0x09,0x8B,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,
0xF8,0x00,0x7F,0xFF,0xFF,0xFE,0x0F,0x09,0x81,0xF3,0xFF,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x0F,0xFF,0xFC,0x00,0xFF,0xFF,0xFF,0xFF,0x87,0x09,0x81,0xF3,0xFF,0xFE,
0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFC,0x00,0xFF,0xFF,0xFF,0xFF,0x87,0x09,
0x81,0xF7,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFE,0x00,0xFF,0xFF,

⌨️ 快捷键说明

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