?? config.h~
字號:
/****************************************Copyright (c)**************************************************
** 智 能 充 電 器 開 發 小 組
** OurAVR 論壇
** QQ 群: 26052247
**
** http://www.ouravr.com/bbs
**
**--------------文件信息--------------------------------------------------------------------------------
**文 件 名: config.h
**創 建 人: 呂海安
**最后修改日期: 2008年03月02日
**描 述: 程序的數據結構配置頭文件
**
**--------------歷史版本信息----------------------------------------------------------------------------
** 創建人: 呂海安
** 版 本: v1.0
** 日 期: 2008年03月02日
** 描 述: 原始版本
**
**--------------當前版本修訂------------------------------------------------------------------------------
** 修改人: 村長 aleyn.wu
** 日 期: 2008年3月3日
** 描 述: 使本項目能在CVAVR下編譯通過
**
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
#ifndef __CONFIG__H
#define __CONFIG__H
#include <mega16.h> // Standard MEGA16/AVR MCU functions
#include <stdio.h> // Standard Input/Output functions
#include <string.h> // Standard Memery functions
#include <delay.h> // CVAVR 自帶的 delay 函數庫
#include <sleep.h>
#ifndef F_CPU
#define F_CPU 16000000UL
#endif // F_CPU
// PORTA
#define PA7 7
#define PA6 6
#define PA5 5
#define PA4 4
#define PA3 3
#define PA2 2
#define PA1 1
#define PA0 0
// PORTB
#define PB7 7
#define PB6 6
#define PB5 5
#define PB4 4
#define PB3 3
#define PB2 2
#define PB1 1
#define PB0 0
// PORTC
#define PC7 7
#define PC6 6
#define PC5 5
#define PC4 4
#define PC3 3
#define PC2 2
#define PC1 1
#define PC0 0
// PORTD
#define PD7 7
#define PD6 6
#define PD5 5
#define PD4 4
#define PD3 3
#define PD2 2
#define PD1 1
#define PD0 0
#define BIT(x) (1 << (x)) // 位操作
#define INT8U unsigned char
#define INT16U unsigned int
#define INT32U unsigned long
#define BOOL unsigned char
#define INT8S char
#define INT16S int
#define INT32S long
#include "Para.h" // 參數表
#include "SIO.h" // 按鍵 functions
#include "UART.h" // UART functions
#include "LCD1602.h" // LCD functions
#include "ADC.h" // ADC functions
#include "PWM.h" // PWM functions
//#include "Menu.h" // 菜單 functions
//#define Memory_Char_to_Int(x) (((INT16U)memory[x]<<8) | ((INT16U)memory[x+1]))
//#define Memory_Char_To_Long(x) (((unsigned long)memory[x])<<24|((unsigned long)memory[x+1])<<16|((unsigned long)memory[x+2])<<8|((unsigned long)memory[x+3]))
//#define Memory_Long_add(x) memory[x]=((Memory_Char_To_Long(x)+1)>>24);memory[x+1]=((Memory_Char_To_Long(x)+1)>>16);memory[x+2]=((Memory_Char_To_Long(x)+1)>>8);memory[x+3]=Memory_Char_To_Long(x)+1
#define TRUE 1
#define FALSE 0
#define Disable() #asm("cli")
#define Enable() #asm("sei")
#define BIT_SET(a,b) a |= BIT(b)
#define BIT_CLR(a,b) a &= ~BIT(b)
#define BIT_INV(a,b) a ^= BIT(b)
#define BIT_STATUS(a,b) a & BIT(b)
typedef struct // 定義一個位段結構,用于處理輸入的各個位
{
INT8U bit0 :1;
INT8U bit1 :1;
INT8U bit2 :1;
INT8U bit3 :1;
INT8U bit4 :1;
INT8U bit5 :1;
INT8U bit6 :1;
INT8U bit7 :1;
}BITTYPE;
typedef union datatype // 定義一個聯合位段
{
INT8U bbyte;
BITTYPE bbit;
}COMMBYTE;
extern INT16U t0flag;
extern INT8U para[230];
#define LED1 PORTC.0 // Battery1, Red
#define LED2 PORTC.1 // Battery1, Green
#define LED3 PORTC.6 // Battery2, Red
#define LED4 PORTC.7 // Battery2, Green
extern void InitMenu(void); // 初始化菜單
extern void ShowMenu(void); // 菜單函數
/*
#include "SIO.c" // Keyboard functions
#include "UART.c" // UART functions
#include "LCD1602.c" // LCD functions
#include "ADC.c" // ADC functions
#include "PWM.c" // PWM functions
*/
#endif
/**************************************************************************************×*****************
** END OF FILE
********************************************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -