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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? cpu.c

?? 基于freescale MC9S12XF512 MCU
?? C
字號(hào):
/*******************************************************************************/
/**
Copyright (c) 2007 Freescale Semiconductor
Freescale Confidential Proprietary
\file       Cpu.c
\brief      S12XF512 CPU initialization, bus clock @40MHz
            and interrupts configuration routines
\author     Freescale Semiconductor
\author     Guadalajara Applications Laboratory RTAC Americas
\author     Jaime Orozco
\version    1.1
\date       March/12/2007
*/
/*******************************************************************************/
/*                                                                             */
/* All software, source code, included documentation, and any implied know-how */
/* are property of Freescale Semiconductor and therefore considered            */ 
/* CONFIDENTIAL INFORMATION.                                                   */
/*                                                                             */
/* This confidential information is disclosed FOR DEMONSTRATION PURPOSES ONLY. */
/*                                                                             */
/* All Confidential Information remains the property of Freescale Semiconductor*/
/* and will not be copied or reproduced without the express written permission */
/* of the Discloser, except for copies that are absolutely necessary in order  */
/* to fulfill the Purpose.                                                     */
/*                                                                             */
/* Services performed by FREESCALE in this matter are performed AS IS and      */
/* without any warranty. CUSTOMER retains the final decision relative to the   */
/* total design and functionality of the end product.                          */
/*                                                                             */
/* FREESCALE neither guarantees nor will be held liable by CUSTOMER for the    */
/* success of this project.                                                    */
/*                                                                             */
/* FREESCALE disclaims all warranties, express, implied or statutory including,*/
/* but not limited to, implied warranty of merchantability or fitness for a    */
/* particular purpose on any hardware, software or advise supplied to the      */
/* project by FREESCALE, and or any product resulting from FREESCALE services. */
/*                                                                             */
/* In no event shall FREESCALE be liable for incidental or consequential       */
/* damages arising out of this agreement. CUSTOMER agrees to hold FREESCALE    */
/* harmless against any and all claims demands or actions by anyone on account */
/* of any damage,or injury, whether commercial, contractual, or tortuous,      */
/* rising directly or indirectly as a result of the advise or assistance       */
/* supplied CUSTOMER in connection with product, services or goods supplied    */
/* under this Agreement.                                                       */
/*                                                                             */
/*******************************************************************************/

/** S12X derivative information */ 
#include "M9S12XF512.h"  

/** Common defines and macros */
#include <hidef.h>   

/** Variable types and common definitions */
#include "typedefs.h"   

/** XGATE definitions */
#include "xgate.h"


/*******************************************************************************/
/**
* \brief    PLL initialization, Bus Clock @ 40MHz
* \author   Jaime Orozco
* \param    void
* \return   void
*/
void vfnClock_Settings(void)
{    
    /* Bus Clock = OSCCLK * (SYNR+1) / ((REFDV+1)(2*POSTDIV))    */
    /*     40MHz =  4MHz  * (9+1) / (1)                          */
    PLLCTL_PLLON = 0;       /* Disable the PLL */
    SYNR_SYN = 0x09;        /* Set PLL synthesizer register to 9 */
    REFDV_REFDV = 0x00;     /* Set PLL divider register to 0 */
    
    /* Fvco = 2*OSCCLK*(SYNR+1)/(REFDV+1) = 8MHz* 10/1 = 80MHz   */
    /*                                    -> VCOFRQ = 01b        */        
    SYNR_VCOFRQ1 = 0;
    SYNR_VCOFRQ0 = 1;
        
    /* Fref = OSCCLK/(REFDV+1) = 4MHz/1 = 4MHz -> REFRQ= 01b     */    
    REFDV_REFFRQ1 = 0;
    REFDV_REFFRQ0 = 1;
    
    PLLCTL_PLLON = 1;   /* PLL enabled */
    
        while(!CRGFLG_LOCK)
            ;       /* Wait until the PLL is within the desired frequency */
                
    CLKSEL_PLLSEL = 1;    /* Select clock source from PLL */      
}


