📄 global.h
字号:
//#######################################################
// A Global Macro Definition
// EEIC.HUST
// Author Azbo 14/07/2005
// Modify by Azbo 18/07/2005
// Change "x" into "(x)" in Macro,because of the priority of operaers.
// Modify by Azbo 18/07/2005
// Delete IO ports' output '0' in Macro of 'SET_PORT*_OUT'.
// Modify by Azbo 18/07/2005
// Add two Macros for test IO ports.
// Modify by Azbo 25/08/2005
// Add tow Mode:Bus opeartion & Bit opeartion.
// Modify by Azbo 28/08/2005
// Add system-stats and actions definition.
//#######################################################
#ifndef __GLOBAL_h__
#define __GLOBAL_h__
#include <SPCE061V004.H>
//Bit map
#define BIT0 0x0001
#define BIT1 0x0002
#define BIT2 0x0004
#define BIT3 0x0008
#define BIT4 0x0010
#define BIT5 0x0020
#define BIT6 0x0040
#define BIT7 0x0080
#define BIT8 0x0100
#define BIT9 0x0200
#define BIT10 0x0400
#define BIT11 0x0800
#define BIT12 0x1000
#define BIT13 0x2000
#define BIT14 0x4000
#define BIT15 0x8000
//All System Status
#define STAT_IDLE 0x0000
#define STAT_WORK 0x0001
#define STAT_SET 0x0002
#define STAT_LCD 0x0004
#define STAT_CHECK 0x0008
#define STAT_ERROR 0x8000
//All Action
#define PRESS_KEY BIT0
#define REV_REPORT BIT1
#define TIMEOUT_8Hz BIT2
#define OPA_LCD BIT3
#define ERROR BIT15
//IO Direct Set
#define SET_PORTA_IN(x) do{(*P_IOA_Dir)&=(~(x));(*P_IOA_Attrib)&=(~(x));(*P_IOA_Data)|=(x);}while(0)
#define SET_PORTA_OUT(x) do{(*P_IOA_Dir)|=((x));(*P_IOA_Attrib)|=((x));}while(0)
#define SET_PORTB_IN(x) do{(*P_IOB_Dir)&=(~(x));(*P_IOB_Attrib)&=(~(x));(*P_IOB_Data)|=((x));}while(0)
#define SET_PORTB_OUT(x) do{(*P_IOB_Dir)|=((x));(*P_IOB_Attrib)|=((x));}while(0)
//IO Control
#define SET_PORTA(x) *P_IOA_Data=(*P_IOA_Buffer)|((x))
#define CLR_PORTA(x) *P_IOA_Data=(*P_IOA_Buffer)&(~(x))
#define SET_PORTB(x) *P_IOB_Data=(*P_IOB_Buffer)|((x))
#define CLR_PORTB(x) *P_IOB_Data=(*P_IOB_Buffer)&(~(x))
//IO data test
#define TEST_PORTA(x) (*P_IOA_Data&(x))
#define TEST_PORTB(x) (*P_IOB_Data&(x))
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -