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

📄 mdb.c

📁 在大型通信系统(机架插板式)中多块单板通过TDM总线
💻 C
📖 第 1 页 / 共 2 页
字号:
        CheckRxHPI();       /* 监测各DSP上报消息情况                */                   

        /* HDLC收发监测 */      
        CheckRxL3Layer();   /* 监测第三层接收情况函数               */    
        CheckTxL2Layer();   /* 监测第二层发送情况函数               */                   
        CheckRxL2Layer();   /* 监测第二层接收情况函数               */    
        CheckTxL1Layer();   /* 监测物理层发送情况函数               */                   
        CheckRxL1Layer();   /* 监测物理层接收情况函数               */    
    }
}


/********************************************************************************/
/*  函数名称:void InitMT8985(void)                                              */
/*  简要描述:初始化MT8985函数                                                   */
/*                                     交换                                     */
/*           HWI0的0-7时隙为信令时隙  ————> HWO1-4的0-1时隙                 */
/*                                                                              */
/*                                     交换                                     */
/*           HWI0的8-23时隙为数据时隙 ————> HWO1-4的2-5时隙                 */
/*                                                                              */
/*                                     交换                                     */
/*           HWI1-4的0-1时隙为信令时隙————> HWO0的0-7时隙                   */
/*                                                                              */
/*                                     交换                                     */
/*           HWI1-4的2-5时隙为数据时隙————> HWO0的8-23时隙                  */
/*                                                                              */
/*  时    间:2000年11月04日                                                     */
/********************************************************************************/
void InitMT8985(void)
{
    uchar data temp;
    uchar data i,j;

    WATCHDOG = ~WATCHDOG;

    /* 将MT8985所有输出关闭  */
    for(j=0;j<8;j++)
    {
        *(MT8985+WRITE+0x00) = (0x18+j);    /* 写CR,设置消息模式,对CMH/HW0-7读写    */
        for(i=0;i<0x20;i++)                 /* 写CMH                                */
        {
            for(;;)
            {
                *(MT8985+WRITE+0x20+i) = 0x40;  /* 写入后再读出比较直至正确         */
                temp=*(MT8985+READ+0x20+i);
                if(temp==0x40)
                {
                    break;
                }
            }
        }
    }

    /* 设置信令部分交换 */
    SetTimeSlot(1,0,0,0); 
    SetTimeSlot(1,1,0,1);
    SetTimeSlot(2,0,0,2);
    SetTimeSlot(2,1,0,3);
    SetTimeSlot(3,0,0,4);
    SetTimeSlot(3,1,0,5);
    SetTimeSlot(4,0,0,6);
    SetTimeSlot(4,1,0,7);
    SetTimeSlot(0,0,1,0);  
    SetTimeSlot(0,1,1,1);       
    SetTimeSlot(0,2,2,0);        
    SetTimeSlot(0,3,2,1);          
    SetTimeSlot(0,4,3,0);         
    SetTimeSlot(0,5,3,1);         
    SetTimeSlot(0,6,4,0);          
    SetTimeSlot(0,7,4,1);       
    

    /* 设置T120部分交换 */
    SetTimeSlot(1,2,0,8);
    SetTimeSlot(1,3,0,9);
    SetTimeSlot(1,4,0,10);
    SetTimeSlot(1,5,0,11);
    SetTimeSlot(2,2,0,12);
    SetTimeSlot(2,3,0,13);
    SetTimeSlot(2,4,0,14);
    SetTimeSlot(2,5,0,15);
    SetTimeSlot(3,2,0,16);
    SetTimeSlot(3,3,0,17);
    SetTimeSlot(3,4,0,18);
    SetTimeSlot(3,5,0,19); 
    SetTimeSlot(4,2,0,20);    
    SetTimeSlot(4,3,0,21);        
    SetTimeSlot(4,4,0,22);      
    SetTimeSlot(4,5,0,23);       
    SetTimeSlot(0,8,1,2);
    SetTimeSlot(0,9,1,3);
    SetTimeSlot(0,10,1,4);
    SetTimeSlot(0,11,1,5);
    SetTimeSlot(0,12,2,2);
    SetTimeSlot(0,13,2,3);
    SetTimeSlot(0,14,2,4); 
    SetTimeSlot(0,15,2,5);   
    SetTimeSlot(0,16,3,2); 
    SetTimeSlot(0,17,3,3);   
    SetTimeSlot(0,18,3,4);         
    SetTimeSlot(0,19,3,5);        
    SetTimeSlot(0,20,4,2);
    SetTimeSlot(0,21,4,3); 
    SetTimeSlot(0,22,4,4);  
    SetTimeSlot(0,23,4,5);   

    /* 配置信令测试时交换 */
    /* 对KPB环回 */ 
    /*
    SetTimeSlot(0,0,0,0);
    SetTimeSlot(0,1,0,1);  
    SetTimeSlot(0,2,0,2);       
    SetTimeSlot(0,3,0,3);          
    SetTimeSlot(0,4,0,4);          
    SetTimeSlot(0,5,0,5);          
    SetTimeSlot(0,6,0,6);          
    SetTimeSlot(0,7,0,7);        
    */
    /* 对MDB-DSP环回 */
    /*
    SetTimeSlot(1,0,1,0);           
    SetTimeSlot(1,1,1,1);          
    SetTimeSlot(2,0,2,0);        
    SetTimeSlot(2,1,2,1);          
    SetTimeSlot(3,0,3,0);          
    SetTimeSlot(3,1,3,1);          
    SetTimeSlot(4,0,4,0);           
    SetTimeSlot(4,1,4,1);         
    */
    
    return;
}


