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

📄 mydefs.h

📁 avr的fat文件系统测试程序
💻 H
字号:
//#########################################################################
// File: MYDEFS.H
//
//
//#########################################################################
// Last change: 23.03.2004
//#########################################################################
// holger.klabunde@t-online.de
// http://home.t-online.de/home/holger.klabunde/homepage.htm
//#########################################################################
// Compiler: AVR-GCC 3.2
//#########################################################################


#ifndef __MYDEFS_H
#define __MYDEFS_H

// spare program memory by deciding if we want to read, write or both
#undef DOS_READ	//undefine this if you don't want to read files with fread()
#undef DOS_WRITE	//undefine this if you don't want to write files with fwrite()
                        //deleting files is also deactivated
#undef DOS_DELETE	//undefine this if you don't want to delete files
//#undef DOS_READ_RAW	//undefine this if you don't want to read files with ReadFileRaw()

//#undef DOS_MKDIR	//undefine this if you don't want to make subdirectories
//#undef DOS_CHDIR	//undefine this if you don't want to go into subdirectories

// spare program memory by deciding if we want to use FAT12, FAT16, FAT32.
// comment out FAT types not used. NOT recommended if you don't know the
// FAT type of your drive !
//#undef USE_FAT12	//undefine this if you don't want to use FAT12
//#undef USE_FAT16	//undefine this if you don't want to use FAT16
//#undef USE_FAT32	//undefine this if you don't want to use FAT32

//#undef USE_FATBUFFER	//undefine this if you don't want to use a FAT buffer
                        //needs 517 Bytes of RAM ! 

//#define F_8   
//#define F_11059
#define F_16

#ifdef F_8
 #define F_CPU      8000000    //processor clock
#endif

#ifdef F_16
 #define F_CPU      16000000    //processor clock
#endif

#ifdef F_11059
 #define F_CPU      11059200    //processor clock
#endif

#define T1_PRESCALER	8
#define T1_TICKS   	F_CPU / ( T1_PRESCALER * 65536 )	
#define T1_ONESECOND    T1_TICKS

#define NOP() asm volatile ("nop" ::)

//Die beiden LED's
#define RED_ON() { cbi(PORTD,7); }
#define RED_OFF() { sbi(PORTD,7); }

#define GREEN_ON() { cbi(PORTD,6); }
#define GREEN_OFF() { sbi(PORTD,6); }

//#define MODE	bit_is_set(PINA,PA0)

#endif //__MYDEFS_H

⌨️ 快捷键说明

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