Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. go-rpio

go-rpio

MITGov4.6.0

A pure Go library for accessing Raspberry Pi GPIO pins without external C dependencies.

GitHubGitHub
2.3k stars224 forks0 contributors

What is go-rpio?

go-rpio is a Go library that provides low-level access to GPIO pins on Raspberry Pi single-board computers. It allows developers to control hardware peripherals like LEDs, sensors, and motors directly from Go code by memory-mapping the BCM2835 GPIO registers. The library solves the problem of needing external C dependencies for Raspberry Pi GPIO programming, offering a pure Go alternative.

Target Audience

Go developers building applications for Raspberry Pi, including IoT projects, robotics, home automation, and embedded systems that require hardware interaction.

Value Proposition

Developers choose go-rpio because it eliminates external C library dependencies, simplifies deployment, and provides a clean Go API for comprehensive GPIO control, including advanced features like PWM and SPI that are often missing in other Go GPIO libraries.

Overview

:electric_plug: Raspberry Pi GPIO library for go-lang

Use Cases

Best For

  • Building IoT devices with Raspberry Pi using Go
  • Creating robotics projects that require precise GPIO control
  • Developing home automation systems with sensor/actuator interfaces
  • Prototyping embedded systems without external C dependencies
  • Educational projects teaching Go and hardware interaction
  • Implementing custom hardware communication via SPI or PWM

Not Ideal For

  • Applications that must run without root privileges for all GPIO operations, including PWM
  • Projects targeting multiple single-board computer platforms beyond Raspberry Pi
  • Teams wanting high-level abstractions or pre-built hardware peripheral components
  • Environments with strict security policies that prohibit memory-mapped I/O or root access

Pros & Cons

Pros

Pure Go Dependencies

Eliminates external C libraries like WiringPi, simplifying deployment and cross-compilation as highlighted in the README's philosophy.

Direct Hardware Access

Uses memory mapping via /dev/mem or /dev/gpiomem for low-latency GPIO control, enabling fast pin operations as described in the features.

Comprehensive Feature Set

Supports advanced hardware features like PWM, SPI, and edge detection, which are often lacking in other Go GPIO libraries, per the README's release notes.

Broad RPi Compatibility

Works with Raspberry Pi models from A/B to Pi 4, as evidenced by the release history and key features section.

Cons

Root Access Limitations

PWM modes and some operations still require root privileges, even with /dev/gpiomem, restricting use in secure or containerized environments.

Complex Non-Root Setup

Configuring /dev/gpiomem without root involves kernel upgrades, user group changes, and udev rules, which the README admits can be cumbersome.

Hardware Lock-In

Tied specifically to Raspberry Pi's BCM2835 chipset, making it unsuitable for projects that may need portability to other SBCs.

Open Source Alternative To

go-rpio is an open-source alternative to the following products:

W
WiringPi

WiringPi is a GPIO access library for Raspberry Pi written in C, providing functions to control the GPIO pins for hardware interfacing.

b
bcm2835

bcm2835 is a C library for accessing GPIO and other peripherals on the Broadcom BCM2835 chip used in Raspberry Pi single-board computers.

Frequently Asked Questions

Quick Stats

Stars2,287
Forks224
Contributors0
Open Issues32
Last commit2 years ago
CreatedSince 2013

Tags

#memory-mapping#edge-detection#iot#spi#embedded-systems#hardware-control#go-library#pwm#raspberry-pi#gpio

Built With

G
Go

Included in

Go169.1k
Auto-fetched 7 hours ago

Related Projects

arduino-cliarduino-cli

Arduino command line tool

Stars5,019
Forks493
Last commit1 day ago
ghwghw

Go HardWare discovery/inspection library

Stars1,875
Forks224
Last commit3 days ago
emgoemgo

Emgo: Bare metal Go (language for programming embedded systems)

Stars1,096
Forks68
Last commit4 years ago
sysinfosysinfo

Sysinfo is a Go library providing Linux OS / kernel / hardware system information.

Stars578
Forks103
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub