⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 swreg.h

📁 vt6528芯片交换机API函数和文档运行程序
💻 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 -------------------------*/
#define MAX_LOOP_TIMEOUT        0x162F  // Write module card's EEPROM should delay time

/*---------------------  Export Types  ------------------------------*/

/*---------------------  Export Macros ------------------------------*/
#define SWREG_vSpecBitOn(u16Addr, u8BitId)        \
    SWREG_vBitsOnU8((UINT16)((u16Addr) + ((u8BitId) / 8)), (UINT8)(0x01 << ((u8BitId) % 8)))
#define SWREG_vSpecBitOff(u16Addr, u8BitId)       \
    SWREG_vBitsOffU8((UINT16)((u16Addr) + ((u8BitId) / 8)), (UINT8)(0x01 << ((u8BitId) % 8)))

#define SWREG_vIsSpecBitOn(u16Addr, u8BitId)      \
    SWREG_bIsBitsOnU8((UINT16)((u16Addr) + ((u8BitId) / 8)), (UINT8)(0x01 << ((u8BitId) % 8)))
#define SWREG_vIsSpecBitOff(u16Addr, u8BitId)     \
    SWREG_bIsBitsOffU8((UINT16)((u16Addr) + ((u8BitId) / 8)), (UINT8)(0x01 << ((u8BitId) % 8)))

/*---------------------  Export Classes  ----------------------------*/

/*---------------------  Export Variables  --------------------------*/

/*---------------------  Export Functions  --------------------------*/
void SWREG_vReadU8(UINT16 u16Addr, PUINT8 pu8Data);
void SWREG_vWriteU8(UINT16 u16Addr, UINT8 u8Data);

void SWREG_vReadU16(UINT16 u16Addr, PUINT16 pu16Data);
void SWREG_vWriteU16(UINT16 u16Addr, UINT16 u16Data);

void SWREG_vReadU32(UINT16 u16Addr, PUINT32 pu32Data);
void SWREG_vWriteU32(UINT16 u16Addr, UINT32 u32Data);

void SWREG_vBitsOnU8(UINT16 u16Addr, UINT8 u8BitPtn);
void SWREG_vBitsOffU8(UINT16 u16Addr, UINT8 u8BitPtn);

BOOL SWREG_bIsBitsOnU8(UINT16 u16Addr, UINT8 u8BitPtn);
BOOL SWREG_bIsBitsOffU8(UINT16 u16Addr, UINT8 u8BitPtn);

BOOL SWREG_bWaitStatus(UINT16 u16Addr, UINT8 u8StsBitPtn, BOOL bWaitCond);

// access long data bits, using byte array data structure
void SWREG_vReadU64(UINT16 u16Addr, PUINT8 pu8Data);
void SWREG_vWriteU64(UINT16 u16Addr, PUINT8 pu8Data);

void SWREG_vReadU128(UINT16 u16Addr, PUINT8 pu8Data);
void SWREG_vWriteU128(UINT16 u16Addr, PUINT8 pu8Data);




#endif /* __SWREG_H__ */


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -