-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTicketMach.simul
58 lines (46 loc) · 1.12 KB
/
TicketMach.simul
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
## --- Modules ---
## Additional packages with Hardware to Simulator
package isel.leic.simul.ticket # for Modules used in TicketMachine
# Generic modules to activate from Simulator
kit = UsbPort ; "Usbport"
kbd = Keyboard("0123456789.^AODv",4,4) ; 1?oe
lcd = LCD ; "Display"
m = Switch ; "Support Interface" ; setLabel("Manut")
# Custom modules from isel.leic.simul.ticket
kb = KeyBuffer ; "Key Buffer"
sr = SerialReceiver ; "Serial Receiver"
dsp = Dispatcher ; "Dispatcher"
ca = CoinAcceptor ; "Acceptor"
tp = TicketPrinter ; "Printer"
## --- Links ---
# Key buffer and Key Decode
kb.DAC -> kbd.ack
kbd.val -> kb.DAV
kbd.K[0:3] -> kb.D[0:3]
kb.Dval -> kit.I4
kit.O0 -> kb.ACK
kb.K[0:3] -> kit.I[0:3]
# Serial Receiver
sr.busy -> kit.I5
kit.O1 -> sr.SCLK
kit.O2 -> sr.SDX
kit.O3 -> sr.~SS
# Dispatcher
sr.DXval -> dsp.Dval
sr.D[0:9] -> dsp.I[0:9]
dsp.done -> sr.accept
# LCD
dsp.WrL -> lcd.e
dsp.D0 -> lcd.rs
dsp.D[1:8] -> lcd.D[0:7]
# Printer
tp.Fn -> dsp.Fsh
dsp.WrT -> tp.print
dsp.D[0:4] -> tp.TId[0:4]
# Coin Acceptor
kit.O4 -> ca.accept
kit.O5 -> ca.eject
kit.O6 -> ca.collect
ca.Coin -> kit.I6
# Manut switch
m.out -> kit.I7