Skip to content

Commit b6ea7d8

Browse files
committed
docs: improved formatting in basic-hal.adoc
1 parent 6cfd6d6 commit b6ea7d8

1 file changed

Lines changed: 26 additions & 30 deletions

File tree

docs/src/hal/basic-hal.adoc

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ rate of the thread. You cannot load a user space component into the
3535
real time space.
3636

3737
.loadrt Syntax and Example
38+
[source,{hal}]
3839
----
3940
loadrt <component> <options>
40-
4141
loadrt 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
----
9798
addf <function> <thread>
98-
9999
addf 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
----
131131
loadusr <component> <options>
132-
133132
loadusr halui
134-
135133
loadusr -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
148146
must be separated by a space from the pin names.
149147

150148
.net Syntax and Example
149+
[source,{hal}]
151150
----
152151
net signal-name pin-name <optional arrow> <optional second pin-name>
153-
154152
net 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
212210
use setp on a pin that is connected to a signal.
213211

214212
.setp Syntax and Example
213+
[source,{hal}]
215214
----
216215
setp <pin/parameter-name> <value>
217-
218216
setp parport.0.pin-08-out TRUE
219217
----
220218

@@ -224,11 +222,10 @@ setp parport.0.pin-08-out TRUE
224222
The command 'sets' sets the value of a signal.
225223

226224
.sets Syntax and Example:
225+
[source,{hal}]
227226
----
228227
sets <signal-name> <value>
229-
230228
net mysignal and2.0.in0 pyvcp.my-led
231-
232229
sets mysignal 1
233230
----
234231

@@ -246,9 +243,9 @@ signal was connected to the pin prior running the command, nothing
246243
happens. The 'unlinkp' command is useful for trouble shooting.
247244

248245
.unlinkp syntax and Example
246+
[source,{hal}]
249247
----
250248
unlinkp <pin-name>
251-
252249
unlinkp parport.0.pin-02-out
253250
----
254251

@@ -264,9 +261,9 @@ The command 'linksp' creates a 'connection' between a signal and one
264261
pin.
265262

266263
.linksp Syntax and Example
264+
[source,{hal}]
267265
----
268266
linksp <signal-name> <pin-name>
269-
270267
linksp X-step parport.0.pin-02-out
271268
----
272269

@@ -278,9 +275,9 @@ The command 'linkps' creates a 'connection' between one pin and one
278275
signal. It is the same as linksp but the arguments are reversed.
279276

280277
.linkps Syntax and Example
278+
[source,{hal}]
281279
----
282280
linkps <pin-name> <signal-name>
283-
284281
linkps 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
----
297295
newsig <signame> <type>
298-
299296
newsig Xstep bit
300297
----
301298

@@ -389,17 +386,17 @@ or the man pages.
389386
The 'and2' component is a two input 'and' gate. The truth table below
390387
shows the output based on each combination of input.
391388

392-
.and2 Syntax
389+
.Syntax
393390
----
394391
and2 [count=N] | [names=name1[,name2...]]
395392
----
396393

397-
.and2 Functions
394+
.Functions
398395
----
399396
and2.n
400397
----
401398

402-
.and2 Pins
399+
.Pins
403400
----
404401
and2.N.in0 (bit, in)
405402
and2.N.in1 (bit, in)
@@ -421,18 +418,18 @@ and2.N.out (bit, out)
421418

422419
The 'not' component is a bit inverter.
423420

424-
.not Syntax
421+
.Syntax
425422
----
426423
not [count=n] | [names=name1[,name2...]]
427424
----
428425

429-
.not Functions
426+
.Functions
430427
----
431428
not.all
432429
not.n
433430
----
434431

435-
.not Pins
432+
.Pins
436433
----
437434
not.n.in (bit, in)
438435
not.n.out (bit, out)
@@ -451,17 +448,17 @@ not.n.out (bit, out)
451448

452449
The 'or2' component is a two input OR gate.
453450

454-
.or2 Syntax
451+
.Syntax
455452
----
456453
or2[count=n] | [names=name1[,name2...]]
457454
----
458455

459-
.or2 Functions
456+
.Functions
460457
----
461458
or2.n
462459
----
463460

464-
.or2 Pins
461+
.Pins
465462
----
466463
or2.n.in0 (bit, in)
467464
or2.n.in1 (bit, in)
@@ -483,17 +480,17 @@ or2.n.out (bit, out)
483480

484481
The 'xor2' component is a two input XOR (exclusive OR) gate.
485482

486-
.xor2 Syntax
483+
.Syntax
487484
----
488485
xor2[count=n] | [names=name1[,name2...]]
489486
----
490487

491-
.xor2 Functions
488+
.Functions
492489
----
493490
xor2.n
494491
----
495492

496-
.xor2 Pins
493+
.Pins
497494
----
498495
xor2.n.in0 (bit, in)
499496
xor2.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
----
518516
loadrt and2 count=1
519-
520517
addf and2.0 servo-thread
521-
522518
net my-sigin1 and2.0.in0 <= parport.0.pin-11-in
523-
524519
net my-sigin2 and2.0.in1 <= parport.0.pin-12-in
525-
526520
net 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
545539
input processing, so that the 'sum' value no longer changes.
546540

547541
.weighted_sum component loading syntax
542+
[source,{hal}]
548543
----
549544
loadrt 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
554549
To update the `weighted_sum`, the `process_wsums` must be attached to a thread.
555550

556551
.add `process_wsums` function
552+
[source,{hal}]
557553
----
558554
addf process_wsums servo-thread
559555
----

0 commit comments

Comments
 (0)