/*******************************************************************************/
/**
* \brief    FlexRay IPLL initialization @ 80MHz
* \author   Jaime Orozco
* \param    void
* \return   void
*/
void vfnIPLL_Startup(void)
{
    /* Fvco = 2*OSCCLK*(SYNR+1)/(REFDV+1) = 8MHz*(9+1)/1 = 80MHz -> VCOFRQ = 01b */
    CGMSYN_SYN = 0x09;     
    CGMREF_REFDIV = 0x00;
    
    CGMSYN_VCOFRQ1 = 0;
    CGMSYN_VCOFRQ0 = 1;
    
    /* Fref = OSCCLK/(REFDIV+1) = 4MHz/1 = 4MHz -> REFFRQ = 01b  */ 
    CGMREF_REFFRQ1 = 0;
    CGMREF_REFFRQ0 = 1;

    CGMCTL_DIV2 = 0;    /* DIV2=0 -> IPLL = Fvco  */ 

    CGMCTL_PLLON=1;     /* IPLL enabled */

        while(!CGMFLG_LOCK)
            ;       /* Wait until the PLL is within the desired frequency */
}

/*******************************************************************************/
/**
* \brief    CPU, XGATE, memory and ports settings
* \author   Jaime Orozco
* \param    void
* \return   void
*/
void vfnPeripheral_Settings(void)
{  
    /* Initialize the XGATE vector block and the XGVBR register */    
    XGVBR= (unsigned int)(void*__far)(XGATE_VectorTable - XGATE_VECTOR_OFFSET);    
    XGMCTL= 0xFBC1;     /* Enable XGATE mode and interrupts */
    
    /* FlexRay module access all memory */
    RAMFRL = 0x00;
    RAMFRU = 0xFF;
    
    /* COP module configuration */
    COPCTL = 0x00;              /* COP disable */ 
    
    MMCCTL1 = 1;    /* Enables Flash in the memory map */                  
    DIRECT = 0;     /* Default location for direct page */              
    IVBR = 0xFF;    /* Default vector base address */    
   
    /* Unused ports are configured as outputs set to zero */
    PORTA = 0;      /* Port A */
    DDRA = 0xFF;    
    PORTB = 0;      /* Port B */
    DDRB = 0xFF;    
    PORTC = 0;      /* Port C */
    DDRC = 0xFF;    
    PORTD = 0;      /* Port D */
    DDRC = 0xFF;
    PORTK = 0;      /* Port K  */
    DDRK= 0xFF;     
    RDRIV = 0xFF;   /* Reduced drive on ports A, B, C, D, E, K. */        
    
    
    /* Port E as input with pull-ups enabled */
    DDRE = 0;       
    PUCR_PUPEE = 1;            
        
        
    /* Port T low nibble used for general purpose LEDs D26 to D29 */     
    PTT = 0x0F;         /* Initial output state */     
    RDRT = 0xFF;        /* Reduced drive */
    DDRT = 0x7F;        /* PT7 as input, remaining pins are outputs */      
    PPST_PPST7 = 0;     /* Pull-up enabled for input pin PT7 */
    PERT_PERT7 = 1; 
    
    
    /* Port S outputs cleared, the signals assigned to SPI0 */
    /* are configured when enabling the SPI0 module */
    PTS = 0;        
    DDRS = 0xFF;    
    RDRS = 0xFF;  
         
         
    /* Unused ports are configured as outputs set to zero and reduced drive */    
    PTP = 0;        /* Port P */
    DDRP = 0xFF;
    RDRP = 0xFF; 
    
    
    /* Port H outputs 3 and 7 are used to enable FlexRay Transceivers TJA1080 */ 
    /* the other pins are configured by the FlexRay module */               
    DDRH_DDRH3 = 1;    
    DDRH_DDRH7 = 1;    
    RDRH = 0xFF;     /* Reduced drive */        
    PERH = 0;        /* Pull devices disabled */
    PTH = 0x88;      /* FlexRay Transceivers enabled */
    
    
    /* Port J inputs 5 and 6 receive signals from FlexRay transceivers */
    PTJ = 0;
    DDRJ_DDRJ5 = 0;    
    DDRJ_DDRJ6 = 0;     
    PERJ = 0;        /* Pull devices disabled */ 
      
                        
    /* Port AD0 unused, outputs set to zero */      
    PT0AD = 0;           
    RDR0AD = 0xFF;  
    DDR0AD = 0xFF;   
    
    
    /* PortAD1 used for general purpose LEDs D22 to D25 */ 
    PT1AD = 0x0F;   /* Initial output state */ 
    RDR1AD = 0xFF;  /* Reduced drive */
    DDR1AD = 0xFF;  /* Port AD as output */ 
}


