- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
What is the correct way to use GPIO's? We have a board where CYPD5225 has to control few devices by pulling several gpios low and high. Simple enough. However I can't seem to find clear example what is the right way (tm) of doing this.
Only clue is FW_IND pin that is configured by default in the shipped example project.
This autogenerates some pin functions but those are not used.
Instead example code uses some low level api and hardcoded defines.
...
gpio_set_value (FW_LED_GPIO_PORT_PIN, !(gpio_read_value (FW_LED_GPIO_PORT_PIN)));
...
...
/* Configure the LED control GPIO as an output. */
gpio_hsiom_set_config (FW_LED_GPIO_PORT_PIN, HSIOM_MODE_GPIO, GPIO_DM_STRONG, true);
...
Is there a simple example how GPIO's should be used?
Solved! Go to Solution.
- Labels:
-
PSoC Creator Software
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please go through the following application note on PSoC 4 GPIOs
https://www.cypress.com/documentation/application-notes/an86439-psoc-4-using-gpio-pins
The above web page has a document along with a zip folder containing projects on the usage of GPIOs. Please go through first 2 projects.
Also, please go through Digital Pins code example present in PSoC Creator code examples section.
Thanks
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please go through the following application note on PSoC 4 GPIOs
https://www.cypress.com/documentation/application-notes/an86439-psoc-4-using-gpio-pins
The above web page has a document along with a zip folder containing projects on the usage of GPIOs. Please go through first 2 projects.
Also, please go through Digital Pins code example present in PSoC Creator code examples section.
Thanks
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, this helps a lot.
If I've understood correctly I don't need to initialize GPIO's myself, the framework handles that as long pins have been bound in PSoC Creators "Design Wide Resources"-pins view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi TeIk_3653391,
Yes, You do not need to initialize the GPIOs. As already mentioned in the App Note : https://www.cypress.com/documentation/application-notes/an86439-psoc-4-using-gpio-pins , the Pins Component is the recommended method for connecting internal PSoC resources to a physical pin. It allows PSoC Creator to automatically place and route the signals within the PSoC device based on the chosen pin configuration.
Best Regards,
Aashita