8ee2d907 pyrossh

HEAD -> master

2 months ago
test lambda
Files changed (4) hide show
  1. .DS_Store +0 -0
  2. docs/rp2350_explanation.svg +376 -0
  3. readme.md +3 -1
  4. src/main.zig +3 -3
.DS_Store ADDED
Binary file
docs/rp2350_explanation.svg ADDED
@@ -0,0 +1,376 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Generator: Adobe Illustrator 25.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+
4
+ <svg
5
+ version="1.1"
6
+ x="0px"
7
+ y="0px"
8
+ width="145.087px"
9
+ height="80px"
10
+ viewBox="0 0 145.087 80"
11
+ style="enable-background:new 0 0 145.087 80;"
12
+ xml:space="preserve"
13
+ id="svg114"
14
+ sodipodi:docname="rp2040_explanation.svg"
15
+ inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
16
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
17
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ xmlns:svg="http://www.w3.org/2000/svg"><defs
20
+ id="defs118">
21
+
22
+
23
+ </defs><sodipodi:namedview
24
+ id="namedview116"
25
+ pagecolor="#ffffff"
26
+ bordercolor="#666666"
27
+ borderopacity="1.0"
28
+ inkscape:pageshadow="2"
29
+ inkscape:pageopacity="0.0"
30
+ inkscape:pagecheckerboard="0"
31
+ showgrid="false"
32
+ inkscape:zoom="13.041952"
33
+ inkscape:cx="54.899758"
34
+ inkscape:cy="9.9678331"
35
+ inkscape:window-width="1920"
36
+ inkscape:window-height="1163"
37
+ inkscape:window-x="3840"
38
+ inkscape:window-y="0"
39
+ inkscape:window-maximized="1"
40
+ inkscape:current-layer="Layer_1" />
41
+ <style
42
+ type="text/css"
43
+ id="style2">
44
+ .st0{fill:#F6F6F6;}
45
+ .st1{fill:#CA4F62;}
46
+ .st2{fill:#4A96D2;}
47
+ .st3{fill:none;}
48
+ .st4{fill:#1D1D1B;}
49
+ .st5{font-family:'Roboto-Bold';}
50
+ .st6{font-size:15px;}
51
+ .st7{fill:none;stroke:#1D1D1B;stroke-width:0.5;stroke-miterlimit:10;}
52
+ .st8{font-size:4px;}
53
+ .st9{fill:none;stroke:#CA4F62;stroke-miterlimit:10;}
54
+ </style>
55
+ <g
56
+ id="Guides">
57
+ </g>
58
+ <g
59
+ id="BG">
60
+ <rect
61
+ class="st0"
62
+ width="145.087"
63
+ height="80"
64
+ id="rect5" />
65
+ </g>
66
+ <g
67
+ id="Ref">
68
+ </g>
69
+ <g
70
+ id="Layer_1">
71
+ <rect
72
+ x="13.694"
73
+ y="8.7620001"
74
+ class="st3"
75
+ width="70.167"
76
+ height="12.116"
77
+ id="rect9" /><text
78
+ id="text29"
79
+ x="12.593029"
80
+ y="19.9993"><tspan
81
+ x="12.593029"
82
+ y="19.9993"
83
+ class="st4 st5 st6"
84
+ id="tspan11"
85
+ dy="0 0 0">RP </tspan></text><text
86
+ id="text29-3"
87
+ x="48.967743"
88
+ y="19.9993"
89
+ style="text-align:center;text-anchor:middle"><tspan
90
+ sodipodi:role="line"
91
+ id="tspan79195"
92
+ x="40.522919"
93
+ y="19.9993"><tspan
94
+ x="40.522919"
95
+ y="19.9993"
96
+ class="st4 st5 st6"
97
+ id="tspan11-6"
98
+ style="text-align:center;text-anchor:middle">2</tspan></tspan><tspan
99
+ sodipodi:role="line"
100
+ id="tspan79197"
101
+ x="42.020721"
102
+ y="19.9993"><tspan
103
+ x="40.522919"
104
+ y="19.9993"
105
+ class="st4 st5 st6"
106
+ dy="0"
107
+ style="text-align:center;text-anchor:middle"
108
+ id="tspan79199"> </tspan></tspan></text><text
109
+ id="text29-3-3"
110
+ x="51.877296"
111
+ y="19.786898"
112
+ style="text-align:center;text-anchor:middle"><tspan
113
+ sodipodi:role="line"
114
+ id="tspan82308"
115
+ x="51.877296"
116
+ y="19.786898"><tspan
117
+ x="51.877296"
118
+ y="19.786898"
119
+ class="st4 st5 st6"
120
+ id="tspan11-6-5"
121
+ style="text-align:center;text-anchor:middle">3</tspan></tspan><tspan
122
+ sodipodi:role="line"
123
+ id="tspan82310"
124
+ x="53.375099"
125
+ y="19.786898"><tspan
126
+ x="51.877296"
127
+ y="19.786898"
128
+ class="st4 st5 st6"
129
+ dy="0"
130
+ style="text-align:center;text-anchor:middle"
131
+ id="tspan82312"> </tspan></tspan></text><text
132
+ id="text29-3-3-6"
133
+ x="63.601402"
134
+ y="19.786898"
135
+ style="text-align:center;text-anchor:middle"><tspan
136
+ sodipodi:role="line"
137
+ id="tspan85781"
138
+ x="63.601402"
139
+ y="19.786898"><tspan
140
+ x="63.601402"
141
+ y="19.786898"
142
+ class="st4 st5 st6"
143
+ id="tspan11-6-5-2"
144
+ style="text-align:center;text-anchor:middle">5</tspan></tspan><tspan
145
+ sodipodi:role="line"
146
+ id="tspan85783"
147
+ x="65.099205"
148
+ y="19.786898"><tspan
149
+ x="63.601402"
150
+ y="19.786898"
151
+ class="st4 st5 st6"
152
+ dy="0"
153
+ style="text-align:center;text-anchor:middle"
154
+ id="tspan85785"> </tspan></tspan></text><text
155
+ id="text29-3-3-6-9"
156
+ x="75.065659"
157
+ y="19.786898"
158
+ style="text-align:center;text-anchor:middle"><tspan
159
+ sodipodi:role="line"
160
+ id="tspan91420"
161
+ x="75.065659"
162
+ y="19.786898"><tspan
163
+ x="75.065659"
164
+ y="19.786898"
165
+ class="st4 st5 st6"
166
+ id="tspan11-6-5-2-1"
167
+ style="text-align:center;text-anchor:middle">0</tspan></tspan><tspan
168
+ sodipodi:role="line"
169
+ id="tspan91422"
170
+ x="76.563461"
171
+ y="19.786898"><tspan
172
+ x="75.065659"
173
+ y="19.786898"
174
+ class="st4 st5 st6"
175
+ dy="0"
176
+ style="text-align:center;text-anchor:middle"
177
+ id="tspan91424"> </tspan></tspan></text>
178
+ <g
179
+ id="g41">
180
+ <g
181
+ id="g39">
182
+ <line
183
+ class="st7"
184
+ x1="23.063"
185
+ y1="26.239"
186
+ x2="23.063"
187
+ y2="67.996"
188
+ id="line33" />
189
+ <g
190
+ id="g37">
191
+ <polygon
192
+ class="st4"
193
+ points="21.674,27.292 23.063,26.702 24.452,27.292 23.063,24 "
194
+ id="polygon35" />
195
+ </g>
196
+ </g>
197
+ </g>
198
+ <g
199
+ id="g51">
200
+ <g
201
+ id="g49">
202
+ <line
203
+ class="st7"
204
+ x1="75.14"
205
+ y1="26.239"
206
+ x2="75.14"
207
+ y2="35.998"
208
+ id="line43" />
209
+ <g
210
+ id="g47">
211
+ <polygon
212
+ class="st4"
213
+ points="73.752,27.292 75.14,26.702 76.529,27.292 75.14,24 "
214
+ id="polygon45" />
215
+ </g>
216
+ </g>
217
+ </g>
218
+ <rect
219
+ x="22.56"
220
+ y="68.995"
221
+ class="st3"
222
+ width="26.603"
223
+ height="7.001"
224
+ id="rect53" />
225
+ <text
226
+ transform="matrix(1 0 0 1 22.5606 71.995)"
227
+ class="st4 st5 st8"
228
+ id="text55">Raspberry Pi</text>
229
+ <line
230
+ class="st9"
231
+ x1="14.644"
232
+ y1="22.123"
233
+ x2="31.482"
234
+ y2="22.123"
235
+ id="line57" />
236
+ <line
237
+ class="st9"
238
+ x1="36.667"
239
+ y1="22.123"
240
+ x2="43.976"
241
+ y2="22.123"
242
+ id="line59" />
243
+ <line
244
+ class="st9"
245
+ x1="48.194"
246
+ y1="22.123"
247
+ x2="55.502"
248
+ y2="22.123"
249
+ id="line61" />
250
+ <line
251
+ class="st9"
252
+ x1="71.408"
253
+ y1="22.123"
254
+ x2="78.716"
255
+ y2="22.123"
256
+ id="line63" />
257
+ <line
258
+ class="st9"
259
+ x1="59.87"
260
+ y1="22.123"
261
+ x2="67.179"
262
+ y2="22.123"
263
+ id="line65" />
264
+ <g
265
+ id="g75">
266
+ <g
267
+ id="g73">
268
+ <line
269
+ class="st7"
270
+ x1="40.285"
271
+ y1="26.239"
272
+ x2="40.285"
273
+ y2="59.996"
274
+ id="line67" />
275
+ <g
276
+ id="g71">
277
+ <polygon
278
+ class="st4"
279
+ points="38.897,27.292 40.285,26.702 41.674,27.292 40.285,24 "
280
+ id="polygon69" />
281
+ </g>
282
+ </g>
283
+ </g>
284
+ <rect
285
+ x="39.783"
286
+ y="60.995"
287
+ class="st3"
288
+ width="30.546"
289
+ height="7.001"
290
+ id="rect77" />
291
+ <text
292
+ transform="matrix(1 0 0 1 39.783 63.995)"
293
+ class="st4 st5 st8"
294
+ id="text79">Number of cores</text>
295
+ <g
296
+ id="g89">
297
+ <g
298
+ id="g87">
299
+ <line
300
+ class="st7"
301
+ x1="51.907"
302
+ y1="26.239"
303
+ x2="51.907"
304
+ y2="51.996"
305
+ id="line81" />
306
+ <g
307
+ id="g85">
308
+ <polygon
309
+ class="st4"
310
+ points="50.518,27.292 51.907,26.702 53.296,27.292 51.907,24 "
311
+ id="polygon83" />
312
+ </g>
313
+ </g>
314
+ </g>
315
+ <rect
316
+ x="51.404"
317
+ y="52.995"
318
+ class="st3"
319
+ width="42.746"
320
+ height="7.001"
321
+ id="rect91" />
322
+ <text
323
+ transform="translate(51.4046,55.995)"
324
+ class="st4 st5 st8"
325
+ id="text93">Type of core (e.g. Cortex-M33)</text>
326
+ <g
327
+ id="g103">
328
+ <g
329
+ id="g101">
330
+ <line
331
+ class="st7"
332
+ x1="63.534"
333
+ y1="26.239"
334
+ x2="63.534"
335
+ y2="43.998"
336
+ id="line95" />
337
+ <g
338
+ id="g99">
339
+ <polygon
340
+ class="st4"
341
+ points="62.145,27.292 63.534,26.702 64.923,27.292 63.534,24 "
342
+ id="polygon97" />
343
+ </g>
344
+ </g>
345
+ </g>
346
+ <rect
347
+ x="63.031"
348
+ y="44.996"
349
+ class="st3"
350
+ width="42.746"
351
+ height="7.001"
352
+ id="rect105" />
353
+ <text
354
+ transform="translate(63.0315,47.9957)"
355
+ class="st4 st5 st8"
356
+ id="text107">floor(log2(RAM / 16 kB))</text>
357
+ <rect
358
+ x="74.635"
359
+ y="36.996"
360
+ class="st3"
361
+ width="53.622"
362
+ height="7.001"
363
+ id="rect109" />
364
+ <text
365
+ transform="translate(74.6349,39.9961)"
366
+ class="st4 st5 st8"
367
+ id="text111">floor(log2(nonvolatile / 128 kB))</text>
368
+ <text
369
+ xml:space="preserve"
370
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none"
371
+ x="38.2201"
372
+ y="18.437899"
373
+ id="text22809"><tspan
374
+ sodipodi:role="line"
375
+ id="tspan22807"></tspan></text></g>
376
+ </svg>
readme.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Setup
4
4
  1. `brew install zig open-ocd arm-none-eabi-gdb`
5
+ 2. Test
6
+
5
7
 
6
8
  If open-ocd doesn't work build from source,
7
9
 
@@ -49,4 +51,4 @@ If open-ocd doesn't work build from source,
49
51
  // - sector base : 400
50
52
  // - sector count : 384
51
53
  // - use block device : new Flash(400, 384)
52
- ```
54
+ ```
src/main.zig CHANGED
@@ -93,9 +93,9 @@ fn sendData(data: []const u8) void {
93
93
  // y1 (int): Ending Y position.
94
94
  // data (bytes): Data buffer to write.
95
95
  fn block(x0: u16, y0: u16, x1: u16, y1: u16, data: []const u8) void {
96
- send(Command{ .code = 0x2A, .data = &.{ @intCast(x0 >> 8), @truncate(x0), @intCast(x1 >> 8), @truncate(x1) } }); // Column address set
96
+ send(.{ .code = 0x2A, .data = &.{ @intCast(x0 >> 8), @truncate(x0), @intCast(x1 >> 8), @truncate(x1) } }); // Column address set
97
- send(Command{ .code = 0x2B, .data = &.{ @intCast(y0 >> 8), @truncate(y0), @intCast(y1 >> 8), @truncate(y1) } }); // Page address set
97
+ send(.{ .code = 0x2B, .data = &.{ @intCast(y0 >> 8), @truncate(y0), @intCast(y1 >> 8), @truncate(y1) } }); // Page address set
98
- send(Command{ .code = 0x2C, .data = data });
98
+ send(.{ .code = 0x2C, .data = data });
99
99
  }
100
100
 
101
101
  fn draw_pixel(x: u16, y: u16, color: u16) void {