9
TouchPanel Library User Manual V1.1 – March 24, 2006

TouchPanel Library User Manual - read.pudn.comread.pudn.com/downloads99/doc/403554/Library User MENU/TouchPanel Use…Description Get touch panel value(LCD Coordinate) Header File

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: TouchPanel Library User Manual - read.pudn.comread.pudn.com/downloads99/doc/403554/Library User MENU/TouchPanel Use…Description Get touch panel value(LCD Coordinate) Header File

TouchPanel Library User Manual V1.1 – March 24, 2006

Page 2: TouchPanel Library User Manual - read.pudn.comread.pudn.com/downloads99/doc/403554/Library User MENU/TouchPanel Use…Description Get touch panel value(LCD Coordinate) Header File

Graphics Library User’s Manual

PRELIMINARY

Table of Content PAGE

TouchPanel Library User Manual ............................................................................................................................................ 1

1 Function List ..................................................................................................................................................................... 4

2 ATTENTION…………………………………………………………………………………………………..…….…….5 3 TouchPanel Interface……………………………………………………………………………………..5

Page 3: TouchPanel Library User Manual - read.pudn.comread.pudn.com/downloads99/doc/403554/Library User MENU/TouchPanel Use…Description Get touch panel value(LCD Coordinate) Header File

Graphics Library User’s Manual

PRELIMINARY

Revision History Revision Date By Remark

V1.0 2005/05/09 pengtj first revision V1.1 2006/03/24 pengtj Add some funtion

Page 4: TouchPanel Library User Manual - read.pudn.comread.pudn.com/downloads99/doc/403554/Library User MENU/TouchPanel Use…Description Get touch panel value(LCD Coordinate) Header File

Graphics Library User’s Manual

PRELIMINARY

1 Function List

Index name 1 DrvTPInitial

2 DrvTPOpen

3 DrvTPClose

4 DrvTPSetDelay

5 DrvTPGetValue

6 DrvTPGetTPKey

7 TouchPanelCalibration

8 TouchPanelCalibrationStatus

9 SetTPCalibrateParameter

10 GetTPCalibrateParameter

Page 5: TouchPanel Library User Manual - read.pudn.comread.pudn.com/downloads99/doc/403554/Library User MENU/TouchPanel Use…Description Get touch panel value(LCD Coordinate) Header File

Graphics Library User’s Manual

PRELIMINARY

2 Attention 1.TouchPanel 与 SP-737 的硬件接口:

SP-737 TouchPanel Screen

XL MY Y1 YU MX X1 XR PY Y2 YL PX X2

Y1 X1 X2 Y2

3 TouchPanel Interface 3.1 DrvTPInitial API Name DrvTPInitial Function TouchPanel Initial Description

C touchpanel.h Header File ASM C void DrvTPInitial(void)

Syntax ASM

Parameters N/A

Return Values N/A

3.2 DrvTPOpen API Name DrvTPOpen Function Open TouchPanel device Description

C touchpanel.h Header File ASM C void DrvTPOpen(void)

Syntax ASM

Page 6: TouchPanel Library User Manual - read.pudn.comread.pudn.com/downloads99/doc/403554/Library User MENU/TouchPanel Use…Description Get touch panel value(LCD Coordinate) Header File

Graphics Library User’s Manual

PRELIMINARY

Parameters N/A

Return Values N/A Remarks N/A

3.3 DrvTPClose API Name DrvTPClose Function Close TouchPanel device Description

C touchpanel.h Header File ASM C void DrvTPClose(void)

Syntax ASM

Parameters N/A

Return Values N/A Remarks N/A

3.4 DrvTPSetDelay API Name DrvTPSetDelay Function 设置采样延时时间

Description C touchpanel.h Header File ASM C void DrvTPSetDelay(int time)

Syntax ASM

Parameters Time:采样延时时间每秒采样数为:128/2/ int time

Return Values N/A Remarks N/A

3.5 DrvTPGetValue API Name DrvTPGetValue Function Get TouchPanel coordinate Description Get touch panel value(LCD Coordinate)

C touchpanel.h Header File ASM C void DrvTPGetValue(STMsg* pmsg,int* x, int* y)

Syntax ASM

Parameters STMsg* pmsg,

Return Values Coordination x,y

Remarks user must run this function then can get LCD X, Y value

3.6 DrvTPGetTPKey

