sourcelibs/Uart/demos/loopback.xtl
1⍝!/usr/bin/env xetal
2⍝ "Hi" (72 105) through a transmitter wired to a receiver, at 3 clocks
3⍝ per bit: the line clock by clock (1 idle; each byte a start bit, its
4⍝ eight data bits low first, a stop bit), then the bytes the receiver
5⍝ logged and how many. Run with "just demo-lib Uart loopback".
6ᵘᵃ⁼u̲se< "Uart"
7ᶜᵏ⁼u̲se< "Clocked"
8ᵘl̲oop ← ᵘᵃl̲oopback 3
9trace ← ᵘᵃLoopIdle 'ᵘl̲oop ᶜᵏt̲race 3 ᵘᵃc̲ommands 72 105
10ᵘᵃl̲ines trace
11s ← f̲irst -1 t̲ake trace
124 t̲ake 10 d̲rop s
1315 s̲elect s