⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmcdrv.cod

📁 ARM读写SD卡程序
💻 COD
📖 第 1 页 / 共 4 页
字号:
  00164	18bd80f0	 ldmneia   sp!, {r4 - r7, pc}

; 389  : 
; 390  :     if (statusInfo & UNDERRUN)

  00168	e3140701	 tst       r4, #1, 14

; 391  :         return  MMC_UNDERRUN;

  0016c	13a000de	 movne     r0, #0xDE

; 417  : }

  00170	18bd80f0	 ldmneia   sp!, {r4 - r7, pc}

; 392  : 
; 393  :     if (statusInfo & OVERRUN)

  00174	e3140802	 tst       r4, #2, 16

; 394  :         return  MMC_OVERRUN;

  00178	13a000dd	 movne     r0, #0xDD

; 417  : }

  0017c	18bd80f0	 ldmneia   sp!, {r4 - r7, pc}

; 395  : 
; 396  :     if (statusInfo & CIDCSD_OVERWRITE)

  00180	e3140801	 tst       r4, #1, 16

; 397  :         return  MMC_CIDCSD_OVERWRITE;

  00184	13a000df	 movne     r0, #0xDF

; 417  : }

  00188	18bd80f0	 ldmneia   sp!, {r4 - r7, pc}

; 398  : 
; 399  :     if (statusInfo & WP_ERASE_SKIP)

  0018c	e3140902	 tst       r4, #2, 18

; 400  :         return  MMC_WP_ERASE_SKIP;

  00190	13a000d4	 movne     r0, #0xD4

; 417  : }

  00194	18bd80f0	 ldmneia   sp!, {r4 - r7, pc}

; 401  : 
; 402  :     if (statusInfo & CARD_ECC_DISABLED)

  00198	e3140901	 tst       r4, #1, 18

; 403  :         return  MMC_CARD_ECC_DISABLED;

  0019c	13a000e0	 movne     r0, #0xE0

; 417  : }

  001a0	18bd80f0	 ldmneia   sp!, {r4 - r7, pc}

; 404  : 
; 405  :     if (statusInfo & ERASE_RESET)

  001a4	e3140a02	 tst       r4, #2, 20

; 406  :         return  MMC_ERASE_RESET;

  001a8	13a000db	 movne     r0, #0xDB

; 417  : }

  001ac	18bd80f0	 ldmneia   sp!, {r4 - r7, pc}

; 407  : 
; 408  : #if (USE_SD)
; 409  :         if (statusInfo & CARD_IS_LOCKED)

  001b0	e3140402	 tst       r4, #2, 8

; 410  :                 return  MMC_CARD_IS_LOCKED;

  001b4	13a000e6	 movne     r0, #0xE6

; 417  : }

  001b8	18bd80f0	 ldmneia   sp!, {r4 - r7, pc}

; 411  : 
; 412  :         if (statusInfo & LOCK_UNLOCK_FAILED)

  001bc	e3140401	 tst       r4, #1, 8

; 413  :                 return  MMC_LOCK_UNLOCK_FAILED;

  001c0	e3a000e7	 mov       r0, #0xE7

; 414  : #endif
; 415  : 
; 416  :     return MMC_CARD_IS_NOT_RESPONDING;

  001c4	03a000c9	 moveq     r0, #0xC9

