📄 sdhal.lst
字号:
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.30A/W32 KICKSTART 04/Aug/2006 19:16:18 #
# Copyright 1999-2005 IAR Systems. All rights reserved. #
# #
# Cpu mode = interwork #
# Endian = little #
# Stack alignment = 4 #
# Source file = C:\Documents and Settings\yc\桌面\AT91SAM7A3(SPI_SD_ #
# RW)\SD_SPI-SAM7A3\src\sdhal.c #
# Command line = "C:\Documents and Settings\yc\桌面\AT91SAM7A3(SPI_SD #
# _RW)\SD_SPI-SAM7A3\src\sdhal.c" -lC "C:\Documents #
# and Settings\yc\桌面\AT91SAM7A3(SPI_SD_RW)\SD_SPI-SA #
# M7A3\compil\RAM_Debug\List\" --remarks -o #
# "C:\Documents and Settings\yc\桌面\AT91SAM7A3(SPI_SD #
# _RW)\SD_SPI-SAM7A3\compil\RAM_Debug\Obj\" -z2 #
# --no_cse --no_unroll --no_inline --no_code_motion #
# --no_tbaa --no_clustering --no_scheduling --debug #
# --cpu_mode thumb --endian little --cpu ARM7TDMI #
# --stack_align 4 --interwork -e --fpu None #
# --dlib_config "D:\IAR Systems\Embedded Workbench #
# 4.0 Kickstart\arm\LIB\dl4tptinl8f.h" -I #
# "C:\Documents and Settings\yc\桌面\AT91SAM7A3(SPI_SD #
# _RW)\SD_SPI-SAM7A3\compil\srcIAR\" -I "C:\Documents #
# and Settings\yc\桌面\AT91SAM7A3(SPI_SD_RW)\SD_SPI-SA #
# M7A3\compil\..\src\" -I "C:\Documents and #
# Settings\yc\桌面\AT91SAM7A3(SPI_SD_RW)\SD_SPI-SAM7A3 #
# \compil\..\..\" -I "D:\IAR Systems\Embedded #
# Workbench 4.0 Kickstart\arm\INC\" #
# List file = C:\Documents and Settings\yc\桌面\AT91SAM7A3(SPI_SD_ #
# RW)\SD_SPI-SAM7A3\compil\RAM_Debug\List\sdhal.lst #
# Object file = C:\Documents and Settings\yc\桌面\AT91SAM7A3(SPI_SD_ #
# RW)\SD_SPI-SAM7A3\compil\RAM_Debug\Obj\sdhal.r79 #
# #
# #
##############################################################################
C:\Documents and Settings\yc\桌面\AT91SAM7A3(SPI_SD_RW)\SD_SPI-SAM7A3\src\sdhal.c
1 /****************************************Copyright (c)**************************************************
2 ** Guangzhou ZLG-MCU Development Co.,LTD.
3 ** graduate school
4 ** http://www.zlgmcu.com
5 **
6 **--------------File Info-------------------------------------------------------------------------------
7 ** File name: sdhal.c
8 ** Last modified Date: 2005-3-11
9 ** Last Version: V2.0
10 ** Descriptions: SD/MMC卡读写模块: 硬件抽象层 ---- SPI操作函数
11 ** Soft Packet of SD/MMC Card: hard abstrast layer ---- function of SPI operation
12 **
13 **------------------------------------------------------------------------------------------------------
14 ** Created by: Ming Yuan Zheng
15 ** Created date: 2005-1-6
16 ** Version: V1.0
17 ** Descriptions: The original version
18 **
19 **------------------------------------------------------------------------------------------------------
20 ** Modified by:
21 ** Modified date:
22 ** Version:
23 ** Descriptions:
24 **
25 **------------------------------------------------------------------------------------------------------
26 ** Modified by:
27 ** Modified date:
28 ** Version:
29 ** Descriptions:
30 **
31 ********************************************************************************************************/
32
33 #include "config.h"
34
35 #include "sdhal.h"
36 #ifndef _PROJECT_H
37 #define _PROJECT_H
38
39 //////////////////////////////////////////////////////////////////////////////
40 // Include your AT91 Library files and specific compiler definitions
41 //////////////////////////////////////////////////////////////////////////////
42 #include "AT91SAM7A3-EK.h"
43 #include "include/AT91SAM7A3.h"
44 #define __inline inline
45 #include "include/lib_AT91SAM7A3.h"
\ In segment CODE, align 4, keep-with-next
\ __??Code16?? __code __interwork __atpcs void AT91F_PIO_CfgPeriph(AT91PS_PIO, unsigned int, unsigned int)
\ AT91F_PIO_CfgPeriph:
\ 00000000 0167 STR R1,[R0, #+0x70]
\ 00000002 4267 STR R2,[R0, #+0x74]
\ 00000004 131C MOV R3,R2
\ 00000006 0B43 ORR R3,R1
\ 00000008 4360 STR R3,[R0, #+0x4]
\ 0000000A 7047 BX LR ;; return
\ In segment CODE, align 4, keep-with-next
\ __??Code16?? __code __interwork __atpcs void AT91F_PIO_CfgOutput(AT91PS_PIO, unsigned int)
\ AT91F_PIO_CfgOutput:
\ 00000000 0160 STR R1,[R0, #+0]
\ 00000002 0161 STR R1,[R0, #+0x10]
\ 00000004 7047 BX LR ;; return
\ In segment CODE, align 4, keep-with-next
\ __??Code16?? __code __interwork __atpcs unsigned int AT91F_PIO_GetInput(AT91PS_PIO)
\ AT91F_PIO_GetInput:
\ 00000000 C06B LDR R0,[R0, #+0x3C]
\ 00000002 7047 BX LR ;; return
\ In segment CODE, align 4, keep-with-next
\ __??Code16?? __code __interwork __atpcs void AT91F_PIO_SetOutput(AT91PS_PIO, unsigned int)
\ AT91F_PIO_SetOutput:
\ 00000000 0163 STR R1,[R0, #+0x30]
\ 00000002 7047 BX LR ;; return
\ In segment CODE, align 4, keep-with-next
\ __??Code16?? __code __interwork __atpcs void AT91F_PIO_ClearOutput(AT91PS_PIO, unsigned int)
\ AT91F_PIO_ClearOutput:
\ 00000000 4163 STR R1,[R0, #+0x34]
\ 00000002 7047 BX LR ;; return
\ In segment CODE, align 4, keep-with-next
\ __??Code16?? __code __interwork __atpcs void AT91F_PIO_OutputEnable(AT91PS_PIO, unsigned int)
\ AT91F_PIO_OutputEnable:
\ 00000000 0161 STR R1,[R0, #+0x10]
\ 00000002 7047 BX LR ;; return
\ In segment CODE, align 4, keep-with-next
\ __??Code16?? __code __interwork __atpcs void AT91F_PMC_EnablePeriphClock(AT91PS_PMC, unsigned int)
\ AT91F_PMC_EnablePeriphClock:
\ 00000000 0161 STR R1,[R0, #+0x10]
\ 00000002 7047 BX LR ;; return
\ In segment CODE, align 4, keep-with-next
\ __??Code16?? __code __interwork __atpcs void AT91F_SPI0_CfgPMC(void)
\ AT91F_SPI0_CfgPMC:
\ 00000000 00B5 PUSH {LR}
\ 00000002 8021 MOV R1,#+0x80
\ 00000004 0901 LSL R1,R1,#+0x4 ;; #+0x800
\ 00000006 0248 LDR R0,??AT91F_SPI0_CfgPMC_0 ;; 0xfffffc00
\ 00000008 ........ _BLF AT91F_PMC_EnablePeriphClock,AT91F_PMC_EnablePeriphClock??rT
\ 0000000C 01BC POP {R0}
\ 0000000E 0047 BX R0 ;; return
\ ??AT91F_SPI0_CfgPMC_0:
\ 00000010 00FCFFFF DC32 0xfffffc00
\ In segment CODE, align 4, keep-with-next
\ __??Code16?? __code __interwork __atpcs void AT91F_SPI0_CfgPIO(void)
\ AT91F_SPI0_CfgPIO:
\ 00000000 00B5 PUSH {LR}
\ 00000002 0022 MOV R2,#+0
\ 00000004 FE21 MOV R1,#+0xFE
\ 00000006 8902 LSL R1,R1,#+0xA ;; #+0x3F800
\ 00000008 0248 LDR R0,??AT91F_SPI0_CfgPIO_0 ;; 0xfffff400
\ 0000000A ........ _BLF AT91F_PIO_CfgPeriph,AT91F_PIO_CfgPeriph??rT
\ 0000000E 01BC POP {R0}
\ 00000010 0047 BX R0 ;; return
\ 00000012 C046 NOP
\ ??AT91F_SPI0_CfgPIO_0:
\ 00000014 00F4FFFF DC32 0xfffff400
46 #endif
47 //******************************************************************************************************/
48
49 /**************************************************************
50
51 读写SD卡的SPI接口函数: SPI接口设置,发送/接收字节函数
52
53 **************************************************************/
54
55 /*******************************************************************************************************************
56 ** 函数名称: void SD_Power() Name: void SD_Power()
57 ** 功能描述: 对卡先下电,再上电 Function: turn off the card's power, and turn on
58 ** 输 入: 无 Input: NULL
59 ** 输 出: 无 Output: NULL
60 ********************************************************************************************************************/
61 /*void SD_Power(void)
62 {
63 INT32U i;
64
65 SD_POWER_GPIO();
66 SD_POWER_OUT();
67 SD_POWER_OFF(); // 关闭 SD 卡电源 turn off power of sd card
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -