📄 swsram.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: swsram.h
*
* Purpose: ASIC embedded SRAM hardware accessing functions
*
* Author: Tevin Chen
* Henry Lin
*
* Date: Jan 08, 2002
* May 26, 2005
*
*/
#ifndef __SWSRAM_H__
#define __SWSRAM_H__
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
/*--------------------- Export Definitions ------------------------*/
/*--------------------- Export Types ------------------------------*/
/*--------------------- Export Macros -----------------------------*/
#define SWSRAM_vExtractBitsByByte(au8Data, u8StartBit, u8EndBit, au8Result) \
SWSRAM_vExtractBitsLtl(au8Data, u8StartBit, u8EndBit, au8Result)
#define SWSRAM_vModifyBitsByByte(au8DataBuf, u8StartBit, u8EndBit, au8ModiPtn) \
SWSRAM_vModifyBitsLtl(au8DataBuf, u8StartBit, u8EndBit, au8ModiPtn)
/*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/
BOOL SWSRAM_bReadEntry(UINT32 u32Addr, PUINT8 au8Data);
BOOL SWSRAM_bWriteEntry(UINT32 u32Addr, PUINT8 au8Data);
void SWSRAM_vReadBlock(UINT32 u32Addr, UINT8 u8BlockNumPerSlot, UINT8 u8BlockId, PUINT8 au8BlockBuf);
void SWSRAM_vWriteBlock(UINT32 u32Addr, UINT8 u8BlockNumPerSlot, UINT8 u8BlockId, PUINT8 au8ValueBuf);
void SWSRAM_vSetBlockEmpty(UINT32 u32Addr, UINT8 u8BlockNumPerSlot, UINT8 u8BlockId);
BOOL SWSRAM_bIsBlockEmpty(UINT32 u32Addr, UINT8 u8BlockNumPerSlot, UINT8 u8BlockId);
void SWSRAM_vSetMemEntryEmpty(UINT32 u32Addr); //new API
BOOL SWSRAM_bIsMemEntryEmpty(UINT32 u32Addr); //new API
//
// Function for extract/modify bits in a byte-array
//
// Note that "au8Data"/"au8DataBuf" MUST be LITTLE-endian,
// while "au8Result"/"au8ModiPtn"/"pbResult"/"pbModiPtn" will be AUTO CONVERT to be big/little endian.
//
void SWSRAM_vExtractBits(PUINT8 au8Data, UINT8 u8StartBit, UINT8 u8EndBit, PUINT8 au8Result);
void SWSRAM_vModifyBits(PUINT8 au8DataBuf, UINT8 u8StartBit, UINT8 u8EndBit, PUINT8 au8ModiPtn);
void SWSRAM_vExtractBitsByBool(PUINT8 au8Data, UINT8 u8StartBit, UINT8 u8EndBit, PBOOL pbResult);
void SWSRAM_vModifyBitsByBool(PUINT8 au8DataBuf, UINT8 u8StartBit, UINT8 u8EndBit, PBOOL pbModiPtn);
//
// Function for extract/modify bits in a byte-array, all in LITTLE-endian
//
void SWSRAM_vExtractBitsLtl(PUINT8 au8Data, UINT8 u8StartBit, UINT8 u8EndBit, PUINT8 au8Result);
void SWSRAM_vModifyBitsLtl(PUINT8 au8DataBuf, UINT8 u8StartBit, UINT8 u8EndBit, PUINT8 au8ModiPtn);
// Function for endian convertion
void SWSRAM_vEndianConvert(PUINT8 pu8DataBuf, UINT8 u8BufSize);
#endif /* __SWSRAM_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -