libnds
|
nds interrupt support. More...
#include <nds/ndstypes.h>
Macros | |
#define | IRQ_AES BIT(12) |
AES interrupt mask (DSi ARM7) | |
#define | IRQ_ALL (~0) |
Mask for all interrupts. | |
#define | IRQ_CAMERA BIT(25) |
Camera interrupt mask (DSi ARM9) | |
#define | IRQ_CARD BIT(19) |
interrupt mask DS Card Slot | |
#define | IRQ_CARD_LINE BIT(20) |
interrupt mask | |
#define | IRQ_CART BIT(13) |
GBA cartridge interrupt mask. | |
#define | IRQ_DMA0 BIT(8) |
DMA 0 interrupt mask. | |
#define | IRQ_DMA1 BIT(9) |
DMA 1 interrupt mask. | |
#define | IRQ_DMA2 BIT(10) |
DMA 2 interrupt mask. | |
#define | IRQ_DMA3 BIT(11) |
DMA 3 interrupt mask. | |
#define | IRQ_DSP BIT(24) |
DSP interrupt mask (DSi ARM9) | |
#define | IRQ_FIFO_EMPTY BIT(17) |
Send FIFO empty interrupt mask. | |
#define | IRQ_FIFO_NOT_EMPTY BIT(18) |
Receive FIFO not empty interrupt mask. | |
#define | IRQ_GEOMETRY_FIFO BIT(21) |
Geometry FIFO interrupt mask (ARM9) | |
#define | IRQ_HBLANK BIT(1) |
Horizontal blank interrupt mask. | |
#define | IRQ_HEADPHONE BIT(5) |
Headphone interrupt mask (DSi ARM7) | |
#define | IRQ_I2C BIT(6) |
I2C interrupt mask (DSi ARM7) | |
#define | IRQ_IPC_SYNC BIT(16) |
IPC sync interrupt mask. | |
#define | IRQ_KEYS BIT(12) |
Keypad interrupt mask. | |
#define | IRQ_LID BIT(22) |
Hinge open interrupt mask. | |
#define | IRQ_MICEXT BIT(14) |
microphone interrupt mask (DSi ARM7) | |
#define | IRQ_NDMA0 BIT(28) |
NDMA 0 interrupt mask (DSi) | |
#define | IRQ_NDMA1 BIT(29) |
NDMA 1 interrupt mask (DSi) | |
#define | IRQ_NDMA2 BIT(30) |
NDMA 2 interrupt mask (DSi) | |
#define | IRQ_NDMA3 BIT(31) |
NDMA 3 interrupt mask (DSi) | |
#define | IRQ_NETWORK BIT(7) |
Serial/RTC interrupt mask (ARM7) (deprecated name) | |
#define | IRQ_RTC BIT(7) |
Serial/RTC interrupt mask (ARM7) | |
#define | IRQ_SD_DATA BIT(9) |
SD/MMC data interrupt mask (DSi ARM7) | |
#define | IRQ_SDIO BIT(10) |
SDIO controller interrupt mask (DSi ARM7) | |
#define | IRQ_SDIO_DATA BIT(11) |
SDIO data interrupt mask (DSi ARM7) | |
#define | IRQ_SDMMC BIT(8) |
SD/MMC controller interrupt mask (DSi ARM7) | |
#define | IRQ_SPI BIT(23) |
SPI interrupt mask. | |
#define | IRQ_TIMER(n) (1 << ((n) + 3)) |
Returns the mask for a given timer. More... | |
#define | IRQ_TIMER0 BIT(3) |
Timer 0 interrupt mask. | |
#define | IRQ_TIMER1 BIT(4) |
Timer 1 interrupt mask. | |
#define | IRQ_TIMER2 BIT(5) |
Timer 2 interrupt mask. | |
#define | IRQ_TIMER3 BIT(6) |
Timer 3 interrupt mask. | |
#define | IRQ_VBLANK BIT(0) |
Vertical blank interrupt mask. | |
#define | IRQ_VCOUNT BIT(2) |
Vcount match interrupt mask. | |
#define | IRQ_WIFI BIT(24) |
WIFI interrupt mask (ARM7) | |
#define | MAX_INTERRUPTS 32 |
Maximum number of interrupts. | |
#define | REG_IE (*(vuint32 *)0x04000210) |
Interrupt Enable Register. More... | |
#define | REG_IF (*(vuint32 *)0x04000214) |
Interrupt Flag Register. More... | |
#define | REG_IME (*(vuint32 *)0x04000208) |
Interrupt Master Enable Register. More... | |
Enumerations | |
enum | IME_VALUE { IME_DISABLE = 0 , IME_ENABLE = 1 } |
Values allowed for REG_IME. More... | |
Functions | |
void | irqClear (u32 irq) |
Remove the handler associated with the interrupt mask IRQ. More... | |
void | irqDisable (u32 irq) |
Prevent the given interrupt from occuring. More... | |
void | irqEnable (u32 irq) |
Allow the given interrupt to occur. More... | |
void | irqInit (void) |
Initialise the libnds interrupt system. More... | |
void | irqInitHandler (VoidFn handler) |
Install a user interrupt dispatcher. More... | |
void | irqSet (u32 irq, VoidFn handler) |
Add a handler for the given interrupt mask. More... | |
VoidFn | setPowerButtonCB (VoidFn CB) |
Set callback for DSi Powerbutton press. More... | |
void | swiIntrWait (u32 waitForSet, uint32_t flags) |
Wait for interrupt(s) to occur. More... | |
void | swiWaitForVBlank (void) |
Waits for a vertical blank interrupt. More... | |
nds interrupt support.
#define IRQ_TIMER | ( | n | ) | (1 << ((n) + 3)) |
Returns the mask for a given timer.
n | Timer index. |
#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 (*(vuint32 *)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.
enum IME_VALUE |
void irqClear | ( | u32 | irq | ) |
Remove the handler associated with the interrupt mask IRQ.
irq | Mask associated with the interrupt. |
void irqDisable | ( | u32 | irq | ) |
Prevent the given interrupt from occuring.
irq | The set of interrupt masks to disable. |
void irqEnable | ( | u32 | irq | ) |
Allow the given interrupt to occur.
irq | The set of interrupt masks to enable. |
void irqInit | ( | void | ) |
Initialise the libnds interrupt system.
This function is called internally (prior to main()) to set up IRQs on the ARM9. It must be called on the ARM7 prior to installing IRQ handlers.
void irqInitHandler | ( | VoidFn | 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. |
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 |
Set callback for DSi Powerbutton press.
CB | Function to call when power button pressed |
void swiIntrWait | ( | u32 | waitForSet, |
uint32_t | flags | ||
) |
Wait for interrupt(s) to occur.
waitForSet | 0: Return if the interrupt has already occured; 1: Wait until the interrupt has been set since the call |
flags | Interrupt mask to wait for. |
void swiWaitForVBlank | ( | void | ) |
Waits for a vertical blank interrupt.