Skip to content

Commit c39a91a

Browse files
committed
Preliminary - HAL types update and HAL isolation
1 parent d0ac241 commit c39a91a

328 files changed

Lines changed: 3695 additions & 4935 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
2.10.0~pre1
1+
2.10.0~pre2
22

configs/apps/gladevcp/complex/complex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def _hal_setup(self,halcomp, builder):
124124

125125
# standard hal pins not associated with any widget
126126
self.halcomp.newpin("example-out", hal.Type.BOOL, hal.Dir.OUT)
127-
self.halcomp.newpin("example-in", hal.HAL_S32, hal.Dir.IN)
127+
self.halcomp.newpin("example-in", hal.Type.SINT, hal.Dir.IN)
128128

129129
# hal pins with change callback. Also unrelated to any HAL widget.
130130
# When the pin's value changes the callback is executed.

configs/attic/unclaimed/plasma-thc/mp1000A.hal

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ loadrt or2 count=9
1616
loadrt scale
1717
loadrt sum2 count=5
1818
loadrt xor2 count=4
19-
loadrt conv_s32_float
19+
loadrt conv_sint_real
2020
loadrt edge count=2
2121

2222
# Attach realtime hal components to a realtime thread
@@ -32,7 +32,7 @@ addf and2.8 servo-thread
3232
addf comp.0 servo-thread
3333
addf comp.1 servo-thread
3434
addf comp.2 servo-thread
35-
addf conv-s32-float.0 servo-thread
35+
addf conv-sint-real.0 servo-thread
3636
addf edge.0 servo-thread
3737
addf edge.1 servo-thread
3838
addf flipflop.0 servo-thread
@@ -178,8 +178,8 @@ net FeedHold xor2.0.out => motion.feed-hold
178178
net CHLSwitched xor2.2.out => and2.1.in1
179179
net ArcOKTimer oneshot.2.out => xor2.1.in0
180180
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
181-
net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
182-
net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
181+
net IgnitionCounterS32 updown.0.count => conv-sint-real.0.in
182+
net IgnitionCounterFloat conv-sint-real.0.out => comp.2.in1
183183
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
184184
net TorchOff not.2.out => flipflop.1.reset
185185
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1

configs/attic/unclaimed/plasma-thc/mp1000B.hal

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ loadrt or2 count=9
1616
loadrt scale
1717
loadrt sum2 count=5
1818
loadrt xor2 count=4
19-
loadrt conv_s32_float
19+
loadrt conv_sint_real
2020
loadrt edge count=2
2121

2222
# Attach realtime hal components to a realtime thread
@@ -32,7 +32,7 @@ addf and2.8 servo-thread
3232
addf comp.0 servo-thread
3333
addf comp.1 servo-thread
3434
addf comp.2 servo-thread
35-
addf conv-s32-float.0 servo-thread
35+
addf conv-sint-real.0 servo-thread
3636
addf edge.0 servo-thread
3737
addf edge.1 servo-thread
3838
addf flipflop.0 servo-thread
@@ -178,8 +178,8 @@ net FeedHold xor2.0.out => motion.feed-hold
178178
net CHLSwitched xor2.2.out => and2.1.in1
179179
net ArcOKTimer oneshot.2.out => xor2.1.in0
180180
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
181-
net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
182-
net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
181+
net IgnitionCounterS32 updown.0.count => conv-sint-real.0.in
182+
net IgnitionCounterFloat conv-sint-real.0.out => comp.2.in1
183183
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
184184
net TorchOff not.2.out => flipflop.1.reset
185185
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1

configs/attic/unclaimed/plasma-thc/thc300.hal

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ loadrt or2 count=9
1616
loadrt scale
1717
loadrt sum2 count=5
1818
loadrt xor2 count=4
19-
loadrt conv_s32_float
19+
loadrt conv_sint_real
2020
loadrt edge count=2
2121

