?? config.h
字號:
/**************************************************************************
** file name : config.h
** date: 2008
** description: 總頭文件
**************************************************************************/
/***********************************************
* general includes *
***********************************************/
#ifndef _CONFIGURE_H
#define _CONFIGURE_H
#ifndef BOOL
typedef unsigned char BOOL;
#else
#error"BOOL has defined"
#endif
#ifndef TRUE
#define TRUE 1
#define true 1
#define YES 1
#define OK 1
#define ON 1
#define on 1
#endif
#ifndef FALSE
#define FALSE 0
#define false 0
#define NO 0
#define NOK 0
#define OFF 0
#define off 0
#endif
#define FAIL false
#define SUCC true
/***********************************************
* avrgcc includes *
***********************************************/
#include <inttypes.h> //標準c褲頭
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <setjmp.h>
#include <math.h>
#include <avr/io.h> //avr c褲頭
#include <avr/wdt.h>
#include <avr/sleep.h>
#include <avr/Interrupt.h>
#include <avr/pgmspace.h>
#include <avr/eeprom.h>
#include <util/delay.h>
#include <util/crc16.h>
typedef unsigned char unit8; /***可移植數(shù)據(jù)類型*****/
typedef unsigned char uint8;
typedef unsigned char u08;
typedef signed char int8;
typedef unsigned int uint16;
typedef unsigned int u16;
typedef signed int int16;
typedef unsigned long uint32;
typedef signed long int32;
typedef unsigned long long int uint64;
typedef long long int int64;
typedef void ( * fptr )() PROGMEM ;/*定義存放在flash中的函數(shù)指針,no input no output*/
/******************************************************
* user includes *
*******************************************************/
#include "inc/cpu.h"
#include "inc/key.h"
#include "inc/led.h"
#include "inc/eeprom.h"
#include "inc/keyproc.h"
#include "inc/relay.h"
#include "inc/ds18b20.h"
#include "inc/hf3223.h"
/*******用戶配置入口********/
/*傳感器路數(shù)定義*/
#define CH1 0
#define CH2 1
/*溫濕度采樣相關*/
#define CH1_T_AD_CH 0 /*溫度通道配置*/
#define CH1_H_AD_CH 2 /*濕度通道配置*/
#define CH1_BREAK_CH 6 /*一路斷線報警檢測*/
#define CH1_T_PULLUP GET_BIT(PORTC).bit0 /*一路溫度上拉使能*/
#define CH1_H_PULLUP GET_BIT(PORTC).bit2 /*一路濕度上拉使能*/
/*繼電器端口配置*/
#define CH1_HEAT PORT(D,2) /*1路升溫*/
#define HEAT CH1_HEAT /*默認的升溫繼電器為1路*/
#define CH1_FAN PORT(D,0) /*1路降溫*/
#define FAN CH1_FAN /*默認的降溫繼電器為1路*/
#define CH1_DEHUM CH1_HEAT /*1路除濕*/
#define DEHUM CH1_HEAT /*默認除濕繼電器為1路*/
/*顯示相關 IO定義*/
#define SEG_A PORT(B,1)
#define SEG_B PORT(B,7)
#define SEG_C PORT(C,1)
#define SEG_D PORT(C,2)
#define SEG_E PORT(D,5)
#define SEG_F PORT(B,2)
#define SEG_G PORT(C,0)
#define SEG_DP PORT(C,3)
#define LED0 PORT(B,3)
#define LED1 PORT(B,4)
#define LED2 PORT(B,5)
#define LED3 PORT(D,6)
#define LED4 PORT(D,7)
#define LED5 PORT(B,0)
#define LED6 PORT(B,6)
#define DIG1 5 //
#define DIG2 4
#define DIG3 3
#define DIG4 2
#define DIG5 1
#define DIG6 6
#define DIG7 7
#define DIG8 8
#define DIG9 9
#define DIGMAX 10
/*按鍵io定義*/
#define KEY_DEC PIN(C,5)
#define KEY_ADD PIN(C,4) //+ -與pcb相反
#define KEY_SET PIN(D,1)
#define KEYCH 1
#define KEYADD 2
#define KEYDEC 3
#define KEYSET 4
//定時器控制索引號
#define _15MS 0
#define _500MS 1
#define _1S 2
#define _60S 3
//define the system running mode
#define AUTO_TH 0
#define MANU_TH 1
#endif
/**************the end ************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -