Driver

Now Generally Useful: OpenBSD's GPIO Subsystem

OpenBSD has had support for General Purpose Input/Output devices since the 3.6 release. GPIO devices, or gpios for short, provide an easy way to interface electronic circuits which can be as simple as a LED or that provide more complex functionality like a OneWire or I2C bus.

The GPIO implementation in OpenBSD 3.6 up to and including 4.4, however, has some problems and drawbacks which made me rework larger parts of this subsystem during the h2k8 hardware hackathon in Coimbra, Portugal.

Simulating GPIO Pins

I am currently writing a control and monitoring software system that makes use of GPIO pins. Since I was at the CCC congress in Berlin I did only have my laptop and no real GPIO hardware...

With only a laptop it's a bit hard to write GPIO software, since laptops usually don't have any GPIO pins. So what I needed to test my new software was either a real device (out of reach) or... writing a simulator.

<Nick> What is a GPIO Simulator?
<kettenis> You write to a pin and nothing happens...

Contributions to OpenBSD

  • watchdogd(8), a daemon to periodically retrigger the watchdog(4) timer device from userland
  • nmea(4), a NMEA 0183 line discipline
  • nmeaattach(8), a utility to attach the nmea(4) line disciplines to ttys, no obsoleted by the newer and more general ldattach(8) command
Syndicate content