1 |
610 |
jeremybenn |
//*****************************************************************************
|
2 |
|
|
//
|
3 |
|
|
// interrupt.h - Prototypes for the NVIC Interrupt Controller Driver.
|
4 |
|
|
//
|
5 |
|
|
// Copyright (c) 2005-2008 Luminary Micro, Inc. All rights reserved.
|
6 |
|
|
//
|
7 |
|
|
// Software License Agreement
|
8 |
|
|
//
|
9 |
|
|
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
|
10 |
|
|
// exclusively on LMI's microcontroller products.
|
11 |
|
|
//
|
12 |
|
|
// The software is owned by LMI and/or its suppliers, and is protected under
|
13 |
|
|
// applicable copyright laws. All rights are reserved. You may not combine
|
14 |
|
|
// this software with "viral" open-source software in order to form a larger
|
15 |
|
|
// program. Any use in violation of the foregoing restrictions may subject
|
16 |
|
|
// the user to criminal sanctions under applicable laws, as well as to civil
|
17 |
|
|
// liability for the breach of the terms and conditions of this license.
|
18 |
|
|
//
|
19 |
|
|
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
20 |
|
|
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
21 |
|
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
22 |
|
|
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
23 |
|
|
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
24 |
|
|
//
|
25 |
|
|
// This is part of revision 2523 of the Stellaris Peripheral Driver Library.
|
26 |
|
|
//
|
27 |
|
|
//*****************************************************************************
|
28 |
|
|
|
29 |
|
|
#ifndef __INTERRUPT_H__
|
30 |
|
|
#define __INTERRUPT_H__
|
31 |
|
|
|
32 |
|
|
//*****************************************************************************
|
33 |
|
|
//
|
34 |
|
|
// If building with a C++ compiler, make all of the definitions in this header
|
35 |
|
|
// have a C binding.
|
36 |
|
|
//
|
37 |
|
|
//*****************************************************************************
|
38 |
|
|
#ifdef __cplusplus
|
39 |
|
|
extern "C"
|
40 |
|
|
{
|
41 |
|
|
#endif
|
42 |
|
|
|
43 |
|
|
//*****************************************************************************
|
44 |
|
|
//
|
45 |
|
|
// Macro to generate an interrupt priority mask based on the number of bits
|
46 |
|
|
// of priority supported by the hardware.
|
47 |
|
|
//
|
48 |
|
|
//*****************************************************************************
|
49 |
|
|
#define INT_PRIORITY_MASK ((0xFF << (8 - NUM_PRIORITY_BITS)) & 0xFF)
|
50 |
|
|
|
51 |
|
|
//*****************************************************************************
|
52 |
|
|
//
|
53 |
|
|
// Prototypes for the APIs.
|
54 |
|
|
//
|
55 |
|
|
//*****************************************************************************
|
56 |
|
|
extern tBoolean IntMasterEnable(void);
|
57 |
|
|
extern tBoolean IntMasterDisable(void);
|
58 |
|
|
extern void IntRegister(unsigned long ulInterrupt, void (*pfnHandler)(void));
|
59 |
|
|
extern void IntUnregister(unsigned long ulInterrupt);
|
60 |
|
|
extern void IntPriorityGroupingSet(unsigned long ulBits);
|
61 |
|
|
extern unsigned long IntPriorityGroupingGet(void);
|
62 |
|
|
extern void IntPrioritySet(unsigned long ulInterrupt,
|
63 |
|
|
unsigned char ucPriority);
|
64 |
|
|
extern long IntPriorityGet(unsigned long ulInterrupt);
|
65 |
|
|
extern void IntEnable(unsigned long ulInterrupt);
|
66 |
|
|
extern void IntDisable(unsigned long ulInterrupt);
|
67 |
|
|
|
68 |
|
|
//*****************************************************************************
|
69 |
|
|
//
|
70 |
|
|
// Mark the end of the C bindings section for C++ compilers.
|
71 |
|
|
//
|
72 |
|
|
//*****************************************************************************
|
73 |
|
|
#ifdef __cplusplus
|
74 |
|
|
}
|
75 |
|
|
#endif
|
76 |
|
|
|
77 |
|
|
#endif // __INTERRUPT_H__
|