You are here

CyU3PGpioDeviceRestore | Cypress Semiconductor


Summary: 3 Replies, Latest post by PRJI on 14 May 2013 04:47 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
dennis's picture
1 post

We have a part that we communicate with via several gpio pins when we're not using the gpif.  To do this, we Call CyU3PGpioDeviceOverride( /* pin number */);


CyU3PGpioGetValue, Set Value....

... talk to part successfully...


CyU3PGpioDisable( .. pin .. );

CyU3PGpioDeviceRestore( .. pin ..);

We've probed our board and it's clear that whatever values we drove the gpio pins on while communicating with our other chip are continued to be driven after we call disable and devicerestore.

Are there other api calls that need made to restore gpio pins back to the gpif?  The gpif operates correctly except that the gpio pins we were using continue to be driven at the last value they were driven at. It seems to me that the disable/restore should do that.

I checked the api return status after making the disable/restore calls and I get a success but it seems the gpio still has control of the pins.

dennisjm's picture
33 posts

Tried to file a technical support request on this too.  Site returns some template error when I submit.

We've tried to drive the gpif bus with crafted data and a custom state machine but that wasn't working for some reason.  No examples that use CyU3PGpifWriteDataWords and the API always returned error 74.  

We are having some successes by simply reconfiguring the entire IO matrix but that seems the unsuggested way to do it in the API guide.


dennisjm's picture
33 posts

Ok, received fix for this from technical support if it helps anyone else. Reportedly permanent fix will be in next SDK. For now after calling CyU3PDeviceGpioRestore you need to also add in this code to fix the pin operation correctly:

if (pin < 32) {
uint32_t temp;
CyU3PReadDeviceRegisters ((uvint32_t *)0xe005100c, 1, &temp);
temp &= ~(1 << pin);
CyU3PWriteDeviceRegisters ((uvint32_t *)0xe005100c, 1, &temp);

prji's picture
Cypress Employee
473 posts

Thanks for the update here.

Log in to post new comments.