/****************************************Copyright (c)************************************************** ** Guangzhou ZHIYUAN electronics Co.,LTD. ** http://www.zyinside.com ** **--------------File Info------------------------------------------------------------------------------- ** File name: target.h ** Last modified Date: 2006-02-22 ** Last Version: 1.0 ** Descriptions: header file of the specific codes for LPC2200 target boards ** Every project should include a copy of this file, user may modify it as needed **------------------------------------------------------------------------------------------------------ ** Modified by: ** Modified date: ** Version: ** Descriptions: ** ********************************************************************************************************/ #ifndef __TARGET_H #define __TARGET_H #ifdef __cplusplus extern "C" { #endif extern void TargetInit(uint32 vpbdiv, uint32 pllcfg, uint32 mamtim); /********************************************************************************************************* ** Function name: TargetInit ** ** Descriptions: config VPBDIV, PLLCFG and MAMTIM ** ** input parameters: vpbdiv pllcfg and mamtim ** Returned value: None ** ********************************************************************************************************/ extern void SetISR(unsigned int Channel, unsigned int PRI, unsigned int Function); /********************************************************************************************************* ** Function name: SetISR ** ** Descriptions: Initialize the target board; it is called in a necessary place, change it as ** needed ** ** input parameters: None ** Returned value: None ********************************************************************************************************/ int __swi(0xaa) SwiHandle(int,unsigned int); /********************************************************************************************************* ** 函数名称: IRQSave ** 功能描述: 全局禁止IRQ中断的同时返回IRQ的状态 ** IRQRestore()配对使用 ** 输 入: 无 ** 输 出: 无 ********************************************************************************************************/ __inline unsigned int IRQSave(void) { return SwiHandle(0x00,0); } /********************************************************************************************************* ** 函数名称: IRQRestore ** 功能描述: 与IRQFIQSaveSave()配对使用,恢复全局FIQ状态 ** 输 入: psr:IRQSave()返回的值 ** 输 出: 无 ********************************************************************************************************/ __inline void IRQRestore(unsigned int psr) { SwiHandle(0x02, psr); } /********************************************************************************************************* ** 函数名称: FIQSave ** 功能描述: 全局禁止FIQ中断的同时返回FIQ的状态 ** FIQRestore()配对使用 ** 输 入: 无 ** 输 出: 无 ********************************************************************************************************/ __inline unsigned int FIQSave(void) { return SwiHandle(0x01,0); } /********************************************************************************************************* ** 函数名称: FIQRestore ** 功能描述: 与IRQFIQSaveSave()配对使用,恢复全局FIQ状态 ** 输 入: psr:FIQSave()返回的值 ** 输 出: 无 ********************************************************************************************************/ __inline void FIQRestore(unsigned int psr) { SwiHandle(0x02, psr); } #define IRQDisable() IRQSave() /* 禁止IRQ中断 */ #define FIQDisable() FIQSave() /* 禁止FIQ中断 */ #define IRQEnable() IRQRestore(IRQSave() & ~(0x80)) /* 允许IRQ中断 */ #define FIQEnable() IRQRestore(FIQSave() & ~(0x40)) /* 允许FIQ中断 */ #ifdef __cplusplus } #endif #endif /********************************************************************************************************* ** End Of File ********************************************************************************************************/