interrupt.h
Go to the documentation of this file.
1 #ifndef __INTERRUPT_H__
2 #define __INTERRUPT_H__
3 
4 //*****************************************************************************
5 //
8 //
9 //*****************************************************************************
10 
11 
12 //*****************************************************************************
13 //
14 // If building with a C++ compiler, make all of the definitions in this header
15 // have a C binding.
16 //
17 //*****************************************************************************
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include <stdint.h>
24 #include "register_remap.h"
25 #include <stdbool.h>
26 #include <msp432.h>
27 
28 //*****************************************************************************
29 //
30 // Macro to generate an interrupt priority mask based on the number of bits
31 // of priority supported by the hardware.
32 //
33 //*****************************************************************************
34 #define INT_PRIORITY_MASK ((0xFF << (8 - NUM_PRIORITY_BITS)) & 0xFF)
35 #define NUM_PRIORITY 8
36 
37 #define NVIC_APINT_PRIGROUP_M 0x00000700 // Interrupt Priority Grouping
38 #define NVIC_APINT_PRIGROUP_7_1 0x00000000 // Priority group 7.1 split
39 #define NVIC_APINT_PRIGROUP_6_2 0x00000100 // Priority group 6.2 split
40 #define NVIC_APINT_PRIGROUP_5_3 0x00000200 // Priority group 5.3 split
41 #define NVIC_APINT_PRIGROUP_4_4 0x00000300 // Priority group 4.4 split
42 #define NVIC_APINT_PRIGROUP_3_5 0x00000400 // Priority group 3.5 split
43 #define NVIC_APINT_PRIGROUP_2_6 0x00000500 // Priority group 2.6 split
44 #define NVIC_APINT_PRIGROUP_1_7 0x00000600 // Priority group 1.7 split
45 #define NVIC_APINT_PRIGROUP_0_8 0x00000700 // Priority group 0.8 split
46 #define NVIC_SYS_PRI1_R 0xE000ED18 // System Handler Priority 1
47 #define NVIC_SYS_PRI2_R 0xE000ED1C // System Handler Priority 2
48 #define NVIC_SYS_PRI3_R 0xE000ED20 // System Handler Priority 3
49 #define NVIC_PRI0_R 0xE000E400 // Interrupt 0-3 Priority
50 #define NVIC_PRI1_R 0xE000E404 // Interrupt 4-7 Priority
51 #define NVIC_PRI2_R 0xE000E408 // Interrupt 8-11 Priority
52 #define NVIC_PRI3_R 0xE000E40C // Interrupt 12-15 Priority
53 #define NVIC_PRI4_R 0xE000E410 // Interrupt 16-19 Priority
54 #define NVIC_PRI5_R 0xE000E414 // Interrupt 20-23 Priority
55 #define NVIC_PRI6_R 0xE000E418 // Interrupt 24-27 Priority
56 #define NVIC_PRI7_R 0xE000E41C // Interrupt 28-31 Priority
57 #define NVIC_PRI8_R 0xE000E420 // Interrupt 32-35 Priority
58 #define NVIC_PRI9_R 0xE000E424 // Interrupt 36-39 Priority
59 #define NVIC_PRI10_R 0xE000E428 // Interrupt 40-43 Priority
60 #define NVIC_PRI11_R 0xE000E42C // Interrupt 44-47 Priority
61 #define NVIC_PRI12_R 0xE000E430 // Interrupt 48-51 Priority
62 #define NVIC_PRI13_R 0xE000E434 // Interrupt 52-55 Priority
63 #define NVIC_PRI14_R 0xE000E438 // Interrupt 56-59 Priority
64 #define NVIC_PRI15_R 0xE000E43C // Interrupt 60-63 Priority
65 #define NVIC_EN0_R 0xE000E100 // Interrupt 0-31 Set Enable
66 #define NVIC_EN1_R 0xE000E104 // Interrupt 32-54 Set Enable
67 #define NVIC_DIS0_R 0xE000E180 // Interrupt 0-31 Clear Enable
68 #define NVIC_DIS1_R 0xE000E184 // Interrupt 32-54 Clear Enable
69 #define NVIC_PEND0_R 0xE000E200 // Interrupt 0-31 Set Pending
70 #define NVIC_PEND1_R 0xE000E204 // Interrupt 32-54 Set Pending
71 #define NVIC_UNPEND0_R 0xE000E280 // Interrupt 0-31 Clear Pending
72 #define NVIC_UNPEND1_R 0xE000E284 // Interrupt 32-54 Clear Pending
73 //*****************************************************************************
74 //
75 // Prototypes for the APIs.
76 //
77 //*****************************************************************************
78 
79 //*****************************************************************************
80 //
89 //
90 //*****************************************************************************
91 extern bool Interrupt_enableMaster(void);
92 
93 //*****************************************************************************
94 //
104 //
105 //*****************************************************************************
106 extern bool Interrupt_disableMaster(void);
107 
108 //*****************************************************************************
109 //
129 //
130 //*****************************************************************************
131 extern void Interrupt_registerInterrupt(uint32_t interruptNumber,
132  void (*intHandler)(void));
133 
134 //*****************************************************************************
135 //
151 //
152 //*****************************************************************************
153 extern void Interrupt_unregisterInterrupt(uint32_t interruptNumber);
154 
155 //*****************************************************************************
156 //
169 //
170 //*****************************************************************************
171 extern void Interrupt_setPriorityGrouping(uint32_t bits);
172 
173 //*****************************************************************************
174 //
181 //
182 //*****************************************************************************
183 extern uint32_t Interrupt_getPriorityGrouping(void);
184 
185 //*****************************************************************************
186 //
210 //
211 //*****************************************************************************
212 extern void Interrupt_setPriority(uint32_t interruptNumber, uint8_t priority);
213 
214 //*****************************************************************************
215 //
228 //
229 //*****************************************************************************
230 extern uint8_t Interrupt_getPriority(uint32_t interruptNumber);
231 
232 //*****************************************************************************
233 //
297 //
298 //*****************************************************************************
299 extern void Interrupt_enableInterrupt(uint32_t interruptNumber);
300 
301 //*****************************************************************************
302 //
315 //
316 //*****************************************************************************
317 extern void Interrupt_disableInterrupt(uint32_t interruptNumber);
318 
319 //*****************************************************************************
320 //
332 //
333 //*****************************************************************************
334 extern bool Interrupt_isEnabled(uint32_t interruptNumber);
335 
336 //*****************************************************************************
337 //
354 //
355 //*****************************************************************************
356 extern void Interrupt_pendInterrupt(uint32_t interruptNumber);
357 
358 //*****************************************************************************
359 //
373 //
374 //*****************************************************************************
375 extern void Interrupt_unpendInterrupt(uint32_t interruptNumber);
376 
377 //*****************************************************************************
378 //
398 //
399 //*****************************************************************************
400 extern void Interrupt_setPriorityMask(uint8_t priorityMask);
401 
402 //*****************************************************************************
403 //
420 //
421 //*****************************************************************************
422 extern uint8_t Interrupt_getPriorityMask(void);
423 
424 //*****************************************************************************
425 //
433 //
434 //*****************************************************************************
435 extern void Interrupt_setVectorTableAddress(uint32_t addr);
436 
437 //*****************************************************************************
438 //
442 //
443 //*****************************************************************************
444 extern uint32_t Interrupt_getVectorTableAddress(void);
445 
446 //*****************************************************************************
447 //
453 //
454 //*****************************************************************************
455 extern void Interrupt_enableSleepOnIsrExit(void);
456 
457 //*****************************************************************************
458 //
464 //
465 //*****************************************************************************
466 extern void Interrupt_disableSleepOnIsrExit(void);
467 
468 //*****************************************************************************
469 //
470 // Mark the end of the C bindings section for C++ compilers.
471 //
472 //*****************************************************************************
473 #ifdef __cplusplus
474 }
475 #endif
476 
477 //*****************************************************************************
478 //
479 // Close the Doxygen group.
481 //
482 //*****************************************************************************
483 
484 #endif // __INTERRUPT_H__
bool Interrupt_enableMaster(void)
void Interrupt_setVectorTableAddress(uint32_t addr)
Definition: interrupt.c:484
void Interrupt_enableSleepOnIsrExit(void)
Definition: interrupt.c:494
void Interrupt_disableSleepOnIsrExit(void)
Definition: interrupt.c:499
void Interrupt_enableInterrupt(uint32_t interruptNumber)
Definition: interrupt.c:264
uint32_t Interrupt_getVectorTableAddress(void)
Definition: interrupt.c:489
void Interrupt_unpendInterrupt(uint32_t interruptNumber)
Definition: interrupt.c:442
uint8_t Interrupt_getPriorityMask(void)
Definition: interrupt.c:479
bool Interrupt_disableMaster(void)
Definition: interrupt.c:126
void Interrupt_registerInterrupt(uint32_t interruptNumber, void(*intHandler)(void))
Definition: interrupt.c:134
bool Interrupt_isEnabled(uint32_t interruptNumber)
Definition: interrupt.c:352
void Interrupt_setPriorityMask(uint8_t priorityMask)
Definition: interrupt.c:474
void Interrupt_setPriority(uint32_t interruptNumber, uint8_t priority)
Definition: interrupt.c:232
void Interrupt_pendInterrupt(uint32_t interruptNumber)
Definition: interrupt.c:404
void Interrupt_disableInterrupt(uint32_t interruptNumber)
Definition: interrupt.c:308
uint8_t Interrupt_getPriority(uint32_t interruptNumber)
Definition: interrupt.c:250
uint32_t Interrupt_getPriorityGrouping(void)
Definition: interrupt.c:203
void Interrupt_setPriorityGrouping(uint32_t bits)
Definition: interrupt.c:190
void Interrupt_unregisterInterrupt(uint32_t interruptNumber)
Definition: interrupt.c:177

Copyright 2014, Texas Instruments Incorporated