#include <nds/jtypes.h>
データ構造 | |
| struct | IntTable |
マクロ定義 | |
| #define | MAX_INTERRUPTS 25 |
| #define | REG_IE (*(vuint32*)0x04000210) |
| Interrupt Enable Register. | |
| #define | REG_IF (*(vuint32*)0x04000214) |
| Interrupt Flag Register. | |
| #define | REG_IME (*(vuint16*)0x04000208) |
| Interrupt Master Enable Register. | |
| #define | VBLANK_INTR_WAIT_FLAGS *(__irq_flags) |
| #define | IRQ_HANDLER *(__irq_vector) |
型定義 | |
| typedef enum IRQ_MASKS | IRQ_MASK |
列挙型 | |
| enum | IRQ_MASKS { IRQ_VBLANK = BIT(0), IRQ_HBLANK = BIT(1), IRQ_VCOUNT = BIT(2), IRQ_TIMER0 = BIT(3), IRQ_TIMER1 = BIT(4), IRQ_TIMER2 = BIT(5), IRQ_TIMER3 = BIT(6), IRQ_NETWORK = BIT(7), IRQ_DMA0 = BIT(8), IRQ_DMA1 = BIT(9), IRQ_DMA2 = BIT(10), IRQ_DMA3 = BIT(11), IRQ_KEYS = BIT(12), IRQ_CART = BIT(13), IRQ_IPC_SYNC = BIT(16), IRQ_FIFO_EMPTY = BIT(17), IRQ_FIFO_NOT_EMPTY = BIT(18), IRQ_CARD = BIT(19), IRQ_CARD_LINE = BIT(20), IRQ_GEOMETRY_FIFO = BIT(21), IRQ_LID = BIT(22), IRQ_SPI = BIT(23), IRQ_WIFI = BIT(24), IRQ_ALL = (~0) } |
| values allowed for REG_IE and REG_IF [詳細] | |
| enum | IME_VALUE { IME_DISABLE = 0, IME_ENABLE = 1 } |
| values allowed for REG_IME [詳細] | |
関数 | |
| void | irqInit () |
| Initialise the libnds interrupt system. | |
| void | irqSet (IRQ_MASK irq, VoidFunctionPointer handler) |
| Add a handler for the given interrupt mask. | |
| void | irqClear (IRQ_MASK irq) |
| remove the handler associated with the interrupt mask irq. | |
| void | irqInitHandler (VoidFunctionPointer handler) |
| Install a user interrupt dispatcher. | |
| void | irqEnable (uint32 irq) |
| Allow the given interrupt to occur. | |
| void | irqDisable (uint32 irq) |
| Prevent the given interrupt from occuring. | |
変数 | |
| VoidFunctionPointer | __irq_vector [] |
| vuint32 | __irq_flags [] |
| #define IRQ_HANDLER *(__irq_vector) |
| #define MAX_INTERRUPTS 25 |
| #define REG_IE (*(vuint32*)0x04000210) |
Interrupt Enable Register.
This is the activation mask for the internal interrupts. Unless the corresponding bit is set, the IRQ will be masked out.
| #define REG_IF (*(vuint32*)0x04000214) |
Interrupt Flag Register.
Since there is only one hardware interrupt vector, the IF register contains flags to indicate when a particular of interrupt has occured. To acknowledge processing interrupts, set IF to the value of the interrupt handled.
| #define REG_IME (*(vuint16*)0x04000208) |
Interrupt Master Enable Register.
When bit 0 is clear, all interrupts are masked. When it is 1, interrupts will occur if not masked out in REG_IE.
| #define VBLANK_INTR_WAIT_FLAGS *(__irq_flags) |
| enum IME_VALUE |
values allowed for REG_IME
| IME_DISABLE | Disable all interrupts. |
| IME_ENABLE | Enable all interrupts not masked out in REG_IE |
00112 { 00113 IME_DISABLE = 0, 00114 IME_ENABLE = 1, 00115 };
| enum IRQ_MASKS |
values allowed for REG_IE and REG_IF
00047 { 00048 IRQ_VBLANK = BIT(0), 00049 IRQ_HBLANK = BIT(1), 00050 IRQ_VCOUNT = BIT(2), 00051 IRQ_TIMER0 = BIT(3), 00052 IRQ_TIMER1 = BIT(4), 00053 IRQ_TIMER2 = BIT(5), 00054 IRQ_TIMER3 = BIT(6), 00055 IRQ_NETWORK = BIT(7), 00056 IRQ_DMA0 = BIT(8), 00057 IRQ_DMA1 = BIT(9), 00058 IRQ_DMA2 = BIT(10), 00059 IRQ_DMA3 = BIT(11), 00060 IRQ_KEYS = BIT(12), 00061 IRQ_CART = BIT(13), 00062 IRQ_IPC_SYNC = BIT(16), 00063 IRQ_FIFO_EMPTY = BIT(17), 00064 IRQ_FIFO_NOT_EMPTY = BIT(18), 00065 IRQ_CARD = BIT(19), 00066 IRQ_CARD_LINE = BIT(20), 00067 IRQ_GEOMETRY_FIFO = BIT(21), 00068 IRQ_LID = BIT(22), 00069 IRQ_SPI = BIT(23), 00070 IRQ_WIFI = BIT(24), 00071 IRQ_ALL = (~0) 00072 };
| irqClear | ( | IRQ_MASK | irq | ) |
remove the handler associated with the interrupt mask irq.
| irq | Mask associated with the interrupt. |
| irqDisable | ( | uint32 | irq | ) |
Prevent the given interrupt from occuring.
| irq | The set of interrupt masks to disable. |
| irqEnable | ( | uint32 | irq | ) |
Allow the given interrupt to occur.
| irq | The set of interrupt masks to enable. |
| irqInit | ( | ) |
Initialise the libnds interrupt system.
Call this function at the start of any application which requires interrupt support. This function should be used in preference to irqInitHandler.
| irqInitHandler | ( | VoidFunctionPointer | handler | ) |
Install a user interrupt dispatcher.
This function installs the main interrupt function, all interrupts are serviced through this routine. For most purposes the libnds interrupt dispacther should be used in preference to user code unless you know *exactly* what you're doing.
| handler | Address of the function to use as an interrupt dispatcher |
| irqSet | ( | IRQ_MASK | irq, | |
| VoidFunctionPointer | handler | |||
| ) |
Add a handler for the given interrupt mask.
Specify the handler to use for the given interrupt. This only works with the default interrupt handler, do not mix the use of this routine with a user-installed IRQ handler.
| irq | Mask associated with the interrupt. | |
| handler | Address of the function to use as an interrupt service routine |
1.5.4