Added SEEEDUINO Relay Board Support

Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
This commit is contained in:
Bernardo Carvalho
2022-01-24 17:17:07 +00:00
parent f6f5670025
commit ef2a3c2d26
7 changed files with 178 additions and 116 deletions

View File

@@ -401,10 +401,10 @@ record(bo, "$(P)$(R)Clean-PrimPneuBreaker"){
record(bo, "$(P)$(R)GasIS-Valves" ) {
# field(DESC," 2 válvulas pneumáticas de corte do sistema de injecção de H/D/Ne/He no TOK, 24V out = deixa passar")
# record(bo, "$(P)$(R)GISValvesOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B6 PP" )
field( ZNAM, "On" )
field( ONAM, "Off" )
field(VAL,"1")
field( OUT, "$(P)$(R)SEEED4RELAY:17:REGISTER.B0 PP" )
field( ZNAM, "OFF" )
field( ONAM, "ON" )
field(VAL,"0")
}
##########################################

View File

@@ -11,11 +11,13 @@ DB += ISTTOKpcf8591.db
DB += ISTTOKpfeiffer.db
DB += ISTTOKtda8444.db
DB += sendmail.db
DB += seeed4relay.db
DB += pcf8591.proto
DB += tda8444.proto
DB += sendmail.proto
DB += pcf8574.proto
DB += pfeiffer.proto
DB += seeed4relay.proto
# If <anyname>.db template is not named <anyname>*.template add
# <anyname>_TEMPLATE = <templatename>

View File

@@ -0,0 +1,19 @@
##############################################################
# ### Read/Write SEEED Relay Board address 0x11=17 register ##
#############################################################
record( mbboDirect, "$(P)$(R)SEEED4RELAY:$(A):REGISTER") {
#record(longout, "$(P)$(R)SEEED4RELAY:$(A):REGISTER") {
field(DTYP, "stream")
field(OUT, "@seeed4relay.proto wReg($(A)) I2C")
# field(DRVH, "15" )
# field(DRVL, "0" )
field(SHFT, "0")
field(NOBT, "4")
field(VAL, 0)
# field(PINI,"YES")
}
record( mbbiDirect, "$(P)$(R)SEEED4RELAY:$(A):REGISTER:READ") {
field(DTYP, "stream")
field(INP, "@seeed4relay.proto rReg($(A)) I2C")
}

View File

@@ -0,0 +1,29 @@
Terminator = "";
LockTimeout = 500;
ReplyTimeout = 100;
ReadTimeout = 100;
WriteTimeout = 100;
MaxInput = 1;
ExtraInput = Error;
#define CMD_CHANNEL_CTRL 0x10
#define CMD_SAVE_I2C_ADDR 0x11
#define CMD_READ_I2C_ADDR 0x12
#define CMD_READ_FIRMWARE_VER 0x13
rReg {
out ${1} 16;
in "%01r";
}
rFw {
out ${1} 18;
in "%01r";
}
## @init { rReg; }
##
wReg {
out ${1} 16 "%.1r";
}
# @init { out ${1}; in "%.1r"; }