Page 7: TouchPanel Library User Manual - read.pudn.comread.pudn.com/downloads99/doc/403554/Library User MENU/TouchPanel Use…Description Get touch panel value(LCD Coordinate) Header File

Graphics Library User’s Manual

PRELIMINARY

API Name DrvTPGetTPKey Function 读取 TouchPanel 硬图标的键值(1~10)

Description C touchpanel.h Header File ASM C UINT DrvTPGetTPKey(STMsg* pmsg)

Syntax ASM

Parameters N/A

Return Values TouchPanel 硬图标的键值(1~10)

Remarks 返回键值为 1~10,其中上面一排从左到右为 1~5,下面一排从左到右为 6~10

Remarks

Return Values touch panel status. If not zero then stylus press Remarks 当手写笔按下时,此程序一直返回非零

3.7 TouchPanelCalibration API Name TouchPanelCalibration Function Get touch panel revise parameter Description 设置 TouchPanel 校正参数

C touchpanel.h Header File ASM C void TouchPanelCalibration(STMsg* pmsg,UINT LCDX,UINT LCDY,UINT PointNum)

Syntax ASM

Parameters LCDX: 当前校验点 LCD X coordinate

LCDY: 当前校验点 LCD Y coordinate

PointNum: 当前点是属于第 1 点,2 点或 3 点

Return Values 校验第 3 点后,调用 TouchPanelCalibrationStatus();

返回 1,LCD 上用于校正的两点距离太近;返回 0,OK

Remarks 见如下示例:

if(pmsg->Reserved==TP_UP)

{

if(CalibrationPoint==0)

{

TouchPanelCalibration(pmsg,CAL_LCDX1,CAL_LCDY1,FirstPoint);

CalibrationPoint++;

DrvClearDevice();

DrvPointRect(CAL_LCDX2, CAL_LCDY2);

}

else if(CalibrationPoint==1)

{

TouchPanelCalibration(pmsg,CAL_LCDX2,CAL_LCDY2,SecondPoint);

CalibrationPoint++;

DrvClearDevice();

DrvPointRect(CAL_LCDX3, CAL_LCDY3);

Page 8: TouchPanel Library User Manual - read.pudn.comread.pudn.com/downloads99/doc/403554/Library User MENU/TouchPanel Use…Description Get touch panel value(LCD Coordinate) Header File

Graphics Library User’s Manual

PRELIMINARY

}

else //if(CalibrationPoint==2)

{

TouchPanelCalibration(pmsg,CAL_LCDX3,CAL_LCDY3,ThirdPoint);

CalibrationPoint++;

CalibrationStatus=TouchPanelCalibrationStatus();

DrvClearDevice();

}

if(CalibrationStatus==0)

{

SysFreeMSG(pmsg);

SysSetNextAP(TSK_MENU);

SysSendMSG( hDispatchQ,MSG_AP_SUICIDE,0);

}

else if(CalibrationPoint==3)

{

CalibrationPoint=0;

DrvPointRect(CAL_LCDX1, CAL_LCDY1);

SysFreeMSG(pmsg);

}

else

SysFreeMSG(pmsg);

break;

}

else

SysFreeMSG(pmsg);

break;

3.8 TouchPanelCalibrationStatus API Name TouchPanelCalibrationStatus Function 检查触摸屏校验是否通过

Description C touchpanel.h Header File ASM C void TouchPanelCalibrationStatus (void)

Syntax ASM

Parameters N/A

Return Values 返回 1,LCD 上用于校正的两点距离太近;返回 0,OK

Remarks N/A

3.9 SetTPCalibrateParameter API Name SetTPCalibrateParameter Function Set Touch panel Calibration Parameter

Page 9: TouchPanel Library User Manual - read.pudn.comread.pudn.com/downloads99/doc/403554/Library User MENU/TouchPanel Use…Description Get touch panel value(LCD Coordinate) Header File

Graphics Library User’s Manual

PRELIMINARY

Description C touchpanel.h Header File ASM C void SetTPCalibrateParameter(TPCalPara* TPPara);

Syntax ASM

Parameters struct TPCalPara

Return Values N/A

Remarks User can call this function when program need the TP Calibration paramters

3.10 GetTPCalibrateParameter API Name GetTPCalibrateParameter Function get Touch panel Calibration Parameter Description

C touchpanel.h Header File ASM C GetTPCalibrateParameter(TPCalPara* TPPara);

Syntax ASM

Parameters struct TPCalPara

Return Values struct TPCalPara

Remarks User can call this function when program complete the TP Calibration process