;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; R56 Developers Toolkit 1995 ;; R56_IO.INC ;; This header file defines the bit positions of the #5010 R56 ;; Adapter. All declarations are pertainig to the I/O mapped ;; control / status ports on the card. This file also contains ;; function prototypes for C callable functions that access the ;; Z16C32 registers and shared memory range. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Macros ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IO_Pause MACRO jmp short $+2 jmp short $+2 jmp short $+2 ENDM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Function Prototypes (card specific) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; VerifyR56 PROTO C, fpR56_INFO:DWORD ResetIUSC PROTO C, fpR56_INFO:DWORD InitIUSC PROTO C fpR56_INFO:DWORD ChangeR56Page PROTO C, fpR56_INFO:DWORD, bPAGE:BYTE IUSCoutb PROTO C, fpR56_INFO:DWORD, bREG:BYTE, bVALUE:BYTE IUSCinb PROTO C, fpR56_INFO:DWORD, bREG:BYTE IUSCout PROTO C, fpR56_INFO:DWORD, bREG:BYTE, wVALUE:WORD IUSCin PROTO C, fpR56_INFO:DWORD, bREG:BYTE DisableR56 PROTO C, fpR56_INFO:DWORD ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Run Time Structures ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IUSCLINKLISTDMA struct lBufferAddress DWORD 0 ; 32 bit buffer address wByteCount WORD 0 ; Byte Count wCSB WORD 0 ; Control Status Block wCCLength WORD 0 ; TCC Length, RCC Residueal, wNotUsed WORD 0 ; Not used lNextAddress DWORD 0 ; Next Buffer or Link Address IUSCLINKLISTDMA ENDS R56_INFO STRUCT MemoryBase DWORD 0 ; MemoryBase InitArray DWORD 0 ; Address of InitArray UserISR DWORD 0 ; TxLinkList DWORD 0 ;fpIUSCLINKLISTDMA RxLinkList DWORD 0 ;fpIUSCLINKLISTDMA wIOAddress WORD 0 ; Base I/O address wRedTxFrames WORD 0 wRedRxFrames WORD 0 wTotalTxFrames WORD 0 wTotalRxFrames WORD 0 wAppTxFrame WORD 0 wAppRxFrame WORD 0 wISRTxFrame WORD 0 wISRRxFrame WORD 0 IOValue1 BYTE 0 ; I/O port value at Base+1 IOValue2 BYTE 0 ; I/O port value at Base+2 IUSCIRQ BYTE 0 ; IRQ (2-15) bStatus BYTE 0 ; R56_INFO ENDS pt equ (R56_INFO ptr [si]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Constants to make init easier. These defines are dependant on the ;; Z16C32 header file (Z16C32.INC) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SELECT_V35 equ Port3_PinCtrl_Output1 OR Port2_PinCtrl_Output0 SELECT_EIA530 equ Port3_PinCtrl_Output1 OR Port2_PinCtrl_Output1 SELECT_RS232 equ Port3_PinCtrl_Output0 OR Port2_PinCtrl_Output0 SELECT_X21 equ Port3_PinCtrl_Output1 OR Port2_PinCtrl_Output1 RTS_ON equ Port7_PinCtrl_Output1 RTS_OFF equ Port7_PinCtrl_Output0 DTR_ON equ Port6_PinCtrl_Output1 DTR_OFF equ Port6_PinCtrl_Output0 CTS_OFF equ CTS_PinStatus_Zero CTS_ON equ CTS_PinStatus_One DCD_OFF equ DCD_PinStatus_Zero DCD_ON equ DCD_PinStatus_One RI_ON equ TxREQ_PinStatus_One RI_ZERO equ TxREQ_PinStatus_Zero DSR_ON equ RxREQ_PinStatus_One DSR_ZERO equ RxREQ_PinStatus_Zero TXC_OUTPUT equ Port5_PinCtrl_Output0 TXC_INPUT equ Port5_PinCtrl_Output1 P0_IS_CLOCK equ Port0_PinCtrl_CTR0_Clock ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Constants to add to register addresses to control initialization. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; writeH EQU 8000H ; write the MS byte writeL EQU 4000H ; write the LS byte writeW EQU 0C000H ; write the whole word checkH EQU 2000H ; read back & check the MB byte checkL EQU 1000H ; read back & check the LS byte checkW EQU 3000H ; read back and check the word ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; I/O offsets ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; R56_0 equ 000000h R56_1 equ 000000h R56_2 equ 000000h R56_3 equ 000000h ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Return Codes and Error Codes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ER_BADRESET equ 01h ; Reset always ON ER_RESETTO equ 02h ; Reset Timed out ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Misc Equates ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; R56_PAGE_SIZE equ 3fffh ; Memory Window Size ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Base+0 Read and Write ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MEM_WIN_ON equ R56_0 OR 80h ; Memory Window ON MEM_WIN_OFF equ R56_0 OR 00h ; Memory Window OFF IUSC_DISABLE equ R56_0 OR 40h ; Disable host access to IUSC registers IUSC_ENABLE equ R56_0 OR 00h ; Enable host access to IUSC registers MEM_PAGE_0 equ R56_0 OR 00h ; Memory Window at Page 0 (HIAD=0 Only) MEM_PAGE_FIRST equ MEM_PAGE_0 MEM_PAGE_1 equ R56_0 OR 01h ; Memory Window at Page 1 (HIAD=0 Only) MEM_PAGE_2 equ R56_0 OR 02h ; Memory Window at Page 2 (HIAD=0 Only) MEM_PAGE_3 equ R56_0 OR 03h ; Memory Window at Page 3 (HIAD=0 Only) MEM_PAGE_4 equ R56_0 OR 04h ; Memory Window at Page 4 (HIAD=0 Only) MEM_PAGE_5 equ R56_0 OR 05h ; Memory Window at Page 5 (HIAD=0 Only) MEM_PAGE_6 equ R56_0 OR 06h ; Memory Window at Page 6 (HIAD=0 Only) MEM_PAGE_7 equ R56_0 OR 07h ; Memory Window at Page 7 (HIAD=0 Only) MEM_PAGE_8 equ R56_0 OR 08h ; Memory Window at Page 8 (HIAD=0 Only) MEM_PAGE_9 equ R56_0 OR 09h ; Memory Window at Page 9 (HIAD=0 Only) MEM_PAGE_A equ R56_0 OR 0Ah ; Memory Window at Page A (HIAD=0 Only) MEM_PAGE_B equ R56_0 OR 0Bh ; Memory Window at Page B (HIAD=0 Only) MEM_PAGE_C equ R56_0 OR 0Ch ; Memory Window at Page C (HIAD=0 Only) MEM_PAGE_D equ R56_0 OR 0Dh ; Memory Window at Page D (HIAD=0 Only) MEM_PAGE_E equ R56_0 OR 0Eh ; Memory Window at Page E (HIAD=0 Only) MEM_PAGE_F equ R56_0 OR 0Fh ; Memory Window at Page F (HIAD=0 Only) MEM_PAGE_LAST equ MEM_PAGE_F ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Base+1 Write Only ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SEL_IRQ_NONE equ R56_1 OR 00h ; No IRQ selected SEL_IRQ_3 equ R56_1 OR 20h ; IRQ 3 Selected SEL_IRQ_4 equ R56_1 OR 40h ; IRQ 4 Selected SEL_IRQ_9 equ R56_1 OR 60h ; IRQ 9 Selected SEL_IRQ_10 equ R56_1 OR 80h ; IRQ 10 Selected SEL_IRQ_11 equ R56_1 OR 0A0h ; IRQ 11 Selected SEL_IRQ_12 equ R56_1 OR 0C0h ; IRQ 12 Selected SEL_IRQ_15 equ R56_1 OR 0E0h ; IRQ 15 Selected ;;Note that the following references are linear notations ;; i.e. C00K = C00000 MEM_HI_C00K equ R56_1 OR 00h ; High Address C00000-C3FFFF (HIAD=1) MEM_HI_C40K equ R56_1 OR 02h ; High Address C40000-C7FFFF (HIAD=1) MEM_HI_C80K equ R56_1 OR 04h ; High Address C80000-CBFFFF (HIAD=1) MEM_HI_CC0K equ R56_1 OR 06h ; High Address CC0000-CFFFFF (HIAD=1) MEM_HI_D00K equ R56_1 OR 08h ; High Address D00000-D3FFFF (HIAD=1) MEM_HI_D40K equ R56_1 OR 0Ah ; High Address D40000-D7FFFF (HIAD=1) MEM_HI_D80K equ R56_1 OR 0Ch ; High Address D80000-DBFFFF (HIAD=1) MEM_HI_DC0K equ R56_1 OR 0Eh ; High Address DC0000-DFFFFF (HIAD=1) MEM_HI_E00K equ R56_1 OR 10h ; High Address E00000-E3FFFF (HIAD=1) MEM_HI_E40K equ R56_1 OR 12h ; High Address E40000-E7FFFF (HIAD=1) MEM_HI_E80K equ R56_1 OR 14h ; High Address E80000-EBFFFF (HIAD=1) MEM_HI_EC0K equ R56_1 OR 16h ; High Address EC0000-EFFFFF (HIAD=1) MEM_HI_F00K equ R56_1 OR 18h ; High Address F00000-F3FFFF (HIAD=1) MEM_HI_F40K equ R56_1 OR 1Ah ; High Address F40000-F7FFFF (HIAD=1) MEM_HI_F80K equ R56_1 OR 1Ch ; High Address F80000-FBFFFF (HIAD=1) MEM_HI_FC0K equ R56_1 OR 1Eh ; High Address FC0000-FFFFFF (HIAD=1) ;; Note that the following references are segment notations ;; i.e. segment 8000 = 80000 linear MEM_LO_8000 equ R56_1 OR 00h ; Low Address 80000-83FFF (HIAD=0) MEM_LO_8400 equ R56_1 OR 01h ; Low Address 84000-87FFF (HIAD=0) MEM_LO_8800 equ R56_1 OR 02h ; Low Address 88000-8BFFF (HIAD=0) MEM_LO_8C00 equ R56_1 OR 03h ; Low Address 8C000-8FFFF (HIAD=0) MEM_LO_9000 equ R56_1 OR 04h ; Low Address 90000-93FFF (HIAD=0) MEM_LO_9400 equ R56_1 OR 05h ; Low Address 94000-97FFF (HIAD=0) MEM_LO_9800 equ R56_1 OR 06h ; Low Address 98000-9BFFF (HIAD=0) MEM_LO_9C00 equ R56_1 OR 07h ; Low Address 9C000-9FFFF (HIAD=0) MEM_LO_A000 equ R56_1 OR 08h ; Low Address A0000-A3FFF (HIAD=0) MEM_LO_A400 equ R56_1 OR 09h ; Low Address A4000-A7FFF (HIAD=0) MEM_LO_A800 equ R56_1 OR 0Ah ; Low Address A8000-ABFFF (HIAD=0) MEM_LO_AC00 equ R56_1 OR 0Bh ; Low Address AC000-AFFFF (HIAD=0) MEM_LO_B000 equ R56_1 OR 0Ch ; Low Address B0000-B3FFF (HIAD=0) MEM_LO_B400 equ R56_1 OR 0Dh ; Low Address B4000-B7FFF (HIAD=0) MEM_LO_B800 equ R56_1 OR 0Eh ; Low Address B8000-BBFFF (HIAD=0) MEM_LO_BC00 equ R56_1 OR 0Fh ; Low Address BC000-BFFFF (HIAD=0) MEM_LO_C000 equ R56_1 OR 10h ; Low Address C0000-C3FFF (HIAD=0) MEM_LO_C400 equ R56_1 OR 11h ; Low Address C4000-C7FFF (HIAD=0) MEM_LO_C800 equ R56_1 OR 12h ; Low Address C8000-CBFFF (HIAD=0) MEM_LO_CC00 equ R56_1 OR 13h ; Low Address CC000-CFFFF (HIAD=0) MEM_LO_D000 equ R56_1 OR 14h ; Low Address D0000-D3FFF (HIAD=0) MEM_LO_D400 equ R56_1 OR 15h ; Low Address D4000-D7FFF (HIAD=0) MEM_LO_D800 equ R56_1 OR 16h ; Low Address D8000-DBFFF (HIAD=0) MEM_LO_DC00 equ R56_1 OR 17h ; Low Address DC000-DFFFF (HIAD=0) MEM_LO_E000 equ R56_1 OR 18h ; Low Address E0000-E3FFF (HIAD=0) MEM_LO_E400 equ R56_1 OR 19h ; Low Address E4000-E7FFF (HIAD=0) MEM_LO_E800 equ R56_1 OR 1Ah ; Low Address E8000-EBFFF (HIAD=0) MEM_LO_EC00 equ R56_1 OR 1Bh ; Low Address EC000-EFFFF (HIAD=0) MEM_LO_F000 equ R56_1 OR 1Ch ; Low Address F0000-F3FFF (HIAD=0) MEM_LO_F400 equ R56_1 OR 1Dh ; Low Address F4000-F7FFF (HIAD=0) MEM_LO_F800 equ R56_1 OR 1Eh ; Low Address F8000-FBFFF (HIAD=0) MEM_LO_FC00 equ R56_1 OR 1Fh ; Low Address FC000-FFFFF (HIAD=0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Base+2 Write Only ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; HIADD equ R56_2 OR 80h ; High Memory Address LOADD equ R56_2 OR 00h ; Low Memory Address ZERO_WS equ R56_2 OR 40h ; Enable zero wait state opperation with RAM NO_ZERO_WS equ R56_2 OR 00h ; Disable zero wait state opperation with RAM EN_16_BIT equ R56_2 OR 20h ; Enable 16 bit operations with RAM ISA_IRQ equ R56_2 OR 10h ; Positive Edge IRQ EISA_IRQ equ R56_2 OR 00h ; wire OR low level IRQ (EISA Only) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Base+3 Read ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; V35_JUMPER equ 80h ; V.35 Header installed IRQ_ACTIVE equ 20h ; The 16C32 Interrupt (IRQ) line is active NOT_RESET equ 10h ; Shows that another write to Base+3 needed SLOT_OK equ 08h ; 1 for 16 bit slot, 0 for 8 bit slot ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Base+3 Write ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RESET_16C32 equ R56_3 OR 00 ; Note that ANY value written to Base+3 ; will reset the board. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of File ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;