-
Notifications
You must be signed in to change notification settings - Fork 4
/
rex.h
78 lines (67 loc) · 1.17 KB
/
rex.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#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