@@ -35,9 +35,9 @@ rate of the thread. You cannot load a user space component into the
3535real time space.
3636
3737.loadrt Syntax and Example
38+ [source,{hal}]
3839----
3940loadrt <component> <options>
40-
4141loadrt mux4 count=1
4242----
4343
@@ -93,15 +93,14 @@ Realtime Threads:
9393 and the motion command handler and supports floating point math.
9494
9595.addf Syntax and Example
96+ [source,{hal}]
9697----
9798addf <function> <thread>
98-
9999addf mux4.0 servo-thread
100100----
101101
102102[NOTE]
103- If the component requires a floating point thread that is usually the slower
104- servo-thread.
103+ If the component requires a floating point thread that is usually the slower servo-thread.
105104
106105[[sub:hal-loadusr]]
107106=== loadusr(((HAL loadusr,loadusr)))
@@ -127,11 +126,10 @@ Flags may be one or more of the following:
127126-n:: name a component when it is a valid option for that component.
128127
129128.loadusr Syntax and Examples
129+ [source,{hal}]
130130----
131131loadusr <component> <options>
132-
133132loadusr halui
134-
135133loadusr -Wn spindle gs2_vfd -n spindle
136134----
137135
@@ -148,9 +146,9 @@ a 'net' command line and are not used by the net command. The direction arrows
148146must be separated by a space from the pin names.
149147
150148.net Syntax and Example
149+ [source,{hal}]
151150----
152151net signal-name pin-name <optional arrow> <optional second pin-name>
153-
154152net home-x joint.0.home-sw-in <= parport.0.pin-11-in
155153----
156154
@@ -212,9 +210,9 @@ Parameters can be set before use or while running as needed. You cannot
212210use setp on a pin that is connected to a signal.
213211
214212.setp Syntax and Example
213+ [source,{hal}]
215214----
216215setp <pin/parameter-name> <value>
217-
218216setp parport.0.pin-08-out TRUE
219217----
220218
@@ -224,11 +222,10 @@ setp parport.0.pin-08-out TRUE
224222The command 'sets' sets the value of a signal.
225223
226224.sets Syntax and Example:
225+ [source,{hal}]
227226----
228227sets <signal-name> <value>
229-
230228net mysignal and2.0.in0 pyvcp.my-led
231-
232229sets mysignal 1
233230----
234231
@@ -246,9 +243,9 @@ signal was connected to the pin prior running the command, nothing
246243happens. The 'unlinkp' command is useful for trouble shooting.
247244
248245.unlinkp syntax and Example
246+ [source,{hal}]
249247----
250248unlinkp <pin-name>
251-
252249unlinkp parport.0.pin-02-out
253250----
254251
@@ -264,9 +261,9 @@ The command 'linksp' creates a 'connection' between a signal and one
264261pin.
265262
266263.linksp Syntax and Example
264+ [source,{hal}]
267265----
268266linksp <signal-name> <pin-name>
269-
270267linksp X-step parport.0.pin-02-out
271268----
272269
@@ -278,9 +275,9 @@ The command 'linkps' creates a 'connection' between one pin and one
278275signal. It is the same as linksp but the arguments are reversed.
279276
280277.linkps Syntax and Example
278+ [source,{hal}]
281279----
282280linkps <pin-name> <signal-name>
283-
284281linkps parport.0.pin-02-out X-Step
285282----
286283
@@ -293,9 +290,9 @@ and the data type of <type>. Type must be 'bit', 's32', 'u32' or
293290'float'. Error if <signame> all ready exists.
294291
295292.newsig Syntax and Example
293+ [source,{hal}]
296294----
297295newsig <signame> <type>
298-
299296newsig Xstep bit
300297----
301298
@@ -389,17 +386,17 @@ or the man pages.
389386The 'and2' component is a two input 'and' gate. The truth table below
390387shows the output based on each combination of input.
391388
392- .and2 Syntax
389+ .Syntax
393390----
394391and2 [count=N] | [names=name1[,name2...]]
395392----
396393
397- .and2 Functions
394+ .Functions
398395----
399396and2.n
400397----
401398
402- .and2 Pins
399+ .Pins
403400----
404401and2.N.in0 (bit, in)
405402and2.N.in1 (bit, in)
@@ -421,18 +418,18 @@ and2.N.out (bit, out)
421418
422419The 'not' component is a bit inverter.
423420
424- .not Syntax
421+ .Syntax
425422----
426423not [count=n] | [names=name1[,name2...]]
427424----
428425
429- .not Functions
426+ .Functions
430427----
431428not.all
432429not.n
433430----
434431
435- .not Pins
432+ .Pins
436433----
437434not.n.in (bit, in)
438435not.n.out (bit, out)
@@ -451,17 +448,17 @@ not.n.out (bit, out)
451448
452449The 'or2' component is a two input OR gate.
453450
454- .or2 Syntax
451+ .Syntax
455452----
456453or2[count=n] | [names=name1[,name2...]]
457454----
458455
459- .or2 Functions
456+ .Functions
460457----
461458or2.n
462459----
463460
464- .or2 Pins
461+ .Pins
465462----
466463or2.n.in0 (bit, in)
467464or2.n.in1 (bit, in)
@@ -483,17 +480,17 @@ or2.n.out (bit, out)
483480
484481The 'xor2' component is a two input XOR (exclusive OR) gate.
485482
486- .xor2 Syntax
483+ .Syntax
487484----
488485xor2[count=n] | [names=name1[,name2...]]
489486----
490487
491- .xor2 Functions
488+ .Functions
492489----
493490xor2.n
494491----
495492
496- .xor2 Pins
493+ .Pins
497494----
498495xor2.n.in0 (bit, in)
499496xor2.n.in1 (bit, in)
@@ -514,15 +511,12 @@ xor2.n.out (bit, out)
514511== Logic Examples(((HAL Logic Examples)))
515512
516513.`and2` example connecting two inputs to one output
514+ [source,{hal}]
517515----
518516loadrt and2 count=1
519-
520517addf and2.0 servo-thread
521-
522518net my-sigin1 and2.0.in0 <= parport.0.pin-11-in
523-
524519net my-sigin2 and2.0.in1 <= parport.0.pin-12-in
525-
526520net both-on parport.0.pin-14-out <= and2.0.out
527521----
528522
@@ -545,6 +539,7 @@ to 'binary coded decimal' but with more options. The 'hold' bit interrupts the
545539input processing, so that the 'sum' value no longer changes.
546540
547541.weighted_sum component loading syntax
542+ [source,{hal}]
548543----
549544loadrt weighted_sum wsum_sizes=size[,size,...]
550545----
@@ -554,6 +549,7 @@ Creates groups of `weighted_sum`s, each with the given number of input bits (siz
554549To update the `weighted_sum`, the `process_wsums` must be attached to a thread.
555550
556551.add `process_wsums` function
552+ [source,{hal}]
557553----
558554addf process_wsums servo-thread
559555----
0 commit comments