/*******************************************************************************/
/**
* \brief    Interrupts configuration
* \author   Jaime Orozco
* \param    void
* \return   void
*/
void vfnInterrupts_Init(void)
{
    /* Access to configuration data registers for interrupts */ 
    INT_CFADDR = 0xF0;  /* Vectors from 0xFFF0 to 0xFFF8 */  
    INT_CFDATA0 = 0x06; /* Real Time Interrupt, priority 6 */    
    
    INT_CFADDR = 0xE0;  /* Vectors from 0xFFE0 to 0xFFE8 */
    INT_CFDATA0 = 0x84; /* Input Capture channel 7 assigned to XGATE, priority 4 */
    
    INT_CFADDR = 0x70;  /* Vectors from 0xFF70 to 0xFF78 */
    INT_CFDATA1 = 0x84; /* Software trigger 0 for XGATE, priority 4 */
        
    TIOS_IOS7 = 0;      /* Channel 7 configured as input capture */    
    TCTL3_EDG7B = 1;    /* Channel 7 input capture enabled in falling edges */    
    TCTL3_EDG7A = 0;                             
    
    ICSYS = 0;          /* Input capture channels in normal mode */
    PACTL = 0;          /* Pulse acumulator disabled */                                      
                                
    RTICTL_RTDEC = 1;   /* Real time interrupt decimal divider */                                                                      
    RTICTL_RTR = 0x55;  /* Divider = 300x10^3; RTI period=300k/4MHz = 75 ms */  
                        
    TSCR2 = 4;          /* Set timer prescaler to 16 */
  
    TFLG1_C7F = 1;      /* Clear input capture 7 interrupt request flag */
    TIE_C7I = 1;        /* Interrupt enabled for Timer channel 7 */
        
    XIRQ_ENABLE();      /* Enable XIRQ */   
    
    CRGFLG_RTIF = 1;    /* Clear real time interrupt flag */    
    CRGINT_RTIE = 1;    /* Enable real time interrupt */    
    TSCR1_TEN = 1;      /* Timer enable */
}

