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

📄 nvic.h

📁 最新版IAR FOR ARM(EWARM)5.11中的代码例子
💻 H
字号:
/*************************************************************************
 *
 *    Used with ICCARM and AARM.
 *
 *    (c) Copyright IAR Systems 2006
 *
 *    File name   : nvic.h
 *    Description : Prototypes for the NVIC Interrupt Controller Driver
 *
 *    History :
 *    1. Data        :
 *       Author      : Stanimir Bonev
 *       Description : 28, April 2006
 *
 *
 *    $Revision: 20136 $
 **************************************************************************/
#ifndef __NVIC_H
#include <Luminary/iolm3s102.h>
#include "cortex_m3_comm.h"

#define ROM_VEC_TABLE			// Use ROM vector table

#define MAX_VEC_NUMB			NVIC_FLASH_CTRL

typedef enum {
	NVIC_Pass = 0, NVIC_Fault = -1
} NVIC_Status_t;

typedef enum {
	PrioGroup7_1 = 0, PrioGroup6_2, PrioGroup5_3, PrioGroup4_4,
	PrioGroup3_5, PrioGroup2_6, PrioGroup1_7, PrioGroup0_8
} PriorityGroup_t;

#define NVIC_VECTKEY_WR	0x05FA0000
#define NVIC_VECTKEY_RD	0xFA050000

#ifdef ROM_VEC_TABLE
#define SET_INTR_HANDLER(Func,Ind) \
__root const unsigned long Func ## _vec @ (4*Ind) = (unsigned long)&Func
#endif

/*************************************************************************
 * Function Name: NVIC_Init
 * Parameters: PriorityGroup_t PriorityGroup
 *
 * Return: none
 *
 * Description: Initialize NVIC
 *
 *************************************************************************/
void NVIC_Init (PriorityGroup_t PriorityGroup);

/*************************************************************************
 * Function Name: NVIC_IntrRegister
 * Parameters: VoidFpnt_t Fpnt, Int8U IntrLine, Int8U Priority
 *
 * Return: VoidFpnt_t
 *
 * Description: Register the handler and set priority of
 * the interrupt
 *
 *************************************************************************/
VoidFpnt_t NVIC_IntrRegister (VoidFpnt_t Fpnt, Int8U IntrLine,
                              Int8U Priority);

/*************************************************************************
 * Function Name: NVIC_IntrEnable
 * Parameters: Int8U IntrLine
 *
 * Return: NVIC_Status_t
 *
 * Description: Enable an interrupt
 *
 *************************************************************************/
NVIC_Status_t NVIC_IntrEnable (Int8U IntrLine);

/*************************************************************************
 * Function Name: NVIC_IntrDisable
 * Parameters: Int8U IntrLine
 *
 * Return: NVIC_Status_t
 *
 * Description: Disable an interrupt
 *
 *************************************************************************/
NVIC_Status_t NVIC_IntrDisable (Int8U IntrLine);


#endif // __NVIC_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -