CyU3PGpioDeviceRestore

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

cross mob
Anonymous
Not applicable

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 */);

   

CyU3PGpioSetSimpleConfig(...)

   

CyU3PGpioGetValue, Set Value....

   

... talk to part successfully...

   

Then

   

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.

0 Likes
3 Replies
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable
        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); }   
0 Likes
Anonymous
Not applicable
        Hi, Thanks for the update here. -PRJI   
0 Likes