📄 swreg.h
字号:
/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
* This software is copyrighted by and is the sole property of
* VIA Networking Technologies, Inc. This software may only be used
* in accordance with the corresponding license agreement. Any unauthorized
* use, duplication, transmission, distribution, or disclosure of this
* software is expressly forbidden.
*
* This software is provided by VIA Networking Technologies, Inc. "as is"
* and any express or implied warranties, including, but not limited to, the
* implied warranties of merchantability and fitness for a particular purpose
* are disclaimed. In no event shall VIA Networking Technologies, Inc.
* be liable for any direct, indirect, incidental, special, exemplary, or
* consequential damages.
*
*
* File: swreg.h
*
* Purpose: Switch register hardware accessing functions
*
* Author: Tevin Chen
*
* Date: Jan 08, 2002
*
*/
#ifndef __SWREG_H__
#define __SWREG_H__
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
/*--------------------- Export Definitions -------------------------*/
/*--------------------- Export Types ------------------------------*/
/*--------------------- Export Macros ------------------------------*/
#define SWREG_vSpecBitOn(wAddr, byBitId) \
SWREG_vBitsOn((UINT16)(wAddr + ((byBitId)/8)), (UINT8)(0x01 << ((byBitId)%8)))
#define SWREG_vSpecBitOff(wAddr, byBitId) \
SWREG_vBitsOff((UINT16)(wAddr + ((byBitId)/8)), (UINT8)(0x01 << ((byBitId)%8)))
#define SWREG_vIsSpecBitOn(wAddr, byBitId) \
SWREG_bIfBitsOn((UINT16)(wAddr + ((byBitId)/8)), (UINT8)(0x01 << ((byBitId)%8)))
#define SWREG_vIsSpecBitOff(wAddr, byBitId) \
SWREG_bIfBitsOff((UINT16)(wAddr + ((byBitId)/8)), (UINT8)(0x01 << ((byBitId)%8)))
/*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/
#ifdef __ASIC_VT6526
extern xdata BYTE x_byCpuPktData;
extern xdata BYTE x_byCpuRegData;
extern xdata BYTE x_byCpuRegAddrLow;
extern xdata BYTE x_byCpuRegAddrHi;
//extern xdata BYTE x_byModuleAddr;
#else // __ASIC_VT6524 or __ASIC_VT6526D
extern xdata BYTE x_byCpuPktData;
extern xdata BYTE x_byCpuRegData;
extern xdata BYTE x_byCpuRegAddrLow;
extern xdata BYTE x_byCpuRegAddrHi;
#endif
/*--------------------- Export Functions --------------------------*/
void SWREG_vReadB(UINT16 wAddr, PUINT8 pbyData) DIRECT_FUNTYPE_REENT;
void SWREG_vWriteB(UINT16 wAddr, UINT8 byData) DIRECT_FUNTYPE_REENT;
void SWREG_vReadW(UINT16 wAddr, PUINT16 pwData) DIRECT_FUNTYPE_REENT;
void SWREG_vWriteW(UINT16 wAddr, UINT16 wData) DIRECT_FUNTYPE_REENT;
void SWREG_vReadDW(UINT16 wAddr, PUINT32 pdwData) DIRECT_FUNTYPE_REENT;
void SWREG_vWriteDW(UINT16 wAddr, UINT32 dwData) DIRECT_FUNTYPE_REENT;
void SWREG_vBitsOn(UINT16 wAddr, UINT8 byBitPtn) DIRECT_FUNTYPE_REENT;
void SWREG_vBitsOff(UINT16 wAddr, UINT8 byBitPtn) DIRECT_FUNTYPE_REENT;
BOOL SWREG_bIfBitsOn(UINT16 wAddr, UINT8 byBitPtn) DIRECT_FUNTYPE_REENT;
BOOL SWREG_bIfBitsOff(UINT16 wAddr, UINT8 byBitPtn) DIRECT_FUNTYPE_REENT;
BOOL SWREG_bWaitStatus(UINT16 wAddr, UINT8 byStsBitPtn, BOOL bWaitCond) DIRECT_FUNTYPE_REENT;
#endif /* __SWREG_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -