1 /*-------------------------------------------------------------------------
2 r3k.h - definitions on the built in I/O ports for the Rabbit 3000
5 Copyright (C) 2020, Philipp Klaus Krause <pkk AT spth.de>
7 This library is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this library; see the file COPYING. If not, write to the
19 Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
22 As a special exception, if you link this library with other files,
23 some of which are compiled with SDCC, to produce an executable,
24 this library does not by itself cause the resulting executable to
25 be covered by the GNU General Public License. This exception does
26 not however invalidate any other reasons why the executable file
27 might be covered by the GNU General Public License.
28 -------------------------------------------------------------------------*/
34 #define _RABREG(addr, reg) __sfr __at(addr) reg
39 _RABREG(0x0D, GPSCR
); // Global Power Save Control Register
41 _RABREG(0x18, MECR
); // MMu Expanded Code Register
43 _RABREG(0x1C, BDCR
); // Breakpoint/Debug Control Register
45 _RABREG(0x2C, GROM
); // Global RAM Configuration Register
46 _RABREG(0x2D, GRAM
); // Global ROM Configuration Register
48 _RABREG(0x38, PFDR
); // Port F Data Register
49 _RABREG(0x3C, PFCR
); // Port F Control Register
50 _RABREG(0x3D, PFFR
); // Port F Function Register
51 _RABREG(0x3E, PFDCR
); // Port F Drive Control Register
52 _RABREG(0x3F, PFDDR
); // Port F Data Direction Register
54 _RABREG(0x47, PBDDR
); // Port B Data Direction Register
56 _RABREG(0x48, PGDR
); // Port G Data Register
57 _RABREG(0x4C, PGCR
); // Port G Control Register
58 _RABREG(0x4D, PGFR
); // Port G Function Register
59 _RABREG(0x4E, PGDCR
); // Port G Drive Control Register
60 _RABREG(0x4F, PGDDR
); // Port G Data Direction Register
62 // TODO: Input capture registers, section 20.1.2 of the Rabbit 3000 User manual.
64 // TODO: PWM registers, section 22.1.2 of the Rabbit 3000 User manual.
66 _RABREG(0x90, QDCSR
); // Quad Decode Ctrl/Status Register
67 _RABREG(0x91, QDCR
); // Quad Decode Control Register
68 _RABREG(0x94, QDC1R
); // Quad Decode Count 1 Register
69 _RABREG(0x96, QDC2R
); // Quad Decode Count 2 Register
71 _RABREG(0xA5, TAT2R
); // Timer A Time Constant 2 Register
72 _RABREG(0xA6, TAT8R
); // Timer A Time Constant 8 Register
73 _RABREG(0xA7, TAT3R
); // Timer A Time Constant 3 Register
74 _RABREG(0xA8, TAT9R
); // Timer A Time Constant 9 Register
75 _RABREG(0xAA, TAT10R
);// Timer A Time Constant 10 Register
77 _RABREG(0xC5, SAER
); // Serial Port A Extended Register
79 _RABREG(0xD5, SBER
); // Serial Port B Extended Register
81 _RABREG(0xE5, SCER
); // Serial Port C Extended Register
83 _RABREG(0xF5, SDER
); // Serial Port D Extended Register
85 _RABREG(0xC8, SEDR
); // Serial Port E Data Register
86 _RABREG(0xC9, SEAR
); // Serial Port E Address Register
87 _RABREG(0xCA, SELR
); // Serial Port E Long Stop Register
88 _RABREG(0xCB, SESR
); // Serial Port E Status Register
89 _RABREG(0xCC, SECR
); // Serial Port E Control Register
90 _RABREG(0xCD, SEER
); // Serial Port E Extended Register
92 _RABREG(0xD8, SFDR
); // Serial Port F Data Register
93 _RABREG(0xD9, SFAR
); // Serial Port F Address Register
94 _RABREG(0xDA, SFLR
); // Serial Port F Long Stop Register
95 _RABREG(0xDB, SFSR
); // Serial Port F Status Register
96 _RABREG(0xDC, SFCR
); // Serial Port F Control Register
97 _RABREG(0xDD, SFER
); // Serial Port F Extended Register