source: rtems/c/src/lib/libbsp/arm/gba/include/gba.h @ 15ca4e7

4.115
Last change on this file since 15ca4e7 was 15ca4e7, checked in by Joel Sherrill <joel.sherrill@…>, on 01/28/11 at 20:29:35

2011-01-28 Joel Sherrill <joel.sherrilL@…>

  • gba/clock/clockdrv.c, gba/console/conio.c, gba/console/console.c, gba/console/defaultfont.h, gba/include/arm_mode_bits.h, gba/include/asm_macros.h, gba/include/bsp.h, gba/include/conio.h, gba/include/gba.h, gba/include/gba_registers.h, gba/irq/irq.c, gba/irq/irq.h, gba/startup/bspstart.c, gba/timer/timer.c, gp32/include/bsp.h, gp32/startup/bspreset.c, gp32/startup/bspstart.c, nds/tools/runtest, shared/comm/uart.c, shared/comm/uart.h, smdk2410/include/bsp.h: Fix typo where license said found in found in.
  • Property mode set to 100644
File size: 3.9 KB
Line 
1/**
2 *  @file gba.h
3 *
4 *  This include file contains definitions related to the ARM BSP.
5 */
6/*
7 *  RTEMS GBA BSP
8 *
9 *  Copyright (c) 2004  Markku Puro <markku.puro@kopteri.net>
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 *
15 *  $Id$
16 */
17
18#ifndef _GBA_H
19#define _GBA_H
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25#include <gba_registers.h>
26
27/*---------------------------------------------------------------------------*
28 * Clock                                                                     *
29 *---------------------------------------------------------------------------*/
30#define  __ClockFrequency   16780000L    /**< ClockFreguency in Hz           */
31#define  __TimPreScaler     1024L        /**< Prescaler value 1,64,256,1024  */
32
33/*---------------------------------------------------------------------------*
34 * Activation defines                                                        *
35 *---------------------------------------------------------------------------*/
36/**
37 * Multiboot/Cart boot Selection.
38 *
39 * If the variable __gba_multiboot is defined
40 * (probably should be in your main project file) then code
41 * is generated which will run as a multiboot image (code starts
42 * at 0x02000000) or as a normal flash cart / emulator image.
43 * (i.e. start.S copies code from ROM to EWRAM if started in cart
44 * or emulator.) If this variable is not defined then code is
45 * generated for flash cart / emulator only operation (code starts
46 * at 0x08000000).
47 */
48#define MULTIBOOT volatile const unsigned short __gba_multiboot;
49
50/**
51 * IWRAM/EWRAM data Selection.
52 *
53 * If the variable __gba_iwram_data is defined
54 * (probably should be in your main project file) then code
55 * is generated which will allocate data section in IWRAM
56 * (data starts at 0x03000080).
57 * If this variable is not defined then data sections is
58 * allocated in EWRAM (data starts at 0x02000000).
59 */
60#define IWRAMDATA volatile const unsigned short __gba_iwram_data;
61
62/**
63 * IWRAM/EWRAM bss Selection.
64 *
65 * If the variable __gba_iwram_bss is defined
66 * (probably should be in your main project file) then code
67 * is generated which will allocate bss section in IWRAM
68 * (data starts at 0x03000080).
69 * If this variable is not defined then bss sections is
70 * allocated in EWRAM (data starts at 0x02000000).
71 */
72#define IWRAMBSS volatile const unsigned short __gba_iwram_bss;
73
74
75/*---------------------------------------------------------------------------*
76 *  Attributes                                                               *
77 *---------------------------------------------------------------------------*/
78#define CODE_IN_ROM   __attribute__ ((section (".text"), long_call))
79#define CODE_IN_IWRAM __attribute__ ((section (".iwram"), long_call))
80#define IN_IWRAM      __attribute__ ((section (".iwram")))
81#define IN_EWRAM      __attribute__ ((section (".ewram")))
82
83/*---------------------------------------------------------------------------*
84 * Console Keypad                                                            *
85 *---------------------------------------------------------------------------*/
86#define OK_KEY (0==0)  /**< TRUE  */
87#define NO_KEY (0==1)  /**< FALSE */
88#define GBA_KEYS_PRESSED(keys) (( ((~GBA_REG_P1) & (keys)) == (keys)) ? (OK_KEY) : (NO_KEY))
89#define GBA_ANY_KEY(keys)      (( ((~GBA_REG_P1) & (keys)) != 0) ? (OK_KEY) : (NO_KEY))
90#define GBA_KEY()              ((~GBA_REG_P1)&GBA_KEY_ALL)
91
92/*---------------------------------------------------------------------------*
93 * Console Screen                                                            *
94 *---------------------------------------------------------------------------*/
95#define GBA_LCD_WIDTH           240
96#define GBA_LCD_HEIGHT          160
97#define GBA_MODE5_WIDTH         160
98#define GBA_MODE5_HEIGHT        128
99#define GBA_LCD_ASPECT          ((float)(GBA_LCD_WIDTH / GBA_LCD_HEIGHT))
100
101
102#ifdef __cplusplus
103}
104#endif
105
106#endif
Note: See TracBrowser for help on using the repository browser.