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

📄 dos.h

📁 来自网上好心人的好东东,关于SD卡读写的,内附protel原理图
💻 H
字号:
//#########################################################################
// File: dos.h
//
//
//#########################################################################
// Last change: 09.05.2004
//#########################################################################
// holger.klabunde@t-online.de
// http://home.t-online.de/home/holger.klabunde/homepage.htm
//#########################################################################
// Compiler: AVR-GCC 3.2
//#########################################################################

#ifndef __DOS_H
#define __DOS_H

//fopen flags
#define F_CLOSED	0
#define F_READ		1
#define F_WRITE		2

#define F_ERROR		0 // dir/file operation failed
#define F_OK		1 // dir/file operation successfull

// #undef defines below in "mydefs.h" if you don't need them
// spare program memory by deciding if we want to read, write or both
#define DOS_READ	//define this if you want to read files
#define DOS_WRITE	//define this if you want to write files
#define DOS_DELETE	//define this if you want to delete files
#define DOS_READ_RAW	//define this if you want to read files with ReadFileRaw()

#define DOS_CHDIR	//define this if you want to go into subdirectories
#define DOS_MKDIR	//define this if you want to make subdirectories

// spare program memory by deciding if we want to use FAT12, FAT16, FAT32.
// don't touch if you don't know the FAT type of your drive !
#define USE_FAT12	//define this if you want to use FAT12
#define USE_FAT16	//define this if you want to use FAT16
#define USE_FAT32	//define this if you want to use FAT32

#define USE_FATBUFFER	//define this if you want to use a FAT buffer
                        //needs 517 Bytes of RAM ! 


extern unsigned char fopen(char *name, unsigned char flag);
extern void fclose(void);
extern unsigned int fread(unsigned char *buf, unsigned int count);
extern unsigned int fwrite(unsigned char *buf, unsigned int count);
extern void fflush(void);
extern unsigned char remove(char *name);

extern unsigned char ReadFileRaw(char *name);
extern unsigned char FindName(char *name);

//this is for easier and faster converting from byte arrays to UINT, ULONG
//ui and ul share the same memory space
union Convert {
 unsigned int  ui;
 unsigned long ul;
};

#include "media.h"   // select flash medium (CF, MMC, SD, ...)
#include "mydefs.h"  // keep the line at this place ! don't move down or delete 

#ifdef COMPACTFLASH_CARD
 #include "compact.h"
#endif

#ifdef MMC_CARD_SPI
 #include "mmc_spi.h"
#endif

#include "fat.h"
#include "dir.h"

#endif //__DOS_H

⌨️ 快捷键说明

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