Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Bidirectional GPIO pin

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Bidirectional GPIO pin
Moderator:
RSKV

Post Reply
Follow this topic



Bidirectional GPIO pin

Nazila posted on 16 Jan 2012 10:30 AM PST
Top Contributor
55 Forum Posts

Hi,

How can I define a bidirectional GPIO? The cypress IC is the master so in firmware we know when it has to switch from output to input.

I defined it as an output in the initialization function (Thread_Entry). In a callBackDma function, I am changing it as an input to read back the data, then change it as an output. Is this method correct?

Thanks,

Nazila




Re: Bidirectional GPIO pin

aasi posted on 17 Jan 2012 03:34 AM PST
Cypress Employee
1073 Forum Posts

Hi,

I don't see any issues with this use case as long as you know the timing of the switching needed.

Regards,

Anand



Re: Bidirectional GPIO pin

aasi posted on 18 Jan 2012 10:39 PM PST
Cypress Employee
1073 Forum Posts

Hi Nazila,

I wanted to understand few more things about your use case. Is it ok for your application to have it configured as bidirectional or as you stated do you specifically need it as input for some time and output for some time?

Regards,

Anand



Re: Bidirectional GPIO pin

Nazila posted on 31 Jan 2012 04:41 PM PST
Top Contributor
55 Forum Posts

Hi,

I am not sure if I understand your question. By default those pins are output, then sometimes they have to be change to be input. The controller is the Cypress chip.

Please let me know if this is not clear.

Thanks,

Nazila



Re: Bidirectional GPIO pin

Bob Marlowe posted on 01 Feb 2012 11:38 PM PST
Top Contributor
1466 Forum Posts

There is the chance to define a pin as "Digital Bidirectional" pin which saves you any switching, just wrie and read to and from the pin as desired. Use the APIs and do not write to the pin-registers directly.

Bob



Re: Bidirectional GPIO pin

DanielaE posted on 01 Feb 2012 12:31 AM PST
Member
6 Forum Posts

There doesn't seem to exist something like a 'digital bidirectional' GPIO - at least I couldn't find one in the publicly available headers or docs. I was bitten by this deficiency when looking for a solution where direction of communication needs to be turned in the middle of a serial communication stream. Configuration of an open-drain GPIO might be possible, but it's still unclear if API checks in the GPIO setter/getter functions prevent doing so.

Ciao!

Daniela






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.