?? target.h
字號:
/****************************************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
********************************************************************************************************/
__swi(0xaa) unsigned int SwiHandle(int, ...);
/*********************************************************************************************************
** 函數名稱: IRQSave
** 功能描述: 全局禁止IRQ中斷的同時返回IRQ的狀態
** IRQRestore()配對使用
** 輸 入: 無
** 輸 出: 無
********************************************************************************************************/
__inline unsigned int IRQSave(void)
{
return SwiHandle(0x00);
}
/*********************************************************************************************************
** 函數名稱: 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);
}
/*********************************************************************************************************
** 函數名稱: 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
********************************************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -