亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 860qmc1h.c

?? 基于如何開發MPC860處理器系統的核心業務模塊QMC的開發程序
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*--------------------------------------------------------------------------				
*
* FILE: 860QMC1h.c
*
* DESCRIPTION: 
*
* This example exercises QMC mode on an 860 with MH functionality.
* It sends and receives 8 frames of data using 8 BDs.  An interrupt is
* generated upon closing of the last RxBD.  The interrupt handler checks for
* errors in the BDs.  The ETH LED on the ADS board lights if no errors are
* detected;  otherwise the LED flashes.  The driver "terminates" in an
* infinite loop.
* 
* This version uses one logical channel (channel 0) on SCC2, and operates 
* in HDLC mode (32bit CRC). 
*
* For a high level explanation, please refer to the applications document
* for this example. This is included in the Zip file you received. If you 
* are interested in a ADS 860 development/evaluation system, please 
* contact your local sales representative.
*
* Note that this software does not run on the MC68360.
*
* This software is located in the Engineer's Toolbox of the Netcomm
* webpage:
*
* http://www.mot.com/netcomm
*              
*
* NOTES  <<<IMPORTANT:  PLEASE READ>>>:
*
*     1) Specifically Designed to run on 860 ADS board.
*
*     2) SPECIAL SETUP: 
*        This program requires that certain external connections be made on
*        the 860 ADS board in order to function.  This code is using a baud
*        rate generator and a timer to generate the clock and sync for the
*        serial interface.  Therefore you must connect the following signals:
*        -signals PA7, PA3, and PA1 (pins A9, A13, and A15 in connector P13)
*         must all be tied together
*        -signals PA0 and PC4 (pins A16 and B31 in connector P13) must be tied
*        together.
*
*     3) If this program is run under BDM (i.e. using mpc8bug, you must 
*        first clear the EXTIE bit in the Debug Enable Register (DER). 
*        Otherwise, the interrupt from the SCC will trap 
*        you back into the debugger.  This command 
*        for mpc8bug is "rms der.extie" followed by "0." at the next prompt.  
*        These commands are executed for you if you run the start script 
*        provided with this example by entering "ex start" after reset.  The 
*        script diables extie, and loads the program.  You then may set
*        breakpoints, look at memory, or just enter "go" as desired.
*
*     4) Be sure to look at the .map file for useful addresses to peek at.
*
*
* REFERENCES: 
*
*      1) MPC860 Users Manual
*      2) QMC Supplement to 360 and 860 UMs
*      3) Application note supplied with this software (located in the 860
*         tbale of the Engineer's Toolbox, at www.mot.com/netcomm 
*         
*
* HISTORY:
*	
* 13 FEB 98  ggh/ecg	    Initial version 
*-------------------------------------------------------------------------*/

#include <string.h>
#include <stdlib.h>        
#include "netcomm.h"       /* global defines */
#include "mpc860.h"        /* IMMR definitions and declarations */
#include "860QMC.h"        /* Local header file */
#include "masks860.h"      /* Global masks header file */


/***********************/
/* Global Declarations */
/***********************/

EPPC  *IMMR;      /* IMMR base pointer */

/*----------------------------*/
/* Base of buffer descriptors */
/*----------------------------*/

BDRINGS *RxTxBD;
    
/*----------------------------------------------------------*/
/* Set of Data Buffers for Transparent Receive and Transmit */
/* Data. The Rx buffer pools will take up the first 8       */
/* buffers and the Tx buffer pools will take up the last 8. */
/*----------------------------------------------------------*/

LB BufferPool[NUM_RXBDS+NUM_TXBDS];

/*---------------------------------------------------------*/
/* Status parameters of the receive and transmit processes */
/*---------------------------------------------------------*/

UHWORD RxGood;          /* Successful RX flag */
UBYTE  RxProcIndex;    /* keeps track of next BD to process */      

/*-----------------------------------------------------*/
/* Interrupt Handler Code to be moved to Address 0x500 */
/*-----------------------------------------------------*/


extern UWORD ExtIntTable[];

/***********************/
/* Function Prototypes */
/***********************/
 
void     Main(void);
void     SI_TSAinit(void);
void     SCCinit(void);
void     QMC_GlobalInit(void);                      
void     InterruptInit(UWORD *, UWORD[]);
void     InitBDs(void);
void     LoadTxBuffers(void);
void     QMC_ChannelInit(void);
void     ExtIntHandler(UWORD);
UHWORD   BDEmpty(UHWORD);
UHWORD   LastBD(UHWORD);
void     Ethled(UHWORD);
void     FlashEthled(void);
/*--------------------------------------------------------------------------
*
* FUNCTION NAME:  main 
*
* DESCRIPTION:
*
*  Main function for MPC860 QMC example code.
*
* EXTERNAL EFFECT: n/a
*                 
* PARAMETERS:  None
*
* RETURNS: None
*
*-------------------------------------------------------------------------*/

void Main()
{
   RxGood = TRUE;   /* initialize as good */
   RxProcIndex = 0; /* initialize */    

   /*------------------------*/
   /* Establish IMMR pointer */
   /*------------------------*/
   
   IMMR = (EPPC *)(GetIMMR() & 0xFFFF0000);  /* MPC8xx internal register
                                                map  */
   
   /*---------------------------------------------------------*/
   /* Initialize the Serial Interface, its Time Slot Assigner */
   /* and the necessary clocks for the interface.             */
   /*---------------------------------------------------------*/

   SI_TSAinit();

   /*----------------------------------------*/
   /* Perform general initialization of SCC2 */
   /*----------------------------------------*/

   SCCinit();

   /*--------------------------------------------------*/
   /* Initialize Global QMC parameters and the QMC TSA */
   /*--------------------------------------------------*/

   QMC_GlobalInit();

   /*--------------------------------------------------------------------*/
   /* Initialize interrupt-related parameters including placing External */
   /* Interrupt Handler Code to Address 0x500 in the vector table,       */
   /* and enabling interrupts in the SCC, CPIC, SIU, and PPC core.       */
   /*--------------------------------------------------------------------*/
   InterruptInit((UWORD *) EXT_INT_VECTOR, ExtIntTable);

   /*------------------------------------------------*/
   /* Load the Tx buffer pool with the test patterns */
   /*------------------------------------------------*/

   LoadTxBuffers();

   /*-------------------------------------------------------------------*/
   /* This function defines a number of buffers for an RX and TX buffer	*/
   /* pool, but does not attempt to manage memory.  It uses the first	*/
   /*  half of the BD pool for RX and the second half for TX.           */ 
   /*-------------------------------------------------------------------*/
   
      InitBDs(); /* Initialize RX and TX BDs */

   /*----------------------------------------*/
   /* Initialize Channel Specific parameters */
   /*----------------------------------------*/

   QMC_ChannelInit();

   /*--------------------------------------------*/
   /* Enable transmit and receive in SCC2's GSMR */
   /* (Step 23 of QMC initialization procedure   */
   /* from QMC Supplement, chapter 6)            */
   /*--------------------------------------------*/

   IMMR->scc_regs[SCC2_REG].scc_gsmr_l |= GSMR_L2_ENR|GSMR_L2_ENT;

   
	/*--------------------------------------------*/
	/* Use this loop to delay the core until CPM  */
	/* has finished transmitting and receiving.   */
    	/*                                            */
    	/* Note that the value 1000000 was chosen to  */
    	/* provide an arbitrarily sufficient amount   */
    	/* of time for reception to complete.  You    */
    	/* may need to alter this value if you change */
    	/* the system speed                           */
	/*--------------------------------------------*/

    UWORD count = 0;
    
       while (count < 1000000)

      {
		   count++;
      }	 
  
  
      /*-----------------------------------------------*/
      /* Spin here indefinitely if there was an error. */
      /*-----------------------------------------------*/

	if (RxGood == FALSE) 
 
       {
         while (1) 
      
            FlashEthled();	 /* spin here if error is flagged */
       } 	 



      /*-------------------------------------------------------*/
      /* Turn On Ethernet LED to indicate error-free reception */
      /*-------------------------------------------------------*/


      if (RxGood == TRUE)  
      { 
      	Ethled(ON);
      }
      
      while (1);  /*spin here after lighting LED*/


}  /* End Main */



/*---------------------------------------------------------------
* FUNCTION NAME: SI_TSAinit                                     
*                                                               
* DESCRIPTION:                                                  
*                                                               
*    This function initializes the Serial Interface, its Time   
*    Slot Assigner, and the necessary clocks and port pins for  
*    the interface.  Note that this function covers steps 1-7   
*    of the QMC Initialization Steps in the QMC Supplement.     
*    Steps 2 and 8 are not necessary for this example as we are 
*    not using PortB nor the shadow RAM.                        
*                                                               
* EXTERNAL EFFECTS: see above                                   
*                                                               
* PARAMETERS: none                                              
*                                                               
* RETURNS:  none                                                
*---------------------------------------------------------------*/

   
void SI_TSAinit()

{

   /*-------------------------------------------*/   
   /* Initialize the SI Mode Register (SIMODE). */
   /*-------------------------------------------*/
      
   IMMR->si_simode = 0x00000840;

   /*------------------------------------------------*/ 
   /* Initialize the SI Clock Route Register (SICR). */
   /*------------------------------------------------*/
      
   IMMR->si_sicr = 0x00004000;

   /*****************************/
   /* Configure Clocks and Pins */
   /*****************************/

	/*---------------------------------------------*/
	/*	Set brg3 to baud rate ~ 1.544 Mbps     */
	/*                                             */
	/* CD=$0F, EN=1, DIV16=0   25MHz/($F+1) = 1.56 */
	/*---------------------------------------------*/

   IMMR->brgc3 = 0x0001001E;

	/*-----------------------------*/
	/* Set up timer 4 for L1RSYNCA */
	/*-----------------------------*/

	IMMR->timer_tgcr &= 0x0FFF;  /* enable timer4, no cascade, frz disabled */
	IMMR->timer_tgcr |= 0x1000;  
	IMMR->timer_tmr4  = 0x002E;  /* no prescale, toggle out, TIN4 clock */
                                 /* FRR=1, no interrupts*/

	IMMR->timer_trr4  = 0x0060;  /* reset at 96 */

    /*----------------------------------------*/
    /* Configure PortA for TDMa functionality */
    /*----------------------------------------*/

    IMMR->pio_papar = 0x05C0;
	IMMR->pio_padir = 0x00CF0;

    /*----------------------------------------------*/
    /* Additional PortA configuration for clocking: */
    /* 14 set for input, 12 & 15 for output         */
    /*----------------------------------------------*/

    IMMR->pio_papar |= 0xD000;
    IMMR->pio_padir &= 0xBFFF;
    IMMR->pio_padir |= 0x9000;

    	/*--------------------------------*/
    	/* Configure Parallel I/O port C  */
	/*                                */
    	/* PC4 = L1RSYNCA, PC5 = L1TSYNCA */
	/*--------------------------------*/
   
    IMMR->pio_pcpar = 0x0C00;
    IMMR->pio_pcdir = 0;

    /*---------------------------------------------------------*/
    /* Program SI RAM to use SCC2 for all timeslots, Rx and Tx */
    /*---------------------------------------------------------*/

	IMMR->si_siram[0] = 0x00;
	IMMR->si_siram[1] = 0xbe;
	IMMR->si_siram[4] = 0x00;
    IMMR->si_siram[5] = 0x9f;
	IMMR->si_siram[0x100] = 0x00;
	IMMR->si_siram[0x101] = 0xbe;
	IMMR->si_siram[0x104] = 0x00;
    IMMR->si_siram[0x105] = 0x9f;

    /*--------------------------------------------*/
    /* Initialize SI Global Mode Register (SIGMR) */
    /*--------------------------------------------*/

    IMMR->si_sigmr=0x04;  /* enable TDMA */

} /* end SI_TSAinit */


/*------------------------------------------------------------------
* FUNCTION NAME: SCCinit                                           
*                                                                  
* DESCRIPTION:                                                     
*                                                                  
*    Performs general SCC mode initialization.  Note this function 
*    covers steps 9 and 10 in the QMC Initialization Steps in the  
*    QMC Supplement.                                               
*                                                                  
* EXTERNAL EFFECT: SCC2 placed in QMC mode                         
*                                                                  
* PARAMETERS: none                                                 
*                                                                  
* RETURNS: none                                                    
*------------------------------------------------------------------*/

void SCCinit()
{
 
    /*-----------------------------------------------------*/
    /* Initialize GSMR_H for normal operation:             */
    /*                                                     */
    /*	CDP, CTSP, CDS, CTSS bits set                      */		
    /*-----------------------------------------------------*/
		
    IMMR->scc_regs[SCC2_REG].scc_gsmr_h = 0x00000780;
    /*-----------------------------------------------------*/
    /* Initialize GSMR_L:  Place SCC in QMC mode           */               
    /*-----------------------------------------------------*/
																						
    IMMR->scc_regs[SCC2_REG].scc_gsmr_l = 0x0000000A;
   
} /* end SCCinit */


/*-------------------------------------------------------------
* FUNCTION NAME:  QMC_GlobalInit                              
*                                                             
* DESCRIPTION:                                                
*                                                             
*    This function initializes various registers in the QMC   
*    Global Parameters for SCC2.  It also initializes the     
*    QMC Time Slot Assignment table for SCC2 and related      
*    pointers.  Note that this function performs steps 11 and 
*    13-15.  Step 12 and other interrupt initialization       
*    related steps are found in InterruptInit.                
*                                                             
* EXTERNAL EFFECTS: see above                                 
*                                                             
* PARAMETERS: none                                            
*                                                             
* RETURNS: none                                               
*-------------------------------------------------------------*/

void QMC_GlobalInit()
{
    
    unsigned long *entry;

   /*----------------------------------------------*/
   /* Initialize registers in the QMC Global PRAM. */
   /*----------------------------------------------*/

   IMMR->PRAM[PAGE2].gqp.mcbase   = 0x40000;

   IMMR->PRAM[PAGE2].gqp.intbase  = 

   IMMR->PRAM[PAGE2].gqp.intptr   = (UWORD) &(IntCQ);

   /*IMMR->PRAM[PAGE2].gqp.mrblr    = BUFFER_SIZE;*/
   /*Note mrblr is a don't care in transparent QMC mode
     and must be set in the channel-specific PRAM*/

   IMMR->PRAM[PAGE2].gqp.grfthr   = 1;

   IMMR->PRAM[PAGE2].gqp.grfcnt   = 1;

   IMMR->PRAM[PAGE2].gqp.c_mask32 = 0xDEBB20E3;

   IMMR->PRAM[PAGE2].gqp.c_mask16 = 0xF0B8;

   IMMR->PRAM[PAGE2].gqp.qmcstate = 0x8000;

   /*------------------------------------------------------*/
   /* Initialize the QMC TSA for SCC2.                     */
   /* Note that this example uses common Rx and Tx tables. */
   /*------------------------------------------------------*/

   /* make logical channel 0 valid */
   IMMR->PRAM[PAGE2].gqp.tsatrx[0]=0xb03f;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久影院色老大| 国产精品亚洲第一区在线暖暖韩国 | 精品日韩欧美一区二区| 综合激情网...| 国产精品1024| 91精品一区二区三区在线观看| 国产精品久久久99| 国产剧情一区在线| 日韩一区二区电影| 性做久久久久久久免费看| 成人深夜福利app| 久久综合久久99| 日本不卡不码高清免费观看| 欧美午夜影院一区| 一区二区视频在线| 不卡的av电影在线观看| 国产偷v国产偷v亚洲高清| 精品一区二区在线免费观看| 91精品免费在线| 天堂av在线一区| 精品视频色一区| 亚洲激情在线播放| 91豆麻精品91久久久久久| 日韩一区欧美小说| 91一区二区在线| 亚洲人成精品久久久久久| 国产精品羞羞答答xxdd| 国产无人区一区二区三区| 国模一区二区三区白浆| 久久综合色婷婷| 国产乱色国产精品免费视频| 久久久噜噜噜久久人人看 | 亚洲自拍偷拍九九九| 91视频国产观看| 一区二区三区四区五区视频在线观看| 99在线精品免费| 亚洲精品视频在线| 欧美亚洲综合另类| 五月激情六月综合| 日韩免费看网站| 国产精品一区三区| 中文字幕一区二区5566日韩| 99久久精品国产精品久久| 亚洲精品va在线观看| 精品国产乱码久久久久久图片| 成人一区二区三区在线观看| 欧美午夜一区二区三区免费大片| 亚洲最新视频在线观看| 日本精品一区二区三区高清 | 国产酒店精品激情| 国产精品久久久久影视| 色天使久久综合网天天| 日本成人中文字幕| 欧美经典一区二区三区| 色视频成人在线观看免| 免费成人在线影院| 国产精品久99| 欧美高清激情brazzers| 国产老女人精品毛片久久| 亚洲人成网站色在线观看| 欧美一区二区啪啪| 国产高清久久久| 香蕉加勒比综合久久| 久久久99免费| 欧美理论在线播放| 国产福利不卡视频| 爽好久久久欧美精品| 中文字幕免费一区| 欧美一区二区视频在线观看2022| 国产成人免费在线视频| 亚洲一区自拍偷拍| 国产欧美一区二区三区在线老狼| 欧美色窝79yyyycom| 国产成人在线影院 | 欧美日韩dvd在线观看| 国产制服丝袜一区| 亚洲图片欧美一区| 国产精品美女一区二区三区| 欧美一区二区视频在线观看2022| av毛片久久久久**hd| 久久99精品一区二区三区三区| 亚洲欧美在线高清| 久久精品亚洲乱码伦伦中文| 9191久久久久久久久久久| 99久久99精品久久久久久| 国产在线播放一区三区四| 亚洲h动漫在线| 一区二区三区电影在线播| 欧美精品一区二区久久婷婷| 精品视频1区2区3区| 91日韩在线专区| 国产成人h网站| 韩日欧美一区二区三区| 日韩和欧美的一区| 亚洲高清视频的网址| 最新欧美精品一区二区三区| 国产日产精品一区| 欧美精品一区二区不卡 | 色系网站成人免费| www.成人在线| 国产大陆精品国产| 国产精品99久久久久久久女警 | 久久色视频免费观看| 欧美高清视频在线高清观看mv色露露十八| 95精品视频在线| 91在线观看一区二区| 成人短视频下载| 成人黄动漫网站免费app| 国产传媒一区在线| 懂色av一区二区夜夜嗨| 久久se精品一区精品二区| 久久精品99国产精品| 美女一区二区在线观看| 蜜桃视频在线一区| 久久精品国内一区二区三区| 精品一区在线看| 国产精品一区二区视频| 粉嫩蜜臀av国产精品网站| 成人污视频在线观看| 91在线视频观看| 欧美综合色免费| 在线播放91灌醉迷j高跟美女| 911精品产国品一二三产区| 日韩一级在线观看| 国产欧美一区二区精品婷婷| 国产精品视频你懂的| 日本一区二区三区电影| 国产精品美女久久久久久久网站| 综合久久一区二区三区| 亚洲最新视频在线观看| 日韩国产高清影视| 国产乱人伦偷精品视频不卡 | 日本久久一区二区三区| 欧美精品精品一区| 精品国产乱码久久久久久影片| 国产午夜精品在线观看| 亚洲欧美日韩国产综合在线| 午夜视频一区二区三区| 加勒比av一区二区| 色综合色狠狠天天综合色| 欧美精品少妇一区二区三区| 精品99999| 亚洲免费观看高清完整版在线观看| 亚洲综合视频网| 国产自产高清不卡| 在线观看亚洲精品视频| 久久综合色婷婷| 亚洲精品成人少妇| 国产在线视频一区二区三区| 91丨九色porny丨蝌蚪| 555夜色666亚洲国产免| 中文在线一区二区| 天堂成人国产精品一区| 成人av在线播放网站| 欧美精品黑人性xxxx| 成人免费在线视频| 久久9热精品视频| 在线精品视频小说1| 久久你懂得1024| 午夜精品福利一区二区三区蜜桃| 国产福利一区二区三区| 欧美一区二区日韩一区二区| 亚洲人妖av一区二区| 国产一区二区三区久久悠悠色av | 国产 欧美在线| 欧美一区二区性放荡片| 亚洲精品国产高清久久伦理二区| 91一区在线观看| 精品电影一区二区三区| 婷婷中文字幕综合| 9久草视频在线视频精品| 26uuu国产日韩综合| 图片区小说区国产精品视频| 91亚洲国产成人精品一区二区三 | 亚洲欧洲一区二区三区| 国产自产v一区二区三区c| 欧美区视频在线观看| 亚洲精品国产无套在线观| 国产99久久久久| 2023国产精品| 日本vs亚洲vs韩国一区三区| 欧美视频一区二区三区| 亚洲黄色片在线观看| 99久久亚洲一区二区三区青草| 国产亚洲欧美日韩俺去了| 蜜桃av一区二区三区| 91精品国产手机| 日一区二区三区| 在线播放中文一区| 亚洲一区电影777| 欧美图区在线视频| 亚洲制服丝袜一区| 色系网站成人免费| 一区二区三区在线观看网站| 97精品国产97久久久久久久久久久久| 日本一区二区三区电影| 成人动漫一区二区在线| 中文字幕中文字幕中文字幕亚洲无线| 成人美女在线观看| 国产欧美日韩视频在线观看|