switchmachine

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MotorStateIdle   MotorState = 0
	MotorStateToPos0 MotorState = 1
	MotorStateToPos1 MotorState = 2
	MotorStateBrake  MotorState = 3

	Position0       Position = 0
	Position1       Position = 1
	PositionUnknown Position = 2

	GPIOOn  GPIOState = true
	GPIOOFF GPIOState = false
)

Variables

This section is empty.

Functions

func StateToString

func StateToString(state State) string

----------------------------------- Printing functions for convience

func StatesEqual

func StatesEqual(sm1, sm2 State) bool

Types

type GPIOState

type GPIOState bool

type Id

type Id uint16

type MotorState

type MotorState uint8

type Position

type Position uint8

type State

type State interface {
	Id() Id
	Position() Position
	MotorState() MotorState
	GPIO0State() GPIOState
	GPIO1State() GPIOState
	UpdateTime() time.Time
}

func NewState

func NewState(id Id, pos Position, m MotorState, g0, g1 GPIOState) State

Jump to

Keyboard shortcuts

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