Search by Tags

How to use GPIO library

 

Compare with Revision




Subscribe for this article updates

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:

  • LEDs
  • Relays
  • and many more..

Use cases for GPIOs as input:

  • Detect switch status
  • Receive interrupt from external devices
  • and many more..

GPIO Library

  • We provide free GPIOLib including sample demo source code.
  • For general information on GPIO please refer this article

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.

  • Build and deploy solution.

Demo application in C (GPIO as input / output)


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.

Download project

Project Module compatibility Language Library Version
GPIO PXA / Tegra C Toradex CE Library (Old)
GPIO VFxx / iMX6 C Toradex CE Library (New)