📄 bsp_sdio_sd.txt
字号:
0000ac d001 BEQ |L8.178|
0000ae 200a MOVS r0,#0xa ;2770
0000b0 e7cd B |L8.78|
|L8.178|
0000b2 f0145f80 TST r4,#0x10000000 ;2773
0000b6 d001 BEQ |L8.188|
0000b8 200b MOVS r0,#0xb ;2775
0000ba e7c8 B |L8.78|
|L8.188|
0000bc f0146f00 TST r4,#0x8000000 ;2778
0000c0 d001 BEQ |L8.198|
0000c2 200c MOVS r0,#0xc ;2780
0000c4 e7c3 B |L8.78|
|L8.198|
0000c6 f0146f80 TST r4,#0x4000000 ;2783
0000ca d001 BEQ |L8.208|
0000cc 200d MOVS r0,#0xd ;2785
0000ce e7be B |L8.78|
|L8.208|
0000d0 f0147f80 TST r4,#0x1000000 ;2788
0000d4 d001 BEQ |L8.218|
0000d6 200e MOVS r0,#0xe ;2790
0000d8 e7b9 B |L8.78|
|L8.218|
0000da f4140f00 TST r4,#0x800000 ;2793
0000de d001 BEQ |L8.228|
0000e0 200f MOVS r0,#0xf ;2795
0000e2 e7b4 B |L8.78|
|L8.228|
0000e4 f4140f80 TST r4,#0x400000 ;2798
0000e8 d001 BEQ |L8.238|
0000ea 2010 MOVS r0,#0x10 ;2800
0000ec e7af B |L8.78|
|L8.238|
0000ee f4141f00 TST r4,#0x200000 ;2803
0000f2 d001 BEQ |L8.248|
0000f4 2011 MOVS r0,#0x11 ;2805
0000f6 e7aa B |L8.78|
|L8.248|
0000f8 f4141f80 TST r4,#0x100000 ;2808
0000fc d001 BEQ |L8.258|
0000fe 2012 MOVS r0,#0x12 ;2810
000100 e7a5 B |L8.78|
|L8.258|
000102 f4142f00 TST r4,#0x80000 ;2813
000106 d001 BEQ |L8.268|
000108 2013 MOVS r0,#0x13 ;2815
00010a e7a0 B |L8.78|
|L8.268|
00010c f4142f80 TST r4,#0x40000 ;2818
000110 d001 BEQ |L8.278|
000112 2014 MOVS r0,#0x14 ;2820
000114 e79b B |L8.78|
|L8.278|
000116 f4143f00 TST r4,#0x20000 ;2823
00011a d001 BEQ |L8.288|
00011c 2015 MOVS r0,#0x15 ;2825
00011e e796 B |L8.78|
|L8.288|
000120 f4143f80 TST r4,#0x10000 ;2828
000124 d001 BEQ |L8.298|
000126 2016 MOVS r0,#0x16 ;2830
000128 e791 B |L8.78|
|L8.298|
00012a f4144f00 TST r4,#0x8000 ;2833
00012e d001 BEQ |L8.308|
000130 2017 MOVS r0,#0x17 ;2835
000132 e78c B |L8.78|
|L8.308|
000134 f4144f80 TST r4,#0x4000 ;2838
000138 d001 BEQ |L8.318|
00013a 2018 MOVS r0,#0x18 ;2840
00013c e787 B |L8.78|
|L8.318|
00013e f4145f00 TST r4,#0x2000 ;2843
000142 d001 BEQ |L8.328|
000144 2019 MOVS r0,#0x19 ;2845
000146 e782 B |L8.78|
|L8.328|
000148 f0140f08 TST r4,#8 ;2848
00014c d001 BEQ |L8.338|
00014e 201a MOVS r0,#0x1a ;2850
000150 e77d B |L8.78|
|L8.338|
000152 4638 MOV r0,r7 ;2853
000154 e77b B |L8.78|
;;;2855
ENDP
000156 0000 DCW 0x0000
|L8.344|
DCD ||RCA||
|L8.348|
DCD SDIO_CmdInitStructure
|L8.352|
DCD 0x40018000
|L8.356|
DCD 0xfdffe008
AREA ||i.SDEnWideBus||, CODE, READONLY, ALIGN=2
SDEnWideBus PROC
;;;2588 */
;;;2589 static SD_Error SDEnWideBus(FunctionalState NewState)
000000 b57c PUSH {r2-r6,lr}
;;;2590 {
000002 4605 MOV r5,r0
;;;2591 SD_Error errorstatus = SD_OK;
000004 242a MOVS r4,#0x2a
;;;2592
;;;2593 uint32_t scr[2] = {0, 0};
000006 2000 MOVS r0,#0
000008 9000 STR r0,[sp,#0]
00000a 9001 STR r0,[sp,#4]
;;;2594
;;;2595 if (SDIO_GetResponse(SDIO_RESP1) & SD_CARD_LOCKED)
00000c f7fffffe BL SDIO_GetResponse
000010 f0107f00 TST r0,#0x2000000
000014 d002 BEQ |L9.28|
;;;2596 {
;;;2597 errorstatus = SD_LOCK_UNLOCK_FAILED;
000016 240e MOVS r4,#0xe
;;;2598 return(errorstatus);
000018 4620 MOV r0,r4
|L9.26|
;;;2599 }
;;;2600
;;;2601 /*!< Get SCR Register */
;;;2602 errorstatus = FindSCR(RCA, scr);
;;;2603
;;;2604 if (errorstatus != SD_OK)
;;;2605 {
;;;2606 return(errorstatus);
;;;2607 }
;;;2608
;;;2609 /*!< If wide bus operation to be enabled */
;;;2610 if (NewState == ENABLE)
;;;2611 {
;;;2612 /*!< If requested card supports wide bus operation */
;;;2613 if ((scr[1] & SD_WIDE_BUS_SUPPORT) != SD_ALLZERO)
;;;2614 {
;;;2615 /*!< Send CMD55 APP_CMD with argument as card's RCA.*/
;;;2616 SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) RCA << 16;
;;;2617 SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_CMD;
;;;2618 SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;
;;;2619 SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;
;;;2620 SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;
;;;2621 SDIO_SendCommand(&SDIO_CmdInitStructure);
;;;2622
;;;2623 errorstatus = CmdResp1Error(SD_CMD_APP_CMD);
;;;2624
;;;2625 if (errorstatus != SD_OK)
;;;2626 {
;;;2627 return(errorstatus);
;;;2628 }
;;;2629
;;;2630 /*!< Send ACMD6 APP_CMD with argument as 2 for wide bus mode */
;;;2631 SDIO_CmdInitStructure.SDIO_Argument = 0x2;
;;;2632 SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_SD_SET_BUSWIDTH;
;;;2633 SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;
;;;2634 SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;
;;;2635 SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;
;;;2636 SDIO_SendCommand(&SDIO_CmdInitStructure);
;;;2637
;;;2638 errorstatus = CmdResp1Error(SD_CMD_APP_SD_SET_BUSWIDTH);
;;;2639
;;;2640 if (errorstatus != SD_OK)
;;;2641 {
;;;2642 return(errorstatus);
;;;2643 }
;;;2644 return(errorstatus);
;;;2645 }
;;;2646 else
;;;2647 {
;;;2648 errorstatus = SD_REQUEST_NOT_APPLICABLE;
;;;2649 return(errorstatus);
;;;2650 }
;;;2651 } /*!< If wide bus operation to be disabled */
;;;2652 else
;;;2653 {
;;;2654 /*!< If requested card supports 1 bit mode operation */
;;;2655 if ((scr[1] & SD_SINGLE_BUS_SUPPORT) != SD_ALLZERO)
;;;2656 {
;;;2657 /*!< Send CMD55 APP_CMD with argument as card's RCA.*/
;;;2658 SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) RCA << 16;
;;;2659 SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_CMD;
;;;2660 SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;
;;;2661 SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;
;;;2662 SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;
;;;2663 SDIO_SendCommand(&SDIO_CmdInitStructure);
;;;2664
;;;2665
;;;2666 errorstatus = CmdResp1Error(SD_CMD_APP_CMD);
;;;2667
;;;2668 if (errorstatus != SD_OK)
;;;2669 {
;;;2670 return(errorstatus);
;;;2671 }
;;;2672
;;;2673 /*!< Send ACMD6 APP_CMD with argument as 2 for wide bus mode */
;;;2674 SDIO_CmdInitStructure.SDIO_Argument = 0x00;
;;;2675 SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_SD_SET_BUSWIDTH;
;;;2676 SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;
;;;2677 SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;
;;;2678 SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;
;;;2679 SDIO_SendCommand(&SDIO_CmdInitStructure);
;;;2680
;;;2681 errorstatus = CmdResp1Error(SD_CMD_APP_SD_SET_BUSWIDTH);
;;;2682
;;;2683 if (errorstatus != SD_OK)
;;;2684 {
;;;2685 return(errorstatus);
;;;2686 }
;;;2687
;;;2688 return(errorstatus);
;;;2689 }
;;;2690 else
;;;2691 {
;;;2692 errorstatus = SD_REQUEST_NOT_APPLICABLE;
;;;2693 return(errorstatus);
;;;2694 }
;;;2695 }
;;;2696 }
00001a bd7c POP {r2-r6,pc}
|L9.28|
00001c 4669 MOV r1,sp ;2602
00001e 483e LDR r0,|L9.280|
000020 6800 LDR r0,[r0,#0] ;2602 ; RCA
000022 b280 UXTH r0,r0 ;2602
000024 f7fffffe BL FindSCR
000028 4604 MOV r4,r0 ;2602
00002a 2c2a CMP r4,#0x2a ;2604
00002c d001 BEQ |L9.50|
00002e 4620 MOV r0,r4 ;2606
000030 e7f3 B |L9.26|
|L9.50|
000032 2d01 CMP r5,#1 ;2610
000034 d137 BNE |L9.166|
000036 9801 LDR r0,[sp,#4] ;2613
000038 f4102f80 TST r0,#0x40000 ;2613
00003c d030 BEQ |L9.160|
00003e 4836 LDR r0,|L9.280|
000040 6800 LDR r0,[r0,#0] ;2616 ; RCA
000042 0400 LSLS r0,r0,#16 ;2616
000044 4935 LDR r1,|L9.284|
000046 6008 STR r0,[r1,#0] ;2616 ; SDIO_CmdInitStructure
000048 2037 MOVS r0,#0x37 ;2617
00004a 6048 STR r0,[r1,#4] ;2617 ; SDIO_CmdInitStructure
00004c 2040 MOVS r0,#0x40 ;2618
00004e 6088 STR r0,[r1,#8] ;2618 ; SDIO_CmdInitStructure
000050 2000 MOVS r0,#0 ;2619
000052 60c8 STR r0,[r1,#0xc] ;2619 ; SDIO_CmdInitStructure
000054 02a8 LSLS r0,r5,#10 ;2620
000056 6108 STR r0,[r1,#0x10] ;2620 ; SDIO_CmdInitStructure
000058 4608 MOV r0,r1 ;2621
00005a f7fffffe BL SDIO_SendCommand
00005e 2037 MOVS r0,#0x37 ;2623
000060 f7fffffe BL CmdResp1Error
000064 4604 MOV r4,r0 ;2623
000066 2c2a CMP r4,#0x2a ;2625
000068 d001 BEQ |L9.110|
00006a 4620 MOV r0,r4 ;2627
00006c e7d5 B |L9.26|
|L9.110|
00006e 2002 MOVS r0,#2 ;2631
000070 492a LDR r1,|L9.284|
000072 6008 STR r0,[r1,#0] ;2631 ; SDIO_CmdInitStructure
000074 2006 MOVS r0,#6 ;2632
000076 6048 STR r0,[r1,#4] ;2632 ; SDIO_CmdInitStructure
000078 2040 MOVS r0,#0x40 ;2633
00007a 6088 STR r0,[r1,#8] ;2633 ; SDIO_CmdInitStructure
00007c 2000 MOVS r0,#0 ;2634
00007e 60c8 STR r0,[r1,#0xc] ;2634 ; SDIO_CmdInitStructure
000080 f44f6080 MOV r0,#0x400 ;2635
000084 6108 STR r0,[r1,#0x10] ;2635 ; SDIO_CmdInitStructure
000086 4608 MOV r0,r1 ;2636
000088 f7fffffe BL SDIO_SendCommand
00008c 2006 MOVS r0,#6 ;2638
00008e f7fffffe BL CmdResp1Error
000092 4604 MOV r4,r0 ;2638
000094 2c2a CMP r4,#0x2a ;2640
000096 d001 BEQ |L9.156|
000098 4620 MOV r0,r4 ;2642
00009a e7be B |L9.26|
|L9.156|
00009c 4620 MOV r0,r4 ;2644
00009e e7bc B |L9.26|
|L9.160|
0000a0 2425 MOVS r4,#0x25 ;2648
0000a2 4620 MOV r0,r4 ;2649
0000a4 e7b9 B |L9.26|
|L9.166|
0000a6 9801 LDR r0,[sp,#4] ;2655
0000a8 f4103f80 TST r0,#0x10000 ;2655
0000ac d031 BEQ |L9.274|
0000ae 481a LDR r0,|L9.280|
0000b0 6800 LDR r0,[r0,#0] ;2658 ; RCA
0000b2 0400 LSLS r0,r0,#16 ;2658
0000b4 4919 LDR r1,|L9.284|
0000b6 6008 STR r0,[r1,#0] ;2658 ; SDIO_CmdInitStructure
0000b8 2037 MOVS r0,#0x37 ;2659
0000ba 6048 STR r0,[r1,#4] ;2659 ; SDIO_CmdInitStructure
0000bc 2040 MOVS r0,#0x40 ;2660
0000be 6088
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -