Nut/OS  4.10.3
API Reference
gba.h File Reference

Go to the source code of this file.

Defines

#define WRAM_START   0x03000000
 Internal work RAM.
#define WRAM_END   (WRAM_START + 0x8000)
#define INT_VECTOR   (WRAM_END - 4)
#define REG_DISPCNT   0x04000000
 Display control.
#define REG_STAT   0x04000004
#define REG_VCOUNT   0x04000006
#define REG_BG0CNT   0x04000008
#define REG_BG1CNT   0x0400000a
#define REG_BG2CNT   0x0400000c
#define REG_BG3CNT   0x0400000e
#define REG_BG0HOFS   0x04000010
#define REG_BG0VOFS   0x04000012
#define REG_BG1HOFS   0x04000014
#define REG_BG1VOFS   0x04000016
#define REG_BG2HOFS   0x04000018
#define REG_BG2VOFS   0x0400001a
#define REG_BG3HOFS   0x0400001c
#define REG_BG3VOFS   0x0400001e
#define REG_BG2PA   0x04000020
#define REG_BG2PB   0x04000022
#define REG_BG2PC   0x04000024
#define REG_BG2PD   0x04000026
#define REG_BG2X   0x04000028
#define REG_BG2Y   0x0400002c
#define REG_BG3PA   0x04000030
#define REG_BG3PB   0x04000032
#define REG_BG3PC   0x04000034
#define REG_BG3PD   0x04000036
#define REG_BG3X   0x04000038
#define REG_BG3Y   0x0400003c
#define REG_WINCNT   0x04000040
#define REG_WININ   0x04000048
#define REG_WINOUT   0x0400004a
#define REG_MOSAIC   0x0400004c
#define REG_BLDCNT   0x04000050
#define REG_BLDALPHA   0x04000052
#define REG_BLDY   0x04000054
#define REG_SOUND1CNT   0x04000060
 Sound control.
#define REG_SOUND2CNT   0x04000068
#define REG_SOUND3CNT   0x04000070
#define REG_SOUND4CNT   0x04000078
#define REG_SOUNDCNT   0x04000080
#define REG_SOUNDBIAS   0x04000088
#define REG_WAVE_RAM0   0x04000090
#define REG_WAVE_RAM1   0x04000094
#define REG_WAVE_RAM2   0x04000098
#define REG_WAVE_RAM3   0x0400009c
#define REG_FIFO_A   0x040000a0
#define REG_FIFO_B   0x040000a4
#define REG_DMA0SAD   0x040000b0
 DMA control.
#define REG_DMA0DAD   0x040000b4
#define REG_DMA0CNT   0x040000b8
#define REG_DMA1SAD   0x040000bc
#define REG_DMA1DAD   0x040000c0
#define REG_DMA1CNT   0x040000c4
#define REG_DMA2SAD   0x040000c8
#define REG_DMA2DAD   0x040000cc
#define REG_DMA2CNT   0x040000d0
#define REG_DMA3SAD   0x040000d4
#define REG_DMA3DAD   0x040000d8
#define REG_DMA3CNT   0x040000dc
#define REG_TMR0CNT   0x04000100
 Timer control.
#define REG_TMR1CNT   0x04000104
#define REG_TMR2CNT   0x04000108
#define REG_TMR3CNT   0x0400010c
#define REG_SIODATA32   0x04000120
 Serial communication control.
#define REG_SIOCNT   0x04000128
#define REG_SIODATA8   0x0400012a
#define REG_KEYINPUT   0x04000130
 Keyboard control.
#define REG_KEYCNT   0x04000132
#define REG_RCNT   0x04000134
 General I/O control.
#define REG_JOYCNT   0x04000140
 JOY Bus control.
#define REG_JOYSTAT   0x04000158
#define REG_JOY_RECV   0x04000150
#define REG_JOY_TRANS   0x04000154
#define REG_IE   0x04000200
 Interrupt control.
