void Pin_Write(uint8 value) definition unclear

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ErOs_662341
Level 1
Level 1

 "Writes the value to the physical port (data output register), masking and shifting the bits appropriately."

   

Does this mean if I have a pin component on P0[0:2] and I call Pin_Write(0x3), P0[0] and P0[1] will be high and P0[2] wil be low?

0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

That is exactly what happens!

   

When you have a pins-component at P2[3..5] a Write(0x05) would set P2[3] and P2[5]  and reset P2[4]. Before the port bits are set they are shifted accordingly.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Useful ap note on GPIO -

   

 

   

    

   

          

   

http://www.cypress.com/?rID=93401     AN86439 - PSoC® 4 - Using GPIO Pins

   

 

   

 

   

Regards, Dana.

0 Likes
ErOs_662341
Level 1
Level 1

 Thanks! That clears it up

0 Likes