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

📄 sdconfig.h

📁 Read MP3 from sd,send vs1003 decode
💻 H
字号:
/****************************************Copyright (c)**************************************************
**                               Guangzhou ZLG-MCU Development Co.,LTD.
**                                      graduate school
**                                 http://www.zlgmcu.com
**
**--------------File Info-------------------------------------------------------------------------------
** File name:			sdconfig.h
** Last modified Date:	2005-3-11
** Last Version:		V2.0
** Descriptions:		SD/MMC 卡读写模块: 配置文件
**						Soft Packet of SD/MMC Card: configuration header file
**
**------------------------------------------------------------------------------------------------------
** Created by:			Ming Yuan Zheng
** Created date:		2005-1-6
** Version:				V1.0
** Descriptions:		初始版本 The original version
**
**------------------------------------------------------------------------------------------------------
** Modified by:			Ming Yuan Zheng
** Modified date:		2005-3-11
** Version:				V2.0
** Descriptions:		增加了LPC22xx的硬件配置	
**						add LPC22xx hardware configuration
**------------------------------------------------------------------------------------------------------
** Modified by: 
** Modified date:
** Version:	
** Descriptions: 
**
********************************************************************************************************/

#ifndef __SDCONFIG_H__
#define __SDCONFIG_H__

#define SD_UCOSII_EN			0			/* 是否在UCOS-II上运行本模块 */

#define SD_CRC_EN		   		1			/* 设置数据传输时是否使用CRC */

#define SPI_CLOCK				5529600		/* 正常通信时,SPI时钟频率 frequency (Hz) */

#define SD_BLOCKSIZE 			512			/* SD卡块的长度 */

#define SD_BLOCKSIZE_NBITS		9  

/* 下面函数不常用,如果用户不需要,可置为 0 裁剪指定函数 */

#define SD_ReadMultiBlock_EN    0			/* 是否使能读多块函数 */

#define SD_WriteMultiBlock_EN   0			/* 是否使能写多块函数 */

#define SD_EraseBlock_EN		1			/* 是否使能擦卡函数 */

#define SD_ProgramCSD_EN   		0			/* 是否使能写CSD寄存器函数 */
	
#define SD_ReadCID_EN	   		0			/* 是否使能读CID寄存器函数 */
	
#define	SD_ReadSD_Status_EN		0			/* 是否使能读SD_Status寄存器函数 */

#define	SD_ReadSCR_EN			0			/* 是否使能读SCR寄存器函数 */

/* LPC22xx_EN 硬件配置 */
 

/* CS 引脚 */		
#define SD_CS									(0x01 << 18)
#define SD_CS_GPIO() 					PINSEL1 &= ~(0x03 << 4)
#define SD_CS_OUT() 					IO0DIR |= SD_CS
#define SD_CS_HIGH() 					IO0SET |= SD_CS
#define SD_CS_LOW() 					IO0CLR |= SD_CS

/* 电源控制引脚 */
#define  SD_POWER				(0x01 << 17)	
#define  SD_POWER_GPIO()		PINSEL1 &= ~(0x03 << 2)			/* 设置 POWER 口为GPIO口 */
#define  SD_POWER_OUT()			IO0DIR |= SD_POWER				/* 设置 POWER 口为输出口 */
#define  SD_POWER_OFF()			IO0SET = SD_POWER				/* 置 POWER 为高电平 */
#define  SD_POWER_ON()			IO0CLR = SD_POWER				/* 置 POWER 为低电平 */

/* 卡完全插入卡座检测引脚 */
#define  SD_INSERT				(0x01 << 19)		
#define  SD_INSERT_GPIO()		PINSEL1 &= ~(0x03 << 6)			/* 设置 INSERT 口为GPIO口 */	
#define  SD_INSERT_IN()			IO0DIR &= ~SD_INSERT			/* 设置 INSERT 口为输出口 */	
#define  SD_INSERT_STATUS()  	(IO0PIN & SD_INSERT)			/* 读取 INSERT 口的状态 */


// Change P0.20 to check WP	-------JOSEPH	2006.11.08
/* 卡写保护检测引脚 */
#define  SD_WP					(0x01 << 20)							// 29
#define  SD_WP_GPIO()			PINSEL1 &= ~(0x03 << 8)	// 26	/* 设置 WP 口为GPIO口 */	
#define  SD_WP_IN()				IO0DIR &= ~SD_WP				/* 设置 WP 口为输出口 */	
#define  SD_WP_STATUS()  		(IO0PIN & SD_WP)				/* 读取 WP 口的状态 */


#endif

⌨️ 快捷键说明

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