summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/gba/irq/irq.h
blob: 37ae5279123b2082f417e22135adbdf4bd67470a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
 * @file
 *
 * @ingroup gba_interrupt
 *
 * @brief Interrupt definitions.
 */

/*
 *  RTEMS GBA BSP
 *
 *  Copyright (c) 2010 embedded brains GmbH.
 *
 *  Copyright (c) 2004  Markku Puro <markku.puro@kopteri.net>
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.org/license/LICENSE.
 */

#ifndef __asm__

#include <rtems.h>
#include <rtems/irq.h>
#include <rtems/irq-extension.h>

#endif /* __asm__ */

#ifndef _IRQ_H_
#define _IRQ_H_

/**
 * @defgroup gba_interrupt Interrupt Support
 * 
 * @ingroup arm_gba
 * 
 * @brief Interrupt support.
 */

/*---------------------------------------------------------------------------*
 *  MACROS                                                                   *
 *---------------------------------------------------------------------------*/

#define ENABLE_IRQ()   GBA_REG_IME = 1;
#define DISABLE_IRQ()  GBA_REG_IME = 0;


/*-------------------------------------------------------------------------+
| Constants
+--------------------------------------------------------------------------*/

#define BSP_IRQ_VBLANK   0
#define BSP_IRQ_HBLANK   1
#define BSP_IRQ_VCOUNTER 2
#define BSP_IRQ_TIMER0   3
#define BSP_IRQ_TIMER1   4
#define BSP_IRQ_TIMER2   5
#define BSP_IRQ_TIMER3   6
#define BSP_IRQ_SERIAL   7
#define BSP_IRQ_DMA0     8
#define BSP_IRQ_DMA1     9
#define BSP_IRQ_DMA2     10
#define BSP_IRQ_DMA3     11
#define BSP_IRQ_KEY      12
#define BSP_IRQ_CART     13
#define BSP_IRQ_NA14     14
#define BSP_IRQ_NA15     15
#define BSP_MAX_INT      16

#define BSP_INTERRUPT_VECTOR_MIN 0

#define BSP_INTERRUPT_VECTOR_MAX (BSP_MAX_INT - 1)

#endif /* _IRQ_H_ */