# vsergeev/c-periphery

A C library for peripheral I/O (GPIO, LED, PWM, SPI, I2C, MMIO, Serial) in Linux.

Repository: https://github.com/vsergeev/c-periphery
Canonical: https://ross.abutalabs.com/products/c-periphery
Language: C
License: MIT
License Family: permissive
Last push: 2025-11-02T21:46:15+00:00

## Health v2 (maintenance only)
Score: 50/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 50, release rhythm 22, longevity 100
- inputs: {"age_days": 4494, "days_push": 304, "days_rel": 304, "gap_med": 246, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1061, forks 304 (observed 2026-08-28T04:03:26.014215+00:00)

## What it is
A small MIT-licensed C library providing userspace access to Linux peripheral I/O interfaces including GPIO, LED, PWM, SPI, I2C, MMIO, and Serial. It consolidates the native Linux APIs into a simple, dependency-free static library for embedded Linux platforms like Raspberry Pi and BeagleBone.

## Use cases
- read and write GPIO pins from userspace C code on a Raspberry Pi
- communicate with I2C sensors in an embedded Linux application
- drive SPI devices from C without writing raw ioctl code
- blink or control LEDs via the Linux LED subsystem
- generate PWM signals for motors or servos
- open and read from serial ports in a C program
- memory-mapped I/O access to hardware registers on BeagleBone

## When to choose
- you need C access to GPIO, SPI, I2C, PWM, serial, LED, or MMIO on embedded Linux
- you want a dependency-free static library with a simple re-entrant API
- you are targeting Raspberry Pi, BeagleBone, or similar single-board computers
- you want a maintained wrapper over the native Linux peripheral APIs

## When to avoid
- you are not on Linux
- you need Python, Lua, Java, or Dart bindings (use the periphery ports instead)
- you need a higher-level robotics framework with device drivers and abstractions
- you need interrupt-driven or real-time guarantees beyond what userspace Linux provides

## Facets
- artifact type: library
- maturity: stable
- function: embedded, file-system, developer-tools
- domain: embedded-systems, hardware, iot, operating-systems
- platform: c, embedded, iot
- tags: gpio, spi, i2c, pwm, serial, mmio, led, peripheral-io, raspberry-pi, beaglebone, userspace-hardware-access, linux

## Member repositories
- vsergeev/c-periphery (main) score 50

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:26.014215+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:56:52.733105+00:00, confidence not recorded.
  - readme: https://github.com/vsergeev/c-periphery (fetched 2026-08-28T04:03:26.014215+00:00, sha 74e537fd146b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
