Attention: this is a legacy library and thus not supported by Toradex anymore. We recommend that you use the new libraries for all Toradex modules. Please see the Toradex CE Libraries and Code Samples for up-to-date information.
This article aims to help the developer in using Toradex GPIO library in VC++. GPIO library is used to access general purpose input/output (GPIO) available on Toradex Computer Modules.
Use cases for GPIOs as output:
Use cases for GPIOs as input:
This application demonstrates the use of GPIO pin (SODIMM pin 101) as output to produce a 0.5Hz pulse.
Follow this tutorial up to step 9 to create a new VC++ project. Edit the code as follows:
To include GPIO library into project refer this article.
Demo in Output configuration.
The following figure shows the output waveform.
Alternatively, you can use the GPIOConfig Tool.
On the Toradex GPIO Config window, click on Pin to sort the list by pin number. Scroll down to SFront.101.
The Level will change between 0 and 1 at the interval of 1 second.
Demo in Input configuration.
When Level changes from 0 to 1, it print message on console.
|VS2008 Project||VS20013 Project||VS2015 Project||Module compatibility||Language||Library Version|
|GPIO||-||-||PXA / Tegra||C||Toradex CE Library (Old)|
|GPIO||GPIO||GPIO||Tegra / VFxx / iMX6||C||Toradex CE Library (New)|
Note: It is always recommended to update the libraries first before compiling the demo project. Click on this link to get latest libraries.