@@ -117,7 +117,7 @@ def set_RP_system_clock(freqHz:int):
117
117
machine .freq (int (freqHz ))
118
118
119
119
@micropython .native
120
- def write_input_byte (val ):
120
+ def write_ui_in_byte (val ):
121
121
# dump_portset('ui_in', val)
122
122
# low level machine stuff
123
123
# move the value bits to GPIO spots
@@ -131,12 +131,12 @@ def write_input_byte(val):
131
131
machine .mem32 [0xd000001c ] = val
132
132
133
133
@micropython .native
134
- def read_input_byte ():
134
+ def read_ui_in_byte ():
135
135
# just read the high and low nibbles from GPIO and combine into a byte
136
136
return ( (machine .mem32 [0xd0000004 ] & (0xf << 17 )) >> (17 - 4 )) | ((machine .mem32 [0xd0000004 ] & (0xf << 9 )) >> 9 )
137
137
138
138
@micropython .native
139
- def write_bidir_byte (val ):
139
+ def write_uio_byte (val ):
140
140
# dump_portset('uio', val)
141
141
# low level machine stuff
142
142
# move the value bits to GPIO spots
@@ -151,24 +151,24 @@ def write_bidir_byte(val):
151
151
152
152
153
153
@micropython .native
154
- def read_bidir_byte ():
154
+ def read_uio_byte ():
155
155
return (machine .mem32 [0xd0000004 ] & (0xff << 21 )) >> 21
156
156
157
157
@micropython .native
158
- def read_bidir_outputenable ():
158
+ def read_uio_outputenable ():
159
159
# GPIO_OE register, masked for our bidir pins
160
160
return (machine .mem32 [0xd0000020 ] & 0x1FE00000 ) >> 21
161
161
162
162
163
163
@micropython .native
164
- def write_bidir_outputenable (val ):
164
+ def write_uio_outputenable (val ):
165
165
# dump_portset('uio_oe', val)
166
166
# GPIO_OE register, clearing bidir pins and setting any enabled
167
167
val = (val << 21 )
168
168
machine .mem32 [0xd0000020 ] = (machine .mem32 [0xd0000020 ] & ((1 << 21 ) - 1 )) | val
169
169
170
170
@micropython .native
171
- def write_output_byte (val ):
171
+ def write_uo_out_byte (val ):
172
172
# dump_portset('uo_out', val)
173
173
# low level machine stuff
174
174
# move the value bits to GPIO spots
@@ -181,7 +181,7 @@ def write_output_byte(val):
181
181
machine .mem32 [0xd000001c ] = val
182
182
183
183
@micropython .native
184
- def read_output_byte ():
184
+ def read_uo_out_byte ():
185
185
186
186
# sample code to deal with differences between
187
187
# PCBs, not actually required as we didn't move anything
@@ -228,47 +228,47 @@ def set_RP_system_clock(freqHz:int):
228
228
RP2040SystemClockDefaultHz = freqHz
229
229
230
230
_inbyte = 0
231
- def write_input_byte (val ):
231
+ def write_ui_in_byte (val ):
232
232
global _inbyte
233
233
print (f'Sim write_input_byte { val } ' )
234
234
_inbyte = val
235
235
236
- def read_input_byte ():
236
+ def read_ui_in_byte ():
237
237
print ('Sim read_output_byte' )
238
238
return _inbyte
239
239
240
240
241
241
_uio_byte = 0
242
- def write_bidir_byte (val ):
242
+ def write_uio_byte (val ):
243
243
global _uio_byte
244
244
print (f'Sim write_bidir_byte { val } ' )
245
245
_uio_byte = val
246
246
247
247
248
248
249
- def read_bidir_byte ():
249
+ def read_uio_byte ():
250
250
print ('Sim read_output_byte' )
251
251
return _uio_byte
252
252
253
253
_outbyte = 0
254
- def write_output_byte (val ):
254
+ def write_uo_out_byte (val ):
255
255
global _outbyte
256
256
print (f'Sim write_output_byte { val } ' )
257
257
_outbyte = val
258
258
259
- def read_output_byte ():
259
+ def read_uo_out_byte ():
260
260
global _outbyte
261
261
v = _outbyte
262
262
#_outbyte += 1
263
263
print ('Sim read_output_byte' )
264
264
return v
265
265
266
266
_uio_oe_pico = 0
267
- def read_bidir_outputenable ():
267
+ def read_uio_outputenable ():
268
268
print ('Sim read_bidir_outputenable' )
269
269
return _uio_oe_pico
270
270
271
- def write_bidir_outputenable (val ):
271
+ def write_uio_outputenable (val ):
272
272
global _uio_oe_pico
273
273
print (f'Sim write_bidir_outputenable { val } ' )
274
274
_uio_oe_pico = val
0 commit comments