#include <Relay.h>
|
short | debug () |
|
short | info (short val0, short val1) |
|
short | loop () |
|
short | onRegisterMethods (Bridge *bridge) |
|
| Relay (Component *owner, short _pin, short _id, short _addr, short _val=0) |
|
short | set (int val) |
|
short | setup () |
|
Definition at line 17 of file Relay.h.
◆ Relay()
Relay::Relay |
( |
Component * |
owner, |
|
|
short |
_pin, |
|
|
short |
_id, |
|
|
short |
_addr, |
|
|
short |
_val = 0 |
|
) |
| |
|
inline |
Definition at line 21 of file Relay.h.
26 : ModbusValue<bool>(_addr, MB_FC::MB_FC_READ_COILS),
27 Component(
"MB_Relay", _id, Component::COMPONENT_DEFAULT, owner),
33 SBI(nFlags, OBJECT_NET_CAPS::E_NCAPS_MODBUS);
34 setRegisterMode(MB_REGISTER_MODE::E_MB_REGISTER_MODE_READ_WRITE);
◆ debug()
◆ info()
short Relay::info |
( |
short |
val0, |
|
|
short |
val1 |
|
) |
| |
|
inline |
Definition at line 37 of file Relay.h.
39 Log.verboseln(
"Relay::info - Pin=%d | Key=%d | Addr=%d | Val=%d | NetVal=%d ",
pin,
id, addr,
value, netVal());
◆ loop()
◆ onRegisterMethods()
short Relay::onRegisterMethods |
( |
Bridge * |
bridge | ) |
|
|
inline |
Definition at line 87 of file Relay.h.
89 bridge->registerMemberFunction(
id,
this, C_STR(
"set"), (ComponentFnPtr)&
Relay::set);
90 bridge->registerMemberFunction(
id,
this, C_STR(
"info"), (ComponentFnPtr)&
Relay::info);
91 bridge->registerMemberFunction(
id,
this, C_STR(
"setFlag"), (ComponentFnPtr)&Relay::setFlag);
◆ set()
short Relay::set |
( |
int |
val | ) |
|
|
inline |
Definition at line 61 of file Relay.h.
64 #ifdef PLATFORM_PORTENTA_H7_M7
67 digital_outputs.set(
pin, HIGH);
68 Log.verbose(F(
"Relay:set pin=%d value=%d" CR),
pin, _value);
72 digital_outputs.set(
pin, LOW);
73 Log.verbose(F(
"Relay:set pin=%d value=%d" CR),
pin, _value);
77 #ifdef PLATFORM_CONTROLLINO_MEGA
78 digitalWrite(
pin, val ? HIGH : LOW);
80 if (netVal() !=
value)
◆ setup()
Definition at line 47 of file Relay.h.
49 #ifdef PLATFORM_PORTENTA_H7_M7
◆ pin
◆ value
The documentation for this class was generated from the following file: