orcus
Functions
orcus.h File Reference

Main header file for Orcus functions. More...

#include <stdint.h>
#include <stdbool.h>
#include <uart.h>
#include <rgb.h>
#include <2d.h>
#include <audio.h>
#include <arm940.h>
#include <sd.h>
#include <lcd.h>
#include <dma.h>
#include <timer.h>
#include <cachemmu.h>

Macros

#define A   (1<<0)
 Button.
 
#define B   (1<<1)
 Button.
 
#define DOWN   (1<<7)
 Button.
 
#define DOWN_LEFT   (1<<12)
 Button.
 
#define DOWN_RIGHT   (1<<13)
 Button.
 
#define L   (1<<17)
 Button.
 
#define LEFT   (1<<8)
 Button.
 
#define R   (1<<18)
 Button.
 
#define RIGHT   (1<<9)
 Button.
 
#define SELECT   (1<<5)
 Button.
 
#define START   (1<<4)
 Button.
 
#define STICK   (1<<16)
 Button.
 
#define UP   (1<<6)
 Button.
 
#define UP_LEFT   (1<<10)
 Button.
 
#define UP_RIGHT   (1<<11)
 Button.
 
#define VOL_DOWN   (1<<15)
 Button.
 
#define VOL_UP   (1<<14)
 Button.
 
#define X   (1<<2)
 Button.
 
#define Y   (1<<3)
 Button.
 

Functions

uint32_t btnState ()
 Get current button state. More...
 
uint32_t btnStateDebounced ()
 Get current button state (debounced). More...
 
void gp2xInit ()
 Initialise GP2X. More...
 
bool gp2xIsF200 ()
 Check if running on an F200. More...
 
void gp2xSetCpuSpeed (unsigned int mhz)
 Set the CPU clock speed. More...
 
void gp2xSetDefaultRamTimings ()
 Set default recommended RAM timings. More...
 
void gp2xSetFastRamTimings ()
 Set faster RAM timings. More...
 
void gp2xSetRamTimings (int tRC, int tRAS, int tWR, int tMRD, int tRFC, int tRP, int tRCD)
 Set custom RAM timings. More...
 

Function Documentation

◆ btnState()

uint32_t btnState ( )

Get current button state (raw).

One can check for a particular button state using &.

For example:

uint32_t btnState()
Get current button state.
#define START
Button.
Definition: orcus.h:92
Returns
Currently pressed buttons OR-ed together.
See also
A

◆ btnStateDebounced()

uint32_t btnStateDebounced ( )

Get current button state. This function debounces presses to give a reliable indicator.

One can check for a particular button state using &.

For example:

uint32_t btnStateDebounced()
Get current button state (debounced).
Returns
Currently pressed buttons OR-ed together.
See also
A

◆ gp2xInit()

void gp2xInit ( )

Initialise the GP2X hardware and set up system calls. This must be called before using any other functions from Orcus.

◆ gp2xIsF200()

bool gp2xIsF200 ( )

Check if running on an F200. This tests to see if the NET2272 chip (only fitted to F100s) is present.

Returns
true if running on an F200, false if running on an F100

◆ gp2xSetCpuSpeed()

void gp2xSetCpuSpeed ( unsigned int  mhz)

Set the CPU clock speed (both ARM920T and ARM940T use the same clock source).

◆ gp2xSetDefaultRamTimings()

void gp2xSetDefaultRamTimings ( )

Equivalent to gp2xSetRamTimings(7, 15, 2, 7, 7, 7, 7)

See also
gp2xSetRamTimings

◆ gp2xSetFastRamTimings()

void gp2xSetFastRamTimings ( )

Equivalent to gp2xSetRamTimings(5, 3, 0, 0, 0, 1, 1)

See also
gp2xSetRamTimings

◆ gp2xSetRamTimings()

void gp2xSetRamTimings ( int  tRC,
int  tRAS,
int  tWR,
int  tMRD,
int  tRFC,
int  tRP,
int  tRCD 
)

Sets RAM timing registers in MMSP2.