×

MPC89_Interrupt中斷程序

消耗积分:1 | 格式:rar | 大小:31KB | 2017-07-14

陳米樂

分享资料个

megawin 中斷程序

  ///////////////////////////////////////////////////

  //

  // FILE: MPC89_Interrupt_Demo.c

  // AUTHOR: Neo (Hsin-Chih Lin)

  // COPYRIGHT: (c) Megawin Technology Co., Ltd.

  // CREATED: 2008.4.17

  // PURPOSE: Demo Interrupt config

  //

  ///////////////////////////////////////////////////

  //#define MPC82x54//and MPC82x52

  //#define MPC82G516

  //if not define either is MPC89 series

  #ifdef MPC82x54

  #include “REG_MPC82L54.H”

  #else

  #ifdef MPC82G516

  #include “REG_MPC82G516.H”

  #else

  #include “REG_MPC89L51-515.H”

  #endif

  #endif

  ///////////////////////////////////////////////////

  //

  // Function:Init_IRQ()

  // Description:

  // Initial interrupt setting

  //

  ///////////////////////////////////////////////////

  void Init_IRQ()

  {

  EA = 0x01; //Enable All Interrupt

  EX0 = 0x01; //Enable External Interrupt 0

  ET0 = 0x01; //Enable Timer Interrupt 0

  EX1 = 0x01; //Enable External Interrupt 1

  ET1 = 0x01; //Enable Timer Interrupt 1

  ES = 0x01; //Enable Serial Interrupt

  #ifdef MPC82x54

  ESPIADC = 0x01; //Enable SPI and ADC Interrupt

  EPCALVD = 0x01; //Enable PCA and LVD Interrupt

  #else

  ET2 = 0x01; //Enable Timer Interrupt 2

  EX2 = 0x01; //Enable External Interrupt 2

  EX3 = 0x01; //Enable External Interrupt 3

  #endif

  #ifdef MPC82G516

  AUXIE |= 0x01; //Enable SPI Interrupt

  AUXIE |= 0x02; //Enable ADC Interrupt

  AUXIE |= 0x04; //Enable PCA Interrupt

  AUXIE |= 0x08; //Enable LVI Interrupt

  AUXIE |= 0x10; //Enable UART 2 Interrupt

  AUXIE |= 0x20; //Enable KBI Interrupt
MPC89_Interrupt中斷程序

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(1)
发评论
EALAN 2017-07-27
0 回复 举报
谢啦 收起回复

下载排行榜

全部1条评论

快来发表一下你的评论吧 !