You are here

Trying to understand how to set GPIO's but having issues | Cypress Semiconductor

Trying to understand how to set GPIO's but having issues

Summary: 1 Reply, Latest post by Keerthy on 15 Oct 2013 03:48 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
frkyfrank's picture
9 posts

I designed a board which utilizes the FX3.

After may days of working with the code base supplied by Cypress, I have successfully uploaded many of the example projects and verified functionality.

I am no code guru, and some of it is a bit confusing to me (to say the least).

Starting with the "GpioApp" code, I am attempting to set "GPIO33" low and "GPIO35" high.

Really, that's it... that's all I need to do.

For the life of me, I cannot seem to make it work.

I guess I need help in one of two ways:

1) If possible, change the code and document so that I can learn by this experience.

2) Explain to me EXACTLY what I need to do.

Either way works for me, if anyone would be so kind as to help me out.

Thank You.

Keerthy's picture
Cypress Employee
31 posts


In order to drive a GPIO high or low, you need to follow the steps mentioned below:

Configure the GPIO as output using CyU3PGpioSetSimpleConfig() API.

You can call the API in CyFxGpioInit() function. Please find an example below:

CyU3PGpioSimpleConfig_t gpioConfig;

    gpioConfig.outValue = CyFalse;
    gpioConfig.driveLowEn = CyTrue;
    gpioConfig.driveHighEn = CyTrue;
    gpioConfig.inputEn = CyFalse;
    gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;
    apiRetStatus = CyU3PGpioSetSimpleConfig(33, &gpioConfig);

The function CyU3PGpioSetValue() can be used to set value of GPIO output pin.The function states what value needs to be pushed to the pin. A CyFalse means 0 and a CyTrue means 1.

Please try using the same at your end and let me know if you are facing any issue.






Log in to post new comments.