#define REG_IF   0x04000202
#define REG_WAITCNT   0x04000204
#define REG_IME   0x04000208
#define INT_VBLANK   0x0001
 Interrupt flags.
#define INT_HBLANK   0x0002
#define INT_VCOUNT   0x0004
#define INT_TMR0   0x0008
#define INT_TMR1   0x0010
#define INT_TMR2   0x0020
#define INT_TMR3   0x0040
#define INT_SIO   0x0080
#define INT_DMA0   0x0100
#define INT_DMA1   0x0200
#define INT_DMA2   0x0400
#define INT_DMA3   0x0800
#define INT_KEYPAD   0x1000
#define INT_GAMEPAK   0x2000
#define REG_HALTCNT   0x04000300
 Power management control.
#define outw(_reg, _val)   (*((volatile unsigned short *)(_reg)) = (_val))
#define outdw(_reg, _val)   (*((volatile unsigned long *)(_reg)) = (_val))
#define inw(_reg)   (*((volatile unsigned short *)(_reg)))
#define indw(_reg)   (*((volatile unsigned long *)(_reg)))
#define GBAKEY_A   0x0001
#define GBAKEY_B   0x0002
#define GBAKEY_SELECT   0x0003
#define GBAKEY_START   0x0008
#define GBAKEY_RIGHT   0x0010
#define GBAKEY_LEFT   0x0020
#define GBAKEY_UP   0x0040
#define GBAKEY_DOWN   0x0080
#define GBAKEY_R   0x0100
#define GBAKEY_L   0x0200
#define TMR_PRE_64   0x00010000
 Timer control.
#define TMR_PRE_256   0x00020000
#define TMR_PRE_1024   0x00030000
#define TMR_IRQ_ENA   0x00400000
#define TMR_ENA   0x00800000
#define SIO_BAUD_9600   0x0000
 SIO control.
#define SIO_BAUD_38400   0x0001
#define SIO_BAUD_57600   0x0002
#define SIO_BAUD_115200   0x0003
#define SIO_CTS_ENA   0x0004
#define SIO_PARITY_ODD   0x0008
#define SIO_TX_FULL   0x0010
#define SIO_RX_EMPTY   0x0020
#define SIO_ERROR   0x0040
#define SIO_DATA_8BIT   0x0080
#define SIO_FIFO_ENA   0x0100
#define SIO_PARITY_ENA   0x0200
#define SIO_SEND_ENA   0x0400
#define SIO_RECV_ENA   0x0800
#define SIO_MODE_32BIT   0x1000
#define SIO_MODE_MULTI   0x2000
#define SIO_MODE_UART   0x3000
#define SIO_IRQ_ENA   0x4000

Define Documentation

#define WRAM_START   0x03000000

Internal work RAM.

Definition at line 53 of file gba.h.

#define WRAM_END   (WRAM_START + 0x8000)

Definition at line 54 of file gba.h.

#define INT_VECTOR   (WRAM_END - 4)

Definition at line 55 of file gba.h.

Referenced by InitIrqHandler().

#define REG_DISPCNT   0x04000000

Display control.

Definition at line 60 of file gba.h.

Referenced by DebugInit().

#define REG_STAT   0x04000004

Definition at line 61 of file gba.h.

#define REG_VCOUNT   0x04000006

Definition at line 62 of file gba.h.

#define REG_BG0CNT   0x04000008

Definition at line 63 of file gba.h.

#define REG_BG1CNT   0x0400000a

Definition at line 64 of file gba.h.

#define REG_BG2CNT   0x0400000c

Definition at line 65 of file gba.h.

Referenced by DebugInit().

#define REG_BG3CNT   0x0400000e

Definition at line 66 of file gba.h.

#define REG_BG0HOFS   0x04000010

Definition at line 67 of file gba.h.

#define REG_BG0VOFS   0x04000012

Definition at line 68 of file gba.h.

