⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 target.h

📁 程序都是在Keil早期的版本(安装文件为rvmdk300a)下开发调试的
💻 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);
__swi(0xaa) unsigned int SwiHandle1(int, int);

/*********************************************************************************************************
** 函数名称: IRQSave
** 功能描述: 全局禁止IRQ中断的同时返回IRQ的状态
**           IRQRestore()配对使用
** 输 入: 无
** 输 出: 无
********************************************************************************************************/
__inline unsigned int IRQSave(void)
{
    return SwiHandle(0x00);
}

/*********************************************************************************************************
** 函数名称: IRQRestore
** 功能描述: 与IRQFIQSaveSave()配对使用,恢复全局FIQ状态
** 输 入: psr:IRQSave()返回的值
** 输 出: 无
********************************************************************************************************/
__inline void IRQRestore(unsigned int psr)
{
    SwiHandle1(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)
{
    SwiHandle1(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 + -