Appendix b, Defined statements for the ktcx card, Ktcx card definitions – Rockwell Automation D17846.2.4 CONTROLNET KT EMULA User Manual
Page 35: Int icard; //global variable that is assigned prio, 0=0x200, 1=0x220,...., 15=0x3e0, Define base ( ( icard * 0x20 ) + 0x200 ), Define shift 0x200, Define, Hreseton, 0x00 * shift + base + 3
Publication 1784-6.2.4 - September 1997
Appendix
B
Defined Statements for the KTCX Card
KTCX Card Definitions
Important: Allen-Bradley assumes no liability for the use of the
example code in this document. It is provided strictly as a guide for
you to help you configure your 1784-KTCX card.
This appendix describes the definitions and their corresponding
values that are used to set-up and run this card:
int iCard;
//Global variable that is assigned
prior to the macros being invoked
// 0=0x200, 1=0x220,...., 15=0x3e0
#define BASE
( ( iCard * 0x20 ) + 0x200 )
#define SHIFT
0x200
/* ISA/EISA interface board register addresses */
/* Interrupt select bits for the AT card control registers
HIRQCTL1,.*/
# define
HRESETON
0x00 * SHIFT + BASE + 3
// reset SMAC
# define
HRESETOFF
0x00 * SHIFT + BASE + 2
// reset SMAC clear
# define
HPTON
0x02 * SHIFT + BASE + 3
// prog terminal on
# define
HPTOFF
0x02 * SHIFT + BASE + 2
// prog terminal off
# define
HIO8
0x06 * SHIFT + BASE + 2
// 8 bit host
# define
HIO16
0x06 * SHIFT + BASE + 3
// 16 bit host
# define
HFAULTON
0x08 * SHIFT + BASE + 3
// KTC processor reset
# define
HFAULTOFF
0x08 * SHIFT + BASE + 2
// KTC processor run mode
# define
HIRQCTRL1
0x34 * SHIFT + BASE + 3
// interrupt control reg 1
# define
HIRQCTRL2
0x38 * SHIFT + BASE + 2
// interrupt control reg 2
# define
IRQ2_HMASK
0x04
# define
IRQ3_HMASK
0x05
# define
IRQ5_HMASK
0x06
# define
IRQ7_HMASK
0x07
# define
IRQ10_HMASK
0x08
# define
IRQ11_HMASK
0x09
# define
IRQ12_HMASK
0x0a
# define
IRQ15_HMASK
0x0b