gpioDevice

package
v3.11.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRegisterNotFound = errors.New("register not found")

Functions

This section is empty.

Types

type Config

type Config interface {
	Chip() string
	InputDebounce() time.Duration
	// InputOptions are used to configure the pin.
	// Valid options: WithBiasDisabled, WithPullDown, WithPullUp
	InputOptions() []string
	// OutputOptions are used to configure the pin.
	// Valid options: AsOpenDrain, AsOpenSource, AsPushPull
	OutputOptions() []string
	Inputs() []Pin
	Outputs() []Pin
}

type DeviceStruct

type DeviceStruct struct {
	device.State
	// contains filtered or unexported fields
}

func NewDevice

func NewDevice(
	deviceConfig device.Config,
	gpioConfig Config,
	stateStorage *dataflow.ValueStorage,
	commandStorage *dataflow.ValueStorage,
) (*DeviceStruct, error)

func (*DeviceStruct) Model

func (d *DeviceStruct) Model() string

func (*DeviceStruct) Run

func (d *DeviceStruct) Run(ctx context.Context) (err error, immediateError bool)

type GpioRegister

type GpioRegister struct {
	dataflow.RegisterStruct
	// contains filtered or unexported fields
}

func (GpioRegister) String

func (r GpioRegister) String() string

type Pin

type Pin interface {
	Pin() string
	Name() string
	Description() string
	LowLabel() string
	HighLabel() string
}

Jump to

Keyboard shortcuts

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