#define REG_BG1HOFS   0x04000014

Definition at line 69 of file gba.h.

#define REG_BG1VOFS   0x04000016

Definition at line 70 of file gba.h.

#define REG_BG2HOFS   0x04000018

Definition at line 71 of file gba.h.

#define REG_BG2VOFS   0x0400001a

Definition at line 72 of file gba.h.

#define REG_BG3HOFS   0x0400001c

Definition at line 73 of file gba.h.

#define REG_BG3VOFS   0x0400001e

Definition at line 74 of file gba.h.

#define REG_BG2PA   0x04000020

Definition at line 75 of file gba.h.

#define REG_BG2PB   0x04000022

Definition at line 76 of file gba.h.

#define REG_BG2PC   0x04000024

Definition at line 77 of file gba.h.

#define REG_BG2PD   0x04000026

Definition at line 78 of file gba.h.

#define REG_BG2X   0x04000028

Definition at line 79 of file gba.h.

#define REG_BG2Y   0x0400002c

Definition at line 80 of file gba.h.

#define REG_BG3PA   0x04000030

Definition at line 81 of file gba.h.

#define REG_BG3PB   0x04000032

Definition at line 82 of file gba.h.

#define REG_BG3PC   0x04000034

Definition at line 83 of file gba.h.

#define REG_BG3PD   0x04000036

Definition at line 84 of file gba.h.

#define REG_BG3X   0x04000038

Definition at line 85 of file gba.h.

#define REG_BG3Y   0x0400003c

Definition at line 86 of file gba.h.

#define REG_WINCNT   0x04000040

Definition at line 87 of file gba.h.

#define REG_WININ   0x04000048

Definition at line 88 of file gba.h.

#define REG_WINOUT   0x0400004a

Definition at line 89 of file gba.h.

#define REG_MOSAIC   0x0400004c

Definition at line 90 of file gba.h.

#define REG_BLDCNT   0x04000050

Definition at line 91 of file gba.h.

#define REG_BLDALPHA   0x04000052

Definition at line 92 of file gba.h.

#define REG_BLDY   0x04000054

Definition at line 93 of file gba.h.

#define REG_SOUND1CNT   0x04000060

Sound control.

Definition at line 98 of file gba.h.

#define REG_SOUND2CNT   0x04000068

Definition at line 99 of file gba.h.

#define REG_SOUND3CNT   0x04000070

Definition at line 100 of file gba.h.

#define REG_SOUND4CNT   0x04000078

Definition at line 101 of file gba.h.

#define REG_SOUNDCNT   0x04000080

Definition at line 102 of file gba.h.

#define REG_SOUNDBIAS   0x04000088

Definition at line 103 of file gba.h.

#define REG_WAVE_RAM0   0x04000090

Definition at line 104 of file gba.h.

#define REG_WAVE_RAM1   0x04000094

Definition at line 105 of file gba.h.

#define REG_WAVE_RAM2   0x04000098

Definition at line 106 of file gba.h.

#define REG_WAVE_RAM3   0x0400009c

Definition at line 107 of file gba.h.

#define REG_FIFO_A   0x040000a0

Definition at line 108 of file gba.h.

#define REG_FIFO_B   0x040000a4

Definition at line 109 of file gba.h.

#define REG_DMA0SAD   0x040000b0

DMA control.

Definition at line 114 of file gba.h.

#define REG_DMA0DAD   0x040000b4

Definition at line 115 of file gba.h.

#define REG_DMA0CNT   0x040000b8

Definition at line 116 of file gba.h.

#define REG_DMA1SAD   0x040000bc

Definition at line 117 of file gba.h.

#define REG_DMA1DAD   0x040000c0

Definition at line 118 of file gba.h.

#define REG_DMA1CNT   0x040000c4

Definition at line 119 of file gba.h.

#define REG_DMA2SAD   0x040000c8

Definition at line 120 of file gba.h.

