gpio

package module
v0.0.0-...-afe5734 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 6 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InputPin

type InputPin interface {
	Read() (bool, error)
}

InputPin is the interface satisfied by GPIO input pins.

func Input

func Input(pinNumber int, activeLow bool) (InputPin, error)

Input initializes a GPIO input pin with the given pin number.

type InterruptPin

type InterruptPin interface {
	InputPin
	Wait(time.Duration) error
}

InterruptPin is the interface satisfied by GPIO interrupt pins.

func Interrupt

func Interrupt(pinNumber int, activeLow bool, edge string) (InterruptPin, error)

Interrupt initializes a GPIO interrupt pin with the given pin number. The edge parameter must be "rising", "falling", or "both".

type OutputPin

type OutputPin interface {
	Write(bool) error
}

OutputPin is the interface satisfied by GPIO output pins.

func Output

func Output(pinNumber int, activeLow bool, initialValue bool) (OutputPin, error)

Output initializes a GPIO output pin with the given pin number and initial logical value.

type Pin

type Pin struct {
	// contains filtered or unexported fields
}

Pin represents a GPIO pin.

func (*Pin) Read

func (pin *Pin) Read() (bool, error)

func (*Pin) Wait

func (pin *Pin) Wait(timeout time.Duration) error

Wait waits with the given timeout for a GPIO input pin to become active.

func (*Pin) Write

func (pin *Pin) Write(value bool) error

type TimeoutError

type TimeoutError struct {
	// contains filtered or unexported fields
}

TimeoutError indicates that a Wait operation on a GPIO input pin timed out.

func (TimeoutError) Error

func (t TimeoutError) Error() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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