Nut/OS  5.0.5
API Reference
cortex_interrupt.h
Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // cortex_interrupt.h - Prototypes for the NVIC Interrupt Controller Driver.
00004 //
00005 //*****************************************************************************
00006 
00007 #ifndef __INTERRUPT_H__
00008 #define __INTERRUPT_H__
00009 
00010 #if defined(SAM3U)
00011 #define NUM_INTERRUPTS       48
00012 #endif
00013 #if defined(MCU_STM32)
00014 #define NUM_INTERRUPTS      121
00015 #endif
00016 #if defined(MCU_LPC176x)
00017 #define NUM_INTERRUPTS       35
00018 #endif
00019 #if defined(MCU_LPC177x_8x)
00020 #define NUM_INTERRUPTS       41
00021 #endif
00022 
00023 //*****************************************************************************
00024 //
00025 // The following are defines for the total number of priority levels.
00026 //
00027 //*****************************************************************************
00028 #define NUM_PRIORITY            8
00029 #define NUM_PRIORITY_BITS       3
00030 #ifdef __cplusplus
00031 extern "C"
00032 {
00033 #endif
00034 
00035 
00036 //*****************************************************************************
00037 //
00038 // Macro to generate an interrupt priority mask based on the number of bits
00039 // of priority supported by the hardware.
00040 //
00041 //*****************************************************************************
00042 #define INT_PRIORITY_MASK       ((0xFF << (8 - NUM_PRIORITY_BITS)) & 0xFF)
00043 
00044 //*****************************************************************************
00045 //
00046 // Prototypes for the APIs.
00047 //
00048 //*****************************************************************************
00049 extern unsigned long CPUcpsid(void);
00050 extern unsigned long CPUcpsie(void);
00051 
00052 extern unsigned char IntMasterEnable(void);
00053 extern unsigned char IntMasterDisable(void);
00054 
00055 extern void IntRegister(IRQn_Type ulInterrupt, void (*pfnHandler)(void*));
00056 extern void IntUnregister(IRQn_Type ulInterrupt);
00057 
00058 /*extern void IntPriorityGroupingSet(unsigned long ulBits);
00059 extern unsigned long IntPriorityGroupingGet(void);*/
00060 extern void IntPrioritySet(IRQn_Type Interrupt, uint32_t Priority);
00061 extern uint32_t IntPriorityGet(IRQn_Type ulInterrupt);
00062 
00063 extern void IntEnable(IRQn_Type ulInterrupt);
00064 extern void IntDisable(IRQn_Type ulInterrupt);
00065 extern int IntIsEnabled(IRQn_Type ulInterrupt);
00066 
00067 #ifdef __cplusplus
00068 }
00069 #endif
00070 
00071 #endif // __INTERRUPT_H__