/*******************************************************************************/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品毛片久久久久久久| 国产一区二区免费视频| 蜜桃视频免费观看一区| av不卡在线观看| 精品久久久久av影院| 婷婷久久综合九色综合绿巨人 | 亚洲h动漫在线| 成人av网址在线| 久久亚洲一区二区三区明星换脸 | 日韩三级在线观看| 亚洲午夜国产一区99re久久| 国产.精品.日韩.另类.中文.在线.播放 | 中文字幕高清不卡| 国产一区二区三区免费看| 欧美高清激情brazzers| 亚洲精品国产视频| 97久久精品人人做人人爽50路| 久久影视一区二区| 七七婷婷婷婷精品国产| 欧美日韩国产一二三| 一区二区三区在线视频观看| 成人深夜在线观看| 中文字幕国产一区二区| 粉嫩一区二区三区性色av| 久久久久久久久岛国免费| 久久国产精品99久久人人澡| 在线不卡欧美精品一区二区三区| 亚洲国产一二三| 在线精品观看国产| 亚洲综合精品久久| 欧美三级日本三级少妇99| 亚洲激情中文1区| 在线视频一区二区三| 亚洲一级二级三级在线免费观看| 91在线视频免费观看| 亚洲日本va午夜在线电影| www.成人网.com| 亚洲精品中文在线影院| 91极品视觉盛宴| 亚洲国产成人av| 日韩欧美国产综合一区| 久久精品国产秦先生| 久久午夜色播影院免费高清| 国产91精品一区二区| 一区免费观看视频| 欧美日韩一区二区三区视频| 日本不卡一二三| 精品免费日韩av| 成人av免费在线观看| 亚洲三级在线播放| 欧美久久久久免费| 国内外成人在线| 一区在线中文字幕| 欧美高清精品3d| 国产盗摄精品一区二区三区在线| 国产精品乱码一区二区三区软件| 91无套直看片红桃| 伦理电影国产精品| 自拍偷在线精品自拍偷无码专区| 欧美中文字幕一区二区三区 | 日韩女优av电影在线观看| 国产中文字幕精品| 亚洲欧洲制服丝袜| 日韩亚洲欧美一区| 99这里只有久久精品视频| 午夜不卡av免费| 亚洲国产成人自拍| 欧美放荡的少妇| 成人av网站在线| 免费成人在线视频观看| 国产精品免费视频观看| 欧美一区二区美女| 一本大道久久a久久精二百| 日韩av一区二区三区四区| 国产色婷婷亚洲99精品小说| 欧美日韩一区成人| av影院午夜一区| 激情五月激情综合网| 亚洲图片欧美色图| 国产精品免费免费| 日韩精品最新网址| 欧美美女视频在线观看| 成人高清免费在线播放| 日韩在线播放一区二区| 1区2区3区精品视频| 精品国产青草久久久久福利| 欧美性一级生活| 91玉足脚交白嫩脚丫在线播放| 久草中文综合在线| 日本aⅴ亚洲精品中文乱码| 亚洲人成网站影音先锋播放| 精品国产一区二区三区av性色| 欧美色偷偷大香| jizz一区二区| 一本一道久久a久久精品 | 日本高清不卡一区| 成人永久看片免费视频天堂| 激情综合色播激情啊| 日韩电影在线免费看| 一区二区三区成人| 亚洲精品国产无套在线观| 中文字幕精品综合| 国产精品免费人成网站| 欧美国产欧美亚州国产日韩mv天天看完整| 欧美一卡二卡三卡| 91精品国产一区二区三区蜜臀| 欧美日韩中文精品| 在线影院国内精品| 在线观看日韩毛片| 欧美无砖砖区免费| 欧美久久久久久蜜桃| 欧美年轻男男videosbes| 欧美影院一区二区| 欧美另类久久久品| 欧美一区二区三区在线视频 | 欧美影视一区二区三区| 欧美亚日韩国产aⅴ精品中极品| 在线免费观看视频一区| 欧美在线视频你懂得| 欧美日韩一级二级三级| 制服.丝袜.亚洲.另类.中文| 欧美日韩成人综合天天影院 | 亚洲免费观看高清| 亚洲欧美日韩人成在线播放| 亚洲精品乱码久久久久久久久| 亚洲一二三级电影| 日韩—二三区免费观看av| 久久99久久99| 国产99久久久久久免费看农村| 成人高清免费观看| 日本福利一区二区| 欧美精品视频www在线观看| 在线电影欧美成精品| 国产性做久久久久久| 亚洲免费观看高清完整版在线| 亚洲五码中文字幕| 国产在线观看一区二区| 波多野结衣亚洲| 欧美三日本三级三级在线播放| 欧美一级在线视频| 中文字幕第一区二区| 亚洲一区二区在线视频| 久久爱另类一区二区小说| 91香蕉视频mp4| 91精品视频网| 国产精品久久久久一区| 日日摸夜夜添夜夜添精品视频| 精品无人码麻豆乱码1区2区 | www.欧美精品一二区| 欧美日韩第一区日日骚| 国产亚洲精品aa| 亚洲午夜久久久久中文字幕久| 精品一区二区国语对白| 日本乱人伦aⅴ精品| 日韩精品中文字幕在线一区| 亚洲三级电影全部在线观看高清| 日本不卡的三区四区五区| 国产成人自拍网| 91精品国产麻豆| 亚洲猫色日本管| 狠狠色狠狠色综合日日91app| 在线区一区二视频| 国产日韩av一区| 丝袜诱惑制服诱惑色一区在线观看 | 国产精品私人影院| 日本中文在线一区| 色视频一区二区| 国产网站一区二区| 奇米影视一区二区三区小说| 91久久精品一区二区| 国产欧美一区二区精品久导航 | 青椒成人免费视频| 91免费精品国自产拍在线不卡| 26uuu成人网一区二区三区| 日韩制服丝袜av| 欧美性做爰猛烈叫床潮| 亚洲欧美日韩系列| 成人一区二区三区中文字幕| 日韩精品中午字幕| 蜜臀久久99精品久久久久宅男| 欧美日韩中文字幕一区| 樱桃视频在线观看一区| 91丨porny丨户外露出| 国产精品私人自拍| 丁香啪啪综合成人亚洲小说 | 99精品久久只有精品| 国产亚洲一本大道中文在线| 美女mm1313爽爽久久久蜜臀| 精品视频一区 二区 三区| 一区二区三区四区蜜桃| 91麻豆swag| 一区二区三区精品久久久| 日本高清成人免费播放| 亚洲精品视频在线看| 欧美在线免费观看视频| 亚洲一级二级在线| 欧美丰满嫩嫩电影| 蜜臀久久久99精品久久久久久| 日韩一级高清毛片| 久久国产精品色婷婷|