sysfs

package
v3.0.33 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GPIO_EXPORT   = "/sys/class/gpio/export"
	GPIO_UNEXPORT = "/sys/class/gpio/unexport"
	GPIO_PIN      = "/sys/class/gpio/gpio%v"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GPIO

type GPIO struct {
	gopi.Unit
	sync.RWMutex
	gopi.Publisher
	gopi.Logger
	*Watcher
	// contains filtered or unexported fields
}

func (*GPIO) Define

func (this *GPIO) Define(cfg gopi.Config) error

func (*GPIO) Dispose

func (this *GPIO) Dispose() error

func (*GPIO) GetPinMode

func (this *GPIO) GetPinMode(logical gopi.GPIOPin) gopi.GPIOMode

func (*GPIO) New

func (this *GPIO) New(gopi.Config) error

func (*GPIO) NumberOfPhysicalPins

func (this *GPIO) NumberOfPhysicalPins() uint

func (*GPIO) PhysicalPin

func (this *GPIO) PhysicalPin(pin uint) gopi.GPIOPin

func (*GPIO) PhysicalPinForPin

func (this *GPIO) PhysicalPinForPin(logical gopi.GPIOPin) uint

func (*GPIO) Pins

func (this *GPIO) Pins() []gopi.GPIOPin

func (*GPIO) ReadPin

func (this *GPIO) ReadPin(logical gopi.GPIOPin) gopi.GPIOState

func (*GPIO) SetPinMode

func (this *GPIO) SetPinMode(logical gopi.GPIOPin, mode gopi.GPIOMode)

Set pin mode

func (*GPIO) SetPullMode

func (this *GPIO) SetPullMode(logical gopi.GPIOPin, pull gopi.GPIOPull) error

func (*GPIO) String

func (this *GPIO) String() string

func (*GPIO) Watch

func (this *GPIO) Watch(logical gopi.GPIOPin, edge gopi.GPIOEdge) error

func (*GPIO) WritePin

func (this *GPIO) WritePin(logical gopi.GPIOPin, state gopi.GPIOState)

type Watcher

type Watcher struct {
	gopi.Unit
	gopi.FilePoll
	gopi.Logger
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Watcher) Dispose

func (this *Watcher) Dispose() error

func (*Watcher) New

func (this *Watcher) New(gopi.Config) error

func (*Watcher) Unwatch

func (this *Watcher) Unwatch(pin gopi.GPIOPin) error

func (*Watcher) Watch

func (this *Watcher) Watch(fd uintptr, pin gopi.GPIOPin, edge gopi.GPIOEdge) error

Jump to

Keyboard shortcuts

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