2222
# Attach realtime hal components to a realtime thread
@@ -32,7 +32,7 @@ addf and2.8 servo-thread
3232
addf comp.0 servo-thread
3333
addf comp.1 servo-thread
3434
addf comp.2 servo-thread
35-
addf conv-s32-float.0 servo-thread
35+
addf conv-sint-real.0 servo-thread
3636
addf edge.0 servo-thread
3737
addf edge.1 servo-thread
3838
addf flipflop.0 servo-thread
@@ -178,8 +178,8 @@ net FeedHold xor2.0.out => motion.feed-hold
178178
net CHLSwitched xor2.2.out => and2.1.in1
179179
net ArcOKTimer oneshot.2.out => xor2.1.in0
180180
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
181-
net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
182-
net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
181+
net IgnitionCounterS32 updown.0.count => conv-sint-real.0.in
182+
net IgnitionCounterFloat conv-sint-real.0.out => comp.2.in1
183183
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
184184
net TorchOff not.2.out => flipflop.1.reset
185185
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1

configs/by_interface/mesa/hm2-modbus/bldc_and_wavebox.mbccs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@
2828
<command device="dummy" function="W_COIL" address="0x0000" noanswer="1"><data value="0xff00" /></command>
2929
</initlist>
3030
<commands> <!-- Command function sequences and HAL pin assignments -->
31-
<command device="bldc" function="R_REGISTERS" address="0x0020" modbustype="U_AB" haltype="S32" scale="1">
31+
<command device="bldc" function="R_REGISTERS" address="0x0020" modbustype="U_AB" haltype="SINT" scale="1">
3232
<pin name="rtpwm"/>
3333
<pin name="rtcurrent"/>
3434
<pin name="comfreq" modbustype="S_AB"/>
3535
<pin skip="1" />
3636
<pin name="rtpos" modbustype="S_ABCD" scale="0"/>
3737
</command>
3838
<!-- Gives us the following pins:
39-
- hm2_modbus.0.bldc.rtpwm (out, s32) (range [0..65535])
40-
- hm2_modbus.0.bldc.rtpwm.offset (in, u64)
41-
- hm2_modbus.0.bldc.rtpwm.scale (in, float) (must be set to 0.1)
42-
- hm2_modbus.0.bldc.rtpwm.scaled (out, float)
43-
- hm2_modbus.0.bldc.rtcurrent (out, s32) (range [0..65535])
44-
- hm2_modbus.0.bldc.rtcurrent.offset (in, u64)
45-
- hm2_modbus.0.bldc.rtcurrent.scale (in, float) (must be set to 0.01)
46-
- hm2_modbus.0.bldc.rtcurrent.scaled (out, float)
47-
- hm2_modbus.0.bldc.comfreq (out, s32) (range [-32768..+32767])
48-
- hm2_modbus.0.bldc.comfreq.offset (in, s64)
49-
- hm2_modbus.0.bldc.comfreq.scale (in, float) (must be set to 0.1)
50-
- hm2_modbus.0.bldc.comfreq.scaled (out, float)
51-
- hm2_modbus.0.bldc.rtpos (out, s32) (range [-2147483648..+2147483647])
39+
- hm2_modbus.0.bldc.rtpwm (out, sint) (range [0..65535])
40+
- hm2_modbus.0.bldc.rtpwm.offset (in, uint)
41+
- hm2_modbus.0.bldc.rtpwm.scale (in, real) (must be set to 0.1)
42+
- hm2_modbus.0.bldc.rtpwm.scaled (out, real)
43+
- hm2_modbus.0.bldc.rtcurrent (out, sint) (range [0..65535])
44+
- hm2_modbus.0.bldc.rtcurrent.offset (in, uint)
45+
- hm2_modbus.0.bldc.rtcurrent.scale (in, real) (must be set to 0.01)
46+
- hm2_modbus.0.bldc.rtcurrent.scaled (out, real)
47+
- hm2_modbus.0.bldc.comfreq (out, sint) (range [-32768..+32767])
48+
- hm2_modbus.0.bldc.comfreq.offset (in, sint)
49+
- hm2_modbus.0.bldc.comfreq.scale (in, real) (must be set to 0.1)
50+
- hm2_modbus.0.bldc.comfreq.scaled (out, real)
51+
- hm2_modbus.0.bldc.rtpos (out, sint) (range [-2147483648..+2147483647])
5252
5353
The start will be suspended (see top). The .scale pins will be set in
5454
the hal-file. Offset pins are automatically initialized to zero.
@@ -58,9 +58,9 @@
5858
<command device="wavebox" function="R_INPUTS" address="0x0000" count="8" name="switch" />
5959
<!-- Gives us the following pins:
6060
- Eight switch inputs on the box are HAL output pins
61-
* hm2_modbus.0.wavebox.switch-00 (out, HAL_BIT)
61+
* hm2_modbus.0.wavebox.switch-00 (out, HAL_BOOL)
6262
* ...
63-
* hm2_modbus.0.wavebox.switch-07 (out, HAL_BIT)
63+
* hm2_modbus.0.wavebox.switch-07 (out, HAL_BOOL)
6464
-->
6565

