tmhelp.c

来自「用于TM1300/PNX1300系列DSP(主要用于视频处理)的设备库的源码」· C语言 代码 · 共 146 行

C
146
字号
/*
 * Copyright (c) 1995,1996,1997,1998 by TriMedia Technologies. 
 *
 * +------------------------------------------------------------------+
 * | This software is furnished under a license and may only be used  |
 * | and copied in accordance with the terms and conditions of  such  |
 * | a license and with the inclusion of this copyright notice. This  |
 * | software or any other copies of this software may not be provided|
 * | or otherwise made available to any other person.  The ownership  |
 * | and title of this software is not transferred.                   |
 * |                                                                  |
 * | The information in this software is subject  to change without   |
 * | any  prior notice and should not be construed as a commitment by |
 * | TriMedia Technologies.                                           |
 * |                                                                  |
 * | this code and information is provided "as is" without any        |
 * | warranty of any kind, either expressed or implied, including but |
 * | not limited to the implied warranties of merchantability and/or  |
 * | fitness for any particular purpose.                              |
 * +------------------------------------------------------------------+
 *
 *  Module name              : tmHelp.c    2.0
 *
 *  Last update              : 2002-03-14
 *
 *  Description              :
 *
 *  Revision                 :
 *        Built for the TCS 2.0b release
 */

#include <tm1/tmBoard.h>    
 
/*---------------------------- includes -----------------------------------*/


#include <stdio.h>
#include <tm1/tmProcessor.h>
#include <tm1/tmIIC.h>
#include <tmlib/dprintf.h>
#include <tm1/tmHelp.h>

/* --------------------------- functions --------------------------------- */

void 
tmHelpReportSystem(FILE* fp)
{
    UInt32        boardID;
    pprocCapabilities_t procCap;
    Char        str[128];
    Char       *sp = str; 
    Char       *boardName;
    UInt        err;
    
    
    procGetCapabilities(&procCap);
    switch (procCap->deviceID) {
    case PROC_DEVICE_UNKNOWN:
        sp += sprintf(sp, "Unknown processor ");
        break;
    case PROC_DEVICE_TM1000:
        sp += sprintf(sp, "TM1000 ");
        break;
    case PROC_DEVICE_TM1100:
        sp += sprintf(sp, "TM1100 ");
        break;
     case PROC_DEVICE_TM1300:
        sp += sprintf(sp, "TM1300 ");
        break;
    case PROC_DEVICE_PNX1300:
        sp += sprintf(sp, "PNX1300 ");
        break;
    case PROC_DEVICE_TM2500:
        sp += sprintf(sp, "TM2500 (Classic DTV) ");
        break;
    case PROC_DEVICE_TM2600:
        sp += sprintf(sp, "TM2600 (HD-SD) ");
        break;
    case PROC_DEVICE_TM2700:
        sp += sprintf(sp, "TM2700 (HD-HD) ");
        break;
    case PROC_DEVICE_TM2800:
        break;
    default:
        sp += sprintf(sp, "Unrecognized processor id 0x%x ", procCap->deviceID);
        break;
    }
    
    switch (procCap->revisionID) {
    case PROC_REVISION_UNKNOWN:
        sp += sprintf(sp, "revision unknown ", procCap->revisionID);
        break;
    case PROC_REVISION_CTC:
        sp += sprintf(sp, "CTC revision ");
        break;
    case PROC_REVISION_1_0:
        sp += sprintf(sp, "revision 1.0 ");
        break;
    case PROC_REVISION_1_1:
        sp += sprintf(sp, "revision 1.1 ");
        break;
    case PROC_REVISION_1_2:
        sp += sprintf(sp, "revision 1.2 ");
        break;
    case PROC_REVISION_1_3:
        sp += sprintf(sp, "revision 1.3 ");
        break;
     case PROC_REVISION_1_4:
        sp += sprintf(sp, "revision 1.4 ");
        break;
    case PROC_REVISION_1_5:
         sp += sprintf(sp, "revision 1.5 ");
         break;
    case PROC_REVISION_1_0S:
        sp += sprintf(sp, "revision 1.0S ");
        break;
    case PROC_REVISION_1_1S:
        sp += sprintf(sp, "revision 1.1S ");
        break;
    default:
        sp += sprintf(sp, " unrecognized revision %d ", procCap->revisionID);
        break;
    }
    sp += sprintf(sp, "running at %3.2f MHz on a",
           0.000001 * (float) procCap->cpuClockFrequency);

    err = tsaBoardGetBoard(&boardID, &boardName);
    if (err == TSA_BOARD_ERR_GETBOARDCONFIG_FAILED)
    {
        UInt id;
        iicReadReg(0xA1, 2, &id);
        sp += sprintf(sp, "n unrecognized board (ID 0x%x).\n", id);
    }
    else
        sp += sprintf(sp, " %s board.\n", boardName);
    
    if (fp) {
        fprintf(fp, "%s", str);
    } else {
        _dp("%s", str);
    }
}

/* ----------------------------------------------------------------------- */

⌨️ 快捷键说明

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