Some questions about GPIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Some questions about GPIO

1,460 Views
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 Kudos
6 Replies

1,208 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Can you provide the code?

Regards,

Daniel

0 Kudos

1,208 Views
letseatorange
Contributor III

hello

      I have uploaded the attachment

thanks!

0 Kudos

1,208 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello,

I cannot open the file.

Could you check it and attach again?

Regards,

Daniel

0 Kudos

1,208 Views
letseatorange
Contributor III

hi

 i'm sorry.new  the attachmen have uploaded!

thanks

0 Kudos

1,208 Views
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,208 Views
letseatorange
Contributor III

hi,

it's work now,Thank you very much.

0 Kudos