Line | |
---|
1 | /* @file |
---|
2 | * |
---|
3 | * @ingroup RTEMSBSPsARMLPC32XX |
---|
4 | * |
---|
5 | * @brief Implementations of interrupt mechanisms for Time Test 27 |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * Copyright (c) 2010 embedded brains GmbH. All rights reserved. |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.org/license/LICENSE. |
---|
14 | */ |
---|
15 | |
---|
16 | #ifndef _RTEMS_TMTEST27 |
---|
17 | #error "This is an RTEMS internal file you must not include directly." |
---|
18 | #endif |
---|
19 | |
---|
20 | #ifndef __tm27_h |
---|
21 | #define __tm27_h |
---|
22 | |
---|
23 | #include <assert.h> |
---|
24 | |
---|
25 | #include <rtems.h> |
---|
26 | |
---|
27 | #include <bsp/lpc32xx.h> |
---|
28 | #include <bsp/irq.h> |
---|
29 | #include <bsp/irq-generic.h> |
---|
30 | |
---|
31 | #define MUST_WAIT_FOR_INTERRUPT 1 |
---|
32 | |
---|
33 | static void Install_tm27_vector(void (*handler)(rtems_vector_number)) |
---|
34 | { |
---|
35 | rtems_status_code sc = RTEMS_SUCCESSFUL; |
---|
36 | |
---|
37 | LPC32XX_SW_INT = 0; |
---|
38 | |
---|
39 | sc = rtems_interrupt_handler_install( |
---|
40 | LPC32XX_IRQ_SW, |
---|
41 | "SW", |
---|
42 | RTEMS_INTERRUPT_UNIQUE, |
---|
43 | (rtems_interrupt_handler) handler, |
---|
44 | NULL |
---|
45 | ); |
---|
46 | assert(sc == RTEMS_SUCCESSFUL); |
---|
47 | } |
---|
48 | |
---|
49 | static void Cause_tm27_intr(void) |
---|
50 | { |
---|
51 | LPC32XX_SW_INT = 0x1; |
---|
52 | } |
---|
53 | |
---|
54 | static void Clear_tm27_intr(void) |
---|
55 | { |
---|
56 | LPC32XX_SW_INT = 0; |
---|
57 | lpc32xx_irq_set_priority(LPC32XX_IRQ_SW, LPC32XX_IRQ_PRIORITY_LOWEST); |
---|
58 | } |
---|
59 | |
---|
60 | static void Lower_tm27_intr(void) |
---|
61 | { |
---|
62 | bsp_interrupt_vector_enable(LPC32XX_IRQ_SW); |
---|
63 | lpc32xx_irq_set_priority(LPC32XX_IRQ_SW, LPC32XX_IRQ_PRIORITY_HIGHEST); |
---|
64 | } |
---|
65 | |
---|
66 | #endif /* __tm27_h */ |
---|
Note: See
TracBrowser
for help on using the repository browser.