pinreg

package
v3.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package pinreg is a registry for the physical headers (made up of pins) on a host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All() map[string][][]pin.Pin

All contains all the on-board headers on a micro computer.

The map key is the header name, e.g. "P1" or "EULER" and the value is a slice of slice of pin.Pin. For a 2x20 header, it's going to be a slice of [20][2]pin.Pin.

func IsConnected

func IsConnected(p pin.Pin) bool

IsConnected returns true if the pin is on a header.

func Position

func Position(p pin.Pin) (string, int)

Position returns the position on a pin if found.

The header and the pin number. Pin numbers are 1-based.

Returns "", 0 if not connected.

func Register

func Register(name string, allPins [][]pin.Pin) error

Register registers a physical header.

It automatically registers all gpio pins to gpioreg.

func Unregister

func Unregister(name string) error

Unregister removes a previously registered header.

This can happen when an USB device, which exposed an header, is unplugged. This is also useful for unit testing.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL