p1am

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: BSD-3-Clause Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const ACTIVE_HDR = 0x04
View Source
const ANALOG_IN_BLOCK = 1
View Source
const ANALOG_OUT_BLOCK = 3
View Source
const BURNOUT_STATUS = 5
View Source
const CFG_HDR = 0x10
View Source
const CONFIGWD_HDR = 0x33
View Source
const DISCRETE_IN_BLOCK = 0
View Source
const DISCRETE_OUT_BLOCK = 2
View Source
const DROPOUT_HDR = 0x05
View Source
const DUMMY = 0xFF
View Source
const EMPTY_SLOT_ID = 0xFFFFFFFE
View Source
const FW_UPDATE_HDR = 0xAA
View Source
const HOLD = 0x00
View Source
const MAX_TIMEOUT = 0xFFFFFFFF
View Source
const MISSING24V_STATUS = 3
View Source
const MOD_HDR = 0x02
View Source
const NUMBER_OF_MODULES = 15 //Current max 15 Modules
View Source
const OVER_RANGE_STATUS = 11
View Source
const PETWD_HDR = 0x30
View Source
const READ_ANALOG_HDR = 0x51
View Source
const READ_BLOCK_HDR = 0x52
View Source
const READ_CFG_HDR = 0x11
View Source
const READ_DISCRETE_HDR = 0x50
View Source
const READ_STATUS_HDR = 0x40
View Source
const STARTWD_HDR = 0x31
View Source
const STATUS_IN_BLOCK = 4
View Source
const STOPWD_HDR = 0x32
View Source
const SWITCH_BUILTIN = 31
View Source
const TOGGLE = 0x01
View Source
const UNDER_RANGE_STATUS = 7
View Source
const VERSION_HDR = 0x03
View Source
const WRITE_ANALOG_HDR = 0x61
View Source
const WRITE_BLOCK_HDR = 0x62
View Source
const WRITE_DISCRETE_HDR = 0x60

Variables

View Source
var Controller = P1AM{
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type Channel

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

func (Channel) ReadDiscrete

func (c Channel) ReadDiscrete() (bool, error)

func (Channel) WriteDiscrete

func (c Channel) WriteDiscrete(value bool) error

type ModuleProps

type ModuleProps struct {
	ModuleID                                 uint32
	DI, DO, AI, AO, Status, Config, DataSize byte
	Name                                     string
}

type P1AM

type P1AM struct {

	// SkipAutoConfig will skip loading a default configuration into each module.
	SkipAutoConfig bool

	Slots int
	// contains filtered or unexported fields
}

func (*P1AM) Active

func (p *P1AM) Active() (bool, error)

func (*P1AM) ConfigureWatchdog

func (p *P1AM) ConfigureWatchdog(interval time.Duration, reset bool) error

func (*P1AM) Initialize

func (p *P1AM) Initialize() error

func (*P1AM) PetWatchdog

func (p *P1AM) PetWatchdog() error

func (*P1AM) Read

func (p *P1AM) Read(data []byte) (int, error)

func (*P1AM) SetEnabled

func (p *P1AM) SetEnabled(enabled bool)

func (*P1AM) Slot

func (p *P1AM) Slot(i int) *Slot

func (*P1AM) StartWatchdog

func (p *P1AM) StartWatchdog() error

func (*P1AM) StopWatchdog

func (p *P1AM) StopWatchdog() error

func (*P1AM) Version

func (p *P1AM) Version() ([3]byte, error)

func (*P1AM) Write

func (p *P1AM) Write(data []byte) (int, error)

type Slot

type Slot struct {
	ID uint32
	// TODO: Embed this?
	Props *ModuleProps
	// contains filtered or unexported fields
}

func (*Slot) Channel

func (s *Slot) Channel(channel int) Channel

func (*Slot) Configure

func (s *Slot) Configure(data []byte) error

func (*Slot) ReadDiscrete

func (s *Slot) ReadDiscrete() (uint32, error)

func (*Slot) WriteDiscrete

func (s *Slot) WriteDiscrete(value uint32) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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