davincievm.c

来自「开发环境CCS3.2,为TI最新处理器TMS320DM6446的网卡驱动程序源码」· C语言 代码 · 共 78 行

C
78
字号
/*
 *  Copyright 2005 by Spectrum Digital Incorporated.
 *  All rights reserved. Property of Spectrum Digital Incorporated.
 *
 *  Not for distribution.
 */

/*
 *  Board Setup ( for ARM and/or DSP )
 *
 */

#include "davincievm.h"

/* ------------------------------------------------------------------------ *
 *                                                                          *
 *  DAVINCIEVM_init( )                                                      *
 *                                                                          *
 *                                                                          *
 *                                                                          *
 *                                                                          *
 *                                                                          *
 * ------------------------------------------------------------------------ */
Int16 DAVINCIEVM_init( )
{
    DAVINCIEVM_PMX_init( );                 // Setup Pin Mux

    /* ---------------------------------------------------------------- *
     *                                                                  *
     *  The commented code below is assumed to have already been        *
     *  called in the ARM GEL file.  The GEL file will setup the        *
     *  pll, power domains, ddr2, aemif, and clocks.                    *
     *                                                                  *
     * ---------------------------------------------------------------- */

    DAVINCIEVM_initPsc( );                  // Setup PSC
    DAVINCIEVM_enablePowerModule( 0, 18 );  // Enable I2C

    DAVINCIEVM_enablePll1( 0, 16 );         // Setup Pll1 ( Clk @ 459 MHz )

    DAVINCIEVM_I2C_init( );                 // Setup I2C

    return 0;
}

/* ------------------------------------------------------------------------ *
 *                                                                          *
 *  DAVINCIEVM_wait( delay )                                                *
 *                                                                          *
 *      Wait in a software loop                                             *
 *                                                                          *
 * ------------------------------------------------------------------------ */
void DAVINCIEVM_wait( Uint32 delay )
{
    volatile Uint32 i;
    for ( i = 0 ; i < delay ; i++ );
}

/* ------------------------------------------------------------------------ *
 *                                                                          *
 *  DAVINCIEVM_waitusec( usec )                                             *
 *                                                                          *
 *      Wait in a software loop for X microseconds                          *
 *                                                                          *
 * ------------------------------------------------------------------------ */
void DAVINCIEVM_waitusec( Uint32 usec )
{
    #ifdef ARM_SIDE

        DAVINCIEVM_wait( ( usec * 51 ) >> 6 );

    #elif DSP_SIDE

        DAVINCIEVM_wait( ( usec * 28 ) );

    #endif
}

⌨️ 快捷键说明

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