joan2937/pigpio
Freepigpio is a C library for the Raspberry which allows control of the General Purpose Input Outputs (GPIO).
About joan2937/pigpio
pigpio is a C library for the Raspberry Pi that provides low-level control of General Purpose Input Outputs (GPIO). It supports high-speed sampling and time-stamping of GPIO 0-31 at rates up to 1,000,000 times per second, simultaneous PWM and servo pulse generation on any user GPIO, callbacks on state changes with microsecond accuracy, notifications via pipe, and timed callbacks. The library allows reading/writing all GPIO in a bank as a single operation, individual mode setting, and arbitrary waveform construction for precise output timing. Additional capabilities include software serial, I2C, and SPI over any user GPIO, rudimentary permission control, and script execution on the pigpiod daemon. Interfaces include C functions, a /dev/pigpio pipe, and a socket interface used by utilities such as pigpiod, pigs, piscope, pig2vcd, and a Python module.
Key Features
Pros & Cons
- High-speed sampling up to 1 MHz on GPIO 0-31
- Simultaneous PWM and servo pulse generation on any user GPIO
- Multiple interface options: C, Python, socket, pipe
- Microsecond-accurate callbacks and waveform construction
- Comprehensive set of utilities: daemon, command-line, waveform viewer
- Open source with active community support
- Limited to Raspberry Pi hardware only
- Requires C programming knowledge for full flexibility
- No high-level abstraction – direct GPIO manipulation
- GPIO availability varies by Raspberry Pi board revision