6666
<!--
@@ -74,9 +74,9 @@
7474
<command device="wavebox" function="W_COILS" address="0x0000" count="8" name="relay" />
7575
<!-- Gives us the following pins:
7676
- Eight relay outputs on the box are HAL input pins
77-
* hm2_modbus.0.wavebox.relay-00 (in, HAL_BIT)
77+
* hm2_modbus.0.wavebox.relay-00 (in, HAL_BOOL)
7878
* ...
79-
* hm2_modbus.0.wavebox.relay-07 (in, HAL_BIT)
79+
* hm2_modbus.0.wavebox.relay-07 (in, HAL_BOOL)
8080
-->
8181
</commands>
8282
</mesamodbus>

configs/by_interface/mesa/hm2-modbus/brushless-dc-motor-driver.mbccs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,27 @@
3636
<command device="dummy" function="W_COIL" address="0x0000" noanswer="1"><data value="0xff00" /></command>
3737
</initlist>
3838
<commands> <!-- Command function sequences and HAL pin assignments -->
39-
<command device="bldc" function="R_REGISTERS" address="0x0020" modbustype="U_AB" haltype="S32" scale="1">
39+
<command device="bldc" function="R_REGISTERS" address="0x0020" modbustype="U_AB" haltype="SINT" scale="1">
4040
<pin name="rtpwm"/>
4141
<pin name="rtcurrent"/>
4242
<pin name="comfreq" modbustype="S_AB"/>
4343
<pin skip="1" />
4444
<pin name="rtpos" modbustype="S_ABCD" scale="0"/>
4545
</command>
4646
<!-- Gives us the following pins:
47-
- hm2_modbus.0.bldc.rtpwm (out, s32) (range [0..65535])
48-
- hm2_modbus.0.bldc.rtpwm.offset (in, u64)
49-
- hm2_modbus.0.bldc.rtpwm.scale (in, float) (must be set to 0.1)
50-
- hm2_modbus.0.bldc.rtpwm.scaled (out, float)
51-
- hm2_modbus.0.bldc.rtcurrent (out, s32) (range [0..65535])
52-
- hm2_modbus.0.bldc.rtcurrent.offset (in, u64)
53-
- hm2_modbus.0.bldc.rtcurrent.scale (in, float) (must be set to 0.01)
54-
- hm2_modbus.0.bldc.rtcurrent.scaled (out, float)
55-
- hm2_modbus.0.bldc.comfreq (out, s32) (range [-32768..+32767])
56-
- hm2_modbus.0.bldc.comfreq.offset (in, s64)
57-
- hm2_modbus.0.bldc.comfreq.scale (in, float) (must be set to 0.1)
58-
- hm2_modbus.0.bldc.comfreq.scaled (out, float)
59-
- hm2_modbus.0.bldc.rtpos (out, s32) (range [-2147483648..+2147483647])
47+
- hm2_modbus.0.bldc.rtpwm (out, sint) (range [0..65535])
48+
- hm2_modbus.0.bldc.rtpwm.offset (in, uint)
49+
- hm2_modbus.0.bldc.rtpwm.scale (in, real) (must be set to 0.1)
50+
- hm2_modbus.0.bldc.rtpwm.scaled (out, real)
51+
- hm2_modbus.0.bldc.rtcurrent (out, sint) (range [0..65535])
52+
- hm2_modbus.0.bldc.rtcurrent.offset (in, uint)
53+
- hm2_modbus.0.bldc.rtcurrent.scale (in, real) (must be set to 0.01)
54+
- hm2_modbus.0.bldc.rtcurrent.scaled (out, real)
55+
- hm2_modbus.0.bldc.comfreq (out, sint) (range [-32768..+32767])
56+
- hm2_modbus.0.bldc.comfreq.offset (in, sint)
57+
- hm2_modbus.0.bldc.comfreq.scale (in, real) (must be set to 0.1)
58+
- hm2_modbus.0.bldc.comfreq.scaled (out, real)
59+
- hm2_modbus.0.bldc.rtpos (out, sint) (range [-2147483648..+2147483647])
6060
6161
The start will be suspended (see top). The .scale pins will be set in
6262
the hal-file. Offset pins are automatically initialized to zero.

