;-------------------------------------------------------------------
; 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_EFW             EQU     08h         ; P1.3
P1_EIT             EQU     10h         ; P1.4
P1_LED             EQU     20h         ; P1.5
P2DIR              EQU     0FF58h      ; 1:input, 0:output
P2PIN              EQU     0FF5Ah
P2CTRL             EQU     0FF5Ch      ; 1:RS232, 0:I/O
P2LTCH             EQU     0FF5Eh
P2_RXD             EQU     01h         ; P2.0
P2_TXD             EQU     02h         ; P2.1
P2_DONE            EQU     04h         ; P2.2
P2_NERR            EQU     10h         ; P2.4
P2_RDY             EQU     20h         ; P2.5
P2_NPGM            EQU     40h         ; P2.6
P2_RTS             EQU     80h         ; P2.7

; 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
SP0_INT             EQU     0FF14h
TMR_INT             EQU     0FF12h
TGT_INT             EQU     0FF18h      ;INT0
SP1_INT             EQU     0FF1Ah      ;INT1