/********************************************************************************/
/*  函数名称:void SetTimeSlot(uchar ucHWI,uchar ucTSI,uchar ucHWO,uchar ucTSO)  */
/*  简要描述:交换设定函数                                                       */
/*                             交换                                             */
/*           ucHWI的ucTSI时隙 <————> ucHWO的ucTSO时隙                       */
/*                                                                              */
/*  时    间:2000年11月04日                                                     */
/********************************************************************************/
void SetTimeSlot(uchar ucHWI,uchar ucTSI,uchar ucHWO,uchar ucTSO)
{
    WATCHDOG = ~WATCHDOG;

    /* 设定交换时隙         */
    *(MT8985+WRITE+0x00) = 0x10+ucHWO;   /* 写CR,设置交换模式,对CML/ucHWO读写 */
    m_ucVar1 = (ucHWI<<5)+ucTSI;
    for(;;)
    {
        *(MT8985+WRITE+0x20+ucTSO) = m_ucVar1; /* 写入后再读出比较 */
        m_ucVar2 = *(MT8985+READ+0x20+ucTSO);
        if(m_ucVar2 == m_ucVar1)
        {
            break;
        }
    }

    /* 将相应时隙打开       */
    *(MT8985+WRITE+0x00) = (0x18+ucHWO); /* 写CR,设置交换模式,对CMH/nHWO读写     */
    for(;;)
    {
        *(MT8985+WRITE+0x20+ucTSO) = 0x41;   /* 写入后再读出比较                    */
        m_ucVar2 = *(MT8985+READ+0x20+ucTSO);
        if(m_ucVar2 == 0x41)
        {
            break;
        }
    }

    return;
}


/********************************************************************************/
/*  函数名称:void HandleCMD(void)                                               */
/*  简要描述:处理收到的命令L3                                                   */
/*                                                                              */
/*  时    间:2002年02月21日                                                     */
/********************************************************************************/
void HandleCMD(void)                  
{     
    WATCHDOG = ~WATCHDOG;
    
    switch (L3RxVar.uiType)
    {
        case    PM_BOARDVER_REQ:    /* 版本查询     */
                
                GetSWVer();         /* 获取CPU、DSP软件版本信息并上报 */                
               
                break;  

        case    0x0:                /* 探测包   */
                break;

        default :                   /* 其它消息转发到DSP    */

                CheckTxHPI();
                       /* 监测各DSP接收命令情况                */                   
                                
                break;
    }       

    return;
}

⌨️ 快捷键说明

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