📄 urlb.h
字号:
//=====================================================================
// TEXAS INSTRUMENTS INCORPORATED PROPRIETARY INFORMATION
// Property of Texas Instruments -- For Unrestricted Internal Use Only
// Unauthorized reproduction and/or distribution is strictly prohibited
// This product is protected under copyright law and trade secret law as
// an unpublished work.Created 2001,(C) Copyright 2001 Texas Instruments.
// All rights reserved.
//=====================================================================
#include "mapping.h"
#ifndef _URLB__H
#define _URLB__H
//---------------------------------------------------------
//NAME : <LIB_function_name>
//DESCRIPTION :
//PARAMETERS :
//RETURN VALUE:
//LIMITATIONS :
//---------------------------------------------------------
//RES_Set(TEST_OK);
#define CHECK_32(RealVal, ExpVal, ErrorCode, DumpAllData) \
if (ExpVal != RealVal) { \
delsb = (UWORD16)(Bit32ExpVal); \
demsb = (UWORD16)(Bit32ExpVal >> 16); \
drlsb = (UWORD16)(Bit32ReadVal); \
drmsb = (UWORD16)(Bit32ReadVal >> 16); \
RES_Set(RESULT_SEPARATOR); \
RES_Set(START_ARRAY_DATA ); \
RES_Set(ErrorCode); \
RES_Set(demsb); \
RES_Set(delsb); \
RES_Set(drmsb); \
RES_Set(drlsb); \
RES_Set(END_ARRAY_DATA); \
TempCheckStatus=TEST_BAD; \
CheckStatus=TEST_BAD; \
} \
else if (DumpAllData == TRUE) { \
drlsb = (UWORD16)(Bit32ReadVal); \
drmsb = (UWORD16)(Bit32ReadVal >> 16); \
delsb = (UWORD16)(Bit32ExpVal); \
demsb = (UWORD16)(Bit32ExpVal >> 16); \
RES_Set(RESULT_SEPARATOR); \
RES_Set(START_ARRAY_DATA ); \
RES_Set(ErrorCode); \
RES_Set(demsb); \
RES_Set(delsb); \
RES_Set(drmsb); \
RES_Set(drlsb); \
RES_Set(END_ARRAY_DATA); \
} \
else { \
} \
//The following routine (CHECK_16) has not been verified
//#define CHECK_16(RealVal, ExpVal, ErrorCode, DumpAllData) \
// if (ExpVal != RealVal || DumpAllData == TRUE) { \
// RES_Set(RESULT_SEPARATOR); \
// RES_Set(START_ARRAY_DATA ); \
// RES_Set(ErrorCode); \
// RES_Set(ExpVal); \
// RES_Set(RealVal); \
// RES_Set(END_ARRAY_DATA); \
// CheckStatus=TEST_BAD; \
// } \
// if (DumpAllData == TRUE) { \
// USB_HHC_HHC_TEST_WD4 = (RealVal,RealVal); \
// } \
//lb write works as follows...
//lb write
//delay with one one read access to the test observe reg
//wait for LBAccessComp
//check for LBAccessComp=complete, WrFifoFull=notfull, SysErr=noerror,
//done
//To wait using WrFifoFull... while ((USB_HHC_HHC_TEST_OBSV & 0x00000008) == 0x00000000)
//To wait using LBAccessComp... while ((USB_HHC_HHC_TEST_OBSV & 0x00000001) == 0x00000001)
#define LB_WRITE(LBAddress, NumWord, WrBe) \
USB_HHC_HHC_TEST_ADDR = LBAddress; \
USB_HHC_HHC_TEST_INITIATE = (0x00000000 | ((UWORD32)NumWord << 16) | ((UWORD32)WrBe)); \
Bit32ReadVal = USB_HHC_HHC_TEST_OBSV; \
while ((USB_HHC_HHC_TEST_OBSV & 0x00000001) == 0x00000001) \
{ \
} \
Bit32ExpVal = (0x00000048); \
Bit32ReadVal = (0x00000049 & USB_HHC_HHC_TEST_OBSV); \
UErrorCode = (UErrorSeq++)<<8 | 0x00FE; \
CHECK_32(Bit32ReadVal, Bit32ExpVal, UErrorCode, DumpAllData); \
//lb read works as follows...
//lb read
//delay with one one read access to the test observe reg
//wait for LBAccessComp
//wait for FifoRdComp
//verify number of read words, SysErr=noerror, LBAccessComp=complete, RdFifoEmpty=empty
//done
#define LB_READ(LBAddress, NumWord) \
USB_HHC_HHC_TEST_ADDR = LBAddress; \
USB_HHC_HHC_TEST_INITIATE = (0x00080000 | ((UWORD32)NumWord << 16)); \
Bit32ReadVal = USB_HHC_HHC_TEST_OBSV; \
while ((USB_HHC_HHC_TEST_OBSV & 0x00000001) == 0x00000001) \
{ \
} \
while ((USB_HHC_HHC_TEST_OBSV & 0x00000002) == 0x00000002) \
{ \
} \
Bit32ExpVal = (0x00000040 | ((UWORD32)NumWord << 10)); \
Bit32ReadVal = (0x00001C61 & USB_HHC_HHC_TEST_OBSV); \
UErrorCode = (UErrorSeq++)<<8 | 0x00FF; \
CHECK_32(Bit32ReadVal, Bit32ExpVal, UErrorCode, DumpAllData); \
#define RESET_MEM() \
Mem_Data = (UWORD32 *) (Mem_Pointer); \
*Mem_Data++ = (0x76543210); \
*Mem_Data++ = (0x87654321); \
*Mem_Data++ = (0x98765432); \
*Mem_Data++ = (0xA9876543); \
Mem_Data = (UWORD32 *) (Mem_Pointer); \
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -