Documentation ¶
Index ¶
- Constants
- type Relay8Module
- func (r *Relay8Module) Activate(relay_mask byte) error
- func (r *Relay8Module) ActivateAll() error
- func (r *Relay8Module) ConfigPulseWidth(relay_mask byte, width_ms uint32) error
- func (r *Relay8Module) Deactivate(relay_mask byte) error
- func (r *Relay8Module) DeactivateAll() error
- func (r *Relay8Module) Destroy()
- func (r *Relay8Module) GetAllRelayStatus() (byte, error)
- func (r *Relay8Module) GetRelayStatus(relay_mask byte) (byte, error)
- func (r *Relay8Module) Init() error
- func (r *Relay8Module) InitModuleNumber(module_number uint8) error
Constants ¶
const ( RELAY1 byte = byte(C.Relay8Module_RELAY1) RELAY2 byte = byte(C.Relay8Module_RELAY2) RELAY3 byte = byte(C.Relay8Module_RELAY3) RELAY4 byte = byte(C.Relay8Module_RELAY4) RELAY5 byte = byte(C.Relay8Module_RELAY5) RELAY6 byte = byte(C.Relay8Module_RELAY6) RELAY7 byte = byte(C.Relay8Module_RELAY7) RELAY8 byte = byte(C.Relay8Module_RELAY8) ALL_RELAY byte = byte(C.Relay8Module_ALL_RELAY) NUMBER_OF_RELAYS byte = byte(C.Relay8Module_NUMBER_OF_RELAYS) )
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.