Skip to content

Commit

Permalink
included rex.h
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-marr committed Feb 14, 2019
1 parent 2a25bc4 commit 6143c23
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

`wcc` is a C compiler targeted at the WRAMP architecture. It is based on
`lcc`, a retargetable compiler. Copyright information for `lcc` can be found
in [CPYRIGHT](CPYRIGHT).
in [CPYRIGHT](CPYRIGHT). Also included in this repo is `rex.h`, a header
file containning definitions for WRAMP IO structures.

## Usage

Expand Down
78 changes: 78 additions & 0 deletions rex.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#ifndef REX_H
#define REX_H

/**
* REX Serial Ports
**/
typedef volatile struct
{
int Tx;
int Rx;
int Ctrl;
int Stat;
int Iack;
} RexSp_t;

#define SP_STAT_RX_RDY (1 << 0)
#define SP_STAT_TX_RDY (1 << 1)
#define SP_STAT_ERR_OVR (1 << 2)
#define SP_STAT_ERR_FRM (1 << 3)
#define SP_STAT_ERR_PAR (1 << 4)

#define SP_CTRL_TX_INT_EN (1 << 9)
#define SP_CTRL_RX_INT_EN (1 << 10)
#define SP_CTRL_INT_EN (1 << 11)

#define SP_IACK_RX (1 << 0)
#define SP_IACK_TX (1 << 1)
#define SP_IACK_ERR (1 << 2)


/**
* REX Timer
**/
typedef volatile struct
{
int Ctrl;
int Load;
int Count;
int Iack;
} RexTimer_t;

/**
* REX Parallel Port
**/
typedef volatile struct
{
int Switches;
int Buttons;
int LeftSSD;
int RightSSD;
int Ctrl;
int Iack;
int SSD0;
int SSD1;
int SSD2;
int SSD3;
int LEDs;
} RexParallel_t;

/**
* REX User Interrupt Button
**/
typedef volatile struct
{
int Iack;
} RexUserInt_t;

/**
* Declarations
**/
#define RexSp1 ((RexSp_t*)0x70000)
#define RexSp2 ((RexSp_t*)0x71000)
#define RexTimer ((RexTimer_t*)0x72000)
#define RexParallel ((RexParallel_t*)0x73000)
#define RexUserInt ((RexUserInt_t*)0x7f000)

#endif

0 comments on commit 6143c23

Please sign in to comment.