📄 nested_ints_defs.h
字号:
/******************************************************************************
* COPYRIGHT (c) MOTOROLA 2003
* FILE NAME: nested_ints_defs.h
*
* PURPOSE: Nested interrupts library C file
*
*******************************************************************************
*******************************************************************************
** THIS CODE IS ONLY INTENDED AS AN EXAMPLE FOR THE METROWERKS COMPILER AND **
** THE HCS122 EVB AND HAS ONLY BEEN GIVEN A MIMIMUM LEVEL OF TEST. **
** IT IS PROVIDED 'AS SEEN' WITH NO GUARANTEES AND NO PROMISE OF SUPPORT. **
*******************************************************************************
*******************************************************************************
*
* DOCUMENTATION SOURCE: EKB Applications
*
* TARGET DEVICE: MC9S12DP256
*
* COMPILER: Metrowerks VERSION: HC12_V2.0
*
* DESCRIPTION: Library file for nested interrupts on HCS12
*
* AUTHOR: Daniel Malik LOCATION: EKB LAST EDIT DATE: 29/09/03
*
* UPDATE HISTORY
* REV AUTHOR DATE DESCRIPTION OF CHANGE
* --- ------ --------- ---------------------
* 1.0 D.Malik 29/09/03 file generation
*
******************************************************************************/
/*===========================================================================*/
/* Motorola reserves the right to make changes without further notice to any */
/* product herein to improve reliability, function, or design. Motorola does */
/* not assume any liability arising out of the application or use of any */
/* product, circuit, or software described herein; neither does it convey */
/* any license under its patent rights nor the rights of others. Motorola */
/* products are not designed, intended, or authorized for use as components */
/* in systems intended for surgical implant into the body, or other */
/* applications intended to support life, or for any other application in */
/* which the failure of the Motorola product could create a situation where */
/* personal injury or death may occur. Should Buyer purchase or use Motorola */
/* products for any such intended or unauthorized application, Buyer shall */
/* indemnify and hold Motorola and its officers, employees, subsidiaries, */
/* affiliates, and distributors harmless against all claims costs, damages, */
/* and expenses, and reasonable attorney fees arising out of, directly or */
/* indirectly, any claim of personal injury or death associated with such */
/* unintended or unauthorized use, even if such claim alleges that Motorola */
/* was negligent regarding the design or manufacture of the part. Motorola */
/* and the Motorola logo* are registered trademarks of Motorola Ltd. */
/*****************************************************************************/
/* provide definitions of the interrupt enable and disable functions: */
/* */
/* Interrupt definitions have form: INTnum_level ENABLE,DISABLE */
/* Where num & level are numbers and ENABLE & DISABLE are names of */
/* macros or functions */
/* */
/* Example: INT0_1 int0ena,int0dis */
/* */
/* - this defines interrupt number 0 */
/* - the interrupt service routine is defined to have interrupt nesting */
/* level of 1 */
/* - the interrupt source is disabled by macro/function int0dis & enabled by */
/* macro/function int0ena (macros/prototypes should be provided) */
/* */
/* Note: the interrupt number serves just for enumeration, it has no link to */
/* hardware interrupt number */
/* : For clarity & readability it is however advisable to define */
/* interrupts to have numbers which correspond with their hardware */
/* numbers */
/* */
/* provide definition of ENABLE_INTERRUPTS() macro/function */
/*****************************************************************************/
#define ENABLE_INTERRUPTS() asm(CLI)
#define INT8E() Timer.tie.bit.c0i = 1 /* enable low priority interrupt */
#define INT8D() Timer.tie.bit.c0i = 0 /* disable low priority interrupt */
#define INT9E() Timer.tie.bit.c1i = 1 /* enable medium priority interrupt */
#define INT9D() Timer.tie.bit.c1i = 0 /* disable medium priority interrupt */
#define INT10E() Timer.tie.bit.c2i = 1 /* enable high priority interrupt */
#define INT10D() Timer.tie.bit.c2i = 0 /* disable high priority interrupt */
#define INT8_1 INT8E,INT8D /* define interrupt #8 as level 1 priority, assign enable/disable macros */
#define INT9_2 INT9E,INT9D /* define interrupt #9 as level 2 priority, assign enable/disable macros */
#define INT10_3 INT10E,INT10D /* define interrupt #10 as level 3 priority, assign enable/disable macros */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -