gpiod
Last updated
Last updated
libgpiod is a new C library and tools for interacting with the linux GPIO character device. Detailed information is here and Adafruit 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 |
---|---|
Tip: Use gpioinfo to lookup chip and line numbers for various pins.
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.