configs/by_interface/mesa/hm2-modbus/hm2-stepper-eth-modbus.hal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ addf estop-latch.0 servo-thread
6262
# ################
6363

6464
# axis enable chain
65-
newsig emcmot.00.enable bit
65+
newsig emcmot.00.enable bool
6666
sets emcmot.00.enable FALSE
6767

6868
net emcmot.00.enable <= joint.0.amp-enable-out
@@ -97,7 +97,7 @@ setp hm2_[HOSTMOT2](BOARD).0.stepgen.00.step_type 0
9797
# ################
9898

9999
# axis enable chain
100-
newsig emcmot.01.enable bit
100+
newsig emcmot.01.enable bool
101101
sets emcmot.01.enable FALSE
102102

103103
net emcmot.01.enable <= joint.1.amp-enable-out
@@ -132,7 +132,7 @@ setp hm2_[HOSTMOT2](BOARD).0.stepgen.01.step_type 0
132132
# ################
133133

134134
# axis enable chain
135-
newsig emcmot.02.enable bit
135+
newsig emcmot.02.enable bool
136136
sets emcmot.02.enable FALSE
137137

138138
net emcmot.02.enable <= joint.2.amp-enable-out

configs/by_interface/mesa/hm2-modbus/rs485io.mbccs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
<initlist>
77
</initlist>
88
<commands>
9-
<command device="rs485io" address="0x1000" function="R_REGISTERS" modbustype="U_ABCD" haltype="HAL_U32" name="potu" count="2" />
10-
<command device="rs485io" address="0x2000" function="R_REGISTERS" modbustype="S_ABCD" haltype="HAL_S32" name="pots" count="2" />
11-
<command device="rs485io" address="0x3000" function="R_REGISTERS" modbustype="F_ABCD" haltype="HAL_FLOAT" name="potf" count="2" />
12-
<command device="rs485io" address="0x4000" function="R_REGISTERS" modbustype="F_HGFEDCBA" haltype="HAL_FLOAT" name="potd" count="1" />
9+
<command device="rs485io" address="0x1000" function="R_REGISTERS" modbustype="U_ABCD" haltype="UINT" name="potu" count="2" />
10+
<command device="rs485io" address="0x2000" function="R_REGISTERS" modbustype="S_ABCD" haltype="SINT" name="pots" count="2" />
11+
<command device="rs485io" address="0x3000" function="R_REGISTERS" modbustype="F_ABCD" haltype="REAL" name="potf" count="2" />
12+
<command device="rs485io" address="0x4000" function="R_REGISTERS" modbustype="F_HGFEDCBA" haltype="REAL" name="potd" count="1" />
1313
<command device="rs485io" address="0x0000" function="R_INPUTS" name="button" count="4" />
1414
<command device="rs485io" address="0x0000" function="W_COILS" name="led" count="6" />
1515
</commands>

configs/by_interface/mesa/hm2-servo/hm2-servo-eth.hal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ addf hm2_[HOSTMOT2](BOARD).0.write servo-thread
7171
# ################
7272

7373
# axis enable chain
74-
newsig emcmot.00.enable bit
74+
newsig emcmot.00.enable bool
7575
sets emcmot.00.enable FALSE
7676
net emcmot.00.enable => pid.0.enable
7777
net emcmot.00.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.00.enable
@@ -112,7 +112,7 @@ net motor.00.command pid.0.output => hm2_[HOSTMOT2](BOARD).0.pwmgen.00.value
112112
# ################
113113

114114
# axis enable chain
115-
newsig emcmot.01.enable bit
115+
newsig emcmot.01.enable bool
116116
sets emcmot.01.enable FALSE
117117
net emcmot.01.enable => pid.1.enable
118118
net emcmot.01.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.01.enable
@@ -153,7 +153,7 @@ net motor.01.command pid.1.output => hm2_[HOSTMOT2](BOARD).0.pwmgen.01.value
153153
# ################
154154

155155
# axis enable chain
156-
newsig emcmot.02.enable bit
156+
newsig emcmot.02.enable bool
157157
sets emcmot.02.enable FALSE
158158
net emcmot.02.enable => pid.2.enable
159159
net emcmot.02.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.02.enable

0 commit comments

Comments
 (0)