Relay8Module

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Relay8Module

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

This struct represents the Signal Relays Module connected via eMOD bus to the controller module. The Relays Module has 8 independent signal relays that you can activate or deactivate each one separately. Moreover, a timeout configuration parameter can be set to generate one shot relay pulse automatically. If timeout is set to 0, relay stays in the current state.

func NewRelay8Module

func NewRelay8Module() *Relay8Module

Allocates internal memory and returns an instance of the module

func (*Relay8Module) Activate

func (r *Relay8Module) Activate(relay_mask byte) error

Activates a relay or set of relays.

func (*Relay8Module) ActivateAll

func (r *Relay8Module) ActivateAll() error

Activates all module relays.

func (*Relay8Module) ConfigPulseWidth

func (r *Relay8Module) ConfigPulseWidth(relay_mask byte, width_ms uint32) error

Configure pulse width of a relay o list of relays. When pulse width is 0 a relay stays in the current state, and there is no pulse.

func (*Relay8Module) Deactivate

func (r *Relay8Module) Deactivate(relay_mask byte) error

Deactivates a relay or set of relays.

func (*Relay8Module) DeactivateAll

func (r *Relay8Module) DeactivateAll() error

Deactivates all module relays.

func (*Relay8Module) Destroy

func (r *Relay8Module) Destroy()

Free the internal memory of the module. The instance can't be used anymore after that.

func (*Relay8Module) GetAllRelayStatus

func (r *Relay8Module) GetAllRelayStatus() (byte, error)

Gets all relay status.

func (*Relay8Module) GetRelayStatus

func (r *Relay8Module) GetRelayStatus(relay_mask byte) (byte, error)

Gets a relay status.

func (*Relay8Module) Init

func (r *Relay8Module) Init() error

Initialize module. It is important to emphasize that this method is mandatory to be called. It can be called several times, each of which the module is initialized again.

func (*Relay8Module) InitModuleNumber

func (r *Relay8Module) InitModuleNumber(module_number uint8) error

Same as Init(), but allows to initialize a specific module number instead of the first one.

Jump to

Keyboard shortcuts

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