#define REG_DMA2DAD   0x040000cc

Definition at line 121 of file gba.h.

#define REG_DMA2CNT   0x040000d0

Definition at line 122 of file gba.h.

#define REG_DMA3SAD   0x040000d4

Definition at line 123 of file gba.h.

#define REG_DMA3DAD   0x040000d8

Definition at line 124 of file gba.h.

#define REG_DMA3CNT   0x040000dc

Definition at line 125 of file gba.h.

#define REG_TMR0CNT   0x04000100

Timer control.

Definition at line 130 of file gba.h.

#define REG_TMR1CNT   0x04000104

Definition at line 131 of file gba.h.

#define REG_TMR2CNT   0x04000108

Definition at line 132 of file gba.h.

#define REG_TMR3CNT   0x0400010c

Definition at line 133 of file gba.h.

Referenced by NutRegisterTimer().

#define REG_SIODATA32   0x04000120

Serial communication control.

Definition at line 138 of file gba.h.

#define REG_SIOCNT   0x04000128

Definition at line 139 of file gba.h.

#define REG_SIODATA8   0x0400012a

Definition at line 140 of file gba.h.

#define REG_KEYINPUT   0x04000130

Keyboard control.

Definition at line 145 of file gba.h.

#define REG_KEYCNT   0x04000132

Definition at line 146 of file gba.h.

#define REG_RCNT   0x04000134

General I/O control.

Definition at line 151 of file gba.h.

#define REG_JOYCNT   0x04000140

JOY Bus control.

Definition at line 156 of file gba.h.

#define REG_JOYSTAT   0x04000158

Definition at line 157 of file gba.h.

#define REG_JOY_RECV   0x04000150

Definition at line 158 of file gba.h.

#define REG_JOY_TRANS   0x04000154

Definition at line 159 of file gba.h.

#define REG_IE   0x04000200

Interrupt control.

Definition at line 164 of file gba.h.

Referenced by NutRegisterTimer().

#define REG_IF   0x04000202

Definition at line 165 of file gba.h.

Referenced by IrqHandler(), and Timer3Entry().

#define REG_WAITCNT   0x04000204

Definition at line 166 of file gba.h.

#define REG_IME   0x04000208

Definition at line 167 of file gba.h.

Referenced by NutRegisterTimer().

#define INT_VBLANK   0x0001

Interrupt flags.

Definition at line 172 of file gba.h.

Referenced by IrqHandler().

#define INT_HBLANK   0x0002

Definition at line 173 of file gba.h.

Referenced by IrqHandler().

#define INT_VCOUNT   0x0004

Definition at line 174 of file gba.h.

Referenced by IrqHandler().

#define INT_TMR0   0x0008

Definition at line 175 of file gba.h.

Referenced by IrqHandler().

#define INT_TMR1   0x0010

Definition at line 176 of file gba.h.

Referenced by IrqHandler().

#define INT_TMR2   0x0020

Definition at line 177 of file gba.h.

Referenced by IrqHandler().

#define INT_TMR3   0x0040

Definition at line 178 of file gba.h.

Referenced by IrqHandler(), NutRegisterTimer(), and Timer3Entry().

#define INT_SIO   0x0080

Definition at line 179 of file gba.h.

Referenced by IrqHandler().

#define INT_DMA0   0x0100

Definition at line 180 of file gba.h.

Referenced by IrqHandler().

#define INT_DMA1   0x0200

Definition at line 181 of file gba.h.

Referenced by IrqHandler().

#define INT_DMA2   0x0400

Definition at line 182 of file gba.h.

Referenced by IrqHandler().

#define INT_DMA3   0x0800

Definition at line 183 of file gba.h.

Referenced by IrqHandler().

#define INT_KEYPAD   0x1000

Definition at line 184 of file gba.h.

Referenced by IrqHandler().

#define INT_GAMEPAK   0x2000

