dsp281x_xintrupt.c

来自「一个DSP2812的源代码」· C语言 代码 · 共 40 行

C
40
字号
//###########################################################################
//
// FILE:   DSP281x_XIntrupt.c
//
// TITLE:  DSP28 External Interrupt Initialization & Support Functions.
//
//###########################################################################
//
//  Ver | dd mmm yyyy | Who  | Description of changes
// =====|=============|======|===============================================
//  1.00| 11 Sep 2003 | L.H. | No change since previous version (v.58 Alpha)
//###########################################################################

#include "DSP281x_Device.h"     // DSP281x Headerfile Include File
#include "DSP281x_Examples.h"   // DSP281x Examples Include File

//---------------------------------------------------------------------------
// InitXIntrupt: 
//---------------------------------------------------------------------------
// This function initializes external interrupts to a known state.
//
void InitXIntrupt(void)
{
 //xint1  INTERrupt  seting
  XIntruptRegs.XINT1CR.bit.ENABLE = 1;
  XIntruptRegs.XINT1CR.bit.POLARITY = 1;//low-to-high transition
//XINT2  INTERRUPT  SET
  XIntruptRegs.XINT2CR.bit.ENABLE = 1;
  XIntruptRegs.XINT2CR.bit.POLARITY = 0;//high-to-low transition
//XNMI_XINT13 INTERRUPT SET
  XIntruptRegs.XNMICR.bit.ENABLE = 0;   //NMI disenable
  XIntruptRegs.XNMICR.bit.POLARITY = 0;//high-to-low transition
  XIntruptRegs.XNMICR.bit.SELECT = 1;//XNMI_XINT13 connected To INT13

}

//===========================================================================
// No more.
//===========================================================================

⌨️ 快捷键说明

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