w5100s.txt
32.8 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
; generated by Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o.\flash\obj\w5100s.o --asm_dir=.\Flash\List\ --list_dir=.\Flash\List\ --depend=.\flash\obj\w5100s.d --cpu=Cortex-M4.fp --apcs=interwork -O1 --diag_suppress=9931,870 -I..\..\Libraries\CMSIS\Include -I..\..\Libraries\CMSIS\Device\ST\STM32F4xx\Include -I..\..\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\uCOS-III\uC-CPU -I..\..\uCOS-III\uC-LIB -I..\..\uCOS-III\uCOS-III\Ports -I..\..\uCOS-III\uCOS-III\Source -I..\..\uCOS-III\uC-CPU\ARM-Cortex-M4\RealView -I..\..\uCOS-III\uC-LIB\Ports\ARM-Cortex-M4\RealView -I..\..\uCOS-III\uCOS-III\Ports\ARM-Cortex-M4\Generic\RealView -I..\..\User -I..\..\User\bsp -I..\..\User\bsp\inc -I..\..\User\libapp -I..\..\RL-ARM\Config -I..\..\RL-ARM\Driver -I..\..\RL-ARM\RL-RTX\inc -I..\..\User\bsp\BSP -I..\..\RL-ARM\RL-CAN -I..\..\Libraries\DSP_LIB\Include -I..\..\MODBUS\modbus\rtu -I..\..\MODBUS\BARE\port -I..\..\MODBUS\modbus\include -I..\..\User\bsp\BSP -I..\..\PLC -I..\..\Avoid -I..\..\User\parameter -I..\..\User\LaserMotionCtr -I..\..\User\W5100S -I..\..\User\bsp -I..\..\User\CHASSIS -I..\..\User\CONTROLFUNCTION -I..\..\User\DATAUPDATE -I..\..\User\HARAWARE -I..\..\User\MOTORDRIVER -I..\..\User\NAVAGATION -I..\..\User\PLATFORM -I..\..\User\SENSOR -I.\RTE\_Flash -IC:\Users\YDJ\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include -IC:\Users\YDJ\AppData\Local\Arm\Packs\Keil\STM32F4xx_DFP\2.13.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -D__UVISION_VERSION=527 -D_RTE_ -DSTM32F407xx -DUSE_STDPERIPH_DRIVER -DSTM32F40_41xxx -D__RTX -D__FPU_USED=1 --omf_browse=.\flash\obj\w5100s.crf ..\..\User\W5100S\w5100s.c]
THUMB
AREA ||i.WIZCHIP_READ||, CODE, READONLY, ALIGN=2
WIZCHIP_READ PROC
;;;22
;;;23 uint8_t WIZCHIP_READ(uint32_t AddrSel)
000000 b570 PUSH {r4-r6,lr}
;;;24 {
000002 4605 MOV r5,r0
;;;25 uint8_t ret;
;;;26
;;;27 WIZCHIP_CRITICAL_ENTER();
000004 4c0b LDR r4,|L1.52|
000006 68e0 LDR r0,[r4,#0xc] ; WIZCHIP
000008 4780 BLX r0
;;;28 WIZCHIP.CS._select();
00000a 6960 LDR r0,[r4,#0x14] ; WIZCHIP
00000c 4780 BLX r0
;;;29
;;;30 #if( (_WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_SPI_))
;;;31 WIZCHIP.IF.SPI._write_byte(0x0F); // 0X0F--读 0XF0--写
00000e 6a21 LDR r1,[r4,#0x20] ; WIZCHIP
000010 200f MOVS r0,#0xf
000012 4788 BLX r1
;;;32 WIZCHIP.IF.SPI._write_byte((AddrSel & 0xFF00) >> 8);
000014 6a21 LDR r1,[r4,#0x20] ; WIZCHIP
000016 f3c52007 UBFX r0,r5,#8,#8
00001a 4788 BLX r1
;;;33 WIZCHIP.IF.SPI._write_byte((AddrSel & 0x00FF) >> 0);
00001c 6a21 LDR r1,[r4,#0x20] ; WIZCHIP
00001e b2e8 UXTB r0,r5
000020 4788 BLX r1
;;;34 ret = WIZCHIP.IF.SPI._read_byte();
000022 69e0 LDR r0,[r4,#0x1c] ; WIZCHIP
000024 4780 BLX r0
000026 4605 MOV r5,r0
;;;35 #elif ( (_WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_BUS_INDIR_) )
;;;36 WIZCHIP.IF.BUS._write_data(IDM_AR0,(AddrSel & 0xFF00) >> 8);
;;;37 WIZCHIP.IF.BUS._write_data(IDM_AR1,(AddrSel & 0x00FF));
;;;38 ret = WIZCHIP.IF.BUS._read_data(IDM_DR);
;;;39 #endif
;;;40 WIZCHIP.CS._deselect();
000028 69a1 LDR r1,[r4,#0x18] ; WIZCHIP
00002a 4788 BLX r1
;;;41 WIZCHIP_CRITICAL_EXIT();
00002c 6921 LDR r1,[r4,#0x10] ; WIZCHIP
00002e 4788 BLX r1
;;;42 return ret;
000030 4628 MOV r0,r5
;;;43 }
000032 bd70 POP {r4-r6,pc}
;;;44
ENDP
|L1.52|
DCD WIZCHIP
AREA ||i.WIZCHIP_READ_BUF||, CODE, READONLY, ALIGN=2
WIZCHIP_READ_BUF PROC
;;;77
;;;78 void WIZCHIP_READ_BUF (uint32_t AddrSel, uint8_t* pBuf, uint16_t len)
000000 e92d41f0 PUSH {r4-r8,lr}
;;;79 {
000004 4680 MOV r8,r0
000006 460e MOV r6,r1
000008 4617 MOV r7,r2
;;;80 uint16_t i = 0;
00000a 2400 MOVS r4,#0
;;;81 WIZCHIP_CRITICAL_ENTER();
00000c 4d0e LDR r5,|L2.72|
00000e 68e8 LDR r0,[r5,#0xc] ; WIZCHIP
000010 4780 BLX r0
;;;82 WIZCHIP.CS._select(); //M20150601 : Moved here.
000012 6968 LDR r0,[r5,#0x14] ; WIZCHIP
000014 4780 BLX r0
;;;83
;;;84 #if ( (_WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_SPI_) )
;;;85
;;;86 WIZCHIP.IF.SPI._write_byte(0x0F);
000016 6a29 LDR r1,[r5,#0x20] ; WIZCHIP
000018 200f MOVS r0,#0xf
00001a 4788 BLX r1
;;;87 WIZCHIP.IF.SPI._write_byte((uint16_t)((AddrSel+i) & 0xFF00) >> 8);
00001c 6a29 LDR r1,[r5,#0x20] ; WIZCHIP
00001e f3c82007 UBFX r0,r8,#8,#8
000022 4788 BLX r1
;;;88 WIZCHIP.IF.SPI._write_byte((uint16_t)((AddrSel+i) & 0x00FF) >> 0);
000024 6a29 LDR r1,[r5,#0x20] ; WIZCHIP
000026 f00800ff AND r0,r8,#0xff
00002a 4788 BLX r1
;;;89
;;;90 for(i = 0; i < len; i++)
00002c e004 B |L2.56|
|L2.46|
;;;91 {
;;;92 pBuf[i] = WIZCHIP.IF.SPI._read_byte();
00002e 69e8 LDR r0,[r5,#0x1c] ; WIZCHIP
000030 4780 BLX r0
000032 5530 STRB r0,[r6,r4]
000034 1c64 ADDS r4,r4,#1 ;90
000036 b2a4 UXTH r4,r4 ;90
|L2.56|
000038 42bc CMP r4,r7 ;90
00003a d3f8 BCC |L2.46|
;;;93 }
;;;94 #elif ( (_WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_BUS_INDIR_) )
;;;95 setMR(getMR() | MR_AI);
;;;96 WIZCHIP.IF.BUS._write_data(IDM_AR0,(AddrSel & 0xFF00) >> 8);
;;;97 WIZCHIP.IF.BUS._write_data(IDM_AR1,(AddrSel & 0x00FF));
;;;98 for(i = 0 ; i < len; i++)
;;;99 pBuf[i] = WIZCHIP.IF.BUS._read_data(IDM_DR);
;;;100 setMR(getMR() & ~MR_AI);
;;;101 #endif
;;;102 WIZCHIP.CS._deselect(); //M20150601 : Moved Here.
00003c 69a8 LDR r0,[r5,#0x18] ; WIZCHIP
00003e 4780 BLX r0
;;;103 WIZCHIP_CRITICAL_EXIT();
000040 6928 LDR r0,[r5,#0x10] ; WIZCHIP
000042 e8bd41f0 POP {r4-r8,lr}
000046 4700 BX r0
;;;104 }
;;;105
ENDP
|L2.72|
DCD WIZCHIP
AREA ||i.WIZCHIP_WRITE||, CODE, READONLY, ALIGN=2
WIZCHIP_WRITE PROC
;;;3
;;;4 void WIZCHIP_WRITE(uint32_t AddrSel, uint8_t wb )
000000 b570 PUSH {r4-r6,lr}
;;;5 {
000002 4605 MOV r5,r0
000004 460e MOV r6,r1
;;;6 WIZCHIP_CRITICAL_ENTER();
000006 4c0c LDR r4,|L3.56|
000008 68e0 LDR r0,[r4,#0xc] ; WIZCHIP
00000a 4780 BLX r0
;;;7 WIZCHIP.CS._select();
00000c 6960 LDR r0,[r4,#0x14] ; WIZCHIP
00000e 4780 BLX r0
;;;8
;;;9 #if( (_WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_SPI_))
;;;10 WIZCHIP.IF.SPI._write_byte(0xF0);
000010 6a22 LDR r2,[r4,#0x20] ; WIZCHIP
000012 20f0 MOVS r0,#0xf0
000014 4790 BLX r2
;;;11 WIZCHIP.IF.SPI._write_byte((AddrSel & 0xFF00) >> 8);
000016 6a22 LDR r2,[r4,#0x20] ; WIZCHIP
000018 f3c52007 UBFX r0,r5,#8,#8
00001c 4790 BLX r2
;;;12 WIZCHIP.IF.SPI._write_byte((AddrSel & 0x00FF) >> 0);
00001e 6a22 LDR r2,[r4,#0x20] ; WIZCHIP
000020 b2e8 UXTB r0,r5
000022 4790 BLX r2
;;;13 WIZCHIP.IF.SPI._write_byte(wb); // Data write (write 1byte data)
000024 6a21 LDR r1,[r4,#0x20] ; WIZCHIP
000026 4630 MOV r0,r6
000028 4788 BLX r1
;;;14 #elif ( (_WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_BUS_INDIR_) )
;;;15 WIZCHIP.IF.BUS._write_data(IDM_AR0,(AddrSel & 0xFF00) >> 8);
;;;16 WIZCHIP.IF.BUS._write_data(IDM_AR1,(AddrSel & 0x00FF));
;;;17 WIZCHIP.IF.BUS._write_data(IDM_DR,wb);
;;;18 #endif
;;;19 WIZCHIP.CS._deselect();
00002a 69a0 LDR r0,[r4,#0x18] ; WIZCHIP
00002c 4780 BLX r0
;;;20 WIZCHIP_CRITICAL_EXIT();
00002e 6920 LDR r0,[r4,#0x10] ; WIZCHIP
000030 e8bd4070 POP {r4-r6,lr}
000034 4700 BX r0
;;;21 }
;;;22
ENDP
000036 0000 DCW 0x0000
|L3.56|
DCD WIZCHIP
AREA ||i.WIZCHIP_WRITE_BUF||, CODE, READONLY, ALIGN=2
WIZCHIP_WRITE_BUF PROC
;;;44
;;;45 void WIZCHIP_WRITE_BUF(uint32_t AddrSel, uint8_t* pBuf, uint16_t len)
000000 e92d41f0 PUSH {r4-r8,lr}
;;;46 {
000004 4680 MOV r8,r0
000006 460e MOV r6,r1
000008 4617 MOV r7,r2
;;;47 uint16_t i = 0;
00000a 2400 MOVS r4,#0
;;;48
;;;49 WIZCHIP_CRITICAL_ENTER();
00000c 4d0e LDR r5,|L4.72|
00000e 68e8 LDR r0,[r5,#0xc] ; WIZCHIP
000010 4780 BLX r0
;;;50 WIZCHIP.CS._select(); //M20150601 : Moved here.
000012 6968 LDR r0,[r5,#0x14] ; WIZCHIP
000014 4780 BLX r0
;;;51
;;;52 #if ((_WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_SPI_))
;;;53
;;;54 WIZCHIP.IF.SPI._write_byte(0xF0); // 0XF0--写 0x0F---读命令
000016 6a29 LDR r1,[r5,#0x20] ; WIZCHIP
000018 20f0 MOVS r0,#0xf0
00001a 4788 BLX r1
;;;55 WIZCHIP.IF.SPI._write_byte((((uint16_t)(AddrSel+i)) & 0xFF00) >> 8);
00001c 6a29 LDR r1,[r5,#0x20] ; WIZCHIP
00001e f3c82007 UBFX r0,r8,#8,#8
000022 4788 BLX r1
;;;56 WIZCHIP.IF.SPI._write_byte((((uint16_t)(AddrSel+i)) & 0x00FF) >> 0);
000024 6a29 LDR r1,[r5,#0x20] ; WIZCHIP
000026 f00800ff AND r0,r8,#0xff
00002a 4788 BLX r1
;;;57
;;;58 for(i = 0; i < len; i++) // 依次写入多个字节
00002c e004 B |L4.56|
|L4.46|
;;;59 {
;;;60 WIZCHIP.IF.SPI._write_byte(pBuf[i]); // Data write (write 1byte data)
00002e 6a2b LDR r3,[r5,#0x20] ; WIZCHIP
000030 5d30 LDRB r0,[r6,r4]
000032 4798 BLX r3
000034 1c64 ADDS r4,r4,#1 ;58
000036 b2a4 UXTH r4,r4 ;58
|L4.56|
000038 42bc CMP r4,r7 ;58
00003a d3f8 BCC |L4.46|
;;;61 }
;;;62 #elif ( (_WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_BUS_INDIR_) )
;;;63 setMR(getMR()|MR_AI);
;;;64 WIZCHIP.IF.BUS._write_data(IDM_AR0,(AddrSel & 0xFF00) >> 8);
;;;65 WIZCHIP.IF.BUS._write_data(IDM_AR1,(AddrSel & 0x00FF));
;;;66 for(i = 0 ; i < len; i++)
;;;67 WIZCHIP.IF.BUS._write_data(IDM_DR,pBuf[i]);
;;;68 setMR(getMR() & ~MR_AI);
;;;69
;;;70
;;;71 #endif
;;;72
;;;73 WIZCHIP.CS._deselect(); //M20150601 : Moved here.
00003c 69a8 LDR r0,[r5,#0x18] ; WIZCHIP
00003e 4780 BLX r0
;;;74 WIZCHIP_CRITICAL_EXIT();
000040 6928 LDR r0,[r5,#0x10] ; WIZCHIP
000042 e8bd41f0 POP {r4-r8,lr}
000046 4700 BX r0
;;;75 }
;;;76
ENDP
|L4.72|
DCD WIZCHIP
AREA ||i.getSn_RX_RSR||, CODE, READONLY, ALIGN=1
getSn_RX_RSR PROC
;;;126
;;;127 uint16_t getSn_RX_RSR(uint8_t sn)
000000 e92d41f0 PUSH {r4-r8,lr}
;;;128 {
;;;129 uint16_t val=0,val1=0;
000004 2700 MOVS r7,#0
;;;130 do
;;;131 {
;;;132 val1 = WIZCHIP_READ(Sn_RX_RSR(sn)); // 读取接收数据大小 高8
000006 f2404126 MOV r1,#0x426
00000a eb012500 ADD r5,r1,r0,LSL #8
;;;133 val1 = (val1 << 8) + WIZCHIP_READ(WIZCHIP_OFFSET_INC(Sn_RX_RSR(sn),1));
00000e 1c49 ADDS r1,r1,#1
000010 eb012600 ADD r6,r1,r0,LSL #8
|L5.20|
000014 4628 MOV r0,r5 ;132
000016 f7fffffe BL WIZCHIP_READ
00001a 4604 MOV r4,r0 ;132
00001c 4630 MOV r0,r6
00001e f7fffffe BL WIZCHIP_READ
000022 eb002004 ADD r0,r0,r4,LSL #8
000026 b284 UXTH r4,r0
;;;134 if (val1 != 0)
000028 b14c CBZ r4,|L5.62|
;;;135 {
;;;136 val = WIZCHIP_READ(Sn_RX_RSR(sn));
00002a 4628 MOV r0,r5
00002c f7fffffe BL WIZCHIP_READ
000030 4607 MOV r7,r0
;;;137 val = (val << 8) + WIZCHIP_READ(WIZCHIP_OFFSET_INC(Sn_RX_RSR(sn),1));
000032 4630 MOV r0,r6
000034 f7fffffe BL WIZCHIP_READ
000038 eb002007 ADD r0,r0,r7,LSL #8
00003c b287 UXTH r7,r0
|L5.62|
;;;138 }
;;;139 }while (val != val1);
00003e 42a7 CMP r7,r4
000040 d1e8 BNE |L5.20|
;;;140 return val;
000042 4638 MOV r0,r7
;;;141 }
000044 e8bd81f0 POP {r4-r8,pc}
;;;142
ENDP
AREA ||i.getSn_RxBASE||, CODE, READONLY, ALIGN=1
getSn_RxBASE PROC
;;;145 /////////////////////////////////////
;;;146 uint32_t getSn_RxBASE(uint8_t sn)
000000 e92d41f0 PUSH {r4-r8,lr}
;;;147 {
000004 4607 MOV r7,r0
;;;148 int8_t i;
;;;149 #if ( _WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_BUS_DIR_)
;;;150 uint32_t rxbase = _W5100_IO_BASE_ + _WIZCHIP_IO_RXBUF_;
;;;151 #else
;;;152 uint32_t rxbase = _WIZCHIP_IO_RXBUF_;
000006 f44f45c0 MOV r5,#0x6000
;;;153 #endif
;;;154 for(i = 0; i < sn; i++)
00000a 2400 MOVS r4,#0
;;;155 rxbase += getSn_RxMAX(i);
00000c 2603 MOVS r6,#3
00000e f04f0801 MOV r8,#1
000012 e00e B |L6.50|
|L6.20|
000014 201a MOVS r0,#0x1a
000016 f7fffffe BL WIZCHIP_READ
00001a 0061 LSLS r1,r4,#1
00001c fa06f201 LSL r2,r6,r1
000020 4010 ANDS r0,r0,r2
000022 40c8 LSRS r0,r0,r1
000024 fa08f000 LSL r0,r8,r0
000028 b280 UXTH r0,r0
00002a eb052580 ADD r5,r5,r0,LSL #10
00002e 1c64 ADDS r4,r4,#1 ;154
000030 b264 SXTB r4,r4 ;154
|L6.50|
000032 42bc CMP r4,r7 ;154
000034 dbee BLT |L6.20|
;;;156
;;;157 return rxbase;
000036 4628 MOV r0,r5
;;;158 }
000038 e8bd81f0 POP {r4-r8,pc}
;;;159
ENDP
AREA ||i.getSn_TX_FSR||, CODE, READONLY, ALIGN=1
getSn_TX_FSR PROC
;;;109
;;;110 uint16_t getSn_TX_FSR(uint8_t sn)
000000 e92d41f0 PUSH {r4-r8,lr}
;;;111 {
;;;112 uint16_t val=0,val1=0;
000004 2700 MOVS r7,#0
;;;113 do
;;;114 {
;;;115 val1 = WIZCHIP_READ(Sn_TX_FSR(sn));
000006 f44f6184 MOV r1,#0x420
00000a eb012500 ADD r5,r1,r0,LSL #8
;;;116 val1 = (val1 << 8) + WIZCHIP_READ(WIZCHIP_OFFSET_INC(Sn_TX_FSR(sn),1));
00000e 1c49 ADDS r1,r1,#1
000010 eb012600 ADD r6,r1,r0,LSL #8
|L7.20|
000014 4628 MOV r0,r5 ;115
000016 f7fffffe BL WIZCHIP_READ
00001a 4604 MOV r4,r0 ;115
00001c 4630 MOV r0,r6
00001e f7fffffe BL WIZCHIP_READ
000022 eb002004 ADD r0,r0,r4,LSL #8
000026 b284 UXTH r4,r0
;;;117 if (val1 != 0)
000028 b14c CBZ r4,|L7.62|
;;;118 {
;;;119 val = WIZCHIP_READ(Sn_TX_FSR(sn));
00002a 4628 MOV r0,r5
00002c f7fffffe BL WIZCHIP_READ
000030 4607 MOV r7,r0
;;;120 val = (val << 8) + WIZCHIP_READ(WIZCHIP_OFFSET_INC(Sn_TX_FSR(sn),1));
000032 4630 MOV r0,r6
000034 f7fffffe BL WIZCHIP_READ
000038 eb002007 ADD r0,r0,r7,LSL #8
00003c b287 UXTH r7,r0
|L7.62|
;;;121 }
;;;122 }while (val != val1);
00003e 42a7 CMP r7,r4
000040 d1e8 BNE |L7.20|
;;;123 return val;
000042 4638 MOV r0,r7
;;;124 }
000044 e8bd81f0 POP {r4-r8,pc}
;;;125
ENDP
AREA ||i.getSn_TxBASE||, CODE, READONLY, ALIGN=1
getSn_TxBASE PROC
;;;159
;;;160 uint32_t getSn_TxBASE(uint8_t sn)
000000 e92d41f0 PUSH {r4-r8,lr}
;;;161 {
000004 4607 MOV r7,r0
;;;162 int8_t i;
;;;163 #if ( _WIZCHIP_IO_MODE_ == _WIZCHIP_IO_MODE_BUS_DIR_)
;;;164 uint32_t txbase = _W5100_IO_BASE_ + _WIZCHIP_IO_TXBUF_;
;;;165 #else
;;;166 uint32_t txbase = _WIZCHIP_IO_TXBUF_;
000006 f44f4580 MOV r5,#0x4000
;;;167 #endif
;;;168 for(i = 0; i < sn; i++)
00000a 2400 MOVS r4,#0
;;;169 txbase += getSn_TxMAX(i);
00000c 2603 MOVS r6,#3
00000e f04f0801 MOV r8,#1
000012 e00e B |L8.50|
|L8.20|
000014 201b MOVS r0,#0x1b
000016 f7fffffe BL WIZCHIP_READ
00001a 0061 LSLS r1,r4,#1
00001c fa06f201 LSL r2,r6,r1
000020 4010 ANDS r0,r0,r2
000022 40c8 LSRS r0,r0,r1
000024 fa08f000 LSL r0,r8,r0
000028 b280 UXTH r0,r0
00002a eb052580 ADD r5,r5,r0,LSL #10
00002e 1c64 ADDS r4,r4,#1 ;168
000030 b264 SXTB r4,r4 ;168
|L8.50|
000032 42bc CMP r4,r7 ;168
000034 dbee BLT |L8.20|
;;;170 return txbase;
000036 4628 MOV r0,r5
;;;171 }
000038 e8bd81f0 POP {r4-r8,pc}
;;;172
ENDP
AREA ||i.wiz_mdio_read||, CODE, READONLY, ALIGN=1
wiz_mdio_read PROC
;;;282
;;;283 uint16_t wiz_mdio_read(uint8_t PHYMDIO_regadr)
000000 b510 PUSH {r4,lr}
;;;284 {
;;;285 setPHYRR(PHYMDIO_regadr);
000002 4601 MOV r1,r0
000004 203f MOVS r0,#0x3f
000006 f7fffffe BL WIZCHIP_WRITE
;;;286 setPHYACR(PHYACR_READ);
00000a 2102 MOVS r1,#2
00000c 2044 MOVS r0,#0x44
00000e f7fffffe BL WIZCHIP_WRITE
|L9.18|
;;;287 while(getPHYACR() != 0){
000012 2044 MOVS r0,#0x44
000014 f7fffffe BL WIZCHIP_READ
000018 2800 CMP r0,#0
00001a d1fa BNE |L9.18|
;;;288 //wait until command executed.
;;;289 }
;;;290 return getPHYDOR();
00001c 2042 MOVS r0,#0x42
00001e f7fffffe BL WIZCHIP_READ
000022 4604 MOV r4,r0
000024 2043 MOVS r0,#0x43
000026 f7fffffe BL WIZCHIP_READ
00002a eb042000 ADD r0,r4,r0,LSL #8
00002e b280 UXTH r0,r0
;;;291 }
000030 bd10 POP {r4,pc}
;;;292
ENDP
AREA ||i.wiz_mdio_write||, CODE, READONLY, ALIGN=1
wiz_mdio_write PROC
;;;268 //todo comment needed
;;;269 void wiz_mdio_write(uint8_t PHYMDIO_regadr, uint16_t var)
000000 b510 PUSH {r4,lr}
;;;270 {
000002 460c MOV r4,r1
;;;271 //set the address to write
;;;272 setPHYRR(PHYMDIO_regadr);
000004 4601 MOV r1,r0
000006 203f MOVS r0,#0x3f
000008 f7fffffe BL WIZCHIP_WRITE
;;;273 //set the data to write
;;;274 setPHYDIR(var);
00000c 0a21 LSRS r1,r4,#8
00000e 2041 MOVS r0,#0x41
000010 f7fffffe BL WIZCHIP_WRITE
000014 b2e1 UXTB r1,r4
000016 2040 MOVS r0,#0x40
000018 f7fffffe BL WIZCHIP_WRITE
;;;275 //write command
;;;276 setPHYACR(PHYACR_WRITE);
00001c 2101 MOVS r1,#1
00001e 2044 MOVS r0,#0x44
000020 f7fffffe BL WIZCHIP_WRITE
|L10.36|
;;;277
;;;278 while(getPHYACR() != 0){
000024 2044 MOVS r0,#0x44
000026 f7fffffe BL WIZCHIP_READ
00002a 2800 CMP r0,#0
00002c d1fa BNE |L10.36|
;;;279 //wait until command executed.
;;;280 }
;;;281 }
00002e bd10 POP {r4,pc}
;;;282
ENDP
AREA ||i.wiz_recv_data||, CODE, READONLY, ALIGN=1
wiz_recv_data PROC
;;;225 */
;;;226 void wiz_recv_data(uint8_t sn, uint8_t *wizdata, uint16_t len)
000000 e92d4ff7 PUSH {r0-r2,r4-r11,lr}
;;;227 {
000004 b082 SUB sp,sp,#8
000006 4607 MOV r7,r0
000008 4690 MOV r8,r2
;;;228 uint16_t ptr;
;;;229 uint16_t size;
;;;230 uint16_t src_mask;
;;;231 uint16_t src_ptr;
;;;232
;;;233 ptr = getSn_RX_RD(sn); // 读取 接收读指针寄存器值
00000a f2404029 MOV r0,#0x429
00000e eb002a07 ADD r10,r0,r7,LSL #8
000012 4650 MOV r0,r10
000014 f7fffffe BL WIZCHIP_READ
000018 4604 MOV r4,r0
00001a f44f6085 MOV r0,#0x428
00001e eb002b07 ADD r11,r0,r7,LSL #8
000022 4658 MOV r0,r11
000024 f7fffffe BL WIZCHIP_READ
000028 eb042000 ADD r0,r4,r0,LSL #8
00002c fa1ff980 UXTH r9,r0
;;;234
;;;235 src_mask = (uint32_t)ptr & getSn_RxMASK(sn); // getSn_RxMASK(sn)--接收缓存大小-1
000030 201a MOVS r0,#0x1a
000032 f7fffffe BL WIZCHIP_READ
000036 007d LSLS r5,r7,#1
000038 2603 MOVS r6,#3
00003a 40ae LSLS r6,r6,r5
00003c 4030 ANDS r0,r0,r6
00003e 40e8 LSRS r0,r0,r5
000040 2101 MOVS r1,#1
000042 4081 LSLS r1,r1,r0
000044 f04f30ff MOV r0,#0xffffffff
000048 eb002481 ADD r4,r0,r1,LSL #10
00004c ea040409 AND r4,r4,r9
;;;236 src_ptr = (getSn_RxBASE(sn) + src_mask);
000050 4638 MOV r0,r7
000052 f7fffffe BL getSn_RxBASE
000056 4420 ADD r0,r0,r4
000058 b280 UXTH r0,r0
00005a 9001 STR r0,[sp,#4]
;;;237
;;;238
;;;239 if( (src_mask + len) > getSn_RxMAX(sn) )
00005c 201a MOVS r0,#0x1a
00005e f7fffffe BL WIZCHIP_READ
000062 4030 ANDS r0,r0,r6
000064 40e8 LSRS r0,r0,r5
000066 2101 MOVS r1,#1
000068 4081 LSLS r1,r1,r0
00006a b288 UXTH r0,r1
00006c eb040108 ADD r1,r4,r8
000070 ebb12f80 CMP r1,r0,LSL #10
000074 d91c BLS |L11.176|
;;;240 {
;;;241 size = getSn_RxMAX(sn) - src_mask;
000076 201a MOVS r0,#0x1a
000078 f7fffffe BL WIZCHIP_READ
00007c 4030 ANDS r0,r0,r6
00007e 40e8 LSRS r0,r0,r5
000080 2101 MOVS r1,#1
000082 4081 LSLS r1,r1,r0
000084 ebc42081 RSB r0,r4,r1,LSL #10
000088 b284 UXTH r4,r0
;;;242 WIZCHIP_READ_BUF((uint32_t)src_ptr, (uint8_t*)wizdata, size);
00008a 4622 MOV r2,r4
00008c 9903 LDR r1,[sp,#0xc]
00008e 9801 LDR r0,[sp,#4]
000090 f7fffffe BL WIZCHIP_READ_BUF
;;;243 wizdata += size;
000094 9803 LDR r0,[sp,#0xc]
000096 1905 ADDS r5,r0,r4
;;;244 size = len - size;
000098 eba80004 SUB r0,r8,r4
00009c b284 UXTH r4,r0
;;;245 src_ptr = getSn_RxBASE(sn);
00009e 4638 MOV r0,r7
0000a0 f7fffffe BL getSn_RxBASE
0000a4 b280 UXTH r0,r0
;;;246 WIZCHIP_READ_BUF(src_ptr, (uint8_t*)wizdata, size);
0000a6 4622 MOV r2,r4
0000a8 4629 MOV r1,r5
0000aa f7fffffe BL WIZCHIP_READ_BUF
0000ae e004 B |L11.186|
|L11.176|
;;;247 }
;;;248 else
;;;249 {
;;;250 WIZCHIP_READ_BUF(src_ptr, (uint8_t*)wizdata, len);
0000b0 4642 MOV r2,r8
0000b2 9903 LDR r1,[sp,#0xc]
0000b4 9801 LDR r0,[sp,#4]
0000b6 f7fffffe BL WIZCHIP_READ_BUF
|L11.186|
;;;251 }
;;;252
;;;253 ptr += len;
0000ba eb090008 ADD r0,r9,r8
0000be b284 UXTH r4,r0
;;;254
;;;255 setSn_RX_RD(sn, ptr);
0000c0 0a21 LSRS r1,r4,#8
0000c2 4658 MOV r0,r11
0000c4 f7fffffe BL WIZCHIP_WRITE
0000c8 b005 ADD sp,sp,#0x14
0000ca b2e1 UXTB r1,r4
0000cc 4650 MOV r0,r10
0000ce e8bd4ff0 POP {r4-r11,lr}
0000d2 f7ffbffe B.W WIZCHIP_WRITE
;;;256 }
;;;257
ENDP
AREA ||i.wiz_recv_ignore||, CODE, READONLY, ALIGN=1
wiz_recv_ignore PROC
;;;257
;;;258 void wiz_recv_ignore(uint8_t sn, uint16_t len)
000000 e92d41f0 PUSH {r4-r8,lr}
;;;259 {
000004 4604 MOV r4,r0
000006 460f MOV r7,r1
;;;260 uint16_t ptr;
;;;261
;;;262 ptr = getSn_RX_RD(sn);
000008 f2404029 MOV r0,#0x429
00000c eb002004 ADD r0,r0,r4,LSL #8
000010 4605 MOV r5,r0
000012 f7fffffe BL WIZCHIP_READ
000016 4680 MOV r8,r0
000018 f44f6085 MOV r0,#0x428
00001c eb002004 ADD r0,r0,r4,LSL #8
000020 4606 MOV r6,r0
000022 f7fffffe BL WIZCHIP_READ
000026 eb082000 ADD r0,r8,r0,LSL #8
;;;263
;;;264 ptr += len;
00002a 4438 ADD r0,r0,r7
00002c b284 UXTH r4,r0
;;;265 setSn_RX_RD(sn,ptr);
00002e 0a21 LSRS r1,r4,#8
000030 4630 MOV r0,r6
000032 f7fffffe BL WIZCHIP_WRITE
000036 b2e1 UXTB r1,r4
000038 4628 MOV r0,r5
00003a e8bd41f0 POP {r4-r8,lr}
00003e f7ffbffe B.W WIZCHIP_WRITE
;;;266 }
;;;267
ENDP
AREA ||i.wiz_send_data||, CODE, READONLY, ALIGN=1
wiz_send_data PROC
;;;183 */
;;;184 void wiz_send_data(uint8_t sn, uint8_t *wizdata, uint16_t len)
000000 e92d4ff7 PUSH {r0-r2,r4-r11,lr}
;;;185 {
000004 b082 SUB sp,sp,#8
000006 4607 MOV r7,r0
000008 4690 MOV r8,r2
;;;186 uint16_t ptr;
;;;187 uint16_t size;
;;;188 uint16_t dst_mask;
;;;189 uint16_t dst_ptr;
;;;190
;;;191 ptr = getSn_TX_WR(sn); // 获取发送写指针寄存器值
00000a f2404025 MOV r0,#0x425
00000e eb002a07 ADD r10,r0,r7,LSL #8
000012 4650 MOV r0,r10
000014 f7fffffe BL WIZCHIP_READ
000018 4604 MOV r4,r0
00001a f2404024 MOV r0,#0x424
00001e eb002b07 ADD r11,r0,r7,LSL #8
000022 4658 MOV r0,r11
000024 f7fffffe BL WIZCHIP_READ
000028 eb042000 ADD r0,r4,r0,LSL #8
00002c fa1ff980 UXTH r9,r0
;;;192
;;;193 dst_mask = ptr & getSn_TxMASK(sn);
000030 201b MOVS r0,#0x1b
000032 f7fffffe BL WIZCHIP_READ
000036 007d LSLS r5,r7,#1
000038 2603 MOVS r6,#3
00003a 40ae LSLS r6,r6,r5
00003c 4030 ANDS r0,r0,r6
00003e 40e8 LSRS r0,r0,r5
000040 2101 MOVS r1,#1
000042 4081 LSLS r1,r1,r0
000044 f04f30ff MOV r0,#0xffffffff
000048 eb002481 ADD r4,r0,r1,LSL #10
00004c ea040409 AND r4,r4,r9
;;;194 dst_ptr = getSn_TxBASE(sn) + dst_mask;
000050 4638 MOV r0,r7
000052 f7fffffe BL getSn_TxBASE
000056 4420 ADD r0,r0,r4
000058 b280 UXTH r0,r0
00005a 9001 STR r0,[sp,#4]
;;;195
;;;196 if (dst_mask + len > getSn_TxMAX(sn))
00005c 201b MOVS r0,#0x1b
00005e f7fffffe BL WIZCHIP_READ
000062 4030 ANDS r0,r0,r6
000064 40e8 LSRS r0,r0,r5
000066 2101 MOVS r1,#1
000068 4081 LSLS r1,r1,r0
00006a b288 UXTH r0,r1
00006c eb040108 ADD r1,r4,r8
000070 ebb12f80 CMP r1,r0,LSL #10
000074 d91c BLS |L13.176|
;;;197 {
;;;198 size = getSn_TxMAX(sn) - dst_mask;
000076 201b MOVS r0,#0x1b
000078 f7fffffe BL WIZCHIP_READ
00007c 4030 ANDS r0,r0,r6
00007e 40e8 LSRS r0,r0,r5
000080 2101 MOVS r1,#1
000082 4081 LSLS r1,r1,r0
000084 ebc42081 RSB r0,r4,r1,LSL #10
000088 b284 UXTH r4,r0
;;;199 WIZCHIP_WRITE_BUF(dst_ptr, wizdata, size);
00008a 4622 MOV r2,r4
00008c 9903 LDR r1,[sp,#0xc]
00008e 9801 LDR r0,[sp,#4]
000090 f7fffffe BL WIZCHIP_WRITE_BUF
;;;200 wizdata += size;
000094 9803 LDR r0,[sp,#0xc]
000096 1905 ADDS r5,r0,r4
;;;201 size = len - size;
000098 eba80004 SUB r0,r8,r4
00009c b284 UXTH r4,r0
;;;202 dst_ptr = getSn_TxBASE(sn);
00009e 4638 MOV r0,r7
0000a0 f7fffffe BL getSn_TxBASE
0000a4 b280 UXTH r0,r0
;;;203 WIZCHIP_WRITE_BUF(dst_ptr, wizdata, size);
0000a6 4622 MOV r2,r4
0000a8 4629 MOV r1,r5
0000aa f7fffffe BL WIZCHIP_WRITE_BUF
0000ae e004 B |L13.186|
|L13.176|
;;;204 }
;;;205 else
;;;206 {
;;;207 WIZCHIP_WRITE_BUF(dst_ptr, wizdata, len);
0000b0 4642 MOV r2,r8
0000b2 9903 LDR r1,[sp,#0xc]
0000b4 9801 LDR r0,[sp,#4]
0000b6 f7fffffe BL WIZCHIP_WRITE_BUF
|L13.186|
;;;208 }
;;;209
;;;210 ptr += len;
0000ba eb090008 ADD r0,r9,r8
0000be b284 UXTH r4,r0
;;;211
;;;212 setSn_TX_WR(sn, ptr);
0000c0 0a21 LSRS r1,r4,#8
0000c2 4658 MOV r0,r11
0000c4 f7fffffe BL WIZCHIP_WRITE
0000c8 b005 ADD sp,sp,#0x14
0000ca b2e1 UXTB r1,r4
0000cc 4650 MOV r0,r10
0000ce e8bd4ff0 POP {r4-r11,lr}
0000d2 f7ffbffe B.W WIZCHIP_WRITE
;;;213 }
;;;214
ENDP