RTEMS  5.1
tm27.h
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  * embedded brains GmbH
12  * Obere Lagerstr. 30
13  * 82178 Puchheim
14  * Germany
15  * <info@embedded-brains.de>
16  *
17  * The license and distribution terms for this file may be
18  * found in the file LICENSE in this distribution or at
19  * http://www.rtems.org/license/LICENSE.
20  */
21 
22 #ifndef _RTEMS_TMTEST27
23 #error "This is an RTEMS internal file you must not include directly."
24 #endif
25 
26 #ifndef __tm27_h
27 #define __tm27_h
28 
29 #include <assert.h>
30 
31 #include <rtems.h>
32 
33 #include <bsp/lpc32xx.h>
34 #include <bsp/irq.h>
35 #include <bsp/irq-generic.h>
36 
37 #define MUST_WAIT_FOR_INTERRUPT 1
38 
39 static void Install_tm27_vector(void (*handler)(rtems_vector_number))
40 {
42 
43  LPC32XX_SW_INT = 0;
44 
46  LPC32XX_IRQ_SW,
47  "SW",
49  (rtems_interrupt_handler) handler,
50  NULL
51  );
52  assert(sc == RTEMS_SUCCESSFUL);
53 }
54 
55 static void Cause_tm27_intr(void)
56 {
57  LPC32XX_SW_INT = 0x1;
58 }
59 
60 static void Clear_tm27_intr(void)
61 {
62  LPC32XX_SW_INT = 0;
63  lpc32xx_irq_set_priority(LPC32XX_IRQ_SW, LPC32XX_IRQ_PRIORITY_LOWEST);
64 }
65 
66 static void Lower_tm27_intr(void)
67 {
68  bsp_interrupt_vector_enable(LPC32XX_IRQ_SW);
69  lpc32xx_irq_set_priority(LPC32XX_IRQ_SW, LPC32XX_IRQ_PRIORITY_HIGHEST);
70 }
71 
72 #endif /* __tm27_h */
Definition: status.h:47
Generic BSP interrupt support API.
rtems_status_code rtems_interrupt_handler_install(rtems_vector_number vector, const char *info, rtems_option options, rtems_interrupt_handler handler, void *arg)
Installs the interrupt handler routine handler for the interrupt vector with number vector.
Definition: irq.c:127
ISR_Vector_number rtems_vector_number
Control block type used to manage the vectors.
Definition: intr.h:47
Information for the Assert Handler.
Register base addresses.
rtems_status_code
Classic API Status.
Definition: status.h:43
#define RTEMS_INTERRUPT_UNIQUE
Makes the interrupt handler unique. Prevents other handler from using the same interrupt vector.
Definition: irq-extension.h:44
void(* rtems_interrupt_handler)(void *)
Interrupt handler routine type.
Definition: irq-extension.h:79
void bsp_interrupt_vector_enable(rtems_vector_number vector)
Enables the interrupt vector with number vector.
Definition: irq.c:98
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77