[1769] GPIO read ...

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

[1769] GPIO read ...

1,227件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bruno on Mon Jul 23 10:49:33 MST 2012
Hello,
I need an example of GPIO for read...

If
LPC_GPIO2->FIODIR = 0x000000FF;
defined as Outputs *

How make for defined as input?
0 件の賞賛
返信
4 返答(返信)

1,179件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bruno on Thu Jul 26 13:34:20 MST 2012
Thanks....
0 件の賞賛
返信

1,179件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Jul 24 00:49:34 MST 2012
Sorry, wasn't aware that someone is reading my posts :rolleyes:
0 件の賞賛
返信

1,179件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbm on Tue Jul 24 00:45:45 MST 2012
Zero, shame on you!

Should be:
LPC_GPIO0->FIOSET = SWITCH;
0 件の賞賛
返信

1,179件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Jul 23 11:05:24 MST 2012
As already described here http://knowledgebase.nxp.com/showthread.php?t=2417


#define SWITCH (1 << 26)            //SWITCH input P0.26

LPC_GPIO0->FIODIR &=~SWITCH;        //set input
LPC_GPIO0->FIOSET = SWITCH;        //set high
...
if(LPC_GPIO0->FIOPIN & SWITCH)        //get pin 
{
//damned, pin is still high
}                                
else
{
//wow, it's pulled low
}
0 件の賞賛
返信