|
我用到了EXTINT2寄存器中的EINT19,这个寄存器有个滤波enable和 disable [yZBmD_m
我把滤波设置为disable ,然后按照和EINT0等没有滤波功能的寄存器相同的用法编程。 N'3r3ilin
但是,EINT19所接的按键时而好用,时而不好用。那位用过EXTINT2和EINTFLT2的,麻烦讲解 YRvZ`$Lc
一下怎么用?我的寄存器设置如下 : !vz <H c
26Cr$@F
J] ,7RV
v_pIOPregs->rGPFCON &= ~(0x3c33 << 0); /* Set EINT0,2(GPF0,2) as EINT ,Set EINT5,6(GPF5,6) as EINT */ 1'd^HU
v_pIOPregs->rGPFCON |= (0x2822 << 0); Du^Rbem1
3_9-%&0
v_pIOPregs->rGPGCON &= ~(0x30003 << 6); /* Set EINT11,19(GPG3,11) as EINT */ uQo'h.-
v_pIOPregs->rGPGCON |= (0x20002 << 6); ym= oVQL
gbSxW,j[
j+?U0Z
v_pIOPregs->rEXTINT0 &= ~(0x202 << 0); /*Configure EINT0,2 as Rising Edge Mode*/ %IRFq
v_pIOPregs->rEXTINT0 |= (0x000 << 0); |%<|3!{
3s0G+dO
v_pIOPregs->rEXTINT1 &= ~(0x2 << 12); /*Configure EINT11 as Rising Edge Mode*/ [e<xb
v_pIOPregs->rEXTINT1 |= (0x0 << 12); A {RA
A 7*pWkt
v_pIOPregs->rEXTINT2 &= ~(0xe << 12); /*Configure EINT19 as Rising Edge Mode*/ 9 =R ZG&
v_pIOPregs->rEXTINT2 |= (0x4 << 12); <Xw~@d].,
P5SUTS*
16DJLK
M>3&`=u
kT&lE8e8
IxlH .
按键程序部分: )^n% 3$'f
else if( (v_pIOPregs->rGPGDAT&(1<< 3)) == 0 ) // EINT11 好用 pL SQ
{ I IXTS
Sleep(5); Pw_ngscK
if( (v_pIOPregs->rGPGDAT&(1<< 3)) == 0 ) K(YB|~pI{
{ c|)!o'
Sleep(10); cyp CS9
return VK_UP ; }DB1dj%=
} B-=LYL4 ,Q
=5#)zfH
@"+*9:z
+8UiCYw*l
} [*L]]^GGF
[/Hu+PFK
else if( (v_pIOPregs->rGPGDAT&(1<<11)) == 0 ) // EINT19 不好用 mN*qwD_t
{ _N]{#
Sleep(5); :$3@;5U
if( (v_pIOPregs->rGPGDAT&(1<<11)) == 0 ) hHn(Mr!'
{ Qdvfv %
Sleep(10); lRQ@MNv]%
return VK_DOWN; &o-r n
} Z$C8VkIoFU
tKesJ.U
EAZ8A9Gr
}
[em13] |
|