source: rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/irq.h @ 1cfcfd3

4.104.114.84.95
Last change on this file since 1cfcfd3 was 1cfcfd3, checked in by Jay Monkman <jtm@…>, on Jul 15, 2004 at 6:25:44 AM

2004-07-15 Jay Monkman

  • ChangeLog?, Makefile.am, clock/.cvsignore, clock/clockdrv.c, include/mc9328mxl.h, irq/.cvsignore, irq/bsp_irq_asm.S, irq/bsp_irq_init.c, irq/irq.c, irq/irq.h, timer/.cvsignore, timer/timer.c: New files.
  • Property mode set to 100644
File size: 3.9 KB
Line 
1/*
2 * Interrupt handler Header file
3 *
4 * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
5 *     
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *
9 *  http://www.OARcorp.com/rtems/license.html.
10 *
11 *
12 *  $Id$
13 */
14
15#ifndef __IRQ_H__
16#define __IRQ_H__
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22  /* define that can be useful (the values are just examples) */
23#ifndef __asm__
24
25/*
26 * Include some preprocessor value also used by assember code
27 */
28 
29#include <rtems.h>
30#include <mc9328mxl.h>
31
32extern void default_int_handler();
33/***********************************************************************
34 * Constants
35 **********************************************************************/
36
37/* enum of the possible interrupt sources on the AT91RM9200 */
38typedef enum {
39    BSP_INT_UART3_PFERR = 0,
40    BSP_INT_UART3_RTS,
41    BSP_INT_UART3_DTR,
42    BSP_INT_UART3_UARTC,
43    BSP_INT_UART3_TX,
44    BSP_INT_PEN_UP,
45    BSP_INT_CSI,
46    BSP_INT_MMA_MAC,
47    BSP_INT_MMA,
48    BSP_INT_COMP,
49    BSP_INT_MSIRQ,
50    BSP_INT_GPIO_PORTA,
51    BSP_INT_GPIO_PORTB,
52    BSP_INT_GPIO_PORTC,
53    BSP_INT_LCDC,
54    BSP_INT_SIM_IRQ,
55    BSP_INT_SIM_DATA,
56    BSP_INT_RTC,
57    BSP_INT_RTC_SAM,
58    BSP_INT_UART2_PFERR,
59    BSP_INT_UART2_RTS,
60    BSP_INT_UART2_DTR,
61    BSP_INT_UART2_UARTC,
62    BSP_INT_UART2_TX,
63    BSP_INT_UART2_RX,
64    BSP_INT_UART1_PFERR,
65    BSP_INT_UART1_RTS,
66    BSP_INT_UART1_DTR,
67    BSP_INT_UART1_UARTC,
68    BSP_INT_UART1_TX,
69    BSP_INT_UART1_RX,
70    BSP_INT_RES31,
71    BSP_INT_RES32,
72    BSP_INT_PEN_DATA,
73    BSP_INT_PWM,
74    BSP_INT_MMC_IRQ,
75    BSP_INT_SSI2_TX,
76    BSP_INT_SSI2_RX,
77    BSP_INT_SSI2_ERR,
78    BSP_INT_I2C,
79    BSP_INT_SPI2,
80    BSP_INT_SPI1,
81    BSP_INT_SSI_TX,
82    BSP_INT_SSI_TX_ERR,
83    BSP_INT_SSI_RX,
84    BSP_INT_SSI_RX_ERR,
85    BSP_INT_TOUCH,
86    BSP_INT_USBD0,
87    BSP_INT_USBD1,
88    BSP_INT_USBD2,
89    BSP_INT_USBD3,
90    BSP_INT_USBD4,
91    BSP_INT_USBD5,
92    BSP_INT_USBD6,
93    BSP_INT_UART3_RX,
94    BSP_INT_BTSYS,
95    BSP_INT_BTTIM,
96    BSP_INT_BTWUI,
97    BSP_INT_TIMER2,
98    BSP_INT_TIMER1,
99    BSP_INT_DMA_ERR,
100    BSP_INT_DMA,
101    BSP_INT_GPIO_PORTD,
102    BSP_INT_WDT,
103
104    BSP_MAX_INT
105} rtems_irq_symbolic_name;
106
107extern void *bsp_vector_table;
108#define VECTOR_TABLE &bsp_vector_table;
109                                                                                           
110typedef unsigned char  rtems_irq_level;
111typedef unsigned char  rtems_irq_trigger;
112
113struct  __rtems_irq_connect_data__;     /* forward declaratiuon */
114
115typedef void (*rtems_irq_hdl)       (void);
116typedef void (*rtems_irq_enable)    (const struct __rtems_irq_connect_data__*);
117typedef void (*rtems_irq_disable)   (const struct __rtems_irq_connect_data__*);
118typedef int  (*rtems_irq_is_enabled)(const struct __rtems_irq_connect_data__*);
119
120typedef struct __rtems_irq_connect_data__ {
121    /* IRQ line */
122    rtems_irq_symbolic_name       name;
123
124    /* Handler */
125    rtems_irq_hdl                 hdl;
126
127    /* function for enabling interrupts at device level. */
128    rtems_irq_enable              on;
129
130    /* function for disabling interrupts at device level. */
131    rtems_irq_disable             off;
132
133    /* Function to test if interrupt is enabled */
134    rtems_irq_is_enabled        isOn;
135
136    /* priority level of interrupt */
137    rtems_irq_level               irqLevel;
138
139    /* Trigger method (rising/falling edge or high/low level) */
140    rtems_irq_trigger             irqTrigger;
141} rtems_irq_connect_data;
142
143/*
144 * function to initialize the interrupt for a specific BSP
145 */
146void BSP_rtems_irq_mngt_init();
147
148
149/*
150 * function to connect a particular irq handler.
151 */
152int BSP_install_rtems_irq_handler       (const rtems_irq_connect_data*);
153
154/*
155 * function to get the current RTEMS irq handler for ptr->name.
156 */
157int BSP_get_current_rtems_irq_handler   (rtems_irq_connect_data* ptr);
158
159/*
160 * function to disconnect the RTEMS irq handler for ptr->name.
161 */
162int BSP_remove_rtems_irq_handler        (const rtems_irq_connect_data*);
163
164#endif /* __asm__ */
165
166#ifdef __cplusplus
167}
168#endif
169
170#endif /* __IRQ_H__ */
Note: See TracBrowser for help on using the repository browser.