-
Notifications
You must be signed in to change notification settings - Fork 2
/
usb.html
1268 lines (1211 loc) · 58 KB
/
usb.html
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>USB — Fomu Bootloader documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/default.js"></script>
<script type="text/javascript" src="_static/WaveDrom.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="VERSION" href="version.html" />
<link rel="prev" title="TOUCH" href="touch.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="usb">
<h1>USB<a class="headerlink" href="#usb" title="Permalink to this headline">¶</a></h1>
<div class="section" id="usb-device-tri-fifo">
<h2>USB Device Tri-FIFO<a class="headerlink" href="#usb-device-tri-fifo" title="Permalink to this headline">¶</a></h2>
<p>This is a three-FIFO USB device. It presents one FIFO each for <code class="docutils literal notranslate"><span class="pre">IN</span></code>, <code class="docutils literal notranslate"><span class="pre">OUT</span></code>, and
<code class="docutils literal notranslate"><span class="pre">SETUP</span></code> data. This allows for up to 16 <code class="docutils literal notranslate"><span class="pre">IN</span></code> and 16 <code class="docutils literal notranslate"><span class="pre">OUT</span></code> endpoints
without sacrificing many FPGA resources.</p>
<p>USB supports four types of transfers: control, bulk, interrupt, and isochronous.
This device does not yet support isochronous transfers, however it supports the
other types of transfers.</p>
</div>
<div class="section" id="interrupt-and-bulk-transfers">
<h2>Interrupt and Bulk Transfers<a class="headerlink" href="#interrupt-and-bulk-transfers" title="Permalink to this headline">¶</a></h2>
<p>Interrupt and bulk transfers are similar from an implementation standpoint –
they differ only in terms of how often they are transmitted.</p>
<p>These transfers can be made to any endpoint, and may even be interleaved. However,
due to the nature of <code class="docutils literal notranslate"><span class="pre">TriEndpointInterface</span></code> any attempt by the host to interleave
transfers will result in a <code class="docutils literal notranslate"><span class="pre">NAK</span></code>, and the host will retry later when the buffer
is empty.</p>
<div class="section" id="in-transfers">
<h3>IN Transfers<a class="headerlink" href="#in-transfers" title="Permalink to this headline">¶</a></h3>
<p>To make an <code class="docutils literal notranslate"><span class="pre">IN</span></code> transfer (i.e. to send data to the host), write the data to
<code class="docutils literal notranslate"><span class="pre">IN_DATA</span></code>. This is a FIFO, and each write to this endpoint will advance the
FIFO pointer automatically. This FIFO is 64 bytes deep. USB <code class="docutils literal notranslate"><span class="pre">DATA</span></code> packets
contain a CRC16 checksum, which is automatically added to any <code class="docutils literal notranslate"><span class="pre">IN</span></code> transfers.</p>
<p><code class="docutils literal notranslate"><span class="pre">TriEndpointInterface</span></code> will continue to respond <code class="docutils literal notranslate"><span class="pre">NAK</span></code> until you arm the buffer.
Do this by writing the endpoint number to <code class="docutils literal notranslate"><span class="pre">IN_CTRL.EPNO</span></code>. This will tell the device
that it should send the data the next time the host asks for it.</p>
<p>Once the data has been transferred, the device will raise an interrupt and you
can begin re-filling the buffer, or fill it with data for a different endpoint.</p>
<p>To send an empty packet, avoid writing any data to <code class="docutils literal notranslate"><span class="pre">IN_DATA</span></code> and simply write
the endpoint number to <code class="docutils literal notranslate"><span class="pre">IN_CTRL.EPNO</span></code>.</p>
<p>The CRC16 will be automatically appended to the end of the transfer.</p>
</div>
<div class="section" id="out-transfers">
<h3>OUT Transfers<a class="headerlink" href="#out-transfers" title="Permalink to this headline">¶</a></h3>
<p>To respond to an <code class="docutils literal notranslate"><span class="pre">OUT</span></code> transfer (i.e. to receive data from the host), enable
a particular endpoint by writing to <code class="docutils literal notranslate"><span class="pre">OUT_CTRL.EPNO</span></code> with the <code class="docutils literal notranslate"><span class="pre">OUT_CTRL.ENABLE</span></code>
bit set. This will tell the device to stop responding <code class="docutils literal notranslate"><span class="pre">NAK</span></code> to that particular
endpoint and to accept any incoming data into a 66-byte FIFO, provided the FIFO
is empty.</p>
<p>Once the host sends data, an interrupt will be raised and that particular endpoint’s
<code class="docutils literal notranslate"><span class="pre">ENABLE</span></code> will be set to <code class="docutils literal notranslate"><span class="pre">0</span></code>. This prevents any additional data from entering
the FIFO while the device examines the data.</p>
<p>The FIFO will contain two extra bytes, which are the two-byte CRC16 of the packet.
You can safely discard these bytes. Because of this, a zero-byte transfer will
be two-bytes, and a full 64-byte transfer will be 66 bytes.</p>
<p>To determine which endpoint the <code class="docutils literal notranslate"><span class="pre">OUT</span></code> packet was sent to, refer to
<code class="docutils literal notranslate"><span class="pre">OUT_STATUS.EPNO</span></code>. This field is only updated when a successful packet is received,
and will not change until the <code class="docutils literal notranslate"><span class="pre">OUT</span></code> FIFO is re-armed.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">OUT</span></code> FIFO will continue to respond to the host with with <code class="docutils literal notranslate"><span class="pre">NAK</span></code> until the
<code class="docutils literal notranslate"><span class="pre">OUT_EV_PENDING.DONE</span></code> bit is cleared.</p>
<p>Additionally, to continue receiving data on that particular endpoint, you will need
to re-enable it by writing the endpoint number, along with the <code class="docutils literal notranslate"><span class="pre">OUT_CTRL.ENABLE</span></code>
to <code class="docutils literal notranslate"><span class="pre">OUT_CTRL</span></code>.</p>
</div>
</div>
<div class="section" id="control-transfers">
<h2>Control Transfers<a class="headerlink" href="#control-transfers" title="Permalink to this headline">¶</a></h2>
<p>Control transfers are complicated, and are the first sort of transfer that
the host uses. Such transfers have three distinct phases.</p>
<p>The first phase is the <code class="docutils literal notranslate"><span class="pre">SETUP</span></code> phase, where the host sends an 8-byte <code class="docutils literal notranslate"><span class="pre">SETUP</span></code>
packet. These <code class="docutils literal notranslate"><span class="pre">SETUP</span></code> packets must always be acknowledged, so any such packet
from the host will get loaded into the <code class="docutils literal notranslate"><span class="pre">SETUP</span></code> FIFO immediately, and an interrupt
event raised. If, for some reason, the device hasn’t drained this <code class="docutils literal notranslate"><span class="pre">SETUP</span></code>
FIFO from a previous transaction, the FIFO will be cleared automatically.</p>
<p>Once the <code class="docutils literal notranslate"><span class="pre">SETUP</span></code> packet is handled, the host will send an <code class="docutils literal notranslate"><span class="pre">IN</span></code> or <code class="docutils literal notranslate"><span class="pre">OUT</span></code>
packet. If the host sends an <code class="docutils literal notranslate"><span class="pre">OUT</span></code> packet, then the <code class="docutils literal notranslate"><span class="pre">OUT</span></code> buffer must be
cleared, the <code class="docutils literal notranslate"><span class="pre">OUT.DONE</span></code> interrupt handled, and the <code class="docutils literal notranslate"><span class="pre">OUT_CTRL.ENABLE</span></code> bit
must be set for the appropriate endpoint, usually EP0. The device will not
accept any data as long as these three conditions are not met.</p>
<p>If the host sends an <code class="docutils literal notranslate"><span class="pre">IN</span></code> packet, the device will respond with <code class="docutils literal notranslate"><span class="pre">NAK</span></code> if
no data has queued. To queue data, fill the <code class="docutils literal notranslate"><span class="pre">IN_DATA</span></code> buffer, then write
<code class="docutils literal notranslate"><span class="pre">0</span></code> to <code class="docutils literal notranslate"><span class="pre">IN_CTRL</span></code>.</p>
<p>You can continue to fill the buffer (for <code class="docutils literal notranslate"><span class="pre">IN</span></code> packets) or drain the buffer
and re-enable the endpoint (for <code class="docutils literal notranslate"><span class="pre">OUT</span></code> packets) until the host has finished
the transfer.</p>
<p>When the host has finished, it will send the opposite packet type. If it
is making <code class="docutils literal notranslate"><span class="pre">IN</span></code> transfers, it will send a single <code class="docutils literal notranslate"><span class="pre">OUT</span></code> packet, or if it
is making <code class="docutils literal notranslate"><span class="pre">OUT</span></code> transfers it will send a single <code class="docutils literal notranslate"><span class="pre">IN</span></code> packet.
You must handle this transaction yourself.</p>
<div class="section" id="stalling-an-endpoint">
<h3>Stalling an Endpoint<a class="headerlink" href="#stalling-an-endpoint" title="Permalink to this headline">¶</a></h3>
<p>When the host sends a request that cannot be processed – for example requesting
a descriptor that does not exist – the device must respond with <code class="docutils literal notranslate"><span class="pre">STALL</span></code>.</p>
<p>Each endpoint keeps track of its own <code class="docutils literal notranslate"><span class="pre">STALL</span></code> state, though a <code class="docutils literal notranslate"><span class="pre">SETUP</span></code> packet
will clear the <code class="docutils literal notranslate"><span class="pre">STALL</span></code> state for the specified endpoint (usually EP0).</p>
<p>To set or clear the <code class="docutils literal notranslate"><span class="pre">STALL</span></code> bit of an <code class="docutils literal notranslate"><span class="pre">IN</span></code> endpoint, write its endpoint number
to <code class="docutils literal notranslate"><span class="pre">IN_CTRL.EPNO</span></code> with the <code class="docutils literal notranslate"><span class="pre">IN_CTRL.STALL</span></code> bit either set or clear. If
this bit is set, then the device will respond to the next <code class="docutils literal notranslate"><span class="pre">IN</span></code> packet from the
host to that particular endpoint with <code class="docutils literal notranslate"><span class="pre">STALL</span></code>. If the bit is clear, then
the next <code class="docutils literal notranslate"><span class="pre">IN</span></code> packet will be responded to with <code class="docutils literal notranslate"><span class="pre">ACK</span></code> and the contents of
the <code class="docutils literal notranslate"><span class="pre">IN</span></code> FIFO.</p>
<p>To stall an <code class="docutils literal notranslate"><span class="pre">OUT</span></code> endpoint, write to <code class="docutils literal notranslate"><span class="pre">OUT_CTRL.EPNO</span></code> with the <code class="docutils literal notranslate"><span class="pre">OUT_CTRL.STALL</span></code>
bit set. To unstall, write to <code class="docutils literal notranslate"><span class="pre">OUT_CTRL.EPNO</span></code> with the <code class="docutils literal notranslate"><span class="pre">OUT_CTRL.STALL</span></code> bit
cleared. Note that <code class="docutils literal notranslate"><span class="pre">OUT_CTRL.ENABLE</span></code> should not be set at the same time as
<code class="docutils literal notranslate"><span class="pre">OUT_CTRL.STALL</span></code>, as this will cause a conflict.</p>
</div>
</div>
<div class="section" id="usb-wishbone-bridge">
<h2>USB Wishbone Bridge<a class="headerlink" href="#usb-wishbone-bridge" title="Permalink to this headline">¶</a></h2>
<p>This bridge provides a transparent bridge to the target device’s Wishbone bus over USB.
It can operate without interfering with the device’s USB stack. It is simple enough to
be able to work even if the USB stack is not enumerated, though the host may not cooperate.</p>
</div>
<div class="section" id="usb-wishbone-debug-protocol">
<h2>USB Wishbone Debug Protocol<a class="headerlink" href="#usb-wishbone-debug-protocol" title="Permalink to this headline">¶</a></h2>
<p>The protocol transfers four bytes a time in big-endian (i.e. USB) order. It uses SETUP packets
with the special type (0x43) as an <cite>attention</cite> word. This is then followed by an <code class="docutils literal notranslate"><span class="pre">OUT</span></code> packet.</p>
<blockquote>
<div>
<div style="overflow-x:auto">
<script type="WaveDrom">
{ "signal": [
["Request",
{ "name": 'data', "wave": 'x222...22x', "data": '0x43 0x00 [ADDRESS] 0x04 0x00' },
{ "name": 'data bits', "wave": 'xxx2222xxx', "data": '7:0 15:8 23:16 31:24'},
{ "name": 'usb meaning', "wave": 'x222.2.2.x', "data": 'bReq bTyp wValue wIndex wLength' },
{ "name": 'usb byte', "wave": 'x22222222x', "data": '1 2 3 4 5 6 7 8' }
],
{},
["Payload",
{ "name": 'data', "wave": 'x3...x', "data": '[DATA]'},
{ "name": 'data bits', "wave": 'x3333x', "data": '7:0 15:8 23:16 31:24'},
{ "name": 'usb meaning', "wave": 'x3...x', "data": 'OUT' },
{ "name": 'usb byte', "wave": 'x3333x', "data": '1 2 3 4'}
]
]}
</script>
</div>
</div></blockquote>
<p>To read data from the device, set the top bit of the <cite>bRequestType</cite>, followed by an <code class="docutils literal notranslate"><span class="pre">IN</span></code> packet.</p>
<blockquote>
<div>
<div style="overflow-x:auto">
<script type="WaveDrom">
{ "signal": [
['Request',
{ "name": 'data', "wave": 'x222...22x', "data": '0xC3 0x00 [ADDRESS] 0x04 0x00' },
{ "name": 'data bits', "wave": 'xxx2222xxx', "data": '7:0 15:8 23:16 31:24'},
{ "name": 'usb meaning', "wave": 'x222.2.2.x', "data": 'bReq bTyp wValue wIndex wLength' },
{ "name": 'usb byte', "wave": 'x22222222x', "data": '1 2 3 4 5 6 7 8' }
],
{},
["Payload",
{ "name": 'data', "wave": 'x5...x', "data": '[DATA]'},
{ "name": 'data bits', "wave": 'x5555x', "data": '7:0 15:8 23:16 31:24'},
{ "name": 'usb meaning', "wave": 'x5...x', "data": 'IN' },
{ "name": 'usb byte', "wave": 'x5555x', "data": '1 2 3 4'}
]
]}
</script>
</div>
</div></blockquote>
</div>
<div class="section" id="register-listing-for-usb">
<h2>Register Listing for USB<a class="headerlink" href="#register-listing-for-usb" title="Permalink to this headline">¶</a></h2>
<table class="docutils align-default">
<colgroup>
<col style="width: 55%" />
<col style="width: 45%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Register</p></th>
<th class="head"><p>Address</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><a class="reference internal" href="#usb-pullup-out"><span class="std std-ref">USB_PULLUP_OUT</span></a></p></td>
<td><p><a class="reference internal" href="#usb-pullup-out"><span class="std std-ref">0xe0004800</span></a></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#usb-address"><span class="std std-ref">USB_ADDRESS</span></a></p></td>
<td><p><a class="reference internal" href="#usb-address"><span class="std std-ref">0xe0004804</span></a></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#usb-next-ev"><span class="std std-ref">USB_NEXT_EV</span></a></p></td>
<td><p><a class="reference internal" href="#usb-next-ev"><span class="std std-ref">0xe0004808</span></a></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#usb-setup-data"><span class="std std-ref">USB_SETUP_DATA</span></a></p></td>
<td><p><a class="reference internal" href="#usb-setup-data"><span class="std std-ref">0xe000480c</span></a></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#usb-setup-ctrl"><span class="std std-ref">USB_SETUP_CTRL</span></a></p></td>
<td><p><a class="reference internal" href="#usb-setup-ctrl"><span class="std std-ref">0xe0004810</span></a></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#usb-setup-status"><span class="std std-ref">USB_SETUP_STATUS</span></a></p></td>
<td><p><a class="reference internal" href="#usb-setup-status"><span class="std std-ref">0xe0004814</span></a></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#usb-setup-ev-status"><span class="std std-ref">USB_SETUP_EV_STATUS</span></a></p></td>
<td><p><a class="reference internal" href="#usb-setup-ev-status"><span class="std std-ref">0xe0004818</span></a></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#usb-setup-ev-pending"><span class="std std-ref">USB_SETUP_EV_PENDING</span></a></p></td>
<td><p><a class="reference internal" href="#usb-setup-ev-pending"><span class="std std-ref">0xe000481c</span></a></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#usb-setup-ev-enable"><span class="std std-ref">USB_SETUP_EV_ENABLE</span></a></p></td>
<td><p><a class="reference internal" href="#usb-setup-ev-enable"><span class="std std-ref">0xe0004820</span></a></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#usb-in-data"><span class="std std-ref">USB_IN_DATA</span></a></p></td>
<td><p><a class="reference internal" href="#usb-in-data"><span class="std std-ref">0xe0004824</span></a></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#usb-in-ctrl"><span class="std std-ref">USB_IN_CTRL</span></a></p></td>
<td><p><a class="reference internal" href="#usb-in-ctrl"><span class="std std-ref">0xe0004828</span></a></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#usb-in-status"><span class="std std-ref">USB_IN_STATUS</span></a></p></td>
<td><p><a class="reference internal" href="#usb-in-status"><span class="std std-ref">0xe000482c</span></a></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#usb-in-ev-status"><span class="std std-ref">USB_IN_EV_STATUS</span></a></p></td>
<td><p><a class="reference internal" href="#usb-in-ev-status"><span class="std std-ref">0xe0004830</span></a></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#usb-in-ev-pending"><span class="std std-ref">USB_IN_EV_PENDING</span></a></p></td>
<td><p><a class="reference internal" href="#usb-in-ev-pending"><span class="std std-ref">0xe0004834</span></a></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#usb-in-ev-enable"><span class="std std-ref">USB_IN_EV_ENABLE</span></a></p></td>
<td><p><a class="reference internal" href="#usb-in-ev-enable"><span class="std std-ref">0xe0004838</span></a></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#usb-out-data"><span class="std std-ref">USB_OUT_DATA</span></a></p></td>
<td><p><a class="reference internal" href="#usb-out-data"><span class="std std-ref">0xe000483c</span></a></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#usb-out-ctrl"><span class="std std-ref">USB_OUT_CTRL</span></a></p></td>
<td><p><a class="reference internal" href="#usb-out-ctrl"><span class="std std-ref">0xe0004840</span></a></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#usb-out-status"><span class="std std-ref">USB_OUT_STATUS</span></a></p></td>
<td><p><a class="reference internal" href="#usb-out-status"><span class="std std-ref">0xe0004844</span></a></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#usb-out-ev-status"><span class="std std-ref">USB_OUT_EV_STATUS</span></a></p></td>
<td><p><a class="reference internal" href="#usb-out-ev-status"><span class="std std-ref">0xe0004848</span></a></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#usb-out-ev-pending"><span class="std std-ref">USB_OUT_EV_PENDING</span></a></p></td>
<td><p><a class="reference internal" href="#usb-out-ev-pending"><span class="std std-ref">0xe000484c</span></a></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#usb-out-ev-enable"><span class="std std-ref">USB_OUT_EV_ENABLE</span></a></p></td>
<td><p><a class="reference internal" href="#usb-out-ev-enable"><span class="std std-ref">0xe0004850</span></a></p></td>
</tr>
</tbody>
</table>
<div class="section" id="usb-pullup-out">
<h3>USB_PULLUP_OUT<a class="headerlink" href="#usb-pullup-out" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x0 = 0xe0004800</cite></p>
<blockquote>
<div>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "pullup_out", "bits": 1},
{"bits": 7},
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
</div>
<div class="section" id="usb-address">
<h3>USB_ADDRESS<a class="headerlink" href="#usb-address" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x4 = 0xe0004804</cite></p>
<blockquote>
<div><p>Sets the USB device address, in order to ignore packets going to other devices
on the bus. This value is reset when the host issues a USB Device Reset
condition.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "addr", "bits": 7},
{"bits": 1}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 9%" />
<col style="width: 81%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[6:0]</p></td>
<td><p>ADDR</p></td>
<td><p>Write the USB address from USB <code class="docutils literal notranslate"><span class="pre">SET_ADDRESS</span></code> packets.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-next-ev">
<h3>USB_NEXT_EV<a class="headerlink" href="#usb-next-ev" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x8 = 0xe0004808</cite></p>
<blockquote>
<div><p>In <code class="docutils literal notranslate"><span class="pre">eptri</span></code>, there are three endpoints. It is possible for an IRQ to fire and
have all three bits set. Under these circumstances it can be difficult to know
which event to process first. Use this register to determine which event needs
to be processed first. Only one bit will ever be set at a time.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "in", "bits": 1},
{"name": "out", "bits": 1},
{"name": "setup", "bits": 1},
{"name": "reset", "bits": 1},
{"bits": 4}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 11%" />
<col style="width: 11%" />
<col style="width: 77%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[0]</p></td>
<td><p>IN</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code> if the next event is an <code class="docutils literal notranslate"><span class="pre">IN</span></code> event</p></td>
</tr>
<tr class="row-odd"><td><p>[1]</p></td>
<td><p>OUT</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code> if the next event is an <code class="docutils literal notranslate"><span class="pre">OUT</span></code> event</p></td>
</tr>
<tr class="row-even"><td><p>[2]</p></td>
<td><p>SETUP</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code> if the next event is an <code class="docutils literal notranslate"><span class="pre">SETUP</span></code> event</p></td>
</tr>
<tr class="row-odd"><td><p>[3]</p></td>
<td><p>RESET</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code> if the next event is a <code class="docutils literal notranslate"><span class="pre">RESET</span></code> event</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-setup-data">
<h3>USB_SETUP_DATA<a class="headerlink" href="#usb-setup-data" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0xc = 0xe000480c</cite></p>
<blockquote>
<div><p>Data from the last <code class="docutils literal notranslate"><span class="pre">SETUP</span></code> transactions. It will be 10 bytes long, because
it will include the CRC16. This is a FIFO, and the queue is advanced
automatically.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "data", "bits": 8}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 15%" />
<col style="width: 13%" />
<col style="width: 72%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[7:0]</p></td>
<td><p>DATA</p></td>
<td><p>The next byte of <code class="docutils literal notranslate"><span class="pre">SETUP</span></code> data</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-setup-ctrl">
<h3>USB_SETUP_CTRL<a class="headerlink" href="#usb-setup-ctrl" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x10 = 0xe0004810</cite></p>
<blockquote>
<div><p>Controls for managing how to handle <code class="docutils literal notranslate"><span class="pre">SETUP</span></code> transactions.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"bits": 5},
{"name": "reset", "type": 4, "bits": 1},
{"bits": 2}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 11%" />
<col style="width: 11%" />
<col style="width: 78%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[5]</p></td>
<td><p>RESET</p></td>
<td><p>Write a <code class="docutils literal notranslate"><span class="pre">1</span></code> here to reset the <cite>SETUP</cite> handler.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-setup-status">
<h3>USB_SETUP_STATUS<a class="headerlink" href="#usb-setup-status" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x14 = 0xe0004814</cite></p>
<blockquote>
<div><p>Status about the most recent <code class="docutils literal notranslate"><span class="pre">SETUP</span></code> transactions, and the state of the FIFO.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "epno", "bits": 4},
{"name": "have", "bits": 1},
{"name": "pend", "bits": 1},
{"name": "is_in", "bits": 1},
{"name": "data", "bits": 1}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 10%" />
<col style="width: 81%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[3:0]</p></td>
<td><p>EPNO</p></td>
<td><p>The destination endpoint for the most recent SETUP token.</p></td>
</tr>
<tr class="row-odd"><td><p>[4]</p></td>
<td><p>HAVE</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code> if there is data in the FIFO.</p></td>
</tr>
<tr class="row-even"><td><p>[5]</p></td>
<td><p>PEND</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code> if there is an IRQ pending.</p></td>
</tr>
<tr class="row-odd"><td><p>[6]</p></td>
<td><p>IS_IN</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code> if an IN stage was detected.</p></td>
</tr>
<tr class="row-even"><td><p>[7]</p></td>
<td><p>DATA</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code> if a DATA stage is expected.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-setup-ev-status">
<h3>USB_SETUP_EV_STATUS<a class="headerlink" href="#usb-setup-ev-status" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x18 = 0xe0004818</cite></p>
<blockquote>
<div><p>This register contains the current raw level of the Event trigger. Writes to this register have no effect.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "ready", "bits": 1},
{"name": "reset", "bits": 1},
{"bits": 6}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 17%" />
<col style="width: 17%" />
<col style="width: 67%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[0]</p></td>
<td><p>READY</p></td>
<td><p>Level of the <cite>ready</cite> event</p></td>
</tr>
<tr class="row-odd"><td><p>[1]</p></td>
<td><p>RESET</p></td>
<td><p>Level of the <cite>reset</cite> event</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-setup-ev-pending">
<h3>USB_SETUP_EV_PENDING<a class="headerlink" href="#usb-setup-ev-pending" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x1c = 0xe000481c</cite></p>
<blockquote>
<div><p>When an Event occurs, the corresponding bit will be set in this register. To clear the Event, set the corresponding bit in this register.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "ready", "bits": 1},
{"name": "reset", "bits": 1},
{"bits": 6}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 6%" />
<col style="width: 6%" />
<col style="width: 88%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[0]</p></td>
<td><p>READY</p></td>
<td><p>Indicates a <code class="docutils literal notranslate"><span class="pre">SETUP</span></code> packet has arrived
and is waiting in the <code class="docutils literal notranslate"><span class="pre">SETUP</span></code> FIFO.</p></td>
</tr>
<tr class="row-odd"><td><p>[1]</p></td>
<td><p>RESET</p></td>
<td><p>Indicates a USB <code class="docutils literal notranslate"><span class="pre">RESET</span></code> condition
has occurred, and the <code class="docutils literal notranslate"><span class="pre">ADDRESS</span></code> is now <code class="docutils literal notranslate"><span class="pre">0</span></code>.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-setup-ev-enable">
<h3>USB_SETUP_EV_ENABLE<a class="headerlink" href="#usb-setup-ev-enable" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x20 = 0xe0004820</cite></p>
<blockquote>
<div><p>This register enables the corresponding Events. Write a <cite>0</cite> to this register to disable individual events.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "ready", "bits": 1},
{"name": "reset", "bits": 1},
{"bits": 6}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 13%" />
<col style="width: 13%" />
<col style="width: 75%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[0]</p></td>
<td><p>READY</p></td>
<td><p>Write a <cite>1</cite> to enable the <cite>ready</cite> Event</p></td>
</tr>
<tr class="row-odd"><td><p>[1]</p></td>
<td><p>RESET</p></td>
<td><p>Write a <cite>1</cite> to enable the <cite>reset</cite> Event</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-in-data">
<h3>USB_IN_DATA<a class="headerlink" href="#usb-in-data" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x24 = 0xe0004824</cite></p>
<blockquote>
<div><p>Each byte written into this register gets added to an outgoing FIFO. Any bytes
that are written here will be transmitted in the order in which they were added.
The FIFO queue is automatically advanced with each write. The FIFO queue is 64
bytes deep. If you exceed this amount, the result is undefined.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "data", "bits": 8}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 14%" />
<col style="width: 12%" />
<col style="width: 73%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[7:0]</p></td>
<td><p>DATA</p></td>
<td><p>The next byte to add to the queue.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-in-ctrl">
<h3>USB_IN_CTRL<a class="headerlink" href="#usb-in-ctrl" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x28 = 0xe0004828</cite></p>
<blockquote>
<div><p>Enables transmission of data in response to <code class="docutils literal notranslate"><span class="pre">IN</span></code> tokens, or resets the
contents of the FIFO.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "epno", "bits": 4},
{"bits": 1},
{"name": "reset", "type": 4, "bits": 1},
{"name": "stall", "type": 4, "bits": 1},
{"bits": 1}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 8%" />
<col style="width: 8%" />
<col style="width: 83%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[3:0]</p></td>
<td><p>EPNO</p></td>
<td><p>The endpoint number for the transaction that is queued in the FIFO.</p></td>
</tr>
<tr class="row-odd"><td><p>[5]</p></td>
<td><p>RESET</p></td>
<td><p>Write a <code class="docutils literal notranslate"><span class="pre">1</span></code> here to clear the contents of the FIFO.</p></td>
</tr>
<tr class="row-even"><td><p>[6]</p></td>
<td><p>STALL</p></td>
<td><p>Write a <code class="docutils literal notranslate"><span class="pre">1</span></code> here to stall the EP written in <code class="docutils literal notranslate"><span class="pre">EP</span></code>.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-in-status">
<h3>USB_IN_STATUS<a class="headerlink" href="#usb-in-status" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x2c = 0xe000482c</cite></p>
<blockquote>
<div><p>Status about the IN handler. As soon as you write to <cite>IN_DATA</cite>,
<code class="docutils literal notranslate"><span class="pre">IN_STATUS.HAVE</span></code> should go to <code class="docutils literal notranslate"><span class="pre">1</span></code>.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "idle", "bits": 1},
{"bits": 3},
{"name": "have", "bits": 1},
{"name": "pend", "bits": 1},
{"bits": 2}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 9%" />
<col style="width: 8%" />
<col style="width: 83%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[0]</p></td>
<td><p>IDLE</p></td>
<td><p>This value is <code class="docutils literal notranslate"><span class="pre">1</span></code> if the packet has finished transmitting.</p></td>
</tr>
<tr class="row-odd"><td><p>[4]</p></td>
<td><p>HAVE</p></td>
<td><p>This value is <code class="docutils literal notranslate"><span class="pre">0</span></code> if the FIFO is empty.</p></td>
</tr>
<tr class="row-even"><td><p>[5]</p></td>
<td><p>PEND</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code> if there is an IRQ pending.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-in-ev-status">
<h3>USB_IN_EV_STATUS<a class="headerlink" href="#usb-in-ev-status" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x30 = 0xe0004830</cite></p>
<blockquote>
<div><p>This register contains the current raw level of the Event trigger. Writes to this register have no effect.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "done", "bits": 1},
{"bits": 7}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 18%" />
<col style="width: 15%" />
<col style="width: 68%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[0]</p></td>
<td><p>DONE</p></td>
<td><p>Level of the <cite>done</cite> event</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-in-ev-pending">
<h3>USB_IN_EV_PENDING<a class="headerlink" href="#usb-in-ev-pending" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x34 = 0xe0004834</cite></p>
<blockquote>
<div><p>When an Event occurs, the corresponding bit will be set in this register. To clear the Event, set the corresponding bit in this register.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "done", "bits": 1},
{"bits": 7}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 7%" />
<col style="width: 6%" />
<col style="width: 87%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[0]</p></td>
<td><p>DONE</p></td>
<td><p>Indicates that the host has successfully transferred an <code class="docutils literal notranslate"><span class="pre">IN</span></code> packet,
and that the FIFO is now empty.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-in-ev-enable">
<h3>USB_IN_EV_ENABLE<a class="headerlink" href="#usb-in-ev-enable" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x38 = 0xe0004838</cite></p>
<blockquote>
<div><p>This register enables the corresponding Events. Write a <cite>0</cite> to this register to disable individual events.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "done", "bits": 1},
{"bits": 7}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 13%" />
<col style="width: 11%" />
<col style="width: 75%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[0]</p></td>
<td><p>DONE</p></td>
<td><p>Write a <cite>1</cite> to enable the <cite>done</cite> Event</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-out-data">
<h3>USB_OUT_DATA<a class="headerlink" href="#usb-out-data" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x3c = 0xe000483c</cite></p>
<blockquote>
<div><p>Data received from the host will go into a FIFO. This register reflects the
contents of the top byte in that FIFO. Reading from this register advances the
FIFO pointer.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "data", "bits": 8}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 15%" />
<col style="width: 13%" />
<col style="width: 73%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[7:0]</p></td>
<td><p>DATA</p></td>
<td><p>The top byte of the receive FIFO.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-out-ctrl">
<h3>USB_OUT_CTRL<a class="headerlink" href="#usb-out-ctrl" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x40 = 0xe0004840</cite></p>
<blockquote>
<div><p>Controls for receiving packet data. To enable an endpoint, write its value to
<code class="docutils literal notranslate"><span class="pre">epno</span></code>, with the <code class="docutils literal notranslate"><span class="pre">enable</span></code> bit set to <code class="docutils literal notranslate"><span class="pre">1</span></code> to enable an endpoint, or <code class="docutils literal notranslate"><span class="pre">0</span></code>
to disable it. Resetting the OutHandler will set all <code class="docutils literal notranslate"><span class="pre">enable</span></code> bits to 0.</p>
<p>Similarly, you can adjust the <code class="docutils literal notranslate"><span class="pre">STALL</span></code> state by setting or clearing the
<code class="docutils literal notranslate"><span class="pre">stall</span></code> bit.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "epno", "bits": 4},
{"name": "enable", "bits": 1},
{"name": "reset", "type": 4, "bits": 1},
{"name": "stall", "bits": 1},
{"bits": 1}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>
</div>
</div></blockquote>
<table class="docutils align-default">
<colgroup>
<col style="width: 8%" />
<col style="width: 9%" />
<col style="width: 83%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Field</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>[3:0]</p></td>
<td><p>EPNO</p></td>
<td><p>The endpoint number to update the <code class="docutils literal notranslate"><span class="pre">enable</span></code> and <code class="docutils literal notranslate"><span class="pre">status</span></code> bits for.</p></td>
</tr>
<tr class="row-odd"><td><p>[4]</p></td>
<td><p>ENABLE</p></td>
<td><p>Write a <code class="docutils literal notranslate"><span class="pre">1</span></code> here to enable receiving data</p></td>
</tr>
<tr class="row-even"><td><p>[5]</p></td>
<td><p>RESET</p></td>
<td><p>Write a <code class="docutils literal notranslate"><span class="pre">1</span></code> here to reset the <code class="docutils literal notranslate"><span class="pre">OUT</span></code> handler</p></td>
</tr>
<tr class="row-odd"><td><p>[6]</p></td>
<td><p>STALL</p></td>
<td><p>Write a <code class="docutils literal notranslate"><span class="pre">1</span></code> here to stall an endpoint</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="usb-out-status">
<h3>USB_OUT_STATUS<a class="headerlink" href="#usb-out-status" title="Permalink to this headline">¶</a></h3>
<p><cite>Address: 0xe0004800 + 0x44 = 0xe0004844</cite></p>
<blockquote>
<div><p>Status about the current state of the <cite>OUT</cite> endpoint.</p>
<div style="overflow-x:auto">
<script type="WaveDrom">
{
"reg": [
{"name": "epno", "bits": 4},
{"name": "have", "bits": 1},
{"name": "pend", "bits": 1},
{"bits": 2}
], "config": {"hspace": 400, "bits": 8, "lanes": 1 }, "options": {"hspace": 400, "bits": 8, "lanes": 1}
}
</script>