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

📄 config.h

📁 AVR ATmega1280在IAR Embedded Workbench IDE4.20平台上编译通过的全部功能的19个C语言例子
💻 H
字号:
#pragma once  /*保证头文件只被编译一次*/
#ifndef CONFIG_H
#define CONFIG_H

/*需要的公共文件*/
#include <ioavr.h>        /*xx需要这个头文件*/
#include <math.h>
#include <stdlib.h>
#include <ina90.h>        /*xx需要这个头文件*/

/*ATmega2560.pdf英文449页资料的试验验证需要的头文件*/
//#include "init.h"   //这里不需要这个头文件
#include "p18.h"
#include "p23.h"
#include "p31.h"
#include "p64_WDT_off.h"
#include "p65_WDT_Prescaler_Change.h"
#include "p74_Move_interrupts.h"
#include "p87.h"
#include "p140.h"
#include "p141.h"
#include "p142.h"
#include "p202.h"
#include "p203.h"
#include "p216.h"
#include "p217.h"
#include "p219.h"
#include "p220.h"
#include "p222.h"
#include "p239.h"
#include "p241.h"

/*以下的9行是这次增加的,不增加就编译通不过*/
#define BIT(x)	(1 << (x))/*要增加下面六条定义才行,否则出警告提示*/
#define _asm	asm			
#define WDR() 	asm("wdr")
#define SEI()	asm("sei")
#define CLI()	asm("cli")
#define NOP()	asm("nop")

#define SET_BIT(x,y) (x |=(1<<y))	/*置x中的第y位为1*/
#define CLR_BIT(x,y) (x&=~(1<<y))	/*清x中的第y位为0*/
#define GET_BIT(x,y) (x&(1<<y))		/*读取x中的第y位*/

/*以下3行是UART用的。*/
/*由于已经改为了标准名称,顾下列3行不用重复定义了。*/
//SFR_B(USR,    0x0B) /* UART Status Register,UART用的*/
//SFR_B(UCR,    0x0A) /* UART Control Register,UART用的 */
//SFR_B(UBRR,   0x09) /* UART Baud Rate Register,UART用的 */

#define uchar unsigned char	/*定义缩写*/
#define uint unsigned int

#endif

⌨️ 快捷键说明

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