rpi

package
v0.0.0-...-53472a3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package rpi provides convenience mappings from Raspberry Pi pin names to offsets.

Index

Constants

View Source
const (
	J8p27 = iota
	J8p28
	J8p3
	J8p5
	J8p7
	J8p29
	J8p31
	J8p26
	J8p24
	J8p21
	J8p19
	J8p23
	J8p32
	J8p33
	J8p8
	J8p10
	J8p36
	J8p11
	J8p12
	J8p35
	J8p38
	J8p40
	J8p15
	J8p16
	J8p18
	J8p22
	J8p37
	J8p13
)

Convenience mapping from J8 pinouts to BCM pinouts.

View Source
const (
	GPIO2
	GPIO3
	GPIO4
	GPIO5
	GPIO6
	GPIO7
	GPIO8
	GPIO9
	GPIO10
	GPIO11
	GPIO12
	GPIO13
	GPIO14
	GPIO15
	GPIO16
	GPIO17
	GPIO18
	GPIO19
	GPIO20
	GPIO21
	GPIO22
	GPIO23
	GPIO24
	GPIO25
	GPIO26
	GPIO27
	MaxGPIOPin
)

GPIO aliases to J8 pins

Variables

View Source
var ErrInvalid = errors.New("invalid pin name")

ErrInvalid indicates the pin name does not match a known pin.

Functions

func MustPin

func MustPin(s string) int

MustPin converts the string to the corresponding pin number or panics if that is not possible.

func Pin

func Pin(s string) (int, error)

Pin maps a pin string name to a pin number.

Pin names are case insensitive and may be of the form J8pX, GPIOX, or X.

Types

This section is empty.

Jump to

Keyboard shortcuts

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