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

📄 sdconfig.h

📁 基于S3C2440处理器的sd卡驱动程序
💻 H
字号:
/****************************************Copyright (c)**************************************************
**                               Guangzhou ZHIYUAN electronics Co.,LTD.
**                                     
**                                 http://www.zyinside.com
**
**--------------File Info-------------------------------------------------------------------------------
** File Name: 				sdconfig.h
** Last modified Date: 		2006.01.09
** Last Version:			V1.0		
** Description: 			configuration head file for s3c2410
**
**------------------------------------------------------------------------------------------------------
** Created By: 				Ming Yuan Zheng 郑明远
** Created date: 			2006.01.09
** Version: 				V1.0
** Descriptions:			The original version 初始版本
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Description:
**
********************************************************************************************************/

#ifndef __SDCONFIG_H__ 
#define __SDCONFIG_H__

#include "sdhal.h"
#include "sdcmd.h"
#include "sddriver.h"

//This segment should not be modified
#ifndef TRUE
#define TRUE  1
#endif

#ifndef FALSE
#define FALSE 0
#endif


typedef unsigned char  INT8U;                   /* 无符号8位整型变量                        */
typedef signed   char  INT8;                    /* 有符号8位整型变量                        */
typedef unsigned short INT16U;                  /* 无符号16位整型变量                       */
typedef signed   short INT16;                   /* 有符号16位整型变量                       */
typedef unsigned int   INT32U;                  /* 无符号32位整型变量                       */
typedef signed   int   INT32;                   /* 有符号32位整型变量                       */
typedef float          FP32;                    /* 单精度浮点数(32位长度)                 */
typedef double         FP64;                    /* 双精度浮点数(64位长度)                 */

/* disable(1) or disable(0) reading or writing by interrupt */
#define SD_INTERRUPT_EN   		0				/* 是(1)否(0)使能中断读写SD/MMC卡 */

#define MMC_MMC_CLOCK_HIGH		20000000		/* SD/MMC卡最高读写速度20MHz */

/* define the block length of sd/mmc card */
#define SD_BLOCKSIZE 			512				/* SD卡/MMC卡块的长度 */

#define SD_BLOCKSIZE_NBITS		9				/* 2 ^ 9 = 512*/

/* define the interrupt of card inserting */
#define IRQ_nCD_SD              IRQ_EINT18
#define SD_IRQ_CD				IRQ_nCD_SD

#define GPIO_nCD_SD  			(GPIO_MODE_IN | GPIO_PULLUP_DIS | GPIO_G10)
#define SD_GPIO_CD				GPIO_nCD_SD

#define SD_CD_LEVEL_LOW							/* 定义卡插入低电平有效 */




// SD Interface
#define SDICON     (*(volatile unsigned *)0x5a000000)	//SDI control
#define SDIPRE     (*(volatile unsigned *)0x5a000004)	//SDI baud rate prescaler
#define SDICARG    (*(volatile unsigned *)0x5a000008)	//SDI command argument
#define SDICCON    (*(volatile unsigned *)0x5a00000c)	//SDI command control
#define SDICSTA    (*(volatile unsigned *)0x5a000010)	//SDI command status
#define SDIRSP0    (*(volatile unsigned *)0x5a000014)	//SDI response 0
#define SDIRSP1    (*(volatile unsigned *)0x5a000018)	//SDI response 1
#define SDIRSP2    (*(volatile unsigned *)0x5a00001c)	//SDI response 2
#define SDIRSP3    (*(volatile unsigned *)0x5a000020)	//SDI response 3
#define SDIDTIMER  (*(volatile unsigned *)0x5a000024)	//SDI data/busy timer
#define SDIBSIZE   (*(volatile unsigned *)0x5a000028)	//SDI block size
#define SDIDCON    (*(volatile unsigned *)0x5a00002c)	//SDI data control
#define SDIDCNT    (*(volatile unsigned *)0x5a000030)	//SDI data remain counter
#define SDIDSTA    (*(volatile unsigned *)0x5a000034)	//SDI data status
#define SDIFSTA    (*(volatile unsigned *)0x5a000038)	//SDI FIFO status
#define SDIIMSK    (*(volatile unsigned *)0x5a00003c)	//SDI interrupt mask. edited for 2440A

#ifdef __BIG_ENDIAN  /* edited for 2440A */
#define SDIDAT    (*(volatile unsigned *)0x5a00004c)	//SDI data

#define SDIDAT8	  (*(volatile char *)0x5a00004c)
//#define SDIDAT     0x5a00004c  
#else  // Little Endian
#define SDIDAT    (*(volatile unsigned *)0x5a000040)	//SDI data 
#define SDIDAT8	  (*(volatile char *)0x5a000040)

//#define SDIDAT     0x5a000040  
#endif   //SD Interface

/* GPIOE control the clk dat cmd and etc. */
#define GPECON    (*(volatile unsigned *)0x56000040)	//Port E control
#define GPEDAT    (*(volatile unsigned *)0x56000044)	//Port E data
#define GPEUP     (*(volatile unsigned *)0x56000048)	//Pull-up control E


#endif

/***********************************************************************************************************                            End Of File**********************************************************************************************************/

⌨️ 快捷键说明

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