gpio

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chip

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

func OpenChip

func OpenChip(chip int) (*Chip, error)

func (*Chip) Close

func (g *Chip) Close() error

func (*Chip) GetChipInfo

func (g *Chip) GetChipInfo() ChipInfo

func (*Chip) GetLineInfo

func (g *Chip) GetLineInfo(line uint32) (LineInfo, error)

func (*Chip) OpenLine

func (g *Chip) OpenLine(label string, flags RequestFlag, line LineRequest) (*Lines, error)

func (*Chip) OpenLines

func (g *Chip) OpenLines(label string, flags RequestFlag, lines []LineRequest) (*Lines, error)

func (*Chip) WatchLine

func (g *Chip) WatchLine(label string, requestFlags RequestFlag, eventFlags EventFlag, line Line) (*Lines, error)

type ChipInfo

type ChipInfo struct {
	Name  string
	Label string
	Lines uint32
}

type EventFlag

type EventFlag uint32
const EventFallingEdge EventFlag = 0x00000002
const EventRisingEdge EventFlag = 0x00000001

type Line

type Line struct {
	Offset uint32
	Name   string
}

type LineFlag

type LineFlag uint32
const LineActiveLow LineFlag = 0x00000004
const LineIsOut LineFlag = 0x00000002
const LineKernel LineFlag = 0x00000001
const LineOpenDrain LineFlag = 0x00000008
const LineOpenSource LineFlag = 0x00000010

type LineInfo

type LineInfo struct {
	LineOffset uint32
	Flags      LineFlag
	Name       string
	Consumer   string
}

type LineRequest

type LineRequest struct {
	Line         Line
	DefaultValue uint8
}

type Lines

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

func (*Lines) Close

func (gl *Lines) Close()

func (*Lines) GetValue

func (gl *Lines) GetValue() (bool, error)

func (*Lines) GetValues

func (gl *Lines) GetValues() ([]bool, error)

func (*Lines) SetValue

func (gl *Lines) SetValue(value bool) error

func (*Lines) SetValues

func (gl *Lines) SetValues(values []bool) error

type RequestFlag

type RequestFlag uint32
const RequestActiveLow RequestFlag = 0x00000004
const RequestInput RequestFlag = 0x00000001
const RequestOpenDrain RequestFlag = 0x00000008
const RequestOpenSource RequestFlag = 0x00000010
const RequestOutput RequestFlag = 0x00000002

Jump to

Keyboard shortcuts

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