;-------------------------------------------------------------------
; 80C188EB Peripheral Control Block Registers (cpPCB.def)
;-------------------------------------------------------------------

; Chip-Select Control Registers
CS_REG             EQU     0FFA4h
CSwait0            EQU     00h         ;zero wait cycle
CSwait1            EQU     01h         ;1 wait cycle
CSwait2            EQU     02h
CSwait3            EQU     03h
CSwait4            EQU     04h
CSen               EQU     08h         ;chip-select enable
CSistop            EQU     04h         ;ignore stop address
CSmem              EQU     02h         ;active for memory
CSrdy              EQU     01h         ;wait for external ready

; I/O Port Control Registers
P1PIN              EQU     0FF52h
P1CTRL             EQU     0FF54h      ; 1:CS,    0:I/O
P1LTCH             EQU     0FF56h
P1_TRST            EQU     08h         ; P1.3
P2DIR              EQU     0FF58h      ; 1:input, 0:output
P2PIN              EQU     0FF5Ah
P2CTRL             EQU     0FF5Ch      ; 1:RS232, 0:I/O
P2LTCH             EQU     0FF5Eh
P2_RTS             EQU     02h         ; P2.1
P2_DEBUG           EQU     08h         ; P2.3
P2_TGTRST          EQU     80h         ; P2.7
if (_VERSION_ EQ 0) OR (_VERSION_ EQ 2)
P2_TEA             EQU     40h         ; P2.6
endif

; Serial Port Control Registers
S0BAUD             EQU     0FF60h
S0CNT              EQU     0FF62h
SPiclk             EQU     08000h
S0RBUF             EQU     0FF68h
S0TBUF             EQU     0FF6Ah
S0STATUS           EQU     0FF66h
S0EMPTY            EQU     8           ;transmitter empty
S0CTRL             EQU     0FF64h
SPbrk              EQU     100h        ;TXD pin driven low
SPcts              EQU     040h        ;enable CTS pin
SPren              EQU     020h        ;receiver enable
SPeven             EQU     010h        ;even parity
SPparity           EQU     008h        ;parity enable
SPmod1             EQU     001h        ;mode 1

; Timer controller for WatchDog
T0CNT              equ     0FF30h
T0CMPA             equ     0FF32h
T0CMPB             equ     0FF34h
T0CTRL             equ     0FF36h
T1CNT              equ     0FF38h
T1CMPA             equ     0FF3Ah
T1CMPB             equ     0FF3Ch
T1CTRL             equ     0FF3Eh
T2CNT              equ     0FF40h
T2CMPA             equ     0FF42h
T2CTRL             equ     0FF46h
TmrEN              EQU     08000h      ;timer enable
TmrINH             EQU     04000h      ;inhibit enable bit
TmrINT             EQU     02000h      ;interrupt at maximum count
TmrRIU             EQU     01000h      ;register in use (read only)
TmrMC              EQU     00020h      ;maximum count (read only)
TmrRTG             EQU     00010h      ;retrigger
TmrP               EQU     00008h      ;prescaler
TmrEXT             EQU     00004h      ;external clock
TmrALT             EQU     00002h      ;alternate compare
TmrCONT            EQU     00001h      ;continuous mode

; Interrupt Control Registers
EOI_REG            equ     0FF02h
EOI_DATA           equ     08000h      ;non-specific EOI
INT_REQ            EQU     0FF0Eh
INT_REQ_INT0       EQU     10h

; Interrupt controller
SP_INT             EQU     0FF14h
TM_INT             EQU     0FF12h
TR_INT             EQU     0FF18h      ;INT0
TB_INT             EQU     0FF1Ah      ;INT1
TX_INT             EQU     0FF1Ch      ;INT2
RX_INT             EQU     0FF1Eh      ;INT3
