APPENDIX A

image

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.