Giter Site home page Giter Site logo

bschwind / pigpio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joan2937/pigpio

1.0 4.0 1.0 2.04 MB

pigpio is a C library for the Raspberry which allows control of the general purpose input outputs (gpios).

License: The Unlicense

C 46.18% C++ 11.92% Python 13.82% Shell 2.00% Makefile 0.29% Groff 25.78%

pigpio's Introduction

pigpio

pigpio is a C library for the Raspberry which allows control of the general purpose input outputs (gpios).

Features

sampling and time-stamping of gpios 0-31 between 100,000 and 1,000,000 times per second.

provision of PWM on any number of the user gpios simultaneously.

provision of servo pulses on any number of the user gpios simultaneously.

callbacks when any of gpios 0-31 change state (callbacks receive the time of the event
accurate to a few microseconds).

notifications via pipe when any of gpios 0-31 change state.

callbacks at timed intervals.

reading/writing all of the gpios 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.

the construction of arbitrary waveforms to give precise timing of output gpio
level changes (accurate to a few microseconds).

software serial links using any user gpio.

rudimentary permission control through the socket and pipe interfaces so users
can be prevented from "updating" inappropriate gpios.

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 pigs command line utility.

the pig2vcd utility which converts notifications into the value change dump (VCD)
format (useful for viewing digital waveforms with GTKWave).

gpios

ALL gpios are identified by their Broadcom number. See elinux.org

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

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

A user should only manipulate gpios 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 gpios 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 gpios 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 gpios 2-27 (0 and 1 are reserved).

It is safe to read all the gpios. 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.

pigpio's People

Contributors

bjoernsch avatar esorton avatar joan2937 avatar mathias-luedtke avatar srounet avatar thuffir avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

estevaofv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.