Class GPIO 1

The library class GPIO provides a very simple API to work with the Raspberry Pi GPIO hardware in a C++ program. Using this library class, you can immediately work to define your application rather than rewrite or adapt the code.

This appendix is useful for those wanting to:

  • Learn about the include file and linking options necessary to use librpi2

  • Use and understand the GPIO::GPIO class constructor.

  • Configure a GPIO for Input/Output or Alternate Function

  • Configure a GPIO pullup or pulldown resistor

  • Configure a GPIO drive strength, hysteresis, or slew rate

  • Query the configuration of a GPIO pin

  • Read or Write a GPIO pin

Get Exploring the Raspberry Pi 2 with C++ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.