Overview

periph.io/x/periph is a standalone hardware library with no external dependency.

Features

periph includes many ready-to-use tools:

go get periph.io/x/periph/cmd/... # List the host drivers registered and/or initialized: periph-info # List the board headers: headers-list # List the state of each GPIO: gpio-list # Set P1_7/GPIO4 on a Raspberry Pi to high: gpio-write P1_7 1

Library

periph tries hard to get out of the way when used as a library.

Here’s the minimal “toggle a LED” example:

package main import ( "time" "periph.io/x/periph/conn/gpio" "periph.io/x/periph/conn/gpio/gpioreg" "periph.io/x/periph/host" ) func main () { host . Init () p := gpioreg . ByName ( "11" ) t := time . NewTicker ( 500 * time . Millisecond ) for l := gpio . Low ; ; l = ! l { p . Out ( l ) <- t . C } }

Learn more about GPIOs.

More infos

Read the source code.

Contribute to the project.

Learn about the project philosophy.

#periph on gophers.slack.com. Request access at invite.slack.golangbridge.org

File issues at github.com/google/periph/issues

Authors

periph was initiated with ❤️️ and passion by Marc-Antoine Ruel. The full list of contributors is in AUTHORS and CONTRIBUTORS.

Disclaimer

This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.

This project is not affiliated with the Go project.