📄 __zboard.h
字号:
//===================================================================//
// Project Name : ZBoard
// Module Name : Master Firmware Program
// Product Type : License
// OS/Dev Tool : AT89C52, uVision 2
// Original Author : Ray Yang
// Organization : YBWork.com
// Original Date : July, 25, 2001
// Addr : Room 402, No. 131, Meilong No. 9
// TEL : 86-21-54630718
// EMail : rayyang2000@yahoo.com
// Website : http://www.ybwork.com
// Copyright : Copyright (L) YBWork.com, 2001
// Comments :
//
// << History >>
// July, 25, 2001 The first release
//===================================================================//
#ifndef __ZBOARD_H__
#define __ZBOARD_H__
#undef MONITOR51
#include <AT89X52.H>
#ifdef _DEBUG
#include <stdio.h> /* prototype declarations for I/O functions */
#include <string.h>
#endif
// New type definitions
typedef unsigned char boolean;
typedef unsigned char BOOL;
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned long ULONG;
/**************************************************************************/
/* macro */
/**************************************************************************/
#ifdef __C51__
#define SWAP(x) ((((x) & 0xFF) << 8) | (((x) >> 8) & 0xFF))
#define SWAP4(x) ((((x) & 0xFF) << 24) | (((x) & 0xFF00) << 8) | (((x) & 0xFF0000) >> 8) | (((x) & 0xFF000000) >> 24))
#else
#define SWAP(X) (x)
#define code
#define idata
#endif
#define MSB(x) (((x) >> 8) & 0xFF)
#define LSB(x) ((x) & 0xFF)
#define FALSE 0
#define TRUE (!FALSE)
#define true TRUE
#define false FALSE
// Disable all interrupts
#define DISABLE_INTERRUPTS EA = 0
// Enable all interrupts
#define ENABLE_INTERRUPTS EA = 1
#define DMA_IDLE 0
#define DMA_RUNNING 1
#define DMA_PENDING 2
typedef union _ZBOARD_FLAGS
{
struct _FLAGS
{
unsigned char bTimer : 1;
unsigned char bBus_Reset : 1;
unsigned char bSuspend : 1;
unsigned char bSetup_Packet : 1;
unsigned char bRemote_Wakeup : 1;
unsigned char bIN_ISR : 1;
unsigned char bControl_State : 2;
unsigned char bConfiguration : 1;
unsigned char bVerbose : 1;
unsigned char bEP1_RxDone : 1;
// unsigned char bSetup_DMA : 2; // V2.3
unsigned char bDMA_State : 2;
// unsigned char bPower_Down : 1; // Smart Board
unsigned char bLED : 2; // Used for LED
unsigned char bRead : 1; // TRUE = Read, FALSE = Write. Now this bit is not used, just reserved for future usage.
// unsigned char bCodeTransfered : 1; // TRUE = Finished, FALSO = Need more data
} bits;
unsigned short nValue;
} ZBOARDFLAGS;
#endif /*__ZBOARD_H__*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -