在线时间4 小时
UID349231
ST金币0
蝴蝶豆0
注册时间2008-3-11
初级会员
- 最后登录
- 2019-9-2
|
楼主 |
发表于 2012-3-28 20:15:46
|
显示全部楼层
a0a.1 0b0c
RE:关于触摸库中代码
终于找到早期的触摸库了,天啊,真是软件查询方式,充放电都是死等的,坑爹啊。
/**
******************************************************************************
* @brief Local sub function to wait for vil on RC structure.
* @par Parameters:
* None
* @retval void None
* @par Required preconditions:
* None
* @warning
* This function must be aligned in memory (start at an even address). This is
* done automatically when pragma "section" is used.
******************************************************************************
*/
void TSL_IO_SW_Burst_Wait_Vil(void)
{
#asm
nop
ld a, _AcquisitionBitMask
ldw x, _sTouchIO // Input data register ...
incw x
// Loop = 1 + 1 + 2 + 2 + 2 cycles = 8 cycles
WaitForVil:
bcp a, (x) // 1 cycles
jreq EndWaitForVil
ldw y, _TIMACQ_CNTR // 2 cycles; hw counter also used for timeout ...
cpw y, #0x0E00 // 2 cycles; Timeout compare
jrult WaitForVil
EndWaitForVil:
#endasm
}
/**
******************************************************************************
* @brief Local sub function to wait for vih on RC structure.
* @par Parameters:
* None
* @retval void None
* @par Required preconditions:
* None
* @warning
* This function must be aligned in memory (start at an even address). This is
* done automatically when pragma "section" is used.
******************************************************************************
*/
void TSL_IO_SW_Burst_Wait_Vih(void)
{
#asm
nop
ld a, _AcquisitionBitMask
ldw x, _sTouchIO // Input data register ...
incw x
// Loop = 1 + 1 + 2 + 2 + 2 cycles = 8 cycles
WaitForVih:
bcp a, (x) // 1 cycles
jrne EndWaitForVih
ldw y, _TIMACQ_CNTR // 2 cycles; hw counter also used for timeout ...
cpw y, #0x0E00 // 2 cycles; Timeout compare
jrult WaitForVih
EndWaitForVih:
#endasm
} |
|