?? int.c
字號:
//****************************************************************************
// @Module Interrupt Controller (INT)
// @Filename INT.C
// @Project T12_T13_AD_PEC.dav
//----------------------------------------------------------------------------
// @Controller Infineon XC164CM-8F40
//
// @Compiler Keil
//
// @Codegenerator 0.2
//
// @Description This file contains functions that use the INT module.
//
//----------------------------------------------------------------------------
// @Date 2006-7-8 23:19:36
//
//****************************************************************************
// USER CODE BEGIN (INT_General,1)
// USER CODE END
//****************************************************************************
// @Project Includes
//****************************************************************************
#include "MAIN.H"
// USER CODE BEGIN (INT_General,2)
// USER CODE END
//****************************************************************************
// @Macros
//****************************************************************************
// USER CODE BEGIN (INT_General,3)
// USER CODE END
//****************************************************************************
// @Defines
//****************************************************************************
// USER CODE BEGIN (INT_General,4)
// USER CODE END
//****************************************************************************
// @Typedefs
//****************************************************************************
// USER CODE BEGIN (INT_General,5)
// USER CODE END
//****************************************************************************
// @Imported Global Variables
//****************************************************************************
// USER CODE BEGIN (INT_General,6)
extern unsigned int ADC_Result[10];
// USER CODE END
//****************************************************************************
// @Global Variables
//****************************************************************************
// USER CODE BEGIN (INT_General,7)
// USER CODE END
//****************************************************************************
// @External Prototypes
//****************************************************************************
// USER CODE BEGIN (INT_General,8)
// USER CODE END
//****************************************************************************
// @Prototypes Of Local Functions
//****************************************************************************
// USER CODE BEGIN (INT_General,9)
// USER CODE END
//****************************************************************************
// @Function void INT_vInit(void)
//
//----------------------------------------------------------------------------
// @Description This is the initialization function of the INT function
// library. It is assumed that the SFRs used by this library
// are in reset state.
//
//----------------------------------------------------------------------------
// @Returnvalue None
//
//----------------------------------------------------------------------------
// @Parameters None
//
//----------------------------------------------------------------------------
// @Date 2006-7-8
//
//****************************************************************************
// USER CODE BEGIN (Init,1)
// USER CODE END
void INT_vInit(void)
{
// USER CODE BEGIN (Init,2)
// USER CODE END
MAIN_vUnlockProtecReg(); // unlock EXISEL0
EXISEL0 = 0x0000; // load the external Interrupt select
// register 0
MAIN_vUnlockProtecReg(); // unlock EXISEL1
EXISEL1 = 0x0000; // load the external Interrupt select
// register 1
MAIN_vUnlockProtecReg(); // unlock EXICON
EXICON = 0x0000; // load the external Interrupt control
// register
PECISNC = 0x0000; // clear PEC interrupt sub node control
// register
PECISNC = 0x0010; // load PEC interrupt sub node control
// register
/// -----------------------------------------------------------------------
/// Configuration of the used INT Port Pins:
/// -----------------------------------------------------------------------
/// -----------------------------------------------------------------------
/// Configuration of the used INT Interrupts:
/// -----------------------------------------------------------------------
/// EOP service request node configuration:
/// - EOP interrupt priority level (ILVL) = 11
/// - EOP interrupt group level (GLVL) = 1
/// - EOP group priority extension (GPX) = 0
EOPIC = 0x006D;
// USER CODE BEGIN (INT_Function,3)
// USER CODE END
} // End of function INT_vInit
//****************************************************************************
// @Function void INT_viEOP(void)
//
//----------------------------------------------------------------------------
// @Description This is the interrupt service routine for the End of PEC
// interrupt. It is called when the configured PEC channel
// counter decrements from 0x01 to 0x00.
// Please note that you have to add application specific code
// to this function.
//
//----------------------------------------------------------------------------
// @Returnvalue None
//
//----------------------------------------------------------------------------
// @Parameters None
//
//----------------------------------------------------------------------------
// @Date 2006-7-8
//
//****************************************************************************
// USER CODE BEGIN (EOP,1)
// USER CODE END
void INT_viEOP(void) interrupt EOPINT
{
// USER CODE BEGIN (EOP,2)
// USER CODE END
if(PECISNC_C2IR) // end of PEC channel 2
{
PECISNC_C2IR = 0;
// USER CODE BEGIN (EOP,5)
PECC2 = 0x520A; // load PECC2 control register
DSTP2 = _sof_(ADC_Result); //set destination pointer
// USER CODE END
}
} // End of function INT_viEOP
// USER CODE BEGIN (INT_General,10)
// USER CODE END
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -