LogoLogo
  • Contributing to docs.beagleboard.io
  • docs.beagleboard.io
  • pru-cookbook
    • common
      • am335x_pru
      • am57xx_pru
    • 03details
      • code
        • am335x_pru
    • 04debug
      • code
        • AM335x_PRU
  • books
    • pru-cookbook
      • common
      • 03details
        • code
          • am335x_pru
    • beaglebone-cookbook
      • 02sensors
        • code
          • gpiod
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. books
  2. beaglebone-cookbook
  3. 02sensors
  4. code

gpiod

Previouscode

Last updated 2 years ago

Was this helpful?

libgpiod is a new C library and tools for interacting with the linux GPIO character device. Detailed information is and also has information.

One of the advantages of gpiod is that it can toggle multiple bits on the same gpio chip at the same time. The toggle2 examples show how it's done.

The directory contains examples of using gpiod with C and python to read/write a gpio pin.

File
Description

Toggles one pin as fast as possible. (300KHz in C, 57KHz in python)

Toggles two pins as fast as possible. (280KHz in C, 55KHz in python)

Reads an input pin and prints its value.

Reads an input pin and writes its value to an output pin. (5us delay in C, 20 us Delay in python)

Like getset, but uses events. (40 us delay in C, 75 us delay in python)

Toggles the four built in USR LEDs.

Tip: Use gpioinfo to lookup chip and line numbers for various pins.

here
Adafruit
toggle1
toggle2
get
getset
getsetEvent
toggleLED