; 417  : }

  001c8	e8bd80f0	 ldmia     sp!, {r4 - r7, pc}
  001cc		 |$M36818|

			 ENDP  ; |MMCAnalysisResponse|

	EXPORT	|mmcCommandAndResponse|
	IMPORT	|MMCPrepareAndSetup|

  00000			 AREA	 |.text| { |mmcCommandAndResponse| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$mmcCommandAndResponse|, PDATA, SELECTION=5, ASSOC=|.text| { |mmcCommandAndResponse| } ; comdat associative
|$T36837| DCD	|mmcCommandAndResponse|
	DCD	0x40004a01
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |mmcCommandAndResponse| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |mmcCommandAndResponse| PROC

; 441  : {

  00000	e92d43f0	 stmdb     sp!, {r4 - r9, lr}
  00004		 |$M36835|
  00004	e1a08000	 mov       r8, r0
  00008	e1a06001	 mov       r6, r1
  0000c	e1a05002	 mov       r5, r2
  00010	e1a04003	 mov       r4, r3

; 442  :     MMC_CC  resErr;
; 443  :     INT16   i;
; 444  : 
; 445  :         
; 446  :         if ( Cmd == STOP_TRANSMISSION)

  00014	e1a00805	 mov       r0, r5, lsl #16
  00018	e1a01820	 mov       r1, r0, lsr #16
  0001c	e3a09000	 mov       r9, #0
  00020	e351000c	 cmp       r1, #0xC
  00024	1a00000e	 bne       |$L36640|

; 447  :         {
; 448  :                 if ( (pc->mode & READ_MODE) == READ_MODE )

  00028	e1d802b0	 ldrh      r0, [r8, #0x20]
  0002c	e1a01800	 mov       r1, r0, lsl #16
  00030	e1a02821	 mov       r2, r1, lsr #16
  00034	e2020080	 and       r0, r2, #0x80
  00038	e3500080	 cmp       r0, #0x80

; 449  :                         multipleRdWr = DATA;      

  0003c	059f00e0	 ldreq     r0, [pc, #0xE0]
  00040	03a01005	 moveq     r1, #5
  00044	01c010b0	 streqh    r1, [r0]
  00048	0a000005	 beq       |$L36640|

; 450  :                 else if ( (pc->mode & WRITE_MODE) == WRITE_MODE )

  0004c	e2020c01	 and       r0, r2, #1, 24
  00050	e3500c01	 cmp       r0, #1, 24

; 451  :                         multipleRdWr = RCV;                      

  00054	e59f00c8	 ldr       r0, [pc, #0xC8]
  00058	03a01006	 moveq     r1, #6
  0005c	01c010b0	 streqh    r1, [r0]

; 452  :                 else
; 453  :                         multipleRdWr = NO;

  00060	11c090b0	 strneh    r9, [r0]
  00064		 |$L36640|

; 454  :         }
; 455  : 
; 456  :     
; 457  :         if ( Resp == R6 )

  00064	e59d701c	 ldr       r7, [sp, #0x1C]

; 458  :         {
; 459  :                 if ( !MMCPrepareAndSetup(Arg, Cmd, noBlocks, R1) )

  00068	e1a01005	 mov       r1, r5
  0006c	e1a02004	 mov       r2, r4
  00070	e3570006	 cmp       r7, #6
  00074	1a000007	 bne       |$L36641|
  00078	e3a03001	 mov       r3, #1
  0007c	e1a00006	 mov       r0, r6
  00080	eb000000	 bl        MMCPrepareAndSetup
  00084	e3500000	 cmp       r0, #0
  00088	1a00000c	 bne       |$L36646|

; 465  :                         return MMC_INTERFACE_ERROR;

  0008c	e3a090d7	 mov       r9, #0xD7

; 460  :                         return MMC_INTERFACE_ERROR;

  00090	e1a00009	 mov       r0, r9

; 480  :     }
; 481  : 
; 482  :     return resErr;
; 483  : }

  00094	e8bd83f0	 ldmia     sp!, {r4 - r9, pc}
  00098		 |$L36641|

; 461  :         }
; 462  :         else
; 463  :         {
; 464  :                 if ( !MMCPrepareAndSetup(Arg, Cmd, noBlocks, (UINT16)Resp) )

  00098	e1a00807	 mov       r0, r7, lsl #16
  0009c	e1a03820	 mov       r3, r0, lsr #16
  000a0	e1a00006	 mov       r0, r6
  000a4	eb000000	 bl        MMCPrepareAndSetup
  000a8	e3500000	 cmp       r0, #0

; 465  :                         return MMC_INTERFACE_ERROR;

  000ac	03a090d7	 moveq     r9, #0xD7
  000b0	01a00009	 moveq     r0, r9

; 480  :     }
; 481  : 
; 482  :     return resErr;
; 483  : }

  000b4	08bd83f0	 ldmeqia   sp!, {r4 - r9, pc}

; 466  :         }
; 467  :     if ( !Resp )                    

  000b8	e3570000	 cmp       r7, #0

; 468  :         return MMC_NO_ERROR;

  000bc	0a000016	 beq       |$L36633|
  000c0		 |$L36646|

; 469  : 
; 470  :     for (i = 0; i < (CID_BYTE_LENGTH>>1); i++)

  000c0	e1a01009	 mov       r1, r9
  000c4		 |$L36647|

; 471  :         pc->LastResponse[i] = 0;

  000c4	e0880081	 add       r0, r8, r1, lsl #1
  000c8	e2811001	 add       r1, r1, #1
  000cc	e1c092b8	 strh      r9, [r0, #0x28]
  000d0	e1a00801	 mov       r0, r1, lsl #16
  000d4	e1a02840	 mov       r2, r0, asr #16
  000d8	e1a01802	 mov       r1, r2, lsl #16
  000dc	e1a01841	 mov       r1, r1, asr #16
  000e0	e3510008	 cmp       r1, #8
  000e4	bafffff6	 blt       |$L36647|

; 472  : 
; 473  :     
; 474  :     resErr = MMCReceivedResponse( pc, Resp );

  000e8	e1a01007	 mov       r1, r7
  000ec	e1a00008	 mov       r0, r8
  000f0	eb000000	 bl        MMCReceivedResponse
  000f4	e1b09000	 movs      r9, r0

; 475  : 
; 476  :     if ( resErr == MMC_NO_ERROR)

  000f8	1a000007	 bne       |$L36633|

; 477  :     {
; 478  :             if ( (Resp == R1) || (Resp == R6) )

  000fc	e3570001	 cmp       r7, #1
  00100	0a000001	 beq       |$L36652|
  00104	e3570006	 cmp       r7, #6
  00108	1a000003	 bne       |$L36633|
  0010c		 |$L36652|

; 479  :                     resErr = MMCAnalysisResponse(pc, Resp);

  0010c	e1a01007	 mov       r1, r7
  00110	e1a00008	 mov       r0, r8
  00114	eb000000	 bl        MMCAnalysisResponse
  00118	e1a09000	 mov       r9, r0
  0011c		 |$L36633|

; 460  :                         return MMC_INTERFACE_ERROR;

  0011c	e1a00009	 mov       r0, r9

; 480  :     }
; 481  : 
; 482  :     return resErr;
; 483  : }

  00120	e8bd83f0	 ldmia     sp!, {r4 - r9, pc}
  00124		 |$L36839|
  00124	00000000	 DCD       |multipleRdWr|
  00128		 |$M36836|

			 ENDP  ; |mmcCommandAndResponse|

	EXPORT	|IsCardBusy|

  00000			 AREA	 |.text| { |IsCardBusy| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$IsCardBusy|, PDATA, SELECTION=5, ASSOC=|.text| { |IsCardBusy| } ; comdat associative
|$T36846| DCD	|IsCardBusy|
	DCD	0x40000200
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |IsCardBusy| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |IsCardBusy| PROC

; 505  : {

  00000		 |$M36844|

; 506  :         
; 507  :         return (getDeviceStatus(driveno, 1));

  00000	e3a01001	 mov       r1, #1
  00004	ea000000	 b         getDeviceStatus
  00008		 |$M36845|

			 ENDP  ; |IsCardBusy|

	EXPORT	|is_device_changed|

  00000			 AREA	 |.text| { |is_device_changed| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$is_device_changed|, PDATA, SELECTION=5, ASSOC=|.text| { |is_device_changed| } ; comdat associative
|$T36854| DCD	|is_device_changed|
	DCD	0x40000200
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |is_device_changed| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |is_device_changed| PROC

; 529  : {

  00000		 |$M36852|

; 530  :         return (getDeviceStatus(driveno, 0));

  00000	e3a01000	 mov       r1, #0
  00004	ea000000	 b         getDeviceStatus
  00008		 |$M36853|

			 ENDP  ; |is_device_changed|

	IMPORT	|MMCSelectController|
	IMPORT	|mmcGetStatus|

  00000			 AREA	 |.text| { |getDeviceStatus| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$getDeviceStatus|, PDATA, SELECTION=5, ASSOC=|.text| { |getDeviceStatus| } ; comdat associative
|$T36864| DCD	|getDeviceStatus|
	DCD	0x40002401
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |getDeviceStatus| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |getDeviceStatus| PROC

; 535  : {

  00000	e92d4070	 stmdb     sp!, {r4 - r6, lr}
  00004		 |$M36862|
  00004	e1a04000	 mov       r4, r0
  00008	e1a05001	 mov       r5, r1

; 536  :     PDEVICE_CONTROLLER pc;
; 537  :     UINT16  phys_drive;
; 538  : 
; 539  : #if (N_INTERFACES > 1)
; 540  :     pc = drno_to_controller(driveno);
; 541  :     phys_drive = drno_to_phys(driveno);
; 542  : #else
; 543  :     phys_drive = driveno;
; 544  :     pc = &controller_s[0];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -