📄 guitm.c
字号:
/************************************************************************/
/* */
/* Copyright (C) SHANGHAI EPSON CORP. 2001 */
/* */
/* File name: GuiTM.c */
/* This is the driver code of ad convert for touch panel */
/* */
/* Revision history */
/* 2004.05.24 David.ji Start */
/* */
/************************************************************************/
#include "GuiTM.h"
#include "ros33.h"
#include "sysGUI.h"
/**************************************
timer initialize
call from system initialize handler
**************************************/
void fnGuiTM_Init(void)
{
/* 16-bit timer 2 clock clk/4096 on */
*(volatile unsigned char*)REG_TM16_2_PSC = 0x0f;
/* 16-bit timer2 fine mode=normal,buffer disable,
output inversion normal, interal clk, output off, reset, stop*/;
*(volatile unsigned char*)REG_TM16_2_CTL = 0x02;
/* priority level */
*(volatile unsigned char*)REG_TM16_2_ILEVL &= INTR_MASK;
*(volatile unsigned char*)REG_TM16_2_ILEVL |= INTR_LEVEL;
/*load regiter interrupt 256ms*(48*1000000*1/256)*/
*(volatile unsigned short*)REG_TM16_2_CMPB = TM16_2_VALUE;
/* reset 16-bit timer comparsion B intterupt factor */
*(volatile unsigned char*)REG_TM16_2_IFLAG |= 0x04;
/* 16-bit timer comparison B interrupt enable */
*(volatile unsigned char*)REG_TM16_2_IMASK |= 0x04;
/* 16-bit timer run */
*(volatile unsigned char*)REG_TM16_2_CTL |= 0x01;
}
void fnGuiTM_Start(void)
{
*(volatile unsigned char*)REG_TM16_2_CTL |= 0x01;
}
void fnGuiTM_Stop(void)
{
/* clear 16-bit timer factor flag */
*(volatile unsigned char*)REG_TM16_2_IFLAG |= 0x04;
*(volatile unsigned char*)REG_TM16_2_CTL &= 0xfe;
}
void Int_GuiTM(void)
{
ent_int();
/* clear 16-bit timer factor flag */
*(volatile unsigned char*)REG_TM16_2_IFLAG |= 0x04;
iset_flg(GUI_EVENTID,0x100);
ret_int();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -