📄 includes.h
字号:
/********************************************
公司名称:
文 件 名:
版 本 号:
程序设计:
说 明:
完成日期:
修改日期:
功能摘要:
**********************************************/
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include <compat/ina90.h>
#include <avr/wdt.h>
#include <avr/eeprom.h>
#include <util/delay.h>
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long
#define ON 1
#define OFF 0
#define HIGH_BYTE 1
#define LOW_BYTE 0
#define HIGH 1
#define LOW 0
#define TURE 1
#define FALSE 0
#define CLOCK_TIME0 1 //定时器0定时1MS
#define CLOCK_TIME1 10
#define _60S (60000 / CLOCK_TIME1)
#define _5S (5000 / CLOCK_TIME1)
#define _3S (3000 / CLOCK_TIME1)
#define _2S (2000 / CLOCK_TIME1)
#define _1S (1000 / CLOCK_TIME1)
#define _500MS (500 / CLOCK_TIME1)
#define _10MS (10 / CLOCK_TIME1)
#define _20MS (20 / CLOCK_TIME1)
//-----------------------------------
#define bit_shut()\
do \
{ DIG1=OFF;\
DIG2=OFF;\
DIG3=OFF;\
DIG4=OFF;\
DIG5=OFF;\
}while(0)
//-----------------------------------
typedef unsigned char uint8;
typedef unsigned int uint16;
typedef unsigned long uint32;
typedef struct run_time
{
uint8 fGetTime;
uint16 WaitTime;
}WAIT_TIME_STRUCT;
//-----------------------------------
typedef struct
{
unsigned char bit0:1 ;
unsigned char bit1:1 ;
unsigned char bit2:1 ;
unsigned char bit3:1 ;
unsigned char bit4:1 ;
unsigned char bit5:1 ;
unsigned char bit6:1 ;
unsigned char bit7:1 ;
}bit_field;
#define GET_BIT(adr) (*(( volatile bit_field * )(&adr)))
#define PORT(m,n) GET_BIT(PORT##m).bit##n
#define PIN(m,n) GET_BIT(PIN##m).bit##n
#define DRA(n) GET_BIT(DDRA).bit##n //方便直观操作 自由设定单个io口的方向
#define DRB(n) GET_BIT(DDRB).bit##n
#define DRC(n) GET_BIT(DDRC).bit##n
#define DRD(n) GET_BIT(DDRD).bit##n
#define DDR(m,n) GET_BIT(DDR##m).bit##n
//----------------------------
#define UP_KEY PIN(B,4)
#define SET_KEY PIN(B,5)
#define DN_KEY PIN(B,3)
#define HC164_CLK PORT(D,5)
#define HC164_Data PORT(D,4)
#define DIG1 PORT(B,2)
#define DIG2 PORT(D,6)
#define DIG3 PORT(D,7)
#define DIG4 PORT(B,0)
#define DIG5 PORT(B,1)
#define CS_AD_A PORT(C,5)
#define CS_AD_B PORT(C,0)
#define SI_AD PORT(C,1)
#define SO_AD PIN(C,3)
#define CLK_AD PORT(C,2)
#define REST_AD PORT(C,4)
#define IO_HighAlarm PORT(D,3)
#define IO_LowAlarm PORT(D,2)
//------------------------------------
#include "Timer1.h"
#include "Calibrate.h"
#include "DataProTask.h"
#include "main.h"
#include "SysInit.h"
#include "Display.h"
#include "Resource.h"
#include "KeyScan.h"
#include "KeyTask.h"
#include "EEProm.h"
#include "CS5460A.h"
#include "SaveTask.h"
#include "Alarm.h"
#include "OS_Q.h"
#include "Comm.h"
//------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -