GPIO direction/drive change on CY7C65211

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

cross mob
Anonymous
Not applicable

API for the GPIO (CyGetGpioValue()/CySetGpioValue()) does not allow us to change the direction/drive of the GPIO pins on CY7C65211. In our system we may have a number of this USB-I2C bridge device and we want to be able to configure the GPIO direction/configuration individually on each of these bridge devices at least at system initialization. Is it possible achieve this with CY7C65211?

I see that you recommend to use the configuration utility to do so; in other posts. Do you have a Linux utility to do so? Even if there is one, it will be difficult to call it form our application. Can you please add APIs for this purpose?

0 Likes
1 Solution

Hello Shiva Pandit,

The GPIOs have to be configured prior to usage (using the Cypress USB-Serial Configuration Utility) and cannot be configured at run-time. The GPIO can only be set/read during runtime using the APIs.

Best regards,

Srinath S

View solution in original post

0 Likes
3 Replies
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello Shiva Pandit,

The device needs to be configured to set the GPIO in the INPUT/OUTPUT mode. The Cypress USB-Serial Configuration Utility has to be used to perform this. Please let know what difficulty you face in performing the same.

Please refer to the attachment in the below thread.

USB-Serial Configuration Utility source code

Best regards,

Srinath S

0 Likes
Anonymous
Not applicable

Hi Srinath,

There are two problems with the configuration utility:

  1. As I mentioned we may have more than one board (say 4 different ones) with this part. On each board, the GPIO pins need to be configured differently. We would like to do this at system initialization and not in the factory. So, we need a way to modify the direction at run-time.
  2. We have looked at the Linux source you linked above. Presumably we have to change the contents of the flash to change the direction/configuration of the GPIO pin and then reset the device to make the change effective. Again, this is difficult to achieve if we want to do it at run-time.
  3. Without knowing the exact contents of the flash, we risk corrupting it and hence it is undesirable to do so at run-time.

If there was a simple API to change the direction, that would be ideal. Not sure if the hardware supports it..

thanks,

-Shiva

0 Likes

Hello Shiva Pandit,

The GPIOs have to be configured prior to usage (using the Cypress USB-Serial Configuration Utility) and cannot be configured at run-time. The GPIO can only be set/read during runtime using the APIs.

Best regards,

Srinath S

0 Likes