Go to file
KurisuD f385cb7d80 Expose serial number 2023-01-03 14:53:54 +09:00
DOC Expose serial number 2023-01-03 14:53:54 +09:00
EXAMPLES added an example of using the pigpio library to implement the SENT interface. 2020-12-20 09:16:10 -08:00
cmake optimized python setup 2019-08-26 12:00:09 +02:00
util Fix issue #274 - Delay on reboot/shutdown. 2020-08-30 10:23:16 -05:00
.gitignore Bump version and generate docs. 2020-06-26 16:20:36 -05:00
CMakeLists.txt Allow building on 64-bit system using lib64 2021-01-31 21:16:20 +01:00
CONTRIBUTING.md Add 'develop' branch model process. 2020-01-10 00:32:24 -06:00
MakeRemote V67: #198 added process exit codes for pigs 2018-03-11 13:24:54 +00:00
Makefile Use -pthread when linking shared libraries. 2019-01-10 14:17:59 +00:00
README V67: #198 added process exit codes for pigs 2018-03-11 13:24:54 +00:00
README.md Update README.md 2021-03-02 11:37:19 -06:00
SUPPORT.md Create SUPPORT.md (#2) 2020-01-01 20:48:41 -06:00
UNLICENCE V6 2013-12-12 10:27:22 +00:00
command.c Expose serial number 2023-01-03 14:53:54 +09:00
command.h V69+: #258 reject and document illegal script commands 2019-07-11 10:09:35 +01:00
custom.cext V26 2015-02-02 21:11:28 +00:00
pig2vcd.1 V72+: new year 2020-01-02 15:01:43 +00:00
pig2vcd.c V6 2013-12-12 10:27:22 +00:00
pigpio.3 Expose serial number 2023-01-03 14:53:54 +09:00
pigpio.c Expose serial number 2023-01-03 14:53:54 +09:00
pigpio.h Expose serial number 2023-01-03 14:53:54 +09:00
pigpio.py Expose serial number 2023-01-03 14:53:54 +09:00
pigpiod.1 V72+: new year 2020-01-02 15:01:43 +00:00
pigpiod.c Exit parent after daemon is initialized. Safer signal handling. Fix #519 2022-05-13 11:17:19 -05:00
pigpiod_if.3 V72+: new year 2020-01-02 15:01:43 +00:00
pigpiod_if.c Expose serial number 2023-01-03 14:53:54 +09:00
pigpiod_if.h V67+: tided up I2C/SPI documentation 2018-10-21 08:54:37 +01:00
pigpiod_if2.3 Auto generate MAN and HTML. 2020-12-23 23:11:15 -06:00
pigpiod_if2.c Expose serial number 2023-01-03 14:53:54 +09:00
pigpiod_if2.h Fixed doc that set_PWM_range() returns the actual range 2021-04-10 23:25:02 +01:00
pigs.1 Expose serial number 2023-01-03 14:53:54 +09:00
pigs.c V69+: #280 SPI/BSC SLAVE peripheral not available on BCM2711 2019-07-07 12:52:44 +01:00
pigs.h V67: #198 added process exit codes for pigs 2018-03-11 13:24:54 +00:00
setup.py Sync versions for next release (78). 2020-09-29 10:19:49 -05:00
x_pigpio.c Expose serial number 2023-01-03 14:53:54 +09:00
x_pigpio.py Add test cases to x_* for padded waves. 2020-04-29 11:25:02 -05:00
x_pigpiod_if.c Corrected test list argument errors 2018-02-06 18:35:49 +00:00
x_pigpiod_if2.c Modify pigpio_start arguments 2020-09-18 23:28:18 +02:00
x_pigs Expose serial number 2023-01-03 14:53:54 +09:00
x_pipe Expose serial number 2023-01-03 14:53:54 +09:00

README.md

pigpio

pigpio is a C library for the Raspberry which allows control of the General Purpose Input Outputs (GPIO).

Features

  • Sampling and time-stamping of GPIO 0-31 between 100,000 and 1,000,000 times per second
  • Provision of PWM on any number of the user GPIO simultaneously
  • Provision of servo pulses on any number of the user GPIO simultaneously
  • Callbacks when any of GPIO 0-31 change state (callbacks receive the time of the event accurate to a few microseconds)
  • Notifications via pipe when any of GPIO 0-31 change state
  • Callbacks at timed intervals
  • Reading/writing all of the GPIO in a bank (0-31, 32-53) as a single operation
  • Individually setting GPIO modes, reading and writing
  • Socket and pipe interfaces for the bulk of the functionality in addition to the underlying C library calls
  • Construction of arbitrary waveforms to give precise timing of output GPIO level changes (accurate to a few microseconds)
  • Software serial links, I2C, and SPI using any user GPIO
  • Rudimentary permission control through the socket and pipe interfaces so users can be prevented from "updating" inappropriate GPIO
  • Creating and running scripts on the pigpio daemon

Interfaces

The library provides a number of control interfaces

  • the C function interface,
  • the /dev/pigpio pipe interface,
  • the socket interface (used by the pigs utility and the Python module).

Utilities

A number of utility programs are provided:

  • the pigpiod daemon,
  • the Python module,
  • the piscope digital waveform viewer,
  • the pigs command line utility,
  • the pig2vcd utility which converts notifications into the value change dump (VCD) format (useful for viewing digital waveforms with GTKWave).

Documentation

See http://abyz.me.uk/rpi/pigpio/

Example programs

See http://abyz.me.uk/rpi/pigpio/examples.html

GPIO

ALL GPIO are identified by their Broadcom number. See http://elinux.org.

There are 54 GPIO in total, arranged in two banks.

Bank 1 contains GPIO 0-31. Bank 2 contains GPIO 32-54.

A user should only manipulate GPIO in bank 1.

There are at least three types of board:

  • Type 1
    • 26 pin header (P1)
    • Hardware revision numbers of 2 and 3
    • User GPIO 0-1, 4, 7-11, 14-15, 17-18, 21-25
  • Type 2
    • 26 pin header (P1) and an additional 8 pin header (P5)
    • Hardware revision numbers of 4, 5, 6, and 15
    • User GPIO 2-4, 7-11, 14-15, 17-18, 22-25, 27-31
  • Type 3
    • 40 pin expansion header (J8)
    • Hardware revision numbers of 16 or greater
    • User GPIO 2-27 (0 and 1 are reserved)

It is safe to read all the GPIO. If you try to write a system GPIO or change its mode you can crash the Pi or corrupt the data on the SD card.