Definition at line 185 of file gba.h.

Referenced by IrqHandler().

#define REG_HALTCNT   0x04000300

Power management control.

Definition at line 190 of file gba.h.

#define outw (   _reg,
  _val 
)    (*((volatile unsigned short *)(_reg)) = (_val))

Definition at line 193 of file gba.h.

Referenced by DebugInit(), NutRegisterTimer(), and Timer3Entry().

#define outdw (   _reg,
  _val 
)    (*((volatile unsigned long *)(_reg)) = (_val))

Definition at line 194 of file gba.h.

Referenced by InitIrqHandler(), and NutRegisterTimer().

#define inw (   _reg)    (*((volatile unsigned short *)(_reg)))

Definition at line 195 of file gba.h.

Referenced by IrqHandler(), and NutRegisterTimer().

#define indw (   _reg)    (*((volatile unsigned long *)(_reg)))

Definition at line 196 of file gba.h.

#define GBAKEY_A   0x0001

Definition at line 199 of file gba.h.

#define GBAKEY_B   0x0002

Definition at line 200 of file gba.h.

#define GBAKEY_SELECT   0x0003

Definition at line 201 of file gba.h.

#define GBAKEY_START   0x0008

Definition at line 202 of file gba.h.

#define GBAKEY_RIGHT   0x0010

Definition at line 203 of file gba.h.

#define GBAKEY_LEFT   0x0020

Definition at line 204 of file gba.h.

#define GBAKEY_UP   0x0040

Definition at line 205 of file gba.h.

#define GBAKEY_DOWN   0x0080

Definition at line 206 of file gba.h.

#define GBAKEY_R   0x0100

Definition at line 207 of file gba.h.

#define GBAKEY_L   0x0200

Definition at line 208 of file gba.h.

#define TMR_PRE_64   0x00010000

Timer control.

Definition at line 213 of file gba.h.

#define TMR_PRE_256   0x00020000

Definition at line 214 of file gba.h.

#define TMR_PRE_1024   0x00030000

Definition at line 215 of file gba.h.

#define TMR_IRQ_ENA   0x00400000

Definition at line 216 of file gba.h.

Referenced by NutRegisterTimer().

#define TMR_ENA   0x00800000

Definition at line 217 of file gba.h.

Referenced by NutRegisterTimer().

#define SIO_BAUD_9600   0x0000

SIO control.

Definition at line 222 of file gba.h.

#define SIO_BAUD_38400   0x0001

Definition at line 223 of file gba.h.

#define SIO_BAUD_57600   0x0002

Definition at line 224 of file gba.h.

#define SIO_BAUD_115200   0x0003

Definition at line 225 of file gba.h.

#define SIO_CTS_ENA   0x0004

Definition at line 226 of file gba.h.

#define SIO_PARITY_ODD   0x0008

Definition at line 227 of file gba.h.

#define SIO_TX_FULL   0x0010

Definition at line 228 of file gba.h.

#define SIO_RX_EMPTY   0x0020

Definition at line 229 of file gba.h.

#define SIO_ERROR   0x0040

Definition at line 230 of file gba.h.

#define SIO_DATA_8BIT   0x0080

Definition at line 231 of file gba.h.

#define SIO_FIFO_ENA   0x0100

Definition at line 232 of file gba.h.

#define SIO_PARITY_ENA   0x0200

Definition at line 233 of file gba.h.

#define SIO_SEND_ENA   0x0400

Definition at line 234 of file gba.h.

#define SIO_RECV_ENA   0x0800

Definition at line 235 of file gba.h.

#define SIO_MODE_32BIT   0x1000

Definition at line 236 of file gba.h.

#define SIO_MODE_MULTI   0x2000

Definition at line 237 of file gba.h.

#define SIO_MODE_UART   0x3000

Definition at line 238 of file gba.h.

#define SIO_IRQ_ENA   0x4000

Definition at line 239 of file gba.h.