Some questions about GPIO

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

Some questions about GPIO

1,555件の閲覧回数
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,303件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Can you provide the code?

Regards,

Daniel

0 件の賞賛

1,303件の閲覧回数
letseatorange
Contributor III

hello

      I have uploaded the attachment

thanks!

0 件の賞賛

1,303件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello,

I cannot open the file.

Could you check it and attach again?

Regards,

Daniel

0 件の賞賛

1,303件の閲覧回数
letseatorange
Contributor III

hi

 i'm sorry.new  the attachmen have uploaded!

thanks

0 件の賞賛

1,303件の閲覧回数
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,303件の閲覧回数
letseatorange
Contributor III

hi,

it's work now,Thank you very much.

0 件の賞賛