Some questions about GPIO

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Some questions about GPIO

1,553 次查看
letseatorange
Contributor III

hi support team:

           Today,when i use GPIO A to read my key signal, i find it can't read it .but when i use GPIO B or C ,they all can read the signal,that's why?My core is v2.0.

 

               thanks!

Original Attachment has been moved to: ceshi.rar

0 项奖励
6 回复数

1,301 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Can you provide the code?

Regards,

Daniel

0 项奖励

1,301 次查看
letseatorange
Contributor III

hello

      I have uploaded the attachment

thanks!

0 项奖励

1,301 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello,

I cannot open the file.

Could you check it and attach again?

Regards,

Daniel

0 项奖励

1,301 次查看
letseatorange
Contributor III

hi

 i'm sorry.new  the attachmen have uploaded!

thanks

0 项奖励

1,301 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Your If statement is not correct,

if(GPIO_HAL_ReadPins(PTA)>> 1 == 0)

you should use something like this:

if((GPIO_HAL_ReadPins(PTA)) & (1 << 1))

Also, set direction registers:

GPIO_HAL_SetPinDirection(PTA,1,0);
GPIO_HAL_SetPinDirection(PTD,15,1);

Regards,

Daniel

1,301 次查看
letseatorange
Contributor III

hi,

it's work now,Thank you very much.

0 项奖励