summaryrefslogtreecommitdiffstats
path: root/tests/tc700_hardware/raspberrypi/rpigpio.awlpro
blob: ec3dfb37f69cfa389dffb1470951b49d197b34a6 (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Awlsim project file generated by awlsim-0.69.0-pre -->
<awlsim_project date_create="2016-03-16 00:00:00.000000"
                date_modify="2019-01-15 19:06:25.218935"
                format_version="1">
	<!-- CPU core configuration -->
	<cpu>
		<!-- CPU core feature specification -->
		<specs call_stack_size="256"
		       nr_accus="2"
		       nr_counters="256"
		       nr_flags="2048"
		       nr_inputs="128"
		       nr_localbytes="1024"
		       nr_outputs="128"
		       nr_timers="256"
		       parenthesis_stack_size="7" />

		<!-- CPU core configuration -->
		<config clock_memory_byte="-1"
		        cycle_time_limit_us="1000000"
		        ext_insns_enable="1"
		        mnemonics="0"
		        ob_startinfo_enable="0"
		        run_time_limit_us="-1" />
	</cpu>

	<!-- AWL/STL language configuration -->
	<language_awl>
		<!-- AWL/STL source code -->
		<source enabled="1"
		        name="main"
		        type="0"><![CDATA[
ORGANIZATION_BLOCK OB 1
BEGIN
	// This test only works with the fake RPi.GPIO module
	// that directly wires outputs to inputs.

	L		MW 0
	L		0
	==I
	SPB		zero

	L		EW 16
	__ASSERT==	__ACCU 1,	W#16#0302
	SPA		out

zero:	L		EW 16
	__ASSERT==	__ACCU 1,	W#16#0000
	SPA		out


out:	L		MW 0
	XOW		W#16#FFFF
	T		MW 0
	T		AW 16


	L		MW 16
	+		1
	T		MW 16
	L		32
	<I
	BEB
	CALL		SFC 46
END_ORGANIZATION_BLOCK


ORGANIZATION_BLOCK OB 100
BEGIN
	// Test direct-I/O
	// This test only works with the fake RPi.GPIO module
	// that directly wires outputs to inputs.
	// Only E16.0, E16.1 and E17.1 are used in hw config.
	// All other bits read as 0.
	L		PEW 16
	__ASSERT==	__ACCU 1,	W#16#0000
	L		PEB 16
	__ASSERT==	__ACCU 1,	W#16#00
	L		PEB 17
	__ASSERT==	__ACCU 1,	W#16#00
	L		W#16#FFFF
	T		PAW 16
	L		PEW 16
	__ASSERT==	__ACCU 1,	W#16#0302
	L		PEB 16
	__ASSERT==	__ACCU 1,	W#16#03
	L		PEB 17
	__ASSERT==	__ACCU 1,	W#16#02
	L		0
	T		PAB 16
	L		PEW 16
	__ASSERT==	__ACCU 1,	W#16#0002
	L		PEB 16
	__ASSERT==	__ACCU 1,	W#16#00
	L		PEB 17
	__ASSERT==	__ACCU 1,	W#16#02
	L		0
	T		PAB 17
	L		PEW 16
	__ASSERT==	__ACCU 1,	W#16#0000
	L		PEB 16
	__ASSERT==	__ACCU 1,	W#16#00
	L		PEB 17
	__ASSERT==	__ACCU 1,	W#16#00


	// Initialize state for OB 1
	L		0
	T		MW 0
	T		MW 16
	T		AW 16
END_ORGANIZATION_BLOCK

]]></source>
	</language_awl>

	<!-- Symbol table configuration -->
	<symbols>
		<!-- symbol table source code -->
		<source enabled="1"
		        name="Main table"
		        type="3"><![CDATA[

]]></source>
	</symbols>

	<!-- Core server link configuration -->
	<core_link>
		<!-- Locally spawned core server -->
		<spawn_local enable="1"
		             interpreters="$DEFAULT"
		             port_range_begin="4183"
		             port_range_end="8278" />

		<!-- Remote server connection -->
		<connect host="localhost"
		         port="4151"
		         timeout_ms="3000" />

		<!-- Transport tunnel -->
		<tunnel local_port="-1"
		        type="0">
			<ssh executable="ssh"
			     port="22"
			     user="pi" />
		</tunnel>
	</core_link>

	<!-- Hardware modules configuration -->
	<hardware>
		<!-- Loaded hardware module -->
		<module name="rpigpio">
			<params>
				<param name="I0.0"
				       value="BCM0" />
				<param name="I0.1"
				       value="BCM1" />
				<param name="I1.1"
				       value="BCM2" />
				<param name="Q0.0"
				       value="BCM0" />
				<param name="Q0.1"
				       value="BCM1" />
				<param name="Q1.1"
				       value="BCM2" />
				<param name="enabled"
				       value="True" />
				<param name="inputAddressBase"
				       value="16" />
				<param name="outputAddressBase"
				       value="16" />
			</params>
		</module>
	</hardware>

	<!-- Graphical user interface configuration -->
	<gui>
		<!-- AWL editor settings -->
		<editor autoindent="1"
		        paste_autoindent="1"
		        validation="1" />
	</gui>
</awlsim_project>
bues.ch cgit interface