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

📄 sdshare.h

📁 SD卡FAT文件系统
💻 H
字号:
/**
 * @file $RCSfile: SDShare.h,v $
 *
 * Copyright (c) 2006 XXXXX INC., All Rights Reserved
 *
 * @author	YongJian Guo <XXX@XXX>
 *
 * @version $Revision: 0.0.0.20 $
 * @date	$Date: 2006/10/13 06:46:18 $
 * $Header: $
 */

#ifndef __SDSHARE_H__
#define __SDSHARE_H__

#include <stdlib.h>
#include <stdio.h>
#include <string.h>



/******************************************************************************/
/* ------------------------ Note !!!!! -------------------------------------- */
/*                                                                            */
/*   All string member (char) Not include '\0'                                */
/*                                                                            */
/******************************************************************************/

typedef unsigned char	uint8;
typedef unsigned short	uint16;
typedef unsigned long	uint32;
typedef signed char		sint8;
typedef signed short	sint16;
typedef signed long		sint32;

typedef unsigned char		BOOL;

#ifndef NULL
#define NULL  0
#endif

#ifndef TRUE
#define TRUE  1
#endif

#ifndef FALSE
#define FALSE 0
#endif


/* errer code 0xFF00 - 0xFFFF */

#define EC_SUCCESS				0x0000					/* operation ok */
#define EC_NORMAL				0x0000					/* normal status */

#define EC_ERROR				0xFFFF					/* errer */
#define EC_BAD_ADDR				0xFFFE					/* address errer */
#define EC_INVALID_FILE_SYSTEM	0xFFFD					/* invalid file system */
#define EC_SD_INIT_ERROR		0xFFFC					/* sd card init errer */
#define EC_INVALID_SD_ADDR		0xFFFB					/* invalid sd card address */
#define EC_SD_WRITE_ERROR		0xFFFA					/* sd card write fault */
#define EC_SD_READ_ERROR		0xFFF9					/* sd card read fault */
#define EC_OP_TIMEOUT			0xFFF8					/* time out */
#define EC_MEM_INVALID			0xFFF7					/* memery errer */
#define EC_SD_NOT_READY			0xFFF6					/* sd card not ready */
#define EC_SD_NOT_ENABLED		0xFFF4					/* sd card not accept */
#define EC_SD_NOT_INIT			0xFFF3					/* sd card not init */
#define EC_RW_ERROR				0xFFF2					/* r/w file errer */
#define EC_SD_CHANGE			0xFFF1					/* sd card moved */
#define EC_DENIED				0xFFF0					/* operation deny */
#define EC_SD_NOT_FOUND			0xFFEF					/* non sd card */
#define EC_SD_WRITE_PROTECTED	0xFFEE					/* sd card write protect */
#define EC_SD_FULL				0xFFED					/* space is full */
#define EC_SD_BAD_ADDR			0xFFEC					/* bad sd card address */
#define EC_NO_FILE				0xFFEB					/* file not found */
#define EC_FILE_READONLY		0xFFEA					/* file read only */
#define EC_FILE_BAD				0xFFE9					/* file errer */	
#define EC_FILE_READ_FAULT		0xFFE8					/* read file fault */
#define EC_FILE_WRITE_FAULT		0xFFE7					/* write file fault */
#define EC_RECORD_NOT_FOUND		0xFFE6					/* record not found */
#define EC_RECORD_BAD			0xFFE5					/* record errer */	
#define EC_BAD_ID				0xFFE4					/* ID errer */
#define EC_BAD_ROOM				0xFFE3					/* Room errer */
#define EC_BAD_INDEX			0xFFE2					/* index errer */
#define EC_INVALID_NAME			0xFFE1					/* file name errer */
#define EC_NO_PATH				0xFFE0					/* path errer */
#define EC_SD_INVALID_PARAM		0xFFDF					/* sd card param errer */
#define EC_SD_W_R_ERRER			0xFFDE					/* sd card r/w errer */
#define EC_INVALID_SD_SIZE		0xFFDD					/* invalid sd card size */

#define FAILURE(n)				( (uint16)(n) >= 0xFF00 )

/********************************/
/*      ARM specital code      */
/********************************/

/********************************/
/*Application Program Configurations*/
/********************************/
/* This segment could be modified as needed. */

/* System configuration .Fosc,cclk,cco,pclk must be defined */
#define Fosc            11059200                    /* Crystal frequence,10MHz~25MHz,should be the same as actual status.  */

#define Fcclk           (Fosc * 4)                  /* System frequence,should be (1~32)multiples of Fosc,and should be equal or less  than 60MHz. */

#define Fcco            (Fcclk * 4)                 /* CCO frequence,should be 2,4,8,16 multiples of Fcclk, ranged from 156MHz to 320MHz. */

#define Fpclk           (Fcclk / 4) * 4             /* VPB clock frequence , must be 1,2,4 multiples of (Fcclk / 4). */



/* #include    "target.h"  */             /* This line may not be deleted  */

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

#endif

⌨️ 快捷键说明

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