USB_gadget.lss
131 KB
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
USB_gadget.elf: format de fichier elf32-avr
Sections :
Idx Nom Taille VMA LMA Fich off Algn
0 .data 0000001c 00800100 00000ff0 00001084 2**0
CONTENTS, ALLOC, LOAD, DATA
1 .text 00000ff0 00000000 00000000 00000094 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .bss 00000124 0080011c 0080011c 000010a0 2**0
ALLOC
3 .comment 00000011 00000000 00000000 000010a0 2**0
CONTENTS, READONLY
4 .note.gnu.avr.deviceinfo 00000040 00000000 00000000 000010b4 2**2
CONTENTS, READONLY
5 .debug_aranges 00000308 00000000 00000000 000010f4 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_info 00005bcc 00000000 00000000 000013fc 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_abbrev 0000158c 00000000 00000000 00006fc8 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_line 000036c6 00000000 00000000 00008554 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_frame 000008cc 00000000 00000000 0000bc1c 2**2
CONTENTS, READONLY, DEBUGGING
10 .debug_str 0000246c 00000000 00000000 0000c4e8 2**0
CONTENTS, READONLY, DEBUGGING
11 .debug_loc 00003926 00000000 00000000 0000e954 2**0
CONTENTS, READONLY, DEBUGGING
12 .debug_ranges 00000420 00000000 00000000 0001227a 2**0
CONTENTS, READONLY, DEBUGGING
Déassemblage de la section .text :
00000000 <__vectors>:
0: 88 c0 rjmp .+272 ; 0x112 <__ctors_end>
2: 00 00 nop
4: a1 c0 rjmp .+322 ; 0x148 <__bad_interrupt>
6: 00 00 nop
8: 9f c0 rjmp .+318 ; 0x148 <__bad_interrupt>
a: 00 00 nop
c: 9d c0 rjmp .+314 ; 0x148 <__bad_interrupt>
e: 00 00 nop
10: 9b c0 rjmp .+310 ; 0x148 <__bad_interrupt>
12: 00 00 nop
14: 99 c0 rjmp .+306 ; 0x148 <__bad_interrupt>
16: 00 00 nop
18: 97 c0 rjmp .+302 ; 0x148 <__bad_interrupt>
1a: 00 00 nop
1c: 95 c0 rjmp .+298 ; 0x148 <__bad_interrupt>
1e: 00 00 nop
20: 93 c0 rjmp .+294 ; 0x148 <__bad_interrupt>
22: 00 00 nop
24: 91 c0 rjmp .+290 ; 0x148 <__bad_interrupt>
26: 00 00 nop
28: 8f c0 rjmp .+286 ; 0x148 <__bad_interrupt>
2a: 00 00 nop
2c: f9 c3 rjmp .+2034 ; 0x820 <__vector_11>
2e: 00 00 nop
30: 9c c4 rjmp .+2360 ; 0x96a <__vector_12>
32: 00 00 nop
34: 89 c0 rjmp .+274 ; 0x148 <__bad_interrupt>
36: 00 00 nop
38: 87 c0 rjmp .+270 ; 0x148 <__bad_interrupt>
3a: 00 00 nop
3c: 85 c0 rjmp .+266 ; 0x148 <__bad_interrupt>
3e: 00 00 nop
40: 83 c0 rjmp .+262 ; 0x148 <__bad_interrupt>
42: 00 00 nop
44: 81 c0 rjmp .+258 ; 0x148 <__bad_interrupt>
46: 00 00 nop
48: 7f c0 rjmp .+254 ; 0x148 <__bad_interrupt>
4a: 00 00 nop
4c: 7d c0 rjmp .+250 ; 0x148 <__bad_interrupt>
4e: 00 00 nop
50: 7b c0 rjmp .+246 ; 0x148 <__bad_interrupt>
52: 00 00 nop
54: 79 c0 rjmp .+242 ; 0x148 <__bad_interrupt>
56: 00 00 nop
58: 77 c0 rjmp .+238 ; 0x148 <__bad_interrupt>
5a: 00 00 nop
5c: 6a c1 rjmp .+724 ; 0x332 <__vector_23>
5e: 00 00 nop
60: 73 c0 rjmp .+230 ; 0x148 <__bad_interrupt>
62: 00 00 nop
64: 71 c0 rjmp .+226 ; 0x148 <__bad_interrupt>
66: 00 00 nop
68: 6f c0 rjmp .+222 ; 0x148 <__bad_interrupt>
6a: 00 00 nop
6c: 6d c0 rjmp .+218 ; 0x148 <__bad_interrupt>
6e: 00 00 nop
70: 6b c0 rjmp .+214 ; 0x148 <__bad_interrupt>
72: 00 00 nop
00000074 <ProductString>:
74: 2e 03 4c 00 55 00 46 00 41 00 20 00 55 00 53 00 ..L.U.F.A. .U.S.
84: 42 00 2d 00 52 00 53 00 32 00 33 00 32 00 20 00 B.-.R.S.2.3.2. .
94: 41 00 64 00 61 00 70 00 74 00 65 00 72 00 00 00 A.d.a.p.t.e.r...
000000a4 <ManufacturerString>:
a4: 18 03 44 00 65 00 61 00 6e 00 20 00 43 00 61 00 ..D.e.a.n. .C.a.
b4: 6d 00 65 00 72 00 61 00 00 00 m.e.r.a...
000000be <LanguageString>:
be: 04 03 09 04 ....
000000c2 <ConfigurationDescriptor>:
c2: 09 02 3e 00 02 01 00 c0 32 09 04 00 00 01 02 02 ..>.....2.......
d2: 01 00 05 24 00 10 01 04 24 02 06 05 24 06 00 01 ...$....$...$...
e2: 07 05 82 03 08 00 ff 09 04 01 00 02 0a 00 00 00 ................
f2: 07 05 04 02 10 00 05 07 05 83 02 10 00 05 ..............
00000100 <DeviceDescriptor>:
100: 12 01 10 01 02 00 00 08 eb 03 4b 20 01 00 01 02 ..........K ....
110: dc 01 ..
00000112 <__ctors_end>:
112: 11 24 eor r1, r1
114: 1f be out 0x3f, r1 ; 63
116: cf ef ldi r28, 0xFF ; 255
118: d2 e0 ldi r29, 0x02 ; 2
11a: de bf out 0x3e, r29 ; 62
11c: cd bf out 0x3d, r28 ; 61
0000011e <__do_copy_data>:
11e: 11 e0 ldi r17, 0x01 ; 1
120: a0 e0 ldi r26, 0x00 ; 0
122: b1 e0 ldi r27, 0x01 ; 1
124: e0 ef ldi r30, 0xF0 ; 240
126: ff e0 ldi r31, 0x0F ; 15
128: 02 c0 rjmp .+4 ; 0x12e <__do_copy_data+0x10>
12a: 05 90 lpm r0, Z+
12c: 0d 92 st X+, r0
12e: ac 31 cpi r26, 0x1C ; 28
130: b1 07 cpc r27, r17
132: d9 f7 brne .-10 ; 0x12a <__do_copy_data+0xc>
00000134 <__do_clear_bss>:
134: 22 e0 ldi r18, 0x02 ; 2
136: ac e1 ldi r26, 0x1C ; 28
138: b1 e0 ldi r27, 0x01 ; 1
13a: 01 c0 rjmp .+2 ; 0x13e <.do_clear_bss_start>
0000013c <.do_clear_bss_loop>:
13c: 1d 92 st X+, r1
0000013e <.do_clear_bss_start>:
13e: a0 34 cpi r26, 0x40 ; 64
140: b2 07 cpc r27, r18
142: e1 f7 brne .-8 ; 0x13c <.do_clear_bss_loop>
144: 5a d0 rcall .+180 ; 0x1fa <main>
146: 52 c7 rjmp .+3748 ; 0xfec <_exit>
00000148 <__bad_interrupt>:
148: 5b cf rjmp .-330 ; 0x0 <__vectors>
0000014a <LEDs_SetAllLEDs>:
PORTD |= LEDMask;
}
static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
{
PORTD = ((PORTD | LEDS_ALL_LEDS) & ~LEDMask);
14a: 9b b1 in r25, 0x0b ; 11
14c: 80 95 com r24
14e: 90 63 ori r25, 0x30 ; 48
150: 89 23 and r24, r25
152: 8b b9 out 0x0b, r24 ; 11
154: 08 95 ret
00000156 <RingBuffer_Insert>:
static inline void RingBuffer_Insert(RingBuffer_t* Buffer,
const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1);
static inline void RingBuffer_Insert(RingBuffer_t* Buffer,
const uint8_t Data)
{
GCC_FORCE_POINTER_ACCESS(Buffer);
156: fc 01 movw r30, r24
*Buffer->In = Data;
158: a0 81 ld r26, Z
15a: b1 81 ldd r27, Z+1 ; 0x01
15c: 6c 93 st X, r22
if (++Buffer->In == Buffer->End)
15e: 80 81 ld r24, Z
160: 91 81 ldd r25, Z+1 ; 0x01
162: 01 96 adiw r24, 0x01 ; 1
164: 91 83 std Z+1, r25 ; 0x01
166: 80 83 st Z, r24
168: 26 81 ldd r18, Z+6 ; 0x06
16a: 37 81 ldd r19, Z+7 ; 0x07
16c: 82 17 cp r24, r18
16e: 93 07 cpc r25, r19
170: 21 f4 brne .+8 ; 0x17a <RingBuffer_Insert+0x24>
Buffer->In = Buffer->Start;
172: 84 81 ldd r24, Z+4 ; 0x04
174: 95 81 ldd r25, Z+5 ; 0x05
176: 91 83 std Z+1, r25 ; 0x01
178: 80 83 st Z, r24
static inline uint_reg_t GetGlobalInterruptMask(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
return SREG;
17a: 2f b7 in r18, 0x3f ; 63
static inline void GlobalInterruptDisable(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
cli();
17c: f8 94 cli
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
Buffer->Count++;
17e: 82 85 ldd r24, Z+10 ; 0x0a
180: 93 85 ldd r25, Z+11 ; 0x0b
182: 01 96 adiw r24, 0x01 ; 1
184: 93 87 std Z+11, r25 ; 0x0b
186: 82 87 std Z+10, r24 ; 0x0a
static inline void SetGlobalInterruptMask(const uint_reg_t GlobalIntState)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
SREG = GlobalIntState;
188: 2f bf out 0x3f, r18 ; 63
__builtin_csrf(AVR32_SR_GM_OFFSET);
#elif (ARCH == ARCH_XMEGA)
SREG = GlobalIntState;
#endif
GCC_MEMORY_BARRIER();
18a: 08 95 ret
0000018c <RingBuffer_Remove>:
* \return Next data element stored in the buffer.
*/
static inline uint8_t RingBuffer_Remove(RingBuffer_t* Buffer) ATTR_NON_NULL_PTR_ARG(1);
static inline uint8_t RingBuffer_Remove(RingBuffer_t* Buffer)
{
GCC_FORCE_POINTER_ACCESS(Buffer);
18c: fc 01 movw r30, r24
uint8_t Data = *Buffer->Out;
18e: a2 81 ldd r26, Z+2 ; 0x02
190: b3 81 ldd r27, Z+3 ; 0x03
192: 8d 91 ld r24, X+
if (++Buffer->Out == Buffer->End)
194: b3 83 std Z+3, r27 ; 0x03
196: a2 83 std Z+2, r26 ; 0x02
198: 26 81 ldd r18, Z+6 ; 0x06
19a: 37 81 ldd r19, Z+7 ; 0x07
19c: a2 17 cp r26, r18
19e: b3 07 cpc r27, r19
1a0: 21 f4 brne .+8 ; 0x1aa <RingBuffer_Remove+0x1e>
Buffer->Out = Buffer->Start;
1a2: 24 81 ldd r18, Z+4 ; 0x04
1a4: 35 81 ldd r19, Z+5 ; 0x05
1a6: 33 83 std Z+3, r19 ; 0x03
1a8: 22 83 std Z+2, r18 ; 0x02
static inline uint_reg_t GetGlobalInterruptMask(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
return SREG;
1aa: 9f b7 in r25, 0x3f ; 63
static inline void GlobalInterruptDisable(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
cli();
1ac: f8 94 cli
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
Buffer->Count--;
1ae: 22 85 ldd r18, Z+10 ; 0x0a
1b0: 33 85 ldd r19, Z+11 ; 0x0b
1b2: 21 50 subi r18, 0x01 ; 1
1b4: 31 09 sbc r19, r1
1b6: 33 87 std Z+11, r19 ; 0x0b
1b8: 22 87 std Z+10, r18 ; 0x0a
static inline void SetGlobalInterruptMask(const uint_reg_t GlobalIntState)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
SREG = GlobalIntState;
1ba: 9f bf out 0x3f, r25 ; 63
SetGlobalInterruptMask(CurrentGlobalInt);
return Data;
}
1bc: 08 95 ret
000001be <SetupHardware>:
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
1be: 84 b7 in r24, 0x34 ; 52
1c0: 87 7f andi r24, 0xF7 ; 247
1c2: 84 bf out 0x34, r24 ; 52
);
}
else
{
uint8_t register temp_reg;
__asm__ __volatile__ (
1c4: 0f b6 in r0, 0x3f ; 63
1c6: f8 94 cli
1c8: a8 95 wdr
1ca: 80 91 60 00 lds r24, 0x0060
1ce: 88 61 ori r24, 0x18 ; 24
1d0: 80 93 60 00 sts 0x0060, r24
1d4: 10 92 60 00 sts 0x0060, r1
1d8: 0f be out 0x3f, r0 ; 63
from 1 to 129. Thus, one does not need to use \c clock_div_t type as argument.
*/
void clock_prescale_set(clock_div_t __x)
{
uint8_t __tmp = _BV(CLKPCE);
__asm__ __volatile__ (
1da: 90 e0 ldi r25, 0x00 ; 0
1dc: 80 e8 ldi r24, 0x80 ; 128
1de: 0f b6 in r0, 0x3f ; 63
1e0: f8 94 cli
1e2: 80 93 61 00 sts 0x0061, r24
1e6: 90 93 61 00 sts 0x0061, r25
1ea: 0f be out 0x3f, r0 ; 63
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void LEDs_Init(void)
{
DDRD |= LEDS_ALL_LEDS;
1ec: 8a b1 in r24, 0x0a ; 10
1ee: 80 63 ori r24, 0x30 ; 48
1f0: 8a b9 out 0x0a, r24 ; 10
PORTD |= LEDS_ALL_LEDS;
1f2: 8b b1 in r24, 0x0b ; 11
1f4: 80 63 ori r24, 0x30 ; 48
1f6: 8b b9 out 0x0b, r24 ; 11
clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */
LEDs_Init();
USB_Init();
1f8: 04 c3 rjmp .+1544 ; 0x802 <USB_Init>
000001fa <main>:
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/
int main(void)
{
SetupHardware();
1fa: e1 df rcall .-62 ; 0x1be <SetupHardware>
const uint16_t Size) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
static inline void RingBuffer_InitBuffer(RingBuffer_t* Buffer,
uint8_t* const DataPtr,
const uint16_t Size)
{
GCC_FORCE_POINTER_ACCESS(Buffer);
1fc: e8 e2 ldi r30, 0x28 ; 40
1fe: f2 e0 ldi r31, 0x02 ; 2
static inline uint_reg_t GetGlobalInterruptMask(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
return SREG;
200: 4f b7 in r20, 0x3f ; 63
static inline void GlobalInterruptDisable(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
cli();
202: f8 94 cli
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
Buffer->In = DataPtr;
204: 88 ea ldi r24, 0xA8 ; 168
206: 91 e0 ldi r25, 0x01 ; 1
208: 91 83 std Z+1, r25 ; 0x01
20a: 80 83 st Z, r24
Buffer->Out = DataPtr;
20c: 93 83 std Z+3, r25 ; 0x03
20e: 82 83 std Z+2, r24 ; 0x02
Buffer->Start = &DataPtr[0];
210: 95 83 std Z+5, r25 ; 0x05
212: 84 83 std Z+4, r24 ; 0x04
Buffer->End = &DataPtr[Size];
214: 88 e2 ldi r24, 0x28 ; 40
216: 92 e0 ldi r25, 0x02 ; 2
218: 97 83 std Z+7, r25 ; 0x07
21a: 86 83 std Z+6, r24 ; 0x06
Buffer->Size = Size;
21c: 20 e8 ldi r18, 0x80 ; 128
21e: 30 e0 ldi r19, 0x00 ; 0
220: 31 87 std Z+9, r19 ; 0x09
222: 20 87 std Z+8, r18 ; 0x08
Buffer->Count = 0;
224: 13 86 std Z+11, r1 ; 0x0b
226: 12 86 std Z+10, r1 ; 0x0a
static inline void SetGlobalInterruptMask(const uint_reg_t GlobalIntState)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
SREG = GlobalIntState;
228: 4f bf out 0x3f, r20 ; 63
const uint16_t Size) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
static inline void RingBuffer_InitBuffer(RingBuffer_t* Buffer,
uint8_t* const DataPtr,
const uint16_t Size)
{
GCC_FORCE_POINTER_ACCESS(Buffer);
22a: ec e9 ldi r30, 0x9C ; 156
22c: f1 e0 ldi r31, 0x01 ; 1
static inline uint_reg_t GetGlobalInterruptMask(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
return SREG;
22e: 4f b7 in r20, 0x3f ; 63
static inline void GlobalInterruptDisable(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
cli();
230: f8 94 cli
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
Buffer->In = DataPtr;
232: 8c e1 ldi r24, 0x1C ; 28
234: 91 e0 ldi r25, 0x01 ; 1
236: 91 83 std Z+1, r25 ; 0x01
238: 80 83 st Z, r24
Buffer->Out = DataPtr;
23a: 93 83 std Z+3, r25 ; 0x03
23c: 82 83 std Z+2, r24 ; 0x02
Buffer->Start = &DataPtr[0];
23e: 95 83 std Z+5, r25 ; 0x05
240: 84 83 std Z+4, r24 ; 0x04
Buffer->End = &DataPtr[Size];
242: 8c e9 ldi r24, 0x9C ; 156
244: 91 e0 ldi r25, 0x01 ; 1
246: 97 83 std Z+7, r25 ; 0x07
248: 86 83 std Z+6, r24 ; 0x06
Buffer->Size = Size;
24a: 31 87 std Z+9, r19 ; 0x09
24c: 20 87 std Z+8, r18 ; 0x08
Buffer->Count = 0;
24e: 13 86 std Z+11, r1 ; 0x0b
250: 12 86 std Z+10, r1 ; 0x0a
static inline void SetGlobalInterruptMask(const uint_reg_t GlobalIntState)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
SREG = GlobalIntState;
252: 4f bf out 0x3f, r20 ; 63
RingBuffer_InitBuffer(&USBtoUSART_Buffer, USBtoUSART_Buffer_Data, sizeof(USBtoUSART_Buffer_Data));
RingBuffer_InitBuffer(&USARTtoUSB_Buffer, USARTtoUSB_Buffer_Data, sizeof(USARTtoUSB_Buffer_Data));
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
254: 80 e2 ldi r24, 0x20 ; 32
256: 79 df rcall .-270 ; 0x14a <LEDs_SetAllLEDs>
static inline void GlobalInterruptEnable(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
sei();
258: 78 94 sei
static inline uint_reg_t GetGlobalInterruptMask(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
return SREG;
25a: 8f b7 in r24, 0x3f ; 63
static inline void GlobalInterruptDisable(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
cli();
25c: f8 94 cli
uint16_t Count;
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
Count = Buffer->Count;
25e: 20 91 32 02 lds r18, 0x0232
262: 30 91 33 02 lds r19, 0x0233
static inline void SetGlobalInterruptMask(const uint_reg_t GlobalIntState)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
SREG = GlobalIntState;
266: 8f bf out 0x3f, r24 ; 63
GlobalInterruptEnable();
for (;;)
{
/* Only try to read in bytes from the CDC interface if the transmit buffer is not full */
if (!(RingBuffer_IsFull(&USBtoUSART_Buffer)))
268: 80 91 30 02 lds r24, 0x0230
26c: 90 91 31 02 lds r25, 0x0231
270: 28 17 cp r18, r24
272: 39 07 cpc r19, r25
274: 49 f0 breq .+18 ; 0x288 <main+0x8e>
{
int16_t ReceivedByte = CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);
276: 80 e0 ldi r24, 0x00 ; 0
278: 91 e0 ldi r25, 0x01 ; 1
27a: ba d5 rcall .+2932 ; 0xdf0 <CDC_Device_ReceiveByte>
/* Store received byte into the USART transmit buffer */
if (!(ReceivedByte < 0))
27c: 97 fd sbrc r25, 7
27e: 04 c0 rjmp .+8 ; 0x288 <main+0x8e>
RingBuffer_Insert(&USBtoUSART_Buffer, ReceivedByte);
280: 68 2f mov r22, r24
282: 88 e2 ldi r24, 0x28 ; 40
284: 92 e0 ldi r25, 0x02 ; 2
286: 67 df rcall .-306 ; 0x156 <RingBuffer_Insert>
static inline uint_reg_t GetGlobalInterruptMask(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
return SREG;
288: 2f b7 in r18, 0x3f ; 63
static inline void GlobalInterruptDisable(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
cli();
28a: f8 94 cli
28c: 80 91 a6 01 lds r24, 0x01A6
290: 90 91 a7 01 lds r25, 0x01A7
static inline void SetGlobalInterruptMask(const uint_reg_t GlobalIntState)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
SREG = GlobalIntState;
294: 2f bf out 0x3f, r18 ; 63
}
uint16_t BufferCount = RingBuffer_GetCount(&USARTtoUSB_Buffer);
if (BufferCount)
296: 00 97 sbiw r24, 0x00 ; 0
298: 29 f4 brne .+10 ; 0x2a4 <main+0xaa>
* \return Boolean \c true if a character can be queued for transmission immediately, \c false otherwise.
*/
static inline bool Serial_IsSendReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Serial_IsSendReady(void)
{
return ((UCSR1A & (1 << UDRE1)) ? true : false);
29a: 80 91 c8 00 lds r24, 0x00C8
}
}
}
/* Load the next byte from the USART transmit buffer into the USART if transmit buffer space is available */
if (Serial_IsSendReady() && !(RingBuffer_IsEmpty(&USBtoUSART_Buffer)))
29e: 85 fd sbrc r24, 5
2a0: 21 c0 rjmp .+66 ; 0x2e4 <main+0xea>
2a2: 32 c0 rjmp .+100 ; 0x308 <__stack+0x9>
*/
static inline void Endpoint_SelectEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void Endpoint_SelectEndpoint(const uint8_t Address)
{
#if !defined(CONTROL_ONLY_DEVICE)
UENUM = (Address & ENDPOINT_EPNUM_MASK);
2a4: 20 91 01 01 lds r18, 0x0101
2a8: 2f 70 andi r18, 0x0F ; 15
2aa: 20 93 e9 00 sts 0x00E9, r18
* \return Boolean \c true if the current endpoint is ready for an IN packet, \c false otherwise.
*/
static inline bool Endpoint_IsINReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsINReady(void)
{
return ((UEINTX & (1 << TXINI)) ? true : false);
2ae: 20 91 e8 00 lds r18, 0x00E8
{
Endpoint_SelectEndpoint(VirtualSerial_CDC_Interface.Config.DataINEndpoint.Address);
/* Check if a packet is already enqueued to the host - if so, we shouldn't try to send more data
* until it completes as there is a chance nothing is listening and a lengthy timeout could occur */
if (Endpoint_IsINReady())
2b2: 20 ff sbrs r18, 0
2b4: f2 cf rjmp .-28 ; 0x29a <main+0xa0>
{
/* Never send more than one bank size less one byte to the host at a time, so that we don't block
* while a Zero Length Packet (ZLP) to terminate the transfer is sent if the host isn't listening */
uint8_t BytesToSend = MIN(BufferCount, (CDC_TXRX_EPSIZE - 1));
2b6: 80 31 cpi r24, 0x10 ; 16
2b8: 91 05 cpc r25, r1
2ba: 10 f0 brcs .+4 ; 0x2c0 <main+0xc6>
2bc: 8f e0 ldi r24, 0x0F ; 15
2be: 90 e0 ldi r25, 0x00 ; 0
2c0: c8 2f mov r28, r24
* \return Next data element stored in the buffer.
*/
static inline uint8_t RingBuffer_Peek(RingBuffer_t* const Buffer) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(1);
static inline uint8_t RingBuffer_Peek(RingBuffer_t* const Buffer)
{
return *Buffer->Out;
2c2: e0 91 9e 01 lds r30, 0x019E
2c6: f0 91 9f 01 lds r31, 0x019F
/* Read bytes from the USART receive buffer into the USB IN endpoint */
while (BytesToSend--)
{
/* Try to send the next byte of data to the host, abort if there is an error without dequeuing */
if (CDC_Device_SendByte(&VirtualSerial_CDC_Interface,
2ca: 60 81 ld r22, Z
2cc: 80 e0 ldi r24, 0x00 ; 0
2ce: 91 e0 ldi r25, 0x01 ; 1
2d0: 27 d5 rcall .+2638 ; 0xd20 <CDC_Device_SendByte>
2d2: c1 50 subi r28, 0x01 ; 1
2d4: 81 11 cpse r24, r1
2d6: e1 cf rjmp .-62 ; 0x29a <main+0xa0>
{
break;
}
/* Dequeue the already sent byte from the buffer now we have confirmed that no transmission error occurred */
RingBuffer_Remove(&USARTtoUSB_Buffer);
2d8: 8c e9 ldi r24, 0x9C ; 156
2da: 91 e0 ldi r25, 0x01 ; 1
2dc: 57 df rcall .-338 ; 0x18c <RingBuffer_Remove>
/* Never send more than one bank size less one byte to the host at a time, so that we don't block
* while a Zero Length Packet (ZLP) to terminate the transfer is sent if the host isn't listening */
uint8_t BytesToSend = MIN(BufferCount, (CDC_TXRX_EPSIZE - 1));
/* Read bytes from the USART receive buffer into the USB IN endpoint */
while (BytesToSend--)
2de: c1 11 cpse r28, r1
2e0: f0 cf rjmp .-32 ; 0x2c2 <main+0xc8>
2e2: db cf rjmp .-74 ; 0x29a <main+0xa0>
static inline uint_reg_t GetGlobalInterruptMask(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
return SREG;
2e4: 2f b7 in r18, 0x3f ; 63
static inline void GlobalInterruptDisable(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
cli();
2e6: f8 94 cli
uint16_t Count;
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
Count = Buffer->Count;
2e8: 80 91 32 02 lds r24, 0x0232
2ec: 90 91 33 02 lds r25, 0x0233
static inline void SetGlobalInterruptMask(const uint_reg_t GlobalIntState)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
SREG = GlobalIntState;
2f0: 2f bf out 0x3f, r18 ; 63
}
}
}
/* Load the next byte from the USART transmit buffer into the USART if transmit buffer space is available */
if (Serial_IsSendReady() && !(RingBuffer_IsEmpty(&USBtoUSART_Buffer)))
2f2: 89 2b or r24, r25
2f4: 49 f0 breq .+18 ; 0x308 <__stack+0x9>
Serial_SendByte(RingBuffer_Remove(&USBtoUSART_Buffer));
2f6: 88 e2 ldi r24, 0x28 ; 40
2f8: 92 e0 ldi r25, 0x02 ; 2
2fa: 48 df rcall .-368 ; 0x18c <RingBuffer_Remove>
2fc: 90 91 c8 00 lds r25, 0x00C8
* \param[in] DataByte Byte to transmit through the USART.
*/
static inline void Serial_SendByte(const char DataByte) ATTR_ALWAYS_INLINE;
static inline void Serial_SendByte(const char DataByte)
{
while (!(Serial_IsSendReady()));
300: 95 ff sbrs r25, 5
302: fc cf rjmp .-8 ; 0x2fc <main+0x102>
UDR1 = DataByte;
304: 80 93 ce 00 sts 0x00CE, r24
CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
308: 80 e0 ldi r24, 0x00 ; 0
30a: 91 e0 ldi r25, 0x01 ; 1
30c: 5c d5 rcall .+2744 ; 0xdc6 <CDC_Device_USBTask>
USB_USBTask();
30e: ca d4 rcall .+2452 ; 0xca4 <USB_USBTask>
}
310: a4 cf rjmp .-184 ; 0x25a <main+0x60>
00000312 <EVENT_USB_Device_Connect>:
}
/** Event handler for the library USB Connection event. */
void EVENT_USB_Device_Connect(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
312: 80 e1 ldi r24, 0x10 ; 16
314: 1a cf rjmp .-460 ; 0x14a <LEDs_SetAllLEDs>
00000316 <EVENT_USB_Device_Disconnect>:
}
/** Event handler for the library USB Disconnection event. */
void EVENT_USB_Device_Disconnect(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
316: 80 e2 ldi r24, 0x20 ; 32
318: 18 cf rjmp .-464 ; 0x14a <LEDs_SetAllLEDs>
0000031a <EVENT_USB_Device_ConfigurationChanged>:
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void)
{
bool ConfigSuccess = true;
ConfigSuccess &= CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface);
31a: 80 e0 ldi r24, 0x00 ; 0
31c: 91 e0 ldi r25, 0x01 ; 1
31e: db d4 rcall .+2486 ; 0xcd6 <CDC_Device_ConfigureEndpoints>
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
320: 81 11 cpse r24, r1
322: 02 c0 rjmp .+4 ; 0x328 <EVENT_USB_Device_ConfigurationChanged+0xe>
324: 80 e2 ldi r24, 0x20 ; 32
326: 01 c0 rjmp .+2 ; 0x32a <EVENT_USB_Device_ConfigurationChanged+0x10>
328: 80 e1 ldi r24, 0x10 ; 16
32a: 0f cf rjmp .-482 ; 0x14a <LEDs_SetAllLEDs>
0000032c <EVENT_USB_Device_ControlRequest>:
}
/** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_ControlRequest(void)
{
CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface);
32c: 80 e0 ldi r24, 0x00 ; 0
32e: 91 e0 ldi r25, 0x01 ; 1
330: 8c c5 rjmp .+2840 ; 0xe4a <CDC_Device_ProcessControlRequest>
00000332 <__vector_23>:
/** ISR to manage the reception of data from the serial port, placing received bytes into a circular buffer
* for later transmission to the host.
*/
ISR(USART1_RX_vect, ISR_BLOCK)
{
332: 1f 92 push r1
334: 0f 92 push r0
336: 0f b6 in r0, 0x3f ; 63
338: 0f 92 push r0
33a: 11 24 eor r1, r1
33c: 2f 93 push r18
33e: 3f 93 push r19
340: 4f 93 push r20
342: 5f 93 push r21
344: 6f 93 push r22
346: 7f 93 push r23
348: 8f 93 push r24
34a: 9f 93 push r25
34c: af 93 push r26
34e: bf 93 push r27
350: ef 93 push r30
352: ff 93 push r31
uint8_t ReceivedByte = UDR1;
354: 60 91 ce 00 lds r22, 0x00CE
if ((USB_DeviceState == DEVICE_STATE_Configured) && !(RingBuffer_IsFull(&USARTtoUSB_Buffer)))
358: 8e b3 in r24, 0x1e ; 30
35a: 84 30 cpi r24, 0x04 ; 4
35c: 89 f4 brne .+34 ; 0x380 <__vector_23+0x4e>
static inline uint_reg_t GetGlobalInterruptMask(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
return SREG;
35e: 8f b7 in r24, 0x3f ; 63
static inline void GlobalInterruptDisable(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
cli();
360: f8 94 cli
362: 20 91 a6 01 lds r18, 0x01A6
366: 30 91 a7 01 lds r19, 0x01A7
static inline void SetGlobalInterruptMask(const uint_reg_t GlobalIntState)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
SREG = GlobalIntState;
36a: 8f bf out 0x3f, r24 ; 63
36c: 80 91 a4 01 lds r24, 0x01A4
370: 90 91 a5 01 lds r25, 0x01A5
374: 28 17 cp r18, r24
376: 39 07 cpc r19, r25
378: 19 f0 breq .+6 ; 0x380 <__vector_23+0x4e>
RingBuffer_Insert(&USARTtoUSB_Buffer, ReceivedByte);
37a: 8c e9 ldi r24, 0x9C ; 156
37c: 91 e0 ldi r25, 0x01 ; 1
37e: eb de rcall .-554 ; 0x156 <RingBuffer_Insert>
}
380: ff 91 pop r31
382: ef 91 pop r30
384: bf 91 pop r27
386: af 91 pop r26
388: 9f 91 pop r25
38a: 8f 91 pop r24
38c: 7f 91 pop r23
38e: 6f 91 pop r22
390: 5f 91 pop r21
392: 4f 91 pop r20
394: 3f 91 pop r19
396: 2f 91 pop r18
398: 0f 90 pop r0
39a: 0f be out 0x3f, r0 ; 63
39c: 0f 90 pop r0
39e: 1f 90 pop r1
3a0: 18 95 reti
000003a2 <EVENT_CDC_Device_LineEncodingChanged>:
/** Event handler for the CDC Class driver Line Encoding Changed event.
*
* \param[in] CDCInterfaceInfo Pointer to the CDC class interface configuration structure being referenced
*/
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
{
3a2: cf 93 push r28
3a4: fc 01 movw r30, r24
uint8_t ConfigMask = 0;
switch (CDCInterfaceInfo->State.LineEncoding.ParityType)
3a6: 81 8d ldd r24, Z+25 ; 0x19
3a8: 81 30 cpi r24, 0x01 ; 1
3aa: 21 f0 breq .+8 ; 0x3b4 <EVENT_CDC_Device_LineEncodingChanged+0x12>
3ac: 82 30 cpi r24, 0x02 ; 2
3ae: 21 f4 brne .+8 ; 0x3b8 <EVENT_CDC_Device_LineEncodingChanged+0x16>
{
case CDC_PARITY_Odd:
ConfigMask = ((1 << UPM11) | (1 << UPM10));
break;
case CDC_PARITY_Even:
ConfigMask = (1 << UPM11);
3b0: c0 e2 ldi r28, 0x20 ; 32
break;
3b2: 03 c0 rjmp .+6 ; 0x3ba <EVENT_CDC_Device_LineEncodingChanged+0x18>
uint8_t ConfigMask = 0;
switch (CDCInterfaceInfo->State.LineEncoding.ParityType)
{
case CDC_PARITY_Odd:
ConfigMask = ((1 << UPM11) | (1 << UPM10));
3b4: c0 e3 ldi r28, 0x30 ; 48
3b6: 01 c0 rjmp .+2 ; 0x3ba <EVENT_CDC_Device_LineEncodingChanged+0x18>
*
* \param[in] CDCInterfaceInfo Pointer to the CDC class interface configuration structure being referenced
*/
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
{
uint8_t ConfigMask = 0;
3b8: c0 e0 ldi r28, 0x00 ; 0
case CDC_PARITY_Even:
ConfigMask = (1 << UPM11);
break;
}
if (CDCInterfaceInfo->State.LineEncoding.CharFormat == CDC_LINEENCODING_TwoStopBits)
3ba: 80 8d ldd r24, Z+24 ; 0x18
3bc: 82 30 cpi r24, 0x02 ; 2
3be: 09 f4 brne .+2 ; 0x3c2 <EVENT_CDC_Device_LineEncodingChanged+0x20>
ConfigMask |= (1 << USBS1);
3c0: c8 60 ori r28, 0x08 ; 8
switch (CDCInterfaceInfo->State.LineEncoding.DataBits)
3c2: 82 8d ldd r24, Z+26 ; 0x1a
3c4: 87 30 cpi r24, 0x07 ; 7
3c6: 31 f0 breq .+12 ; 0x3d4 <EVENT_CDC_Device_LineEncodingChanged+0x32>
3c8: 88 30 cpi r24, 0x08 ; 8
3ca: 31 f0 breq .+12 ; 0x3d8 <EVENT_CDC_Device_LineEncodingChanged+0x36>
3cc: 86 30 cpi r24, 0x06 ; 6
3ce: 29 f4 brne .+10 ; 0x3da <EVENT_CDC_Device_LineEncodingChanged+0x38>
{
case 6:
ConfigMask |= (1 << UCSZ10);
3d0: c2 60 ori r28, 0x02 ; 2
break;
3d2: 03 c0 rjmp .+6 ; 0x3da <EVENT_CDC_Device_LineEncodingChanged+0x38>
case 7:
ConfigMask |= (1 << UCSZ11);
3d4: c4 60 ori r28, 0x04 ; 4
break;
3d6: 01 c0 rjmp .+2 ; 0x3da <EVENT_CDC_Device_LineEncodingChanged+0x38>
case 8:
ConfigMask |= ((1 << UCSZ11) | (1 << UCSZ10));
3d8: c6 60 ori r28, 0x06 ; 6
break;
}
/* Keep the TX line held high (idle) while the USART is reconfigured */
PORTD |= (1 << 3);
3da: 5b 9a sbi 0x0b, 3 ; 11
/* Must turn off USART before reconfiguring it, otherwise incorrect operation may occur */
UCSR1B = 0;
3dc: 10 92 c9 00 sts 0x00C9, r1
UCSR1A = 0;
3e0: 10 92 c8 00 sts 0x00C8, r1
UCSR1C = 0;
3e4: 10 92 ca 00 sts 0x00CA, r1
/* Set the new baud rate before configuring the USART */
UBRR1 = SERIAL_2X_UBBRVAL(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS);
3e8: 24 89 ldd r18, Z+20 ; 0x14
3ea: 35 89 ldd r19, Z+21 ; 0x15
3ec: 46 89 ldd r20, Z+22 ; 0x16
3ee: 57 89 ldd r21, Z+23 ; 0x17
3f0: da 01 movw r26, r20
3f2: c9 01 movw r24, r18
3f4: b6 95 lsr r27
3f6: a7 95 ror r26
3f8: 97 95 ror r25
3fa: 87 95 ror r24
3fc: bc 01 movw r22, r24
3fe: cd 01 movw r24, r26
400: 60 5c subi r22, 0xC0 ; 192
402: 7d 4b sbci r23, 0xBD ; 189
404: 80 4f sbci r24, 0xF0 ; 240
406: 9f 4f sbci r25, 0xFF ; 255
408: cf d5 rcall .+2974 ; 0xfa8 <__udivmodsi4>
40a: 21 50 subi r18, 0x01 ; 1
40c: 31 09 sbc r19, r1
40e: 30 93 cd 00 sts 0x00CD, r19
412: 20 93 cc 00 sts 0x00CC, r18
/* Reconfigure the USART in double speed mode for a wider baud rate range at the expense of accuracy */
UCSR1C = ConfigMask;
416: c0 93 ca 00 sts 0x00CA, r28
UCSR1A = (1 << U2X1);
41a: 82 e0 ldi r24, 0x02 ; 2
41c: 80 93 c8 00 sts 0x00C8, r24
UCSR1B = ((1 << RXCIE1) | (1 << TXEN1) | (1 << RXEN1));
420: 88 e9 ldi r24, 0x98 ; 152
422: 80 93 c9 00 sts 0x00C9, r24
/* Release the TX line after the USART has been reconfigured */
PORTD &= ~(1 << 3);
426: 5b 98 cbi 0x0b, 3 ; 11
}
428: cf 91 pop r28
42a: 08 95 ret
0000042c <CALLBACK_USB_GetDescriptor>:
*/
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint16_t wIndex,
const void** const DescriptorAddress)
{
const uint8_t DescriptorType = (wValue >> 8);
42c: 29 2f mov r18, r25
42e: 33 27 eor r19, r19
const uint8_t DescriptorNumber = (wValue & 0xFF);
const void* Address = NULL;
uint16_t Size = NO_DESCRIPTOR;
switch (DescriptorType)
430: 22 30 cpi r18, 0x02 ; 2
432: 31 05 cpc r19, r1
434: 59 f0 breq .+22 ; 0x44c <CALLBACK_USB_GetDescriptor+0x20>
436: 23 30 cpi r18, 0x03 ; 3
438: 31 05 cpc r19, r1
43a: 69 f0 breq .+26 ; 0x456 <CALLBACK_USB_GetDescriptor+0x2a>
43c: 21 30 cpi r18, 0x01 ; 1
43e: 31 05 cpc r19, r1
440: f9 f4 brne .+62 ; 0x480 <CALLBACK_USB_GetDescriptor+0x54>
{
case DTYPE_Device:
Address = &DeviceDescriptor;
Size = sizeof(USB_Descriptor_Device_t);
442: 82 e1 ldi r24, 0x12 ; 18
444: 90 e0 ldi r25, 0x00 ; 0
uint16_t Size = NO_DESCRIPTOR;
switch (DescriptorType)
{
case DTYPE_Device:
Address = &DeviceDescriptor;
446: 20 e0 ldi r18, 0x00 ; 0
448: 31 e0 ldi r19, 0x01 ; 1
44a: 1e c0 rjmp .+60 ; 0x488 <CALLBACK_USB_GetDescriptor+0x5c>
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
Address = &ConfigurationDescriptor;
Size = sizeof(USB_Descriptor_Configuration_t);
44c: 8e e3 ldi r24, 0x3E ; 62
44e: 90 e0 ldi r25, 0x00 ; 0
case DTYPE_Device:
Address = &DeviceDescriptor;
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
Address = &ConfigurationDescriptor;
450: 22 ec ldi r18, 0xC2 ; 194
452: 30 e0 ldi r19, 0x00 ; 0
Size = sizeof(USB_Descriptor_Configuration_t);
break;
454: 19 c0 rjmp .+50 ; 0x488 <CALLBACK_USB_GetDescriptor+0x5c>
456: 99 27 eor r25, r25
case DTYPE_String:
switch (DescriptorNumber)
458: 81 30 cpi r24, 0x01 ; 1
45a: 91 05 cpc r25, r1
45c: 41 f0 breq .+16 ; 0x46e <CALLBACK_USB_GetDescriptor+0x42>
45e: 82 30 cpi r24, 0x02 ; 2
460: 91 05 cpc r25, r1
462: 41 f0 breq .+16 ; 0x474 <CALLBACK_USB_GetDescriptor+0x48>
464: 89 2b or r24, r25
466: 61 f4 brne .+24 ; 0x480 <CALLBACK_USB_GetDescriptor+0x54>
{
case STRING_ID_Language:
Address = &LanguageString;
Size = pgm_read_byte(&LanguageString.Header.Size);
468: ee eb ldi r30, 0xBE ; 190
46a: f0 e0 ldi r31, 0x00 ; 0
46c: 05 c0 rjmp .+10 ; 0x478 <CALLBACK_USB_GetDescriptor+0x4c>
break;
case STRING_ID_Manufacturer:
Address = &ManufacturerString;
Size = pgm_read_byte(&ManufacturerString.Header.Size);
46e: e4 ea ldi r30, 0xA4 ; 164
470: f0 e0 ldi r31, 0x00 ; 0
472: 02 c0 rjmp .+4 ; 0x478 <CALLBACK_USB_GetDescriptor+0x4c>
break;
case STRING_ID_Product:
Address = &ProductString;
Size = pgm_read_byte(&ProductString.Header.Size);
474: e4 e7 ldi r30, 0x74 ; 116
476: f0 e0 ldi r31, 0x00 ; 0
478: 84 91 lpm r24, Z
47a: 90 e0 ldi r25, 0x00 ; 0
case STRING_ID_Manufacturer:
Address = &ManufacturerString;
Size = pgm_read_byte(&ManufacturerString.Header.Size);
break;
case STRING_ID_Product:
Address = &ProductString;
47c: 9f 01 movw r18, r30
Size = pgm_read_byte(&ProductString.Header.Size);
break;
47e: 04 c0 rjmp .+8 ; 0x488 <CALLBACK_USB_GetDescriptor+0x5c>
{
const uint8_t DescriptorType = (wValue >> 8);
const uint8_t DescriptorNumber = (wValue & 0xFF);
const void* Address = NULL;
uint16_t Size = NO_DESCRIPTOR;
480: 80 e0 ldi r24, 0x00 ; 0
482: 90 e0 ldi r25, 0x00 ; 0
const void** const DescriptorAddress)
{
const uint8_t DescriptorType = (wValue >> 8);
const uint8_t DescriptorNumber = (wValue & 0xFF);
const void* Address = NULL;
484: 20 e0 ldi r18, 0x00 ; 0
486: 30 e0 ldi r19, 0x00 ; 0
}
break;
}
*DescriptorAddress = Address;
488: fa 01 movw r30, r20
48a: 31 83 std Z+1, r19 ; 0x01
48c: 20 83 st Z, r18
return Size;
}
48e: 08 95 ret
00000490 <Endpoint_Write_Control_Stream_LE>:
else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)
return ENDPOINT_RWCSTREAM_BusSuspended;
}
return ENDPOINT_RWCSTREAM_NoError;
}
490: 20 91 3e 02 lds r18, 0x023E
494: 30 91 3f 02 lds r19, 0x023F
498: 26 17 cp r18, r22
49a: 37 07 cpc r19, r23
49c: 48 f0 brcs .+18 ; 0x4b0 <Endpoint_Write_Control_Stream_LE+0x20>
49e: 61 15 cp r22, r1
4a0: 71 05 cpc r23, r1
4a2: 39 f4 brne .+14 ; 0x4b2 <Endpoint_Write_Control_Stream_LE+0x22>
4a4: 20 91 e8 00 lds r18, 0x00E8
4a8: 2e 77 andi r18, 0x7E ; 126
4aa: 20 93 e8 00 sts 0x00E8, r18
4ae: 01 c0 rjmp .+2 ; 0x4b2 <Endpoint_Write_Control_Stream_LE+0x22>
4b0: b9 01 movw r22, r18
4b2: 40 e0 ldi r20, 0x00 ; 0
4b4: 61 15 cp r22, r1
4b6: 71 05 cpc r23, r1
4b8: 79 f1 breq .+94 ; 0x518 <Endpoint_Write_Control_Stream_LE+0x88>
4ba: 2e b3 in r18, 0x1e ; 30
4bc: 22 23 and r18, r18
4be: f1 f1 breq .+124 ; 0x53c <Endpoint_Write_Control_Stream_LE+0xac>
4c0: 25 30 cpi r18, 0x05 ; 5
4c2: f1 f1 breq .+124 ; 0x540 <Endpoint_Write_Control_Stream_LE+0xb0>
4c4: 20 91 e8 00 lds r18, 0x00E8
4c8: 23 fd sbrc r18, 3
4ca: 3c c0 rjmp .+120 ; 0x544 <Endpoint_Write_Control_Stream_LE+0xb4>
4cc: 20 91 e8 00 lds r18, 0x00E8
4d0: 22 fd sbrc r18, 2
4d2: 2e c0 rjmp .+92 ; 0x530 <Endpoint_Write_Control_Stream_LE+0xa0>
4d4: 20 91 e8 00 lds r18, 0x00E8
4d8: 20 ff sbrs r18, 0
4da: ec cf rjmp .-40 ; 0x4b4 <Endpoint_Write_Control_Stream_LE+0x24>
4dc: 20 91 f2 00 lds r18, 0x00F2
4e0: 30 e0 ldi r19, 0x00 ; 0
4e2: fc 01 movw r30, r24
4e4: cf 01 movw r24, r30
4e6: 61 15 cp r22, r1
4e8: 71 05 cpc r23, r1
4ea: 59 f0 breq .+22 ; 0x502 <Endpoint_Write_Control_Stream_LE+0x72>
4ec: 28 30 cpi r18, 0x08 ; 8
4ee: 31 05 cpc r19, r1
4f0: 40 f4 brcc .+16 ; 0x502 <Endpoint_Write_Control_Stream_LE+0x72>
4f2: 81 91 ld r24, Z+
4f4: 80 93 f1 00 sts 0x00F1, r24
4f8: 61 50 subi r22, 0x01 ; 1
4fa: 71 09 sbc r23, r1
4fc: 2f 5f subi r18, 0xFF ; 255
4fe: 3f 4f sbci r19, 0xFF ; 255
500: f1 cf rjmp .-30 ; 0x4e4 <Endpoint_Write_Control_Stream_LE+0x54>
502: 41 e0 ldi r20, 0x01 ; 1
504: 28 30 cpi r18, 0x08 ; 8
506: 31 05 cpc r19, r1
508: 09 f0 breq .+2 ; 0x50c <Endpoint_Write_Control_Stream_LE+0x7c>
50a: 40 e0 ldi r20, 0x00 ; 0
50c: 20 91 e8 00 lds r18, 0x00E8
510: 2e 77 andi r18, 0x7E ; 126
512: 20 93 e8 00 sts 0x00E8, r18
516: ce cf rjmp .-100 ; 0x4b4 <Endpoint_Write_Control_Stream_LE+0x24>
518: 41 11 cpse r20, r1
51a: cf cf rjmp .-98 ; 0x4ba <Endpoint_Write_Control_Stream_LE+0x2a>
51c: 09 c0 rjmp .+18 ; 0x530 <Endpoint_Write_Control_Stream_LE+0xa0>
51e: 8e b3 in r24, 0x1e ; 30
520: 88 23 and r24, r24
522: 61 f0 breq .+24 ; 0x53c <Endpoint_Write_Control_Stream_LE+0xac>
524: 85 30 cpi r24, 0x05 ; 5
526: 61 f0 breq .+24 ; 0x540 <Endpoint_Write_Control_Stream_LE+0xb0>
528: 80 91 e8 00 lds r24, 0x00E8
52c: 83 fd sbrc r24, 3
52e: 0a c0 rjmp .+20 ; 0x544 <Endpoint_Write_Control_Stream_LE+0xb4>
530: 80 91 e8 00 lds r24, 0x00E8
534: 82 ff sbrs r24, 2
536: f3 cf rjmp .-26 ; 0x51e <Endpoint_Write_Control_Stream_LE+0x8e>
538: 80 e0 ldi r24, 0x00 ; 0
53a: 08 95 ret
53c: 82 e0 ldi r24, 0x02 ; 2
53e: 08 95 ret
540: 83 e0 ldi r24, 0x03 ; 3
542: 08 95 ret
544: 81 e0 ldi r24, 0x01 ; 1
546: 08 95 ret
00000548 <Endpoint_Write_Control_PStream_LE>:
uint16_t Length)
{
uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length));
bool LastPacketFull = false;
if (Length > USB_ControlRequest.wLength)
548: 20 91 3e 02 lds r18, 0x023E
54c: 30 91 3f 02 lds r19, 0x023F
550: 26 17 cp r18, r22
552: 37 07 cpc r19, r23
554: 48 f0 brcs .+18 ; 0x568 <Endpoint_Write_Control_PStream_LE+0x20>
Length = USB_ControlRequest.wLength;
else if (!(Length))
556: 61 15 cp r22, r1
558: 71 05 cpc r23, r1
55a: 39 f4 brne .+14 ; 0x56a <Endpoint_Write_Control_PStream_LE+0x22>
*/
static inline void Endpoint_ClearIN(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearIN(void)
{
#if !defined(CONTROL_ONLY_DEVICE)
UEINTX &= ~((1 << TXINI) | (1 << FIFOCON));
55c: 20 91 e8 00 lds r18, 0x00E8
560: 2e 77 andi r18, 0x7E ; 126
562: 20 93 e8 00 sts 0x00E8, r18
566: 01 c0 rjmp .+2 ; 0x56a <Endpoint_Write_Control_PStream_LE+0x22>
568: b9 01 movw r22, r18
56a: fc 01 movw r30, r24
56c: 20 e0 ldi r18, 0x00 ; 0
Endpoint_ClearIN();
while (Length || LastPacketFull)
56e: 61 15 cp r22, r1
570: 71 05 cpc r23, r1
572: 61 f1 breq .+88 ; 0x5cc <Endpoint_Write_Control_PStream_LE+0x84>
{
uint8_t USB_DeviceState_LCL = USB_DeviceState;
574: 8e b3 in r24, 0x1e ; 30
if (USB_DeviceState_LCL == DEVICE_STATE_Unattached)
576: 88 23 and r24, r24
578: d9 f1 breq .+118 ; 0x5f0 <Endpoint_Write_Control_PStream_LE+0xa8>
return ENDPOINT_RWCSTREAM_DeviceDisconnected;
else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)
57a: 85 30 cpi r24, 0x05 ; 5
57c: d9 f1 breq .+118 ; 0x5f4 <Endpoint_Write_Control_PStream_LE+0xac>
* \return Boolean \c true if the selected endpoint has received a SETUP packet, \c false otherwise.
*/
static inline bool Endpoint_IsSETUPReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsSETUPReceived(void)
{
return ((UEINTX & (1 << RXSTPI)) ? true : false);
57e: 80 91 e8 00 lds r24, 0x00E8
return ENDPOINT_RWCSTREAM_BusSuspended;
else if (Endpoint_IsSETUPReceived())
582: 83 fd sbrc r24, 3
584: 39 c0 rjmp .+114 ; 0x5f8 <Endpoint_Write_Control_PStream_LE+0xb0>
* \return Boolean \c true if current endpoint is has received an OUT packet, \c false otherwise.
*/
static inline bool Endpoint_IsOUTReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsOUTReceived(void)
{
return ((UEINTX & (1 << RXOUTI)) ? true : false);
586: 80 91 e8 00 lds r24, 0x00E8
return ENDPOINT_RWCSTREAM_HostAborted;
else if (Endpoint_IsOUTReceived())
58a: 82 fd sbrc r24, 2
58c: 2b c0 rjmp .+86 ; 0x5e4 <Endpoint_Write_Control_PStream_LE+0x9c>
* \return Boolean \c true if the current endpoint is ready for an IN packet, \c false otherwise.
*/
static inline bool Endpoint_IsINReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsINReady(void)
{
return ((UEINTX & (1 << TXINI)) ? true : false);
58e: 80 91 e8 00 lds r24, 0x00E8
break;
if (Endpoint_IsINReady())
592: 80 ff sbrs r24, 0
594: ec cf rjmp .-40 ; 0x56e <Endpoint_Write_Control_PStream_LE+0x26>
#if (defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR))
return UEBCX;
#elif defined(USB_SERIES_4_AVR)
return (((uint16_t)UEBCHX << 8) | UEBCLX);
#elif defined(USB_SERIES_2_AVR)
return UEBCLX;
596: 80 91 f2 00 lds r24, 0x00F2
59a: 90 e0 ldi r25, 0x00 ; 0
{
uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint();
while (Length && (BytesInEndpoint < USB_Device_ControlEndpointSize))
59c: 61 15 cp r22, r1
59e: 71 05 cpc r23, r1
5a0: 59 f0 breq .+22 ; 0x5b8 <Endpoint_Write_Control_PStream_LE+0x70>
5a2: 88 30 cpi r24, 0x08 ; 8
5a4: 91 05 cpc r25, r1
5a6: 40 f4 brcc .+16 ; 0x5b8 <Endpoint_Write_Control_PStream_LE+0x70>
{
TEMPLATE_TRANSFER_BYTE(DataStream);
5a8: 24 91 lpm r18, Z
* \param[in] Data Data to write into the the currently selected endpoint's FIFO buffer.
*/
static inline void Endpoint_Write_8(const uint8_t Data) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_8(const uint8_t Data)
{
UEDATX = Data;
5aa: 20 93 f1 00 sts 0x00F1, r18
TEMPLATE_BUFFER_MOVE(DataStream, 1);
5ae: 31 96 adiw r30, 0x01 ; 1
Length--;
5b0: 61 50 subi r22, 0x01 ; 1
5b2: 71 09 sbc r23, r1
BytesInEndpoint++;
5b4: 01 96 adiw r24, 0x01 ; 1
5b6: f2 cf rjmp .-28 ; 0x59c <Endpoint_Write_Control_PStream_LE+0x54>
}
LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize);
5b8: 21 e0 ldi r18, 0x01 ; 1
5ba: 08 97 sbiw r24, 0x08 ; 8
5bc: 09 f0 breq .+2 ; 0x5c0 <Endpoint_Write_Control_PStream_LE+0x78>
5be: 20 e0 ldi r18, 0x00 ; 0
*/
static inline void Endpoint_ClearIN(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearIN(void)
{
#if !defined(CONTROL_ONLY_DEVICE)
UEINTX &= ~((1 << TXINI) | (1 << FIFOCON));
5c0: 80 91 e8 00 lds r24, 0x00E8
5c4: 8e 77 andi r24, 0x7E ; 126
5c6: 80 93 e8 00 sts 0x00E8, r24
5ca: d1 cf rjmp .-94 ; 0x56e <Endpoint_Write_Control_PStream_LE+0x26>
if (Length > USB_ControlRequest.wLength)
Length = USB_ControlRequest.wLength;
else if (!(Length))
Endpoint_ClearIN();
while (Length || LastPacketFull)
5cc: 21 11 cpse r18, r1
5ce: d2 cf rjmp .-92 ; 0x574 <Endpoint_Write_Control_PStream_LE+0x2c>
5d0: 09 c0 rjmp .+18 ; 0x5e4 <Endpoint_Write_Control_PStream_LE+0x9c>
}
}
while (!(Endpoint_IsOUTReceived()))
{
uint8_t USB_DeviceState_LCL = USB_DeviceState;
5d2: 8e b3 in r24, 0x1e ; 30
if (USB_DeviceState_LCL == DEVICE_STATE_Unattached)
5d4: 88 23 and r24, r24
5d6: 61 f0 breq .+24 ; 0x5f0 <Endpoint_Write_Control_PStream_LE+0xa8>
return ENDPOINT_RWCSTREAM_DeviceDisconnected;
else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)
5d8: 85 30 cpi r24, 0x05 ; 5
5da: 61 f0 breq .+24 ; 0x5f4 <Endpoint_Write_Control_PStream_LE+0xac>
* \return Boolean \c true if the selected endpoint has received a SETUP packet, \c false otherwise.
*/
static inline bool Endpoint_IsSETUPReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsSETUPReceived(void)
{
return ((UEINTX & (1 << RXSTPI)) ? true : false);
5dc: 80 91 e8 00 lds r24, 0x00E8
return ENDPOINT_RWCSTREAM_BusSuspended;
else if (Endpoint_IsSETUPReceived())
5e0: 83 fd sbrc r24, 3
5e2: 0a c0 rjmp .+20 ; 0x5f8 <Endpoint_Write_Control_PStream_LE+0xb0>
* \return Boolean \c true if current endpoint is has received an OUT packet, \c false otherwise.
*/
static inline bool Endpoint_IsOUTReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsOUTReceived(void)
{
return ((UEINTX & (1 << RXOUTI)) ? true : false);
5e4: 80 91 e8 00 lds r24, 0x00E8
LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize);
Endpoint_ClearIN();
}
}
while (!(Endpoint_IsOUTReceived()))
5e8: 82 ff sbrs r24, 2
5ea: f3 cf rjmp .-26 ; 0x5d2 <Endpoint_Write_Control_PStream_LE+0x8a>
return ENDPOINT_RWCSTREAM_BusSuspended;
else if (Endpoint_IsSETUPReceived())
return ENDPOINT_RWCSTREAM_HostAborted;
}
return ENDPOINT_RWCSTREAM_NoError;
5ec: 80 e0 ldi r24, 0x00 ; 0
5ee: 08 95 ret
while (Length || LastPacketFull)
{
uint8_t USB_DeviceState_LCL = USB_DeviceState;
if (USB_DeviceState_LCL == DEVICE_STATE_Unattached)
return ENDPOINT_RWCSTREAM_DeviceDisconnected;
5f0: 82 e0 ldi r24, 0x02 ; 2
5f2: 08 95 ret
else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)
return ENDPOINT_RWCSTREAM_BusSuspended;
5f4: 83 e0 ldi r24, 0x03 ; 3
5f6: 08 95 ret
else if (Endpoint_IsSETUPReceived())
return ENDPOINT_RWCSTREAM_HostAborted;
5f8: 81 e0 ldi r24, 0x01 ; 1
else if (Endpoint_IsSETUPReceived())
return ENDPOINT_RWCSTREAM_HostAborted;
}
return ENDPOINT_RWCSTREAM_NoError;
}
5fa: 08 95 ret
000005fc <Endpoint_ConfigureEndpoint_Prv>:
UEIENX = 0;
UEINTX = 0;
UECFG1X = 0;
Endpoint_DisableEndpoint();
}
}
5fc: 98 2f mov r25, r24
5fe: 95 30 cpi r25, 0x05 ; 5
600: 58 f5 brcc .+86 ; 0x658 <Endpoint_ConfigureEndpoint_Prv+0x5c>
602: 90 93 e9 00 sts 0x00E9, r25
606: 98 17 cp r25, r24
608: 39 f0 breq .+14 ; 0x618 <Endpoint_ConfigureEndpoint_Prv+0x1c>
60a: 70 91 ec 00 lds r23, 0x00EC
60e: 20 91 ed 00 lds r18, 0x00ED
612: 50 91 f0 00 lds r21, 0x00F0
616: 03 c0 rjmp .+6 ; 0x61e <Endpoint_ConfigureEndpoint_Prv+0x22>
618: 24 2f mov r18, r20
61a: 76 2f mov r23, r22
61c: 50 e0 ldi r21, 0x00 ; 0
61e: 21 ff sbrs r18, 1
620: 19 c0 rjmp .+50 ; 0x654 <Endpoint_ConfigureEndpoint_Prv+0x58>
622: 30 91 eb 00 lds r19, 0x00EB
626: 3e 7f andi r19, 0xFE ; 254
628: 30 93 eb 00 sts 0x00EB, r19
62c: 30 91 ed 00 lds r19, 0x00ED
630: 3d 7f andi r19, 0xFD ; 253
632: 30 93 ed 00 sts 0x00ED, r19
636: 30 91 eb 00 lds r19, 0x00EB
63a: 31 60 ori r19, 0x01 ; 1
63c: 30 93 eb 00 sts 0x00EB, r19
640: 70 93 ec 00 sts 0x00EC, r23
644: 20 93 ed 00 sts 0x00ED, r18
648: 50 93 f0 00 sts 0x00F0, r21
64c: 20 91 ee 00 lds r18, 0x00EE
650: 27 ff sbrs r18, 7
652: 07 c0 rjmp .+14 ; 0x662 <Endpoint_ConfigureEndpoint_Prv+0x66>
654: 9f 5f subi r25, 0xFF ; 255
656: d3 cf rjmp .-90 ; 0x5fe <Endpoint_ConfigureEndpoint_Prv+0x2>
658: 8f 70 andi r24, 0x0F ; 15
65a: 80 93 e9 00 sts 0x00E9, r24
65e: 81 e0 ldi r24, 0x01 ; 1
660: 08 95 ret
662: 80 e0 ldi r24, 0x00 ; 0
664: 08 95 ret
00000666 <Endpoint_ConfigureEndpointTable>:
666: ef 92 push r14
668: ff 92 push r15
66a: 0f 93 push r16
66c: 1f 93 push r17
66e: cf 93 push r28
670: df 93 push r29
672: e6 2e mov r14, r22
674: ec 01 movw r28, r24
676: 8c 01 movw r16, r24
678: 0c 5f subi r16, 0xFC ; 252
67a: 1f 4f sbci r17, 0xFF ; 255
67c: f1 2c mov r15, r1
67e: fe 14 cp r15, r14
680: 99 f1 breq .+102 ; 0x6e8 <Endpoint_ConfigureEndpointTable+0x82>
682: 98 81 ld r25, Y
684: 99 23 and r25, r25
686: 59 f1 breq .+86 ; 0x6de <Endpoint_ConfigureEndpointTable+0x78>
688: f8 01 movw r30, r16
68a: 20 81 ld r18, Z
68c: 69 81 ldd r22, Y+1 ; 0x01
68e: 7a 81 ldd r23, Y+2 ; 0x02
690: 31 97 sbiw r30, 0x01 ; 1
692: 30 81 ld r19, Z
694: 89 2f mov r24, r25
696: 8f 70 andi r24, 0x0F ; 15
698: 85 30 cpi r24, 0x05 ; 5
69a: 10 f0 brcs .+4 ; 0x6a0 <Endpoint_ConfigureEndpointTable+0x3a>
69c: 80 e0 ldi r24, 0x00 ; 0
69e: 25 c0 rjmp .+74 ; 0x6ea <Endpoint_ConfigureEndpointTable+0x84>
6a0: 22 30 cpi r18, 0x02 ; 2
6a2: 10 f4 brcc .+4 ; 0x6a8 <Endpoint_ConfigureEndpointTable+0x42>
6a4: 42 e0 ldi r20, 0x02 ; 2
6a6: 01 c0 rjmp .+2 ; 0x6aa <Endpoint_ConfigureEndpointTable+0x44>
6a8: 46 e0 ldi r20, 0x06 ; 6
6aa: e8 e0 ldi r30, 0x08 ; 8
6ac: f0 e0 ldi r31, 0x00 ; 0
6ae: 20 e0 ldi r18, 0x00 ; 0
6b0: e6 17 cp r30, r22
6b2: f7 07 cpc r31, r23
6b4: 20 f4 brcc .+8 ; 0x6be <Endpoint_ConfigureEndpointTable+0x58>
6b6: 2f 5f subi r18, 0xFF ; 255
6b8: ee 0f add r30, r30
6ba: ff 1f adc r31, r31
6bc: f9 cf rjmp .-14 ; 0x6b0 <Endpoint_ConfigureEndpointTable+0x4a>
6be: 22 95 swap r18
6c0: 20 7f andi r18, 0xF0 ; 240
6c2: 42 2b or r20, r18
6c4: 23 2f mov r18, r19
6c6: 22 95 swap r18
6c8: 22 0f add r18, r18
6ca: 22 0f add r18, r18
6cc: 20 7c andi r18, 0xC0 ; 192
6ce: 99 1f adc r25, r25
6d0: 99 27 eor r25, r25
6d2: 99 1f adc r25, r25
6d4: 62 2f mov r22, r18
6d6: 69 2b or r22, r25
6d8: 91 df rcall .-222 ; 0x5fc <Endpoint_ConfigureEndpoint_Prv>
6da: 88 23 and r24, r24
6dc: f9 f2 breq .-66 ; 0x69c <Endpoint_ConfigureEndpointTable+0x36>
6de: f3 94 inc r15
6e0: 25 96 adiw r28, 0x05 ; 5
6e2: 0b 5f subi r16, 0xFB ; 251
6e4: 1f 4f sbci r17, 0xFF ; 255
6e6: cb cf rjmp .-106 ; 0x67e <Endpoint_ConfigureEndpointTable+0x18>
6e8: 81 e0 ldi r24, 0x01 ; 1
6ea: df 91 pop r29
6ec: cf 91 pop r28
6ee: 1f 91 pop r17
6f0: 0f 91 pop r16
6f2: ff 90 pop r15
6f4: ef 90 pop r14
6f6: 08 95 ret
000006f8 <Endpoint_ClearStatusStage>:
void Endpoint_ClearStatusStage(void)
{
if (USB_ControlRequest.bmRequestType & REQDIR_DEVICETOHOST)
6f8: 80 91 38 02 lds r24, 0x0238
6fc: 87 ff sbrs r24, 7
6fe: 0f c0 rjmp .+30 ; 0x71e <Endpoint_ClearStatusStage+0x26>
* \return Boolean \c true if current endpoint is has received an OUT packet, \c false otherwise.
*/
static inline bool Endpoint_IsOUTReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsOUTReceived(void)
{
return ((UEINTX & (1 << RXOUTI)) ? true : false);
700: 80 91 e8 00 lds r24, 0x00E8
{
while (!(Endpoint_IsOUTReceived()))
704: 82 fd sbrc r24, 2
706: 04 c0 rjmp .+8 ; 0x710 <Endpoint_ClearStatusStage+0x18>
{
if (USB_DeviceState == DEVICE_STATE_Unattached)
708: 8e b3 in r24, 0x1e ; 30
70a: 81 11 cpse r24, r1
70c: f9 cf rjmp .-14 ; 0x700 <Endpoint_ClearStatusStage+0x8>
70e: 10 c0 rjmp .+32 ; 0x730 <Endpoint_ClearStatusStage+0x38>
*/
static inline void Endpoint_ClearOUT(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearOUT(void)
{
#if !defined(CONTROL_ONLY_DEVICE)
UEINTX &= ~((1 << RXOUTI) | (1 << FIFOCON));
710: 80 91 e8 00 lds r24, 0x00E8
714: 8b 77 andi r24, 0x7B ; 123
716: 0a c0 rjmp .+20 ; 0x72c <Endpoint_ClearStatusStage+0x34>
}
else
{
while (!(Endpoint_IsINReady()))
{
if (USB_DeviceState == DEVICE_STATE_Unattached)
718: 8e b3 in r24, 0x1e ; 30
71a: 88 23 and r24, r24
71c: 49 f0 breq .+18 ; 0x730 <Endpoint_ClearStatusStage+0x38>
* \return Boolean \c true if the current endpoint is ready for an IN packet, \c false otherwise.
*/
static inline bool Endpoint_IsINReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsINReady(void)
{
return ((UEINTX & (1 << TXINI)) ? true : false);
71e: 80 91 e8 00 lds r24, 0x00E8
Endpoint_ClearOUT();
}
else
{
while (!(Endpoint_IsINReady()))
722: 80 ff sbrs r24, 0
724: f9 cf rjmp .-14 ; 0x718 <Endpoint_ClearStatusStage+0x20>
*/
static inline void Endpoint_ClearIN(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearIN(void)
{
#if !defined(CONTROL_ONLY_DEVICE)
UEINTX &= ~((1 << TXINI) | (1 << FIFOCON));
726: 80 91 e8 00 lds r24, 0x00E8
72a: 8e 77 andi r24, 0x7E ; 126
72c: 80 93 e8 00 sts 0x00E8, r24
730: 08 95 ret
00000732 <Endpoint_WaitUntilReady>:
* \return Current USB frame number from the USB controller.
*/
static inline uint16_t USB_Device_GetFrameNumber(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline uint16_t USB_Device_GetFrameNumber(void)
{
return UDFNUM;
732: 20 91 e4 00 lds r18, 0x00E4
736: 30 91 e5 00 lds r19, 0x00E5
73a: 95 e6 ldi r25, 0x65 ; 101
* \return The currently selected endpoint's direction, as a \c ENDPOINT_DIR_* mask.
*/
static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_GetEndpointDirection(void)
{
return (UECFG0X & (1 << EPDIR)) ? ENDPOINT_DIR_IN : ENDPOINT_DIR_OUT;
73c: 40 91 ec 00 lds r20, 0x00EC
740: 84 2f mov r24, r20
742: 81 70 andi r24, 0x01 ; 1
744: 40 ff sbrs r20, 0
746: 21 c0 rjmp .+66 ; 0x78a <Endpoint_WaitUntilReady+0x58>
* \return Boolean \c true if the current endpoint is ready for an IN packet, \c false otherwise.
*/
static inline bool Endpoint_IsINReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsINReady(void)
{
return ((UEINTX & (1 << TXINI)) ? true : false);
748: 80 91 e8 00 lds r24, 0x00E8
for (;;)
{
if (Endpoint_GetEndpointDirection() == ENDPOINT_DIR_IN)
{
if (Endpoint_IsINReady())
74c: 80 fd sbrc r24, 0
74e: 1b c0 rjmp .+54 ; 0x786 <Endpoint_WaitUntilReady+0x54>
{
if (Endpoint_IsOUTReceived())
return ENDPOINT_READYWAIT_NoError;
}
uint8_t USB_DeviceState_LCL = USB_DeviceState;
750: 8e b3 in r24, 0x1e ; 30
if (USB_DeviceState_LCL == DEVICE_STATE_Unattached)
752: 88 23 and r24, r24
754: 91 f0 breq .+36 ; 0x77a <Endpoint_WaitUntilReady+0x48>
return ENDPOINT_READYWAIT_DeviceDisconnected;
else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)
756: 85 30 cpi r24, 0x05 ; 5
758: 91 f0 breq .+36 ; 0x77e <Endpoint_WaitUntilReady+0x4c>
* \return Boolean \c true if the currently selected endpoint is stalled, \c false otherwise.
*/
static inline bool Endpoint_IsStalled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsStalled(void)
{
return ((UECONX & (1 << STALLRQ)) ? true : false);
75a: 80 91 eb 00 lds r24, 0x00EB
return ENDPOINT_READYWAIT_BusSuspended;
else if (Endpoint_IsStalled())
75e: 85 fd sbrc r24, 5
760: 10 c0 rjmp .+32 ; 0x782 <Endpoint_WaitUntilReady+0x50>
762: 40 91 e4 00 lds r20, 0x00E4
766: 50 91 e5 00 lds r21, 0x00E5
return ENDPOINT_READYWAIT_EndpointStalled;
uint16_t CurrentFrameNumber = USB_Device_GetFrameNumber();
if (CurrentFrameNumber != PreviousFrameNumber)
76a: 42 17 cp r20, r18
76c: 53 07 cpc r21, r19
76e: 31 f3 breq .-52 ; 0x73c <Endpoint_WaitUntilReady+0xa>
770: 9a 01 movw r18, r20
772: 91 50 subi r25, 0x01 ; 1
{
PreviousFrameNumber = CurrentFrameNumber;
if (!(TimeoutMSRem--))
774: 19 f7 brne .-58 ; 0x73c <Endpoint_WaitUntilReady+0xa>
return ENDPOINT_READYWAIT_Timeout;
776: 84 e0 ldi r24, 0x04 ; 4
778: 08 95 ret
}
uint8_t USB_DeviceState_LCL = USB_DeviceState;
if (USB_DeviceState_LCL == DEVICE_STATE_Unattached)
return ENDPOINT_READYWAIT_DeviceDisconnected;
77a: 82 e0 ldi r24, 0x02 ; 2
77c: 08 95 ret
else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)
return ENDPOINT_READYWAIT_BusSuspended;
77e: 83 e0 ldi r24, 0x03 ; 3
780: 08 95 ret
else if (Endpoint_IsStalled())
return ENDPOINT_READYWAIT_EndpointStalled;
782: 81 e0 ldi r24, 0x01 ; 1
784: 08 95 ret
for (;;)
{
if (Endpoint_GetEndpointDirection() == ENDPOINT_DIR_IN)
{
if (Endpoint_IsINReady())
return ENDPOINT_READYWAIT_NoError;
786: 80 e0 ldi r24, 0x00 ; 0
788: 08 95 ret
* \return Boolean \c true if current endpoint is has received an OUT packet, \c false otherwise.
*/
static inline bool Endpoint_IsOUTReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsOUTReceived(void)
{
return ((UEINTX & (1 << RXOUTI)) ? true : false);
78a: 40 91 e8 00 lds r20, 0x00E8
}
else
{
if (Endpoint_IsOUTReceived())
78e: 42 ff sbrs r20, 2
790: df cf rjmp .-66 ; 0x750 <Endpoint_WaitUntilReady+0x1e>
if (!(TimeoutMSRem--))
return ENDPOINT_READYWAIT_Timeout;
}
}
}
792: 08 95 ret
00000794 <USB_ResetInterface>:
{
#if defined(USB_CAN_BE_BOTH)
bool UIDModeSelectEnabled = ((UHWCON & (1 << UIDE)) != 0);
#endif
USB_INT_DisableAllInterrupts();
794: 3f d0 rcall .+126 ; 0x814 <USB_INT_DisableAllInterrupts>
USB_INT_ClearAllInterrupts();
796: 41 d0 rcall .+130 ; 0x81a <USB_INT_ClearAllInterrupts>
}
static inline void USB_Controller_Reset(void) ATTR_ALWAYS_INLINE;
static inline void USB_Controller_Reset(void)
{
USBCON &= ~(1 << USBE);
798: 80 91 d8 00 lds r24, 0x00D8
79c: 8f 77 andi r24, 0x7F ; 127
79e: 80 93 d8 00 sts 0x00D8, r24
USBCON |= (1 << USBE);
7a2: 80 91 d8 00 lds r24, 0x00D8
7a6: 80 68 ori r24, 0x80 ; 128
7a8: 80 93 d8 00 sts 0x00D8, r24
}
static inline void USB_CLK_Unfreeze(void) ATTR_ALWAYS_INLINE;
static inline void USB_CLK_Unfreeze(void)
{
USBCON &= ~(1 << FRZCLK);
7ac: 80 91 d8 00 lds r24, 0x00D8
7b0: 8f 7d andi r24, 0xDF ; 223
7b2: 80 93 d8 00 sts 0x00D8, r24
/* Inline Functions: */
static inline void USB_PLL_On(void) ATTR_ALWAYS_INLINE;
static inline void USB_PLL_On(void)
{
PLLCSR = USB_PLL_PSC;
7b6: 19 bc out 0x29, r1 ; 41
PLLCSR = (USB_PLL_PSC | (1 << PLLE));
7b8: 82 e0 ldi r24, 0x02 ; 2
7ba: 89 bd out 0x29, r24 ; 41
if (!(USB_Options & USB_OPT_MANUAL_PLL))
{
#if defined(USB_SERIES_2_AVR)
USB_PLL_On();
while (!(USB_PLL_IsReady()));
7bc: 09 b4 in r0, 0x29 ; 41
7be: 00 fe sbrs r0, 0
7c0: fd cf rjmp .-6 ; 0x7bc <USB_ResetInterface+0x28>
}
#if defined(USB_CAN_BE_DEVICE)
static void USB_Init_Device(void)
{
USB_DeviceState = DEVICE_STATE_Unattached;
7c2: 1e ba out 0x1e, r1 ; 30
USB_Device_ConfigurationNumber = 0;
7c4: 10 92 34 02 sts 0x0234, r1
#if !defined(NO_DEVICE_REMOTE_WAKEUP)
USB_Device_RemoteWakeupEnabled = false;
7c8: 10 92 36 02 sts 0x0236, r1
#endif
#if !defined(NO_DEVICE_SELF_POWER)
USB_Device_CurrentlySelfPowered = false;
7cc: 10 92 35 02 sts 0x0235, r1
uint8_t Number = (Address & ENDPOINT_EPNUM_MASK);
if (Number >= ENDPOINT_TOTAL_ENDPOINTS)
return false;
return Endpoint_ConfigureEndpoint_Prv(Number,
7d0: 42 e0 ldi r20, 0x02 ; 2
7d2: 60 e0 ldi r22, 0x00 ; 0
7d4: 80 e0 ldi r24, 0x00 ; 0
7d6: 12 df rcall .-476 ; 0x5fc <Endpoint_ConfigureEndpoint_Prv>
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
UDINT &= ~(1 << WAKEUPI);
break;
case USB_INT_SUSPI:
UDINT &= ~(1 << SUSPI);
7d8: 80 91 e1 00 lds r24, 0x00E1
7dc: 8e 7f andi r24, 0xFE ; 254
7de: 80 93 e1 00 sts 0x00E1, r24
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
UDIEN |= (1 << WAKEUPE);
break;
case USB_INT_SUSPI:
UDIEN |= (1 << SUSPE);
7e2: 80 91 e2 00 lds r24, 0x00E2
7e6: 81 60 ori r24, 0x01 ; 1
7e8: 80 93 e2 00 sts 0x00E2, r24
break;
case USB_INT_EORSTI:
UDIEN |= (1 << EORSTE);
7ec: 80 91 e2 00 lds r24, 0x00E2
7f0: 88 60 ori r24, 0x08 ; 8
7f2: 80 93 e2 00 sts 0x00E2, r24
* register and despite the datasheet making no mention of its requirement in host mode.
*/
static inline void USB_Attach(void) ATTR_ALWAYS_INLINE;
static inline void USB_Attach(void)
{
UDCON &= ~(1 << DETACH);
7f6: 80 91 e0 00 lds r24, 0x00E0
7fa: 8e 7f andi r24, 0xFE ; 254
7fc: 80 93 e0 00 sts 0x00E0, r24
800: 08 95 ret
00000802 <USB_Init>:
static inline void USB_REG_On(void)
{
#if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)
UHWCON |= (1 << UVREGE);
#else
REGCR &= ~(1 << REGDIS);
802: e3 e6 ldi r30, 0x63 ; 99
804: f0 e0 ldi r31, 0x00 ; 0
806: 80 81 ld r24, Z
808: 8e 7f andi r24, 0xFE ; 254
80a: 80 83 st Z, r24
UHWCON &= ~(1 << UIDE);
USB_CurrentMode = Mode;
}
#endif
USB_IsInitialized = true;
80c: 81 e0 ldi r24, 0x01 ; 1
80e: 80 93 37 02 sts 0x0237, r24
USB_ResetInterface();
812: c0 cf rjmp .-128 ; 0x794 <USB_ResetInterface>
00000814 <USB_INT_DisableAllInterrupts>:
#if defined(USB_CAN_BE_HOST)
UHIEN = 0;
#endif
#if defined(USB_CAN_BE_DEVICE)
UDIEN = 0;
814: 10 92 e2 00 sts 0x00E2, r1
818: 08 95 ret
0000081a <USB_INT_ClearAllInterrupts>:
#if defined(USB_CAN_BE_HOST)
UHINT = 0;
#endif
#if defined(USB_CAN_BE_DEVICE)
UDINT = 0;
81a: 10 92 e1 00 sts 0x00E1, r1
81e: 08 95 ret
00000820 <__vector_11>:
#endif
}
ISR(USB_GEN_vect, ISR_BLOCK)
{
820: 1f 92 push r1
822: 0f 92 push r0
824: 0f b6 in r0, 0x3f ; 63
826: 0f 92 push r0
828: 11 24 eor r1, r1
82a: 2f 93 push r18
82c: 3f 93 push r19
82e: 4f 93 push r20
830: 5f 93 push r21
832: 6f 93 push r22
834: 7f 93 push r23
836: 8f 93 push r24
838: 9f 93 push r25
83a: af 93 push r26
83c: bf 93 push r27
83e: ef 93 push r30
840: ff 93 push r31
case USB_INT_SUSPI:
return (UDINT & (1 << SUSPI));
case USB_INT_EORSTI:
return (UDINT & (1 << EORSTI));
case USB_INT_SOFI:
return (UDINT & (1 << SOFI));
842: 80 91 e1 00 lds r24, 0x00E1
#if defined(USB_CAN_BE_DEVICE)
#if !defined(NO_SOF_EVENTS)
if (USB_INT_HasOccurred(USB_INT_SOFI) && USB_INT_IsEnabled(USB_INT_SOFI))
846: 82 ff sbrs r24, 2
848: 0a c0 rjmp .+20 ; 0x85e <__vector_11+0x3e>
case USB_INT_SUSPI:
return (UDIEN & (1 << SUSPE));
case USB_INT_EORSTI:
return (UDIEN & (1 << EORSTE));
case USB_INT_SOFI:
return (UDIEN & (1 << SOFE));
84a: 80 91 e2 00 lds r24, 0x00E2
84e: 82 ff sbrs r24, 2
850: 06 c0 rjmp .+12 ; 0x85e <__vector_11+0x3e>
break;
case USB_INT_EORSTI:
UDINT &= ~(1 << EORSTI);
break;
case USB_INT_SOFI:
UDINT &= ~(1 << SOFI);
852: 80 91 e1 00 lds r24, 0x00E1
856: 8b 7f andi r24, 0xFB ; 251
858: 80 93 e1 00 sts 0x00E1, r24
{
USB_INT_Clear(USB_INT_SOFI);
EVENT_USB_Device_StartOfFrame();
85c: 22 d2 rcall .+1092 ; 0xca2 <USB_Event_Stub>
#endif
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
return (UDINT & (1 << WAKEUPI));
case USB_INT_SUSPI:
return (UDINT & (1 << SUSPI));
85e: 80 91 e1 00 lds r24, 0x00E1
EVENT_USB_Device_Disconnect();
}
}
#endif
if (USB_INT_HasOccurred(USB_INT_SUSPI) && USB_INT_IsEnabled(USB_INT_SUSPI))
862: 80 ff sbrs r24, 0
864: 16 c0 rjmp .+44 ; 0x892 <__vector_11+0x72>
#endif
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
return (UDIEN & (1 << WAKEUPE));
case USB_INT_SUSPI:
return (UDIEN & (1 << SUSPE));
866: 80 91 e2 00 lds r24, 0x00E2
86a: 80 ff sbrs r24, 0
86c: 12 c0 rjmp .+36 ; 0x892 <__vector_11+0x72>
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
UDIEN &= ~(1 << WAKEUPE);
break;
case USB_INT_SUSPI:
UDIEN &= ~(1 << SUSPE);
86e: 80 91 e2 00 lds r24, 0x00E2
872: 8e 7f andi r24, 0xFE ; 254
874: 80 93 e2 00 sts 0x00E2, r24
USBCON |= (1 << IDTE);
break;
#endif
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
UDIEN |= (1 << WAKEUPE);
878: 80 91 e2 00 lds r24, 0x00E2
87c: 80 61 ori r24, 0x10 ; 16
87e: 80 93 e2 00 sts 0x00E2, r24
#endif
static inline void USB_CLK_Freeze(void) ATTR_ALWAYS_INLINE;
static inline void USB_CLK_Freeze(void)
{
USBCON |= (1 << FRZCLK);
882: 80 91 d8 00 lds r24, 0x00D8
886: 80 62 ori r24, 0x20 ; 32
888: 80 93 d8 00 sts 0x00D8, r24
}
static inline void USB_PLL_Off(void) ATTR_ALWAYS_INLINE;
static inline void USB_PLL_Off(void)
{
PLLCSR = 0;
88c: 19 bc out 0x29, r1 ; 41
if (!(USB_Options & USB_OPT_MANUAL_PLL))
USB_PLL_Off();
#if defined(USB_SERIES_2_AVR) && !defined(NO_LIMITED_CONTROLLER_CONNECT)
USB_DeviceState = DEVICE_STATE_Unattached;
88e: 1e ba out 0x1e, r1 ; 30
EVENT_USB_Device_Disconnect();
890: 42 dd rcall .-1404 ; 0x316 <EVENT_USB_Device_Disconnect>
case USB_INT_IDTI:
return (USBINT & (1 << IDTI));
#endif
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
return (UDINT & (1 << WAKEUPI));
892: 80 91 e1 00 lds r24, 0x00E1
USB_DeviceState = DEVICE_STATE_Suspended;
EVENT_USB_Device_Suspend();
#endif
}
if (USB_INT_HasOccurred(USB_INT_WAKEUPI) && USB_INT_IsEnabled(USB_INT_WAKEUPI))
896: 84 ff sbrs r24, 4
898: 2d c0 rjmp .+90 ; 0x8f4 <__vector_11+0xd4>
case USB_INT_IDTI:
return (USBCON & (1 << IDTE));
#endif
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
return (UDIEN & (1 << WAKEUPE));
89a: 80 91 e2 00 lds r24, 0x00E2
89e: 84 ff sbrs r24, 4
8a0: 29 c0 rjmp .+82 ; 0x8f4 <__vector_11+0xd4>
/* Inline Functions: */
static inline void USB_PLL_On(void) ATTR_ALWAYS_INLINE;
static inline void USB_PLL_On(void)
{
PLLCSR = USB_PLL_PSC;
8a2: 19 bc out 0x29, r1 ; 41
PLLCSR = (USB_PLL_PSC | (1 << PLLE));
8a4: 82 e0 ldi r24, 0x02 ; 2
8a6: 89 bd out 0x29, r24 ; 41
{
if (!(USB_Options & USB_OPT_MANUAL_PLL))
{
USB_PLL_On();
while (!(USB_PLL_IsReady()));
8a8: 09 b4 in r0, 0x29 ; 41
8aa: 00 fe sbrs r0, 0
8ac: fd cf rjmp .-6 ; 0x8a8 <__vector_11+0x88>
}
static inline void USB_CLK_Unfreeze(void) ATTR_ALWAYS_INLINE;
static inline void USB_CLK_Unfreeze(void)
{
USBCON &= ~(1 << FRZCLK);
8ae: 80 91 d8 00 lds r24, 0x00D8
8b2: 8f 7d andi r24, 0xDF ; 223
8b4: 80 93 d8 00 sts 0x00D8, r24
USBINT &= ~(1 << IDTI);
break;
#endif
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
UDINT &= ~(1 << WAKEUPI);
8b8: 80 91 e1 00 lds r24, 0x00E1
8bc: 8f 7e andi r24, 0xEF ; 239
8be: 80 93 e1 00 sts 0x00E1, r24
USBCON &= ~(1 << IDTE);
break;
#endif
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
UDIEN &= ~(1 << WAKEUPE);
8c2: 80 91 e2 00 lds r24, 0x00E2
8c6: 8f 7e andi r24, 0xEF ; 239
8c8: 80 93 e2 00 sts 0x00E2, r24
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
UDIEN |= (1 << WAKEUPE);
break;
case USB_INT_SUSPI:
UDIEN |= (1 << SUSPE);
8cc: 80 91 e2 00 lds r24, 0x00E2
8d0: 81 60 ori r24, 0x01 ; 1
8d2: 80 93 e2 00 sts 0x00E2, r24
USB_INT_Clear(USB_INT_WAKEUPI);
USB_INT_Disable(USB_INT_WAKEUPI);
USB_INT_Enable(USB_INT_SUSPI);
if (USB_Device_ConfigurationNumber)
8d6: 80 91 34 02 lds r24, 0x0234
8da: 88 23 and r24, r24
8dc: 11 f0 breq .+4 ; 0x8e2 <__vector_11+0xc2>
USB_DeviceState = DEVICE_STATE_Configured;
8de: 84 e0 ldi r24, 0x04 ; 4
8e0: 07 c0 rjmp .+14 ; 0x8f0 <__vector_11+0xd0>
}
static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline bool USB_Device_IsAddressSet(void)
{
return (UDADDR & (1 << ADDEN));
8e2: 80 91 e3 00 lds r24, 0x00E3
else
USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Addressed : DEVICE_STATE_Powered;
8e6: 87 fd sbrc r24, 7
8e8: 02 c0 rjmp .+4 ; 0x8ee <__vector_11+0xce>
8ea: 81 e0 ldi r24, 0x01 ; 1
8ec: 01 c0 rjmp .+2 ; 0x8f0 <__vector_11+0xd0>
8ee: 83 e0 ldi r24, 0x03 ; 3
8f0: 8e bb out 0x1e, r24 ; 30
#if defined(USB_SERIES_2_AVR) && !defined(NO_LIMITED_CONTROLLER_CONNECT)
EVENT_USB_Device_Connect();
8f2: 0f dd rcall .-1506 ; 0x312 <EVENT_USB_Device_Connect>
case USB_INT_WAKEUPI:
return (UDINT & (1 << WAKEUPI));
case USB_INT_SUSPI:
return (UDINT & (1 << SUSPI));
case USB_INT_EORSTI:
return (UDINT & (1 << EORSTI));
8f4: 80 91 e1 00 lds r24, 0x00E1
#else
EVENT_USB_Device_WakeUp();
#endif
}
if (USB_INT_HasOccurred(USB_INT_EORSTI) && USB_INT_IsEnabled(USB_INT_EORSTI))
8f8: 83 ff sbrs r24, 3
8fa: 26 c0 rjmp .+76 ; 0x948 <__vector_11+0x128>
case USB_INT_WAKEUPI:
return (UDIEN & (1 << WAKEUPE));
case USB_INT_SUSPI:
return (UDIEN & (1 << SUSPE));
case USB_INT_EORSTI:
return (UDIEN & (1 << EORSTE));
8fc: 80 91 e2 00 lds r24, 0x00E2
900: 83 ff sbrs r24, 3
902: 22 c0 rjmp .+68 ; 0x948 <__vector_11+0x128>
break;
case USB_INT_SUSPI:
UDINT &= ~(1 << SUSPI);
break;
case USB_INT_EORSTI:
UDINT &= ~(1 << EORSTI);
904: 80 91 e1 00 lds r24, 0x00E1
908: 87 7f andi r24, 0xF7 ; 247
90a: 80 93 e1 00 sts 0x00E1, r24
{
USB_INT_Clear(USB_INT_EORSTI);
USB_DeviceState = DEVICE_STATE_Default;
90e: 82 e0 ldi r24, 0x02 ; 2
910: 8e bb out 0x1e, r24 ; 30
USB_Device_ConfigurationNumber = 0;
912: 10 92 34 02 sts 0x0234, r1
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
UDINT &= ~(1 << WAKEUPI);
break;
case USB_INT_SUSPI:
UDINT &= ~(1 << SUSPI);
916: 80 91 e1 00 lds r24, 0x00E1
91a: 8e 7f andi r24, 0xFE ; 254
91c: 80 93 e1 00 sts 0x00E1, r24
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
UDIEN &= ~(1 << WAKEUPE);
break;
case USB_INT_SUSPI:
UDIEN &= ~(1 << SUSPE);
920: 80 91 e2 00 lds r24, 0x00E2
924: 8e 7f andi r24, 0xFE ; 254
926: 80 93 e2 00 sts 0x00E2, r24
USBCON |= (1 << IDTE);
break;
#endif
#if defined(USB_CAN_BE_DEVICE)
case USB_INT_WAKEUPI:
UDIEN |= (1 << WAKEUPE);
92a: 80 91 e2 00 lds r24, 0x00E2
92e: 80 61 ori r24, 0x10 ; 16
930: 80 93 e2 00 sts 0x00E2, r24
uint8_t Number = (Address & ENDPOINT_EPNUM_MASK);
if (Number >= ENDPOINT_TOTAL_ENDPOINTS)
return false;
return Endpoint_ConfigureEndpoint_Prv(Number,
934: 42 e0 ldi r20, 0x02 ; 2
936: 60 e0 ldi r22, 0x00 ; 0
938: 80 e0 ldi r24, 0x00 ; 0
93a: 60 de rcall .-832 ; 0x5fc <Endpoint_ConfigureEndpoint_Prv>
break;
case USB_INT_SOFI:
UDIEN |= (1 << SOFE);
break;
case USB_INT_RXSTPI:
UEIENX |= (1 << RXSTPE);
93c: 80 91 f0 00 lds r24, 0x00F0
940: 88 60 ori r24, 0x08 ; 8
942: 80 93 f0 00 sts 0x00F0, r24
#if defined(INTERRUPT_CONTROL_ENDPOINT)
USB_INT_Enable(USB_INT_RXSTPI);
#endif
EVENT_USB_Device_Reset();
946: ad d1 rcall .+858 ; 0xca2 <USB_Event_Stub>
USB_ResetInterface();
EVENT_USB_UIDChange();
}
#endif
}
948: ff 91 pop r31
94a: ef 91 pop r30
94c: bf 91 pop r27
94e: af 91 pop r26
950: 9f 91 pop r25
952: 8f 91 pop r24
954: 7f 91 pop r23
956: 6f 91 pop r22
958: 5f 91 pop r21
95a: 4f 91 pop r20
95c: 3f 91 pop r19
95e: 2f 91 pop r18
960: 0f 90 pop r0
962: 0f be out 0x3f, r0 ; 63
964: 0f 90 pop r0
966: 1f 90 pop r1
968: 18 95 reti
0000096a <__vector_12>:
#if defined(INTERRUPT_CONTROL_ENDPOINT) && defined(USB_CAN_BE_DEVICE)
ISR(USB_COM_vect, ISR_BLOCK)
{
96a: 1f 92 push r1
96c: 0f 92 push r0
96e: 0f b6 in r0, 0x3f ; 63
970: 0f 92 push r0
972: 11 24 eor r1, r1
974: 2f 93 push r18
976: 3f 93 push r19
978: 4f 93 push r20
97a: 5f 93 push r21
97c: 6f 93 push r22
97e: 7f 93 push r23
980: 8f 93 push r24
982: 9f 93 push r25
984: af 93 push r26
986: bf 93 push r27
988: cf 93 push r28
98a: df 93 push r29
98c: ef 93 push r30
98e: ff 93 push r31
*/
static inline uint8_t Endpoint_GetCurrentEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_GetCurrentEndpoint(void)
{
#if !defined(CONTROL_ONLY_DEVICE)
return ((UENUM & ENDPOINT_EPNUM_MASK) | Endpoint_GetEndpointDirection());
990: c0 91 e9 00 lds r28, 0x00E9
994: cf 70 andi r28, 0x0F ; 15
* \return The currently selected endpoint's direction, as a \c ENDPOINT_DIR_* mask.
*/
static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_GetEndpointDirection(void)
{
return (UECFG0X & (1 << EPDIR)) ? ENDPOINT_DIR_IN : ENDPOINT_DIR_OUT;
996: 80 91 ec 00 lds r24, 0x00EC
99a: d8 2f mov r29, r24
99c: d1 70 andi r29, 0x01 ; 1
99e: 80 fd sbrc r24, 0
9a0: d0 e8 ldi r29, 0x80 ; 128
*/
static inline void Endpoint_SelectEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void Endpoint_SelectEndpoint(const uint8_t Address)
{
#if !defined(CONTROL_ONLY_DEVICE)
UENUM = (Address & ENDPOINT_EPNUM_MASK);
9a2: 10 92 e9 00 sts 0x00E9, r1
break;
case USB_INT_SOFI:
UDIEN &= ~(1 << SOFE);
break;
case USB_INT_RXSTPI:
UEIENX &= ~(1 << RXSTPE);
9a6: 80 91 f0 00 lds r24, 0x00F0
9aa: 87 7f andi r24, 0xF7 ; 247
9ac: 80 93 f0 00 sts 0x00F0, r24
static inline void GlobalInterruptEnable(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
sei();
9b0: 78 94 sei
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
USB_INT_Disable(USB_INT_RXSTPI);
GlobalInterruptEnable();
USB_Device_ProcessControlRequest();
9b2: 1e d0 rcall .+60 ; 0x9f0 <USB_Device_ProcessControlRequest>
9b4: 10 92 e9 00 sts 0x00E9, r1
break;
case USB_INT_SOFI:
UDIEN |= (1 << SOFE);
break;
case USB_INT_RXSTPI:
UEIENX |= (1 << RXSTPE);
9b8: 80 91 f0 00 lds r24, 0x00F0
9bc: 88 60 ori r24, 0x08 ; 8
9be: 80 93 f0 00 sts 0x00F0, r24
*/
static inline uint8_t Endpoint_GetCurrentEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_GetCurrentEndpoint(void)
{
#if !defined(CONTROL_ONLY_DEVICE)
return ((UENUM & ENDPOINT_EPNUM_MASK) | Endpoint_GetEndpointDirection());
9c2: cd 2b or r28, r29
*/
static inline void Endpoint_SelectEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void Endpoint_SelectEndpoint(const uint8_t Address)
{
#if !defined(CONTROL_ONLY_DEVICE)
UENUM = (Address & ENDPOINT_EPNUM_MASK);
9c4: cf 70 andi r28, 0x0F ; 15
9c6: c0 93 e9 00 sts 0x00E9, r28
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
USB_INT_Enable(USB_INT_RXSTPI);
Endpoint_SelectEndpoint(PrevSelectedEndpoint);
}
9ca: ff 91 pop r31
9cc: ef 91 pop r30
9ce: df 91 pop r29
9d0: cf 91 pop r28
9d2: bf 91 pop r27
9d4: af 91 pop r26
9d6: 9f 91 pop r25
9d8: 8f 91 pop r24
9da: 7f 91 pop r23
9dc: 6f 91 pop r22
9de: 5f 91 pop r21
9e0: 4f 91 pop r20
9e2: 3f 91 pop r19
9e4: 2f 91 pop r18
9e6: 0f 90 pop r0
9e8: 0f be out 0x3f, r0 ; 63
9ea: 0f 90 pop r0
9ec: 1f 90 pop r1
9ee: 18 95 reti
000009f0 <USB_Device_ProcessControlRequest>:
#if !defined(NO_DEVICE_REMOTE_WAKEUP)
bool USB_Device_RemoteWakeupEnabled;
#endif
void USB_Device_ProcessControlRequest(void)
{
9f0: 1f 93 push r17
9f2: cf 93 push r28
9f4: df 93 push r29
9f6: cd b7 in r28, 0x3d ; 61
9f8: de b7 in r29, 0x3e ; 62
9fa: aa 97 sbiw r28, 0x2a ; 42
9fc: 0f b6 in r0, 0x3f ; 63
9fe: f8 94 cli
a00: de bf out 0x3e, r29 ; 62
a02: 0f be out 0x3f, r0 ; 63
a04: cd bf out 0x3d, r28 ; 61
a06: e8 e3 ldi r30, 0x38 ; 56
a08: f2 e0 ldi r31, 0x02 ; 2
a0a: 88 e0 ldi r24, 0x08 ; 8
a0c: 8e 0f add r24, r30
* \return Next byte in the currently selected endpoint's FIFO buffer.
*/
static inline uint8_t Endpoint_Read_8(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_Read_8(void)
{
return UEDATX;
a0e: 90 91 f1 00 lds r25, 0x00F1
USB_ControlRequest.wLength = Endpoint_Read_16_LE();
#else
uint8_t* RequestHeader = (uint8_t*)&USB_ControlRequest;
for (uint8_t RequestHeaderByte = 0; RequestHeaderByte < sizeof(USB_Request_Header_t); RequestHeaderByte++)
*(RequestHeader++) = Endpoint_Read_8();
a12: 91 93 st Z+, r25
USB_ControlRequest.wIndex = Endpoint_Read_16_LE();
USB_ControlRequest.wLength = Endpoint_Read_16_LE();
#else
uint8_t* RequestHeader = (uint8_t*)&USB_ControlRequest;
for (uint8_t RequestHeaderByte = 0; RequestHeaderByte < sizeof(USB_Request_Header_t); RequestHeaderByte++)
a14: 8e 13 cpse r24, r30
a16: fb cf rjmp .-10 ; 0xa0e <USB_Device_ProcessControlRequest+0x1e>
*(RequestHeader++) = Endpoint_Read_8();
#endif
EVENT_USB_Device_ControlRequest();
a18: 89 dc rcall .-1774 ; 0x32c <EVENT_USB_Device_ControlRequest>
* \return Boolean \c true if the selected endpoint has received a SETUP packet, \c false otherwise.
*/
static inline bool Endpoint_IsSETUPReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsSETUPReceived(void)
{
return ((UEINTX & (1 << RXSTPI)) ? true : false);
a1a: 80 91 e8 00 lds r24, 0x00E8
if (Endpoint_IsSETUPReceived())
a1e: 83 ff sbrs r24, 3
a20: 28 c1 rjmp .+592 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
{
uint8_t bmRequestType = USB_ControlRequest.bmRequestType;
a22: 80 91 38 02 lds r24, 0x0238
switch (USB_ControlRequest.bRequest)
a26: 90 91 39 02 lds r25, 0x0239
a2a: 95 30 cpi r25, 0x05 ; 5
a2c: 09 f4 brne .+2 ; 0xa30 <USB_Device_ProcessControlRequest+0x40>
a2e: 83 c0 rjmp .+262 ; 0xb36 <USB_Device_ProcessControlRequest+0x146>
a30: 30 f4 brcc .+12 ; 0xa3e <USB_Device_ProcessControlRequest+0x4e>
a32: 91 30 cpi r25, 0x01 ; 1
a34: a9 f1 breq .+106 ; 0xaa0 <USB_Device_ProcessControlRequest+0xb0>
a36: 68 f0 brcs .+26 ; 0xa52 <USB_Device_ProcessControlRequest+0x62>
a38: 93 30 cpi r25, 0x03 ; 3
a3a: 91 f1 breq .+100 ; 0xaa0 <USB_Device_ProcessControlRequest+0xb0>
a3c: 1a c1 rjmp .+564 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
a3e: 98 30 cpi r25, 0x08 ; 8
a40: 09 f4 brne .+2 ; 0xa44 <USB_Device_ProcessControlRequest+0x54>
a42: ed c0 rjmp .+474 ; 0xc1e <USB_Device_ProcessControlRequest+0x22e>
a44: 99 30 cpi r25, 0x09 ; 9
a46: 09 f4 brne .+2 ; 0xa4a <USB_Device_ProcessControlRequest+0x5a>
a48: f9 c0 rjmp .+498 ; 0xc3c <USB_Device_ProcessControlRequest+0x24c>
a4a: 96 30 cpi r25, 0x06 ; 6
a4c: 09 f0 breq .+2 ; 0xa50 <USB_Device_ProcessControlRequest+0x60>
a4e: 11 c1 rjmp .+546 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
a50: 93 c0 rjmp .+294 ; 0xb78 <USB_Device_ProcessControlRequest+0x188>
{
case REQ_GetStatus:
if ((bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) ||
a52: 80 38 cpi r24, 0x80 ; 128
a54: 21 f0 breq .+8 ; 0xa5e <USB_Device_ProcessControlRequest+0x6e>
a56: 82 38 cpi r24, 0x82 ; 130
a58: 09 f0 breq .+2 ; 0xa5c <USB_Device_ProcessControlRequest+0x6c>
a5a: 0b c1 rjmp .+534 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
a5c: 08 c0 rjmp .+16 ; 0xa6e <USB_Device_ProcessControlRequest+0x7e>
Endpoint_ClearOUT();
}
static void USB_Device_GetStatus(void)
{
uint8_t CurrentStatus = 0;
a5e: 80 91 35 02 lds r24, 0x0235
if (USB_Device_CurrentlySelfPowered)
CurrentStatus |= FEATURE_SELFPOWERED_ENABLED;
#endif
#if !defined(NO_DEVICE_REMOTE_WAKEUP)
if (USB_Device_RemoteWakeupEnabled)
a62: 90 91 36 02 lds r25, 0x0236
a66: 99 23 and r25, r25
a68: 89 f0 breq .+34 ; 0xa8c <USB_Device_ProcessControlRequest+0x9c>
CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED;
a6a: 82 60 ori r24, 0x02 ; 2
a6c: 0f c0 rjmp .+30 ; 0xa8c <USB_Device_ProcessControlRequest+0x9c>
break;
}
case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT):
{
#if !defined(CONTROL_ONLY_DEVICE)
uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK);
a6e: 80 91 3c 02 lds r24, 0x023C
a72: 8f 70 andi r24, 0x0F ; 15
if (EndpointIndex >= ENDPOINT_TOTAL_ENDPOINTS)
a74: 85 30 cpi r24, 0x05 ; 5
a76: 08 f0 brcs .+2 ; 0xa7a <USB_Device_ProcessControlRequest+0x8a>
a78: fc c0 rjmp .+504 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
*/
static inline void Endpoint_SelectEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void Endpoint_SelectEndpoint(const uint8_t Address)
{
#if !defined(CONTROL_ONLY_DEVICE)
UENUM = (Address & ENDPOINT_EPNUM_MASK);
a7a: 80 93 e9 00 sts 0x00E9, r24
* \return Boolean \c true if the currently selected endpoint is stalled, \c false otherwise.
*/
static inline bool Endpoint_IsStalled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsStalled(void)
{
return ((UECONX & (1 << STALLRQ)) ? true : false);
a7e: 80 91 eb 00 lds r24, 0x00EB
a82: 85 fb bst r24, 5
a84: 88 27 eor r24, r24
a86: 80 f9 bld r24, 0
*/
static inline void Endpoint_SelectEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void Endpoint_SelectEndpoint(const uint8_t Address)
{
#if !defined(CONTROL_ONLY_DEVICE)
UENUM = (Address & ENDPOINT_EPNUM_MASK);
a88: 10 92 e9 00 sts 0x00E9, r1
* \note This is not applicable for non CONTROL type endpoints.
*/
static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearSETUP(void)
{
UEINTX &= ~(1 << RXSTPI);
a8c: 90 91 e8 00 lds r25, 0x00E8
a90: 97 7f andi r25, 0xF7 ; 247
a92: 90 93 e8 00 sts 0x00E8, r25
* \param[in] Data Data to write to the currently selected endpoint's FIFO buffer.
*/
static inline void Endpoint_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_16_LE(const uint16_t Data)
{
UEDATX = (Data & 0xFF);
a96: 80 93 f1 00 sts 0x00F1, r24
UEDATX = (Data >> 8);
a9a: 10 92 f1 00 sts 0x00F1, r1
a9e: ca c0 rjmp .+404 ; 0xc34 <USB_Device_ProcessControlRequest+0x244>
}
break;
case REQ_ClearFeature:
case REQ_SetFeature:
if ((bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) ||
aa0: 28 2f mov r18, r24
aa2: 2d 7f andi r18, 0xFD ; 253
aa4: 09 f0 breq .+2 ; 0xaa8 <USB_Device_ProcessControlRequest+0xb8>
aa6: e5 c0 rjmp .+458 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
Endpoint_ClearStatusStage();
}
static void USB_Device_ClearSetFeature(void)
{
switch (USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT)
aa8: 88 23 and r24, r24
aaa: 19 f0 breq .+6 ; 0xab2 <USB_Device_ProcessControlRequest+0xc2>
aac: 82 30 cpi r24, 0x02 ; 2
aae: 61 f0 breq .+24 ; 0xac8 <USB_Device_ProcessControlRequest+0xd8>
ab0: e0 c0 rjmp .+448 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
{
#if !defined(NO_DEVICE_REMOTE_WAKEUP)
case REQREC_DEVICE:
{
if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_DeviceRemoteWakeup)
ab2: 80 91 3a 02 lds r24, 0x023A
ab6: 81 30 cpi r24, 0x01 ; 1
ab8: 09 f0 breq .+2 ; 0xabc <USB_Device_ProcessControlRequest+0xcc>
aba: db c0 rjmp .+438 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
USB_Device_RemoteWakeupEnabled = (USB_ControlRequest.bRequest == REQ_SetFeature);
abc: 93 30 cpi r25, 0x03 ; 3
abe: 09 f0 breq .+2 ; 0xac2 <USB_Device_ProcessControlRequest+0xd2>
ac0: 80 e0 ldi r24, 0x00 ; 0
ac2: 80 93 36 02 sts 0x0236, r24
ac6: 2e c0 rjmp .+92 ; 0xb24 <USB_Device_ProcessControlRequest+0x134>
}
#endif
#if !defined(CONTROL_ONLY_DEVICE)
case REQREC_ENDPOINT:
{
if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_EndpointHalt)
ac8: 80 91 3a 02 lds r24, 0x023A
acc: 81 11 cpse r24, r1
ace: 2a c0 rjmp .+84 ; 0xb24 <USB_Device_ProcessControlRequest+0x134>
{
uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK);
ad0: 80 91 3c 02 lds r24, 0x023C
ad4: 8f 70 andi r24, 0x0F ; 15
if (EndpointIndex == ENDPOINT_CONTROLEP || EndpointIndex >= ENDPOINT_TOTAL_ENDPOINTS)
ad6: 2f ef ldi r18, 0xFF ; 255
ad8: 28 0f add r18, r24
ada: 24 30 cpi r18, 0x04 ; 4
adc: 08 f0 brcs .+2 ; 0xae0 <USB_Device_ProcessControlRequest+0xf0>
ade: c9 c0 rjmp .+402 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
*/
static inline void Endpoint_SelectEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void Endpoint_SelectEndpoint(const uint8_t Address)
{
#if !defined(CONTROL_ONLY_DEVICE)
UENUM = (Address & ENDPOINT_EPNUM_MASK);
ae0: 80 93 e9 00 sts 0x00E9, r24
* \return Boolean \c true if the currently selected endpoint is enabled, \c false otherwise.
*/
static inline bool Endpoint_IsEnabled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsEnabled(void)
{
return ((UECONX & (1 << EPEN)) ? true : false);
ae4: 20 91 eb 00 lds r18, 0x00EB
return;
Endpoint_SelectEndpoint(EndpointIndex);
if (Endpoint_IsEnabled())
ae8: 20 ff sbrs r18, 0
aea: 1c c0 rjmp .+56 ; 0xb24 <USB_Device_ProcessControlRequest+0x134>
{
if (USB_ControlRequest.bRequest == REQ_SetFeature)
aec: 93 30 cpi r25, 0x03 ; 3
aee: 21 f4 brne .+8 ; 0xaf8 <USB_Device_ProcessControlRequest+0x108>
* \ingroup Group_EndpointPacketManagement_AVR8
*/
static inline void Endpoint_StallTransaction(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_StallTransaction(void)
{
UECONX |= (1 << STALLRQ);
af0: 80 91 eb 00 lds r24, 0x00EB
af4: 80 62 ori r24, 0x20 ; 32
af6: 14 c0 rjmp .+40 ; 0xb20 <USB_Device_ProcessControlRequest+0x130>
* \ingroup Group_EndpointPacketManagement_AVR8
*/
static inline void Endpoint_ClearStall(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearStall(void)
{
UECONX |= (1 << STALLRQC);
af8: 90 91 eb 00 lds r25, 0x00EB
afc: 90 61 ori r25, 0x10 ; 16
afe: 90 93 eb 00 sts 0x00EB, r25
* \param[in] Address Endpoint address whose FIFO buffers are to be reset.
*/
static inline void Endpoint_ResetEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ResetEndpoint(const uint8_t Address)
{
UERST = (1 << (Address & ENDPOINT_EPNUM_MASK));
b02: 21 e0 ldi r18, 0x01 ; 1
b04: 30 e0 ldi r19, 0x00 ; 0
b06: a9 01 movw r20, r18
b08: 02 c0 rjmp .+4 ; 0xb0e <USB_Device_ProcessControlRequest+0x11e>
b0a: 44 0f add r20, r20
b0c: 55 1f adc r21, r21
b0e: 8a 95 dec r24
b10: e2 f7 brpl .-8 ; 0xb0a <USB_Device_ProcessControlRequest+0x11a>
b12: 40 93 ea 00 sts 0x00EA, r20
UERST = 0;
b16: 10 92 ea 00 sts 0x00EA, r1
/** Resets the data toggle of the currently selected endpoint. */
static inline void Endpoint_ResetDataToggle(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ResetDataToggle(void)
{
UECONX |= (1 << RSTDT);
b1a: 80 91 eb 00 lds r24, 0x00EB
b1e: 88 60 ori r24, 0x08 ; 8
b20: 80 93 eb 00 sts 0x00EB, r24
*/
static inline void Endpoint_SelectEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void Endpoint_SelectEndpoint(const uint8_t Address)
{
#if !defined(CONTROL_ONLY_DEVICE)
UENUM = (Address & ENDPOINT_EPNUM_MASK);
b24: 10 92 e9 00 sts 0x00E9, r1
* \note This is not applicable for non CONTROL type endpoints.
*/
static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearSETUP(void)
{
UEINTX &= ~(1 << RXSTPI);
b28: 80 91 e8 00 lds r24, 0x00E8
b2c: 87 7f andi r24, 0xF7 ; 247
b2e: 80 93 e8 00 sts 0x00E8, r24
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
Endpoint_ClearSETUP();
Endpoint_ClearStatusStage();
b32: e2 dd rcall .-1084 ; 0x6f8 <Endpoint_ClearStatusStage>
b34: 9e c0 rjmp .+316 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
USB_Device_ClearSetFeature();
}
break;
case REQ_SetAddress:
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE))
b36: 81 11 cpse r24, r1
b38: 9c c0 rjmp .+312 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
}
}
static void USB_Device_SetAddress(void)
{
uint8_t DeviceAddress = (USB_ControlRequest.wValue & 0x7F);
b3a: 10 91 3a 02 lds r17, 0x023A
b3e: 1f 77 andi r17, 0x7F ; 127
#endif
static inline void USB_Device_SetDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void USB_Device_SetDeviceAddress(const uint8_t Address)
{
UDADDR = (UDADDR & (1 << ADDEN)) | (Address & 0x7F);
b40: 80 91 e3 00 lds r24, 0x00E3
b44: 80 78 andi r24, 0x80 ; 128
b46: 81 2b or r24, r17
b48: 80 93 e3 00 sts 0x00E3, r24
b4c: 80 91 e8 00 lds r24, 0x00E8
b50: 87 7f andi r24, 0xF7 ; 247
b52: 80 93 e8 00 sts 0x00E8, r24
USB_Device_SetDeviceAddress(DeviceAddress);
Endpoint_ClearSETUP();
Endpoint_ClearStatusStage();
b56: d0 dd rcall .-1120 ; 0x6f8 <Endpoint_ClearStatusStage>
* \return Boolean \c true if the current endpoint is ready for an IN packet, \c false otherwise.
*/
static inline bool Endpoint_IsINReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsINReady(void)
{
return ((UEINTX & (1 << TXINI)) ? true : false);
b58: 80 91 e8 00 lds r24, 0x00E8
while (!(Endpoint_IsINReady()));
b5c: 80 ff sbrs r24, 0
b5e: fc cf rjmp .-8 ; 0xb58 <USB_Device_ProcessControlRequest+0x168>
static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void USB_Device_EnableDeviceAddress(const uint8_t Address)
{
(void)Address;
UDADDR |= (1 << ADDEN);
b60: 80 91 e3 00 lds r24, 0x00E3
b64: 80 68 ori r24, 0x80 ; 128
b66: 80 93 e3 00 sts 0x00E3, r24
USB_Device_EnableDeviceAddress(DeviceAddress);
USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default;
b6a: 11 11 cpse r17, r1
b6c: 02 c0 rjmp .+4 ; 0xb72 <USB_Device_ProcessControlRequest+0x182>
b6e: 82 e0 ldi r24, 0x02 ; 2
b70: 01 c0 rjmp .+2 ; 0xb74 <USB_Device_ProcessControlRequest+0x184>
b72: 83 e0 ldi r24, 0x03 ; 3
b74: 8e bb out 0x1e, r24 ; 30
b76: 7d c0 rjmp .+250 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE))
USB_Device_SetAddress();
break;
case REQ_GetDescriptor:
if ((bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) ||
b78: 80 58 subi r24, 0x80 ; 128
b7a: 82 30 cpi r24, 0x02 ; 2
b7c: 08 f0 brcs .+2 ; 0xb80 <USB_Device_ProcessControlRequest+0x190>
b7e: 79 c0 rjmp .+242 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
!(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS))
uint8_t DescriptorAddressSpace;
#endif
#if !defined(NO_INTERNAL_SERIAL) && (USE_INTERNAL_SERIAL != NO_DESCRIPTOR)
if (USB_ControlRequest.wValue == ((DTYPE_String << 8) | USE_INTERNAL_SERIAL))
b80: 80 91 3a 02 lds r24, 0x023A
b84: 90 91 3b 02 lds r25, 0x023B
b88: 8c 3d cpi r24, 0xDC ; 220
b8a: 53 e0 ldi r21, 0x03 ; 3
b8c: 95 07 cpc r25, r21
b8e: 71 f5 brne .+92 ; 0xbec <USB_Device_ProcessControlRequest+0x1fc>
{
USB_Descriptor_Header_t Header;
uint16_t UnicodeString[INTERNAL_SERIAL_LENGTH_BITS / 4];
} SignatureDescriptor;
SignatureDescriptor.Header.Type = DTYPE_String;
b90: 83 e0 ldi r24, 0x03 ; 3
b92: 8a 83 std Y+2, r24 ; 0x02
SignatureDescriptor.Header.Size = USB_STRING_LEN(INTERNAL_SERIAL_LENGTH_BITS / 4);
b94: 8a e2 ldi r24, 0x2A ; 42
b96: 89 83 std Y+1, r24 ; 0x01
static inline uint_reg_t GetGlobalInterruptMask(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
return SREG;
b98: 4f b7 in r20, 0x3f ; 63
static inline void GlobalInterruptDisable(void)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
cli();
b9a: f8 94 cli
__builtin_ssrf(AVR32_SR_GM_OFFSET);
#elif (ARCH == ARCH_XMEGA)
cli();
#endif
GCC_MEMORY_BARRIER();
b9c: de 01 movw r26, r28
b9e: 13 96 adiw r26, 0x03 ; 3
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
uint8_t SigReadAddress = INTERNAL_SERIAL_START_ADDRESS;
for (uint8_t SerialCharNum = 0; SerialCharNum < (INTERNAL_SERIAL_LENGTH_BITS / 4); SerialCharNum++)
ba0: 20 e0 ldi r18, 0x00 ; 0
static inline void USB_Device_GetSerialString(uint16_t* const UnicodeString)
{
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
uint8_t SigReadAddress = INTERNAL_SERIAL_START_ADDRESS;
ba2: 3e e0 ldi r19, 0x0E ; 14
for (uint8_t SerialCharNum = 0; SerialCharNum < (INTERNAL_SERIAL_LENGTH_BITS / 4); SerialCharNum++)
{
uint8_t SerialByte = boot_signature_byte_get(SigReadAddress);
ba4: 51 e2 ldi r21, 0x21 ; 33
ba6: e3 2f mov r30, r19
ba8: f0 e0 ldi r31, 0x00 ; 0
baa: 50 93 57 00 sts 0x0057, r21
bae: e4 91 lpm r30, Z
if (SerialCharNum & 0x01)
bb0: 20 ff sbrs r18, 0
bb2: 03 c0 rjmp .+6 ; 0xbba <USB_Device_ProcessControlRequest+0x1ca>
{
SerialByte >>= 4;
bb4: e2 95 swap r30
bb6: ef 70 andi r30, 0x0F ; 15
SigReadAddress++;
bb8: 3f 5f subi r19, 0xFF ; 255
}
SerialByte &= 0x0F;
bba: ef 70 andi r30, 0x0F ; 15
bbc: 8e 2f mov r24, r30
bbe: 90 e0 ldi r25, 0x00 ; 0
UnicodeString[SerialCharNum] = cpu_to_le16((SerialByte >= 10) ?
bc0: ea 30 cpi r30, 0x0A ; 10
bc2: 10 f0 brcs .+4 ; 0xbc8 <USB_Device_ProcessControlRequest+0x1d8>
bc4: c7 96 adiw r24, 0x37 ; 55
bc6: 01 c0 rjmp .+2 ; 0xbca <USB_Device_ProcessControlRequest+0x1da>
bc8: c0 96 adiw r24, 0x30 ; 48
bca: 8d 93 st X+, r24
bcc: 9d 93 st X+, r25
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
uint8_t SigReadAddress = INTERNAL_SERIAL_START_ADDRESS;
for (uint8_t SerialCharNum = 0; SerialCharNum < (INTERNAL_SERIAL_LENGTH_BITS / 4); SerialCharNum++)
bce: 2f 5f subi r18, 0xFF ; 255
bd0: 24 31 cpi r18, 0x14 ; 20
bd2: 49 f7 brne .-46 ; 0xba6 <USB_Device_ProcessControlRequest+0x1b6>
static inline void SetGlobalInterruptMask(const uint_reg_t GlobalIntState)
{
GCC_MEMORY_BARRIER();
#if (ARCH == ARCH_AVR8)
SREG = GlobalIntState;
bd4: 4f bf out 0x3f, r20 ; 63
* \note This is not applicable for non CONTROL type endpoints.
*/
static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearSETUP(void)
{
UEINTX &= ~(1 << RXSTPI);
bd6: 80 91 e8 00 lds r24, 0x00E8
bda: 87 7f andi r24, 0xF7 ; 247
bdc: 80 93 e8 00 sts 0x00E8, r24
USB_Device_GetSerialString(SignatureDescriptor.UnicodeString);
Endpoint_ClearSETUP();
Endpoint_Write_Control_Stream_LE(&SignatureDescriptor, sizeof(SignatureDescriptor));
be0: 6a e2 ldi r22, 0x2A ; 42
be2: 70 e0 ldi r23, 0x00 ; 0
be4: ce 01 movw r24, r28
be6: 01 96 adiw r24, 0x01 ; 1
be8: 53 dc rcall .-1882 ; 0x490 <Endpoint_Write_Control_Stream_LE>
bea: 13 c0 rjmp .+38 ; 0xc12 <USB_Device_ProcessControlRequest+0x222>
USB_Device_GetInternalSerialDescriptor();
return;
}
#endif
if ((DescriptorSize = CALLBACK_USB_GetDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex,
bec: 60 91 3c 02 lds r22, 0x023C
bf0: 70 91 3d 02 lds r23, 0x023D
bf4: ae 01 movw r20, r28
bf6: 4f 5f subi r20, 0xFF ; 255
bf8: 5f 4f sbci r21, 0xFF ; 255
bfa: 18 dc rcall .-2000 ; 0x42c <CALLBACK_USB_GetDescriptor>
bfc: bc 01 movw r22, r24
bfe: 89 2b or r24, r25
c00: c1 f1 breq .+112 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
c02: 90 91 e8 00 lds r25, 0x00E8
c06: 97 7f andi r25, 0xF7 ; 247
c08: 90 93 e8 00 sts 0x00E8, r25
#if defined(USE_RAM_DESCRIPTORS) || !defined(ARCH_HAS_MULTI_ADDRESS_SPACE)
Endpoint_Write_Control_Stream_LE(DescriptorPointer, DescriptorSize);
#elif defined(USE_EEPROM_DESCRIPTORS)
Endpoint_Write_Control_EStream_LE(DescriptorPointer, DescriptorSize);
#elif defined(USE_FLASH_DESCRIPTORS)
Endpoint_Write_Control_PStream_LE(DescriptorPointer, DescriptorSize);
c0c: 89 81 ldd r24, Y+1 ; 0x01
c0e: 9a 81 ldd r25, Y+2 ; 0x02
c10: 9b dc rcall .-1738 ; 0x548 <Endpoint_Write_Control_PStream_LE>
*/
static inline void Endpoint_ClearOUT(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearOUT(void)
{
#if !defined(CONTROL_ONLY_DEVICE)
UEINTX &= ~((1 << RXOUTI) | (1 << FIFOCON));
c12: 80 91 e8 00 lds r24, 0x00E8
c16: 8b 77 andi r24, 0x7B ; 123
c18: 80 93 e8 00 sts 0x00E8, r24
c1c: 2a c0 rjmp .+84 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
USB_Device_GetDescriptor();
}
break;
case REQ_GetConfiguration:
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE))
c1e: 80 38 cpi r24, 0x80 ; 128
c20: 41 f5 brne .+80 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
* \note This is not applicable for non CONTROL type endpoints.
*/
static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearSETUP(void)
{
UEINTX &= ~(1 << RXSTPI);
c22: 80 91 e8 00 lds r24, 0x00E8
c26: 87 7f andi r24, 0xF7 ; 247
c28: 80 93 e8 00 sts 0x00E8, r24
static void USB_Device_GetConfiguration(void)
{
Endpoint_ClearSETUP();
Endpoint_Write_8(USB_Device_ConfigurationNumber);
c2c: 80 91 34 02 lds r24, 0x0234
* \param[in] Data Data to write into the the currently selected endpoint's FIFO buffer.
*/
static inline void Endpoint_Write_8(const uint8_t Data) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_8(const uint8_t Data)
{
UEDATX = Data;
c30: 80 93 f1 00 sts 0x00F1, r24
*/
static inline void Endpoint_ClearIN(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearIN(void)
{
#if !defined(CONTROL_ONLY_DEVICE)
UEINTX &= ~((1 << TXINI) | (1 << FIFOCON));
c34: 80 91 e8 00 lds r24, 0x00E8
c38: 8e 77 andi r24, 0x7E ; 126
c3a: 79 cf rjmp .-270 ; 0xb2e <USB_Device_ProcessControlRequest+0x13e>
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE))
USB_Device_GetConfiguration();
break;
case REQ_SetConfiguration:
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE))
c3c: 81 11 cpse r24, r1
c3e: 19 c0 rjmp .+50 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
}
static void USB_Device_SetConfiguration(void)
{
#if defined(FIXED_NUM_CONFIGURATIONS)
if ((uint8_t)USB_ControlRequest.wValue > FIXED_NUM_CONFIGURATIONS)
c40: 90 91 3a 02 lds r25, 0x023A
c44: 92 30 cpi r25, 0x02 ; 2
c46: a8 f4 brcc .+42 ; 0xc72 <USB_Device_ProcessControlRequest+0x282>
* \note This is not applicable for non CONTROL type endpoints.
*/
static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearSETUP(void)
{
UEINTX &= ~(1 << RXSTPI);
c48: 80 91 e8 00 lds r24, 0x00E8
c4c: 87 7f andi r24, 0xF7 ; 247
c4e: 80 93 e8 00 sts 0x00E8, r24
#endif
#endif
Endpoint_ClearSETUP();
USB_Device_ConfigurationNumber = (uint8_t)USB_ControlRequest.wValue;
c52: 90 93 34 02 sts 0x0234, r25
Endpoint_ClearStatusStage();
c56: 50 dd rcall .-1376 ; 0x6f8 <Endpoint_ClearStatusStage>
if (USB_Device_ConfigurationNumber)
c58: 80 91 34 02 lds r24, 0x0234
c5c: 81 11 cpse r24, r1
c5e: 06 c0 rjmp .+12 ; 0xc6c <USB_Device_ProcessControlRequest+0x27c>
}
static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline bool USB_Device_IsAddressSet(void)
{
return (UDADDR & (1 << ADDEN));
c60: 80 91 e3 00 lds r24, 0x00E3
USB_DeviceState = DEVICE_STATE_Configured;
else
USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered;
c64: 87 fd sbrc r24, 7
c66: 02 c0 rjmp .+4 ; 0xc6c <USB_Device_ProcessControlRequest+0x27c>
c68: 81 e0 ldi r24, 0x01 ; 1
c6a: 01 c0 rjmp .+2 ; 0xc6e <USB_Device_ProcessControlRequest+0x27e>
c6c: 84 e0 ldi r24, 0x04 ; 4
c6e: 8e bb out 0x1e, r24 ; 30
EVENT_USB_Device_ConfigurationChanged();
c70: 54 db rcall .-2392 ; 0x31a <EVENT_USB_Device_ConfigurationChanged>
* \return Boolean \c true if the selected endpoint has received a SETUP packet, \c false otherwise.
*/
static inline bool Endpoint_IsSETUPReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsSETUPReceived(void)
{
return ((UEINTX & (1 << RXSTPI)) ? true : false);
c72: 80 91 e8 00 lds r24, 0x00E8
default:
break;
}
}
if (Endpoint_IsSETUPReceived())
c76: 83 ff sbrs r24, 3
c78: 0a c0 rjmp .+20 ; 0xc8e <USB_Device_ProcessControlRequest+0x29e>
* \note This is not applicable for non CONTROL type endpoints.
*/
static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearSETUP(void)
{
UEINTX &= ~(1 << RXSTPI);
c7a: 80 91 e8 00 lds r24, 0x00E8
c7e: 87 7f andi r24, 0xF7 ; 247
c80: 80 93 e8 00 sts 0x00E8, r24
* \ingroup Group_EndpointPacketManagement_AVR8
*/
static inline void Endpoint_StallTransaction(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_StallTransaction(void)
{
UECONX |= (1 << STALLRQ);
c84: 80 91 eb 00 lds r24, 0x00EB
c88: 80 62 ori r24, 0x20 ; 32
c8a: 80 93 eb 00 sts 0x00EB, r24
{
Endpoint_ClearSETUP();
Endpoint_StallTransaction();
}
}
c8e: aa 96 adiw r28, 0x2a ; 42
c90: 0f b6 in r0, 0x3f ; 63
c92: f8 94 cli
c94: de bf out 0x3e, r29 ; 62
c96: 0f be out 0x3f, r0 ; 63
c98: cd bf out 0x3d, r28 ; 61
c9a: df 91 pop r29
c9c: cf 91 pop r28
c9e: 1f 91 pop r17
ca0: 08 95 ret
00000ca2 <USB_Event_Stub>:
#define __INCLUDE_FROM_EVENTS_C
#define __INCLUDE_FROM_USB_DRIVER
#include "Events.h"
void USB_Event_Stub(void)
{
ca2: 08 95 ret
00000ca4 <USB_USBTask>:
#if defined(USB_CAN_BE_DEVICE) && !defined(DEVICE_STATE_AS_GPIOR)
volatile uint8_t USB_DeviceState;
#endif
void USB_USBTask(void)
{
ca4: cf 93 push r28
}
#if defined(USB_CAN_BE_DEVICE)
static void USB_DeviceTask(void)
{
if (USB_DeviceState == DEVICE_STATE_Unattached)
ca6: 8e b3 in r24, 0x1e ; 30
ca8: 88 23 and r24, r24
caa: 99 f0 breq .+38 ; 0xcd2 <USB_USBTask+0x2e>
*/
static inline uint8_t Endpoint_GetCurrentEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_GetCurrentEndpoint(void)
{
#if !defined(CONTROL_ONLY_DEVICE)
return ((UENUM & ENDPOINT_EPNUM_MASK) | Endpoint_GetEndpointDirection());
cac: c0 91 e9 00 lds r28, 0x00E9
cb0: cf 70 andi r28, 0x0F ; 15
* \return The currently selected endpoint's direction, as a \c ENDPOINT_DIR_* mask.
*/
static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_GetEndpointDirection(void)
{
return (UECFG0X & (1 << EPDIR)) ? ENDPOINT_DIR_IN : ENDPOINT_DIR_OUT;
cb2: 90 91 ec 00 lds r25, 0x00EC
cb6: 89 2f mov r24, r25
cb8: 81 70 andi r24, 0x01 ; 1
cba: 90 fd sbrc r25, 0
cbc: 80 e8 ldi r24, 0x80 ; 128
*/
static inline uint8_t Endpoint_GetCurrentEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_GetCurrentEndpoint(void)
{
#if !defined(CONTROL_ONLY_DEVICE)
return ((UENUM & ENDPOINT_EPNUM_MASK) | Endpoint_GetEndpointDirection());
cbe: c8 2b or r28, r24
*/
static inline void Endpoint_SelectEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void Endpoint_SelectEndpoint(const uint8_t Address)
{
#if !defined(CONTROL_ONLY_DEVICE)
UENUM = (Address & ENDPOINT_EPNUM_MASK);
cc0: 10 92 e9 00 sts 0x00E9, r1
* \return Boolean \c true if the selected endpoint has received a SETUP packet, \c false otherwise.
*/
static inline bool Endpoint_IsSETUPReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsSETUPReceived(void)
{
return ((UEINTX & (1 << RXSTPI)) ? true : false);
cc4: 80 91 e8 00 lds r24, 0x00E8
uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint();
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
if (Endpoint_IsSETUPReceived())
cc8: 83 fd sbrc r24, 3
USB_Device_ProcessControlRequest();
cca: 92 de rcall .-732 ; 0x9f0 <USB_Device_ProcessControlRequest>
*/
static inline void Endpoint_SelectEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void Endpoint_SelectEndpoint(const uint8_t Address)
{
#if !defined(CONTROL_ONLY_DEVICE)
UENUM = (Address & ENDPOINT_EPNUM_MASK);
ccc: cf 70 andi r28, 0x0F ; 15
cce: c0 93 e9 00 sts 0x00E9, r28
#elif defined(USB_CAN_BE_HOST)
USB_HostTask();
#elif defined(USB_CAN_BE_DEVICE)
USB_DeviceTask();
#endif
}
cd2: cf 91 pop r28
cd4: 08 95 ret
00000cd6 <CDC_Device_ConfigureEndpoints>:
void CDC_Device_CreateBlockingStream(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
FILE* const Stream)
{
*Stream = (FILE)FDEV_SETUP_STREAM(CDC_Device_putchar, CDC_Device_getchar_Blocking, _FDEV_SETUP_RW);
fdev_set_udata(Stream, CDCInterfaceInfo);
cd6: cf 93 push r28
cd8: df 93 push r29
cda: ec 01 movw r28, r24
cdc: fc 01 movw r30, r24
cde: 70 96 adiw r30, 0x10 ; 16
ce0: 8b e0 ldi r24, 0x0B ; 11
ce2: df 01 movw r26, r30
ce4: 1d 92 st X+, r1
ce6: 8a 95 dec r24
ce8: e9 f7 brne .-6 ; 0xce4 <CDC_Device_ConfigureEndpoints+0xe>
cea: 82 e0 ldi r24, 0x02 ; 2
cec: 8c 83 std Y+4, r24 ; 0x04
cee: 89 87 std Y+9, r24 ; 0x09
cf0: 83 e0 ldi r24, 0x03 ; 3
cf2: 8e 87 std Y+14, r24 ; 0x0e
cf4: 61 e0 ldi r22, 0x01 ; 1
cf6: ce 01 movw r24, r28
cf8: 01 96 adiw r24, 0x01 ; 1
cfa: b5 dc rcall .-1686 ; 0x666 <Endpoint_ConfigureEndpointTable>
cfc: 88 23 and r24, r24
cfe: 61 f0 breq .+24 ; 0xd18 <CDC_Device_ConfigureEndpoints+0x42>
d00: 61 e0 ldi r22, 0x01 ; 1
d02: ce 01 movw r24, r28
d04: 06 96 adiw r24, 0x06 ; 6
d06: af dc rcall .-1698 ; 0x666 <Endpoint_ConfigureEndpointTable>
d08: 88 23 and r24, r24
d0a: 31 f0 breq .+12 ; 0xd18 <CDC_Device_ConfigureEndpoints+0x42>
d0c: 61 e0 ldi r22, 0x01 ; 1
d0e: ce 01 movw r24, r28
d10: 0b 96 adiw r24, 0x0b ; 11
d12: df 91 pop r29
d14: cf 91 pop r28
d16: a7 cc rjmp .-1714 ; 0x666 <Endpoint_ConfigureEndpointTable>
d18: 80 e0 ldi r24, 0x00 ; 0
d1a: df 91 pop r29
d1c: cf 91 pop r28
d1e: 08 95 ret
00000d20 <CDC_Device_SendByte>:
d20: 0f 93 push r16
d22: 1f 93 push r17
d24: cf 93 push r28
d26: 2e b3 in r18, 0x1e ; 30
d28: 24 30 cpi r18, 0x04 ; 4
d2a: f9 f4 brne .+62 ; 0xd6a <CDC_Device_SendByte+0x4a>
d2c: fc 01 movw r30, r24
d2e: 04 89 ldd r16, Z+20 ; 0x14
d30: 15 89 ldd r17, Z+21 ; 0x15
d32: 26 89 ldd r18, Z+22 ; 0x16
d34: 37 89 ldd r19, Z+23 ; 0x17
d36: 01 2b or r16, r17
d38: 02 2b or r16, r18
d3a: 03 2b or r16, r19
d3c: b1 f0 breq .+44 ; 0xd6a <CDC_Device_SendByte+0x4a>
d3e: c6 2f mov r28, r22
d40: 81 81 ldd r24, Z+1 ; 0x01
d42: 8f 70 andi r24, 0x0F ; 15
d44: 80 93 e9 00 sts 0x00E9, r24
d48: 80 91 e8 00 lds r24, 0x00E8
d4c: 85 ff sbrs r24, 5
d4e: 04 c0 rjmp .+8 ; 0xd58 <CDC_Device_SendByte+0x38>
d50: c0 93 f1 00 sts 0x00F1, r28
d54: 80 e0 ldi r24, 0x00 ; 0
d56: 0a c0 rjmp .+20 ; 0xd6c <CDC_Device_SendByte+0x4c>
d58: 80 91 e8 00 lds r24, 0x00E8
d5c: 8e 77 andi r24, 0x7E ; 126
d5e: 80 93 e8 00 sts 0x00E8, r24
d62: e7 dc rcall .-1586 ; 0x732 <Endpoint_WaitUntilReady>
d64: 88 23 and r24, r24
d66: a1 f3 breq .-24 ; 0xd50 <CDC_Device_SendByte+0x30>
d68: 01 c0 rjmp .+2 ; 0xd6c <CDC_Device_SendByte+0x4c>
d6a: 82 e0 ldi r24, 0x02 ; 2
d6c: cf 91 pop r28
d6e: 1f 91 pop r17
d70: 0f 91 pop r16
d72: 08 95 ret
00000d74 <CDC_Device_Flush>:
d74: 2e b3 in r18, 0x1e ; 30
d76: 24 30 cpi r18, 0x04 ; 4
d78: 21 f5 brne .+72 ; 0xdc2 <CDC_Device_Flush+0x4e>
d7a: fc 01 movw r30, r24
d7c: 44 89 ldd r20, Z+20 ; 0x14
d7e: 55 89 ldd r21, Z+21 ; 0x15
d80: 66 89 ldd r22, Z+22 ; 0x16
d82: 77 89 ldd r23, Z+23 ; 0x17
d84: 45 2b or r20, r21
d86: 46 2b or r20, r22
d88: 47 2b or r20, r23
d8a: d9 f0 breq .+54 ; 0xdc2 <CDC_Device_Flush+0x4e>
d8c: 81 81 ldd r24, Z+1 ; 0x01
d8e: 8f 70 andi r24, 0x0F ; 15
d90: 80 93 e9 00 sts 0x00E9, r24
d94: 80 91 f2 00 lds r24, 0x00F2
d98: 88 23 and r24, r24
d9a: 89 f0 breq .+34 ; 0xdbe <CDC_Device_Flush+0x4a>
d9c: 90 91 e8 00 lds r25, 0x00E8
da0: 80 91 e8 00 lds r24, 0x00E8
da4: 8e 77 andi r24, 0x7E ; 126
da6: 80 93 e8 00 sts 0x00E8, r24
daa: 95 fd sbrc r25, 5
dac: 08 c0 rjmp .+16 ; 0xdbe <CDC_Device_Flush+0x4a>
dae: c1 dc rcall .-1662 ; 0x732 <Endpoint_WaitUntilReady>
db0: 81 11 cpse r24, r1
db2: 08 c0 rjmp .+16 ; 0xdc4 <CDC_Device_Flush+0x50>
db4: 80 91 e8 00 lds r24, 0x00E8
db8: 8e 77 andi r24, 0x7E ; 126
dba: 80 93 e8 00 sts 0x00E8, r24
dbe: 80 e0 ldi r24, 0x00 ; 0
dc0: 08 95 ret
dc2: 82 e0 ldi r24, 0x02 ; 2
dc4: 08 95 ret
00000dc6 <CDC_Device_USBTask>:
dc6: 2e b3 in r18, 0x1e ; 30
dc8: 24 30 cpi r18, 0x04 ; 4
dca: 89 f4 brne .+34 ; 0xdee <CDC_Device_USBTask+0x28>
dcc: fc 01 movw r30, r24
dce: 44 89 ldd r20, Z+20 ; 0x14
dd0: 55 89 ldd r21, Z+21 ; 0x15
dd2: 66 89 ldd r22, Z+22 ; 0x16
dd4: 77 89 ldd r23, Z+23 ; 0x17
dd6: 45 2b or r20, r21
dd8: 46 2b or r20, r22
dda: 47 2b or r20, r23
ddc: 41 f0 breq .+16 ; 0xdee <CDC_Device_USBTask+0x28>
dde: 21 81 ldd r18, Z+1 ; 0x01
de0: 2f 70 andi r18, 0x0F ; 15
de2: 20 93 e9 00 sts 0x00E9, r18
de6: 20 91 e8 00 lds r18, 0x00E8
dea: 20 fd sbrc r18, 0
dec: c3 cf rjmp .-122 ; 0xd74 <CDC_Device_Flush>
dee: 08 95 ret
00000df0 <CDC_Device_ReceiveByte>:
df0: 2e b3 in r18, 0x1e ; 30
df2: 24 30 cpi r18, 0x04 ; 4
df4: 19 f0 breq .+6 ; 0xdfc <CDC_Device_ReceiveByte+0xc>
df6: 8f ef ldi r24, 0xFF ; 255
df8: 9f ef ldi r25, 0xFF ; 255
dfa: 08 95 ret
dfc: fc 01 movw r30, r24
dfe: 44 89 ldd r20, Z+20 ; 0x14
e00: 55 89 ldd r21, Z+21 ; 0x15
e02: 66 89 ldd r22, Z+22 ; 0x16
e04: 77 89 ldd r23, Z+23 ; 0x17
e06: 45 2b or r20, r21
e08: 46 2b or r20, r22
e0a: 47 2b or r20, r23
e0c: a1 f3 breq .-24 ; 0xdf6 <CDC_Device_ReceiveByte+0x6>
e0e: 86 81 ldd r24, Z+6 ; 0x06
e10: 8f 70 andi r24, 0x0F ; 15
e12: 80 93 e9 00 sts 0x00E9, r24
e16: 80 91 e8 00 lds r24, 0x00E8
e1a: 82 ff sbrs r24, 2
e1c: ec cf rjmp .-40 ; 0xdf6 <CDC_Device_ReceiveByte+0x6>
e1e: 80 91 f2 00 lds r24, 0x00F2
e22: 88 23 and r24, r24
e24: 21 f0 breq .+8 ; 0xe2e <CDC_Device_ReceiveByte+0x3e>
e26: 20 91 f1 00 lds r18, 0x00F1
e2a: 30 e0 ldi r19, 0x00 ; 0
e2c: 02 c0 rjmp .+4 ; 0xe32 <CDC_Device_ReceiveByte+0x42>
e2e: 2f ef ldi r18, 0xFF ; 255
e30: 3f ef ldi r19, 0xFF ; 255
e32: 80 91 f2 00 lds r24, 0x00F2
e36: 81 11 cpse r24, r1
e38: 05 c0 rjmp .+10 ; 0xe44 <CDC_Device_ReceiveByte+0x54>
e3a: 80 91 e8 00 lds r24, 0x00E8
e3e: 8b 77 andi r24, 0x7B ; 123
e40: 80 93 e8 00 sts 0x00E8, r24
e44: c9 01 movw r24, r18
e46: 08 95 ret
00000e48 <CDC_Device_Event_Stub>:
return ReceivedByte;
}
#endif
void CDC_Device_Event_Stub(void)
{
e48: 08 95 ret
00000e4a <CDC_Device_ProcessControlRequest>:
#define __INCLUDE_FROM_CDC_DRIVER
#define __INCLUDE_FROM_CDC_DEVICE_C
#include "CDCClassDevice.h"
void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
{
e4a: cf 93 push r28
e4c: df 93 push r29
e4e: ec 01 movw r28, r24
* \return Boolean \c true if the selected endpoint has received a SETUP packet, \c false otherwise.
*/
static inline bool Endpoint_IsSETUPReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsSETUPReceived(void)
{
return ((UEINTX & (1 << RXSTPI)) ? true : false);
e50: 80 91 e8 00 lds r24, 0x00E8
if (!(Endpoint_IsSETUPReceived()))
e54: 83 ff sbrs r24, 3
e56: a5 c0 rjmp .+330 ; 0xfa2 <CDC_Device_ProcessControlRequest+0x158>
return;
if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber)
e58: 88 81 ld r24, Y
e5a: 90 e0 ldi r25, 0x00 ; 0
e5c: 20 91 3c 02 lds r18, 0x023C
e60: 30 91 3d 02 lds r19, 0x023D
e64: 28 17 cp r18, r24
e66: 39 07 cpc r19, r25
e68: 09 f0 breq .+2 ; 0xe6c <CDC_Device_ProcessControlRequest+0x22>
e6a: 9b c0 rjmp .+310 ; 0xfa2 <CDC_Device_ProcessControlRequest+0x158>
return;
switch (USB_ControlRequest.bRequest)
e6c: 80 91 39 02 lds r24, 0x0239
e70: 81 32 cpi r24, 0x21 ; 33
e72: 61 f0 breq .+24 ; 0xe8c <CDC_Device_ProcessControlRequest+0x42>
e74: 20 f4 brcc .+8 ; 0xe7e <CDC_Device_ProcessControlRequest+0x34>
e76: 80 32 cpi r24, 0x20 ; 32
e78: 09 f4 brne .+2 ; 0xe7c <CDC_Device_ProcessControlRequest+0x32>
e7a: 3e c0 rjmp .+124 ; 0xef8 <CDC_Device_ProcessControlRequest+0xae>
e7c: 92 c0 rjmp .+292 ; 0xfa2 <CDC_Device_ProcessControlRequest+0x158>
e7e: 82 32 cpi r24, 0x22 ; 34
e80: 09 f4 brne .+2 ; 0xe84 <CDC_Device_ProcessControlRequest+0x3a>
e82: 6b c0 rjmp .+214 ; 0xf5a <CDC_Device_ProcessControlRequest+0x110>
e84: 83 32 cpi r24, 0x23 ; 35
e86: 09 f4 brne .+2 ; 0xe8a <CDC_Device_ProcessControlRequest+0x40>
e88: 7c c0 rjmp .+248 ; 0xf82 <CDC_Device_ProcessControlRequest+0x138>
e8a: 8b c0 rjmp .+278 ; 0xfa2 <CDC_Device_ProcessControlRequest+0x158>
{
case CDC_REQ_GetLineEncoding:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
e8c: 80 91 38 02 lds r24, 0x0238
e90: 81 3a cpi r24, 0xA1 ; 161
e92: 09 f0 breq .+2 ; 0xe96 <CDC_Device_ProcessControlRequest+0x4c>
e94: 86 c0 rjmp .+268 ; 0xfa2 <CDC_Device_ProcessControlRequest+0x158>
* \note This is not applicable for non CONTROL type endpoints.
*/
static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearSETUP(void)
{
UEINTX &= ~(1 << RXSTPI);
e96: 80 91 e8 00 lds r24, 0x00E8
e9a: 87 7f andi r24, 0xF7 ; 247
e9c: 80 93 e8 00 sts 0x00E8, r24
* \return Boolean \c true if the current endpoint is ready for an IN packet, \c false otherwise.
*/
static inline bool Endpoint_IsINReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsINReady(void)
{
return ((UEINTX & (1 << TXINI)) ? true : false);
ea0: 80 91 e8 00 lds r24, 0x00E8
{
Endpoint_ClearSETUP();
while (!(Endpoint_IsINReady()));
ea4: 80 ff sbrs r24, 0
ea6: fc cf rjmp .-8 ; 0xea0 <CDC_Device_ProcessControlRequest+0x56>
Endpoint_Write_32_LE(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS);
ea8: 8c 89 ldd r24, Y+20 ; 0x14
eaa: 9d 89 ldd r25, Y+21 ; 0x15
eac: ae 89 ldd r26, Y+22 ; 0x16
eae: bf 89 ldd r27, Y+23 ; 0x17
* \param[in] Data Data to write to the currently selected endpoint's FIFO buffer.
*/
static inline void Endpoint_Write_32_LE(const uint32_t Data) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_32_LE(const uint32_t Data)
{
UEDATX = (Data & 0xFF);
eb0: 80 93 f1 00 sts 0x00F1, r24
UEDATX = (Data >> 8);
eb4: 49 2f mov r20, r25
eb6: 5a 2f mov r21, r26
eb8: 6b 2f mov r22, r27
eba: 77 27 eor r23, r23
ebc: 40 93 f1 00 sts 0x00F1, r20
UEDATX = (Data >> 16);
ec0: ad 01 movw r20, r26
ec2: 66 27 eor r22, r22
ec4: 77 27 eor r23, r23
ec6: 40 93 f1 00 sts 0x00F1, r20
UEDATX = (Data >> 24);
eca: 8b 2f mov r24, r27
ecc: 99 27 eor r25, r25
ece: aa 27 eor r26, r26
ed0: bb 27 eor r27, r27
ed2: 80 93 f1 00 sts 0x00F1, r24
Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.CharFormat);
ed6: 88 8d ldd r24, Y+24 ; 0x18
* \param[in] Data Data to write into the the currently selected endpoint's FIFO buffer.
*/
static inline void Endpoint_Write_8(const uint8_t Data) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_8(const uint8_t Data)
{
UEDATX = Data;
ed8: 80 93 f1 00 sts 0x00F1, r24
Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.ParityType);
edc: 89 8d ldd r24, Y+25 ; 0x19
ede: 80 93 f1 00 sts 0x00F1, r24
Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.DataBits);
ee2: 8a 8d ldd r24, Y+26 ; 0x1a
ee4: 80 93 f1 00 sts 0x00F1, r24
*/
static inline void Endpoint_ClearIN(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearIN(void)
{
#if !defined(CONTROL_ONLY_DEVICE)
UEINTX &= ~((1 << TXINI) | (1 << FIFOCON));
ee8: 80 91 e8 00 lds r24, 0x00E8
eec: 8e 77 andi r24, 0x7E ; 126
eee: 80 93 e8 00 sts 0x00E8, r24
EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue);
}
break;
}
}
ef2: df 91 pop r29
ef4: cf 91 pop r28
Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.CharFormat);
Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.ParityType);
Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.DataBits);
Endpoint_ClearIN();
Endpoint_ClearStatusStage();
ef6: 00 cc rjmp .-2048 ; 0x6f8 <Endpoint_ClearStatusStage>
}
break;
case CDC_REQ_SetLineEncoding:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
ef8: 80 91 38 02 lds r24, 0x0238
efc: 81 32 cpi r24, 0x21 ; 33
efe: 09 f0 breq .+2 ; 0xf02 <CDC_Device_ProcessControlRequest+0xb8>
f00: 50 c0 rjmp .+160 ; 0xfa2 <CDC_Device_ProcessControlRequest+0x158>
* \note This is not applicable for non CONTROL type endpoints.
*/
static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearSETUP(void)
{
UEINTX &= ~(1 << RXSTPI);
f02: 80 91 e8 00 lds r24, 0x00E8
f06: 87 7f andi r24, 0xF7 ; 247
f08: 80 93 e8 00 sts 0x00E8, r24
* \return Boolean \c true if current endpoint is has received an OUT packet, \c false otherwise.
*/
static inline bool Endpoint_IsOUTReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsOUTReceived(void)
{
return ((UEINTX & (1 << RXOUTI)) ? true : false);
f0c: 80 91 e8 00 lds r24, 0x00E8
{
Endpoint_ClearSETUP();
while (!(Endpoint_IsOUTReceived()))
f10: 82 fd sbrc r24, 2
f12: 04 c0 rjmp .+8 ; 0xf1c <CDC_Device_ProcessControlRequest+0xd2>
{
if (USB_DeviceState == DEVICE_STATE_Unattached)
f14: 8e b3 in r24, 0x1e ; 30
f16: 81 11 cpse r24, r1
f18: f9 cf rjmp .-14 ; 0xf0c <CDC_Device_ProcessControlRequest+0xc2>
f1a: 43 c0 rjmp .+134 ; 0xfa2 <CDC_Device_ProcessControlRequest+0x158>
{
uint32_t Value;
uint8_t Bytes[4];
} Data;
Data.Bytes[0] = UEDATX;
f1c: 30 91 f1 00 lds r19, 0x00F1
Data.Bytes[1] = UEDATX;
f20: 20 91 f1 00 lds r18, 0x00F1
Data.Bytes[2] = UEDATX;
f24: 90 91 f1 00 lds r25, 0x00F1
Data.Bytes[3] = UEDATX;
f28: 80 91 f1 00 lds r24, 0x00F1
return;
}
CDCInterfaceInfo->State.LineEncoding.BaudRateBPS = Endpoint_Read_32_LE();
f2c: 3c 8b std Y+20, r19 ; 0x14
f2e: 2d 8b std Y+21, r18 ; 0x15
f30: 9e 8b std Y+22, r25 ; 0x16
f32: 8f 8b std Y+23, r24 ; 0x17
* \return Next byte in the currently selected endpoint's FIFO buffer.
*/
static inline uint8_t Endpoint_Read_8(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_Read_8(void)
{
return UEDATX;
f34: 80 91 f1 00 lds r24, 0x00F1
CDCInterfaceInfo->State.LineEncoding.CharFormat = Endpoint_Read_8();
f38: 88 8f std Y+24, r24 ; 0x18
f3a: 80 91 f1 00 lds r24, 0x00F1
CDCInterfaceInfo->State.LineEncoding.ParityType = Endpoint_Read_8();
f3e: 89 8f std Y+25, r24 ; 0x19
f40: 80 91 f1 00 lds r24, 0x00F1
CDCInterfaceInfo->State.LineEncoding.DataBits = Endpoint_Read_8();
f44: 8a 8f std Y+26, r24 ; 0x1a
*/
static inline void Endpoint_ClearOUT(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearOUT(void)
{
#if !defined(CONTROL_ONLY_DEVICE)
UEINTX &= ~((1 << RXOUTI) | (1 << FIFOCON));
f46: 80 91 e8 00 lds r24, 0x00E8
f4a: 8b 77 andi r24, 0x7B ; 123
f4c: 80 93 e8 00 sts 0x00E8, r24
Endpoint_ClearOUT();
Endpoint_ClearStatusStage();
f50: d3 db rcall .-2138 ; 0x6f8 <Endpoint_ClearStatusStage>
EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo);
f52: ce 01 movw r24, r28
EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue);
}
break;
}
}
f54: df 91 pop r29
f56: cf 91 pop r28
CDCInterfaceInfo->State.LineEncoding.DataBits = Endpoint_Read_8();
Endpoint_ClearOUT();
Endpoint_ClearStatusStage();
EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo);
f58: 24 ca rjmp .-3000 ; 0x3a2 <EVENT_CDC_Device_LineEncodingChanged>
}
break;
case CDC_REQ_SetControlLineState:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
f5a: 80 91 38 02 lds r24, 0x0238
f5e: 81 32 cpi r24, 0x21 ; 33
f60: 01 f5 brne .+64 ; 0xfa2 <CDC_Device_ProcessControlRequest+0x158>
* \note This is not applicable for non CONTROL type endpoints.
*/
static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearSETUP(void)
{
UEINTX &= ~(1 << RXSTPI);
f62: 80 91 e8 00 lds r24, 0x00E8
f66: 87 7f andi r24, 0xF7 ; 247
f68: 80 93 e8 00 sts 0x00E8, r24
{
Endpoint_ClearSETUP();
Endpoint_ClearStatusStage();
f6c: c5 db rcall .-2166 ; 0x6f8 <Endpoint_ClearStatusStage>
CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue;
f6e: 80 91 3a 02 lds r24, 0x023A
f72: 90 91 3b 02 lds r25, 0x023B
f76: 99 8b std Y+17, r25 ; 0x11
f78: 88 8b std Y+16, r24 ; 0x10
EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo);
f7a: ce 01 movw r24, r28
EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue);
}
break;
}
}
f7c: df 91 pop r29
f7e: cf 91 pop r28
Endpoint_ClearSETUP();
Endpoint_ClearStatusStage();
CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue;
EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo);
f80: 63 cf rjmp .-314 ; 0xe48 <CDC_Device_Event_Stub>
}
break;
case CDC_REQ_SendBreak:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
f82: 80 91 38 02 lds r24, 0x0238
f86: 81 32 cpi r24, 0x21 ; 33
f88: 61 f4 brne .+24 ; 0xfa2 <CDC_Device_ProcessControlRequest+0x158>
f8a: 80 91 e8 00 lds r24, 0x00E8
f8e: 87 7f andi r24, 0xF7 ; 247
f90: 80 93 e8 00 sts 0x00E8, r24
{
Endpoint_ClearSETUP();
Endpoint_ClearStatusStage();
f94: b1 db rcall .-2206 ; 0x6f8 <Endpoint_ClearStatusStage>
EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue);
f96: 60 91 3a 02 lds r22, 0x023A
f9a: ce 01 movw r24, r28
}
break;
}
}
f9c: df 91 pop r29
f9e: cf 91 pop r28
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
Endpoint_ClearSETUP();
Endpoint_ClearStatusStage();
EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue);
fa0: 53 cf rjmp .-346 ; 0xe48 <CDC_Device_Event_Stub>
}
break;
}
}
fa2: df 91 pop r29
fa4: cf 91 pop r28
fa6: 08 95 ret
00000fa8 <__udivmodsi4>:
fa8: a1 e2 ldi r26, 0x21 ; 33
faa: 1a 2e mov r1, r26
fac: aa 1b sub r26, r26
fae: bb 1b sub r27, r27
fb0: fd 01 movw r30, r26
fb2: 0d c0 rjmp .+26 ; 0xfce <__udivmodsi4_ep>
00000fb4 <__udivmodsi4_loop>:
fb4: aa 1f adc r26, r26
fb6: bb 1f adc r27, r27
fb8: ee 1f adc r30, r30
fba: ff 1f adc r31, r31
fbc: a2 17 cp r26, r18
fbe: b3 07 cpc r27, r19
fc0: e4 07 cpc r30, r20
fc2: f5 07 cpc r31, r21
fc4: 20 f0 brcs .+8 ; 0xfce <__udivmodsi4_ep>
fc6: a2 1b sub r26, r18
fc8: b3 0b sbc r27, r19
fca: e4 0b sbc r30, r20
fcc: f5 0b sbc r31, r21
00000fce <__udivmodsi4_ep>:
fce: 66 1f adc r22, r22
fd0: 77 1f adc r23, r23
fd2: 88 1f adc r24, r24
fd4: 99 1f adc r25, r25
fd6: 1a 94 dec r1
fd8: 69 f7 brne .-38 ; 0xfb4 <__udivmodsi4_loop>
fda: 60 95 com r22
fdc: 70 95 com r23
fde: 80 95 com r24
fe0: 90 95 com r25
fe2: 9b 01 movw r18, r22
fe4: ac 01 movw r20, r24
fe6: bd 01 movw r22, r26
fe8: cf 01 movw r24, r30
fea: 08 95 ret
00000fec <_exit>:
fec: f8 94 cli
00000fee <__stop_program>:
fee: ff cf rjmp .-2 ; 0xfee <__stop_program>