?? __hal.c
字號:
//===================================================================//
// 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
//===================================================================//
#include "ZBoard.H"
#include "HAL.H"
#include "USBD12.H"
void outportb(unsigned short nPort, unsigned char nVal)
{
#ifdef PARALLEL_BUS
unsigned char xdata *exAddress;
exAddress = nPort;
*exAddress = nVal;
#else
P1 &= 0xf1; // Enable D12
IC_D12_A0 = nPort & 0x01 ? 1 : 0;
IC_D12_WR = 0;
P0 = nVal;
IC_D12_WR = 1;
P1 |= 0x0e; // Disable D12
#endif
}
unsigned char inportb(unsigned short nPort)
{
unsigned char nVal;
#ifdef PARALLEL_BUS
unsigned char xdata *exAddress;
exAddress = nPort;
nVal = *exAddress;
#else
P1 &= 0xf1; // Enable D12
IC_D12_A0 = nPort & 0x01 ? 1 : 0;
IC_D12_RD = 0;
nVal = P0;
IC_D12_RD = 1;
P1 |= 0x0e; // Disable D12
#endif
return nVal;
}
void Delay(unsigned char nFactor)
{
unsigned char i;
for(i=0; i<nFactor; i++)
i=i;
}
void DelayMs(unsigned char nFactor)
{
unsigned char i;
for(i=0; i<nFactor; i++)
Delay(2);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -