www.pudn.com > jtag_src.rar > jtag.h
/* * jtag.h : the head file for jtag.c * * This head file defines the connection between parallel port and JTAG. * Wiggler is supported by defaul. If you want to support other interfaces, * please change the configuration by yourself. * * Copyright (C) 2004, OPEN-JTAG, All rights reserved. */ #ifndef XJTAG_JTAG_H #define XJTAG_JTAG_H #include "types.h" #define WIGGLER /* * The followint table shows the pin assignment of 25-pin Parallel Printer Port. * please refer to IEEE 1284 standard for detailed description. * data port (Out) status port (In) * bit[7] -- pin9 (Out) bit[7] -- pin11 (In), busy (Hardware Inverted) * bit[6] -- pin8 (Out) bit[6] -- pin10 (In), Ack * bit[5] -- pin7 (Out) bit[5] -- pin12 (In), Paper out * bit[4] -- pin6 (Out) bit[4] -- pin13 (In), Select * bit[3] -- pin5 (Out) bit[3] -- pin15 (In), Error * bit[2] -- pin4 (Out) bit[2] -- IRQ(Not) * bit[1] -- pin3 (Out) bit[1] -- Reserved * bit[0] -- pin2 (Out) bit[0] -- Reserved */ /* I/O address of parallet port */ #define PARAL_DATA_PORT 0x378 #define PARAL_STAT_PORT 0x379 #define PARAL_INIT_DATA 0x0 #define PARAL_PIN_11 0x80 //A special pin (Hardware Inverted) /* Connection definition between JTAG & Parallel Port */ #ifdef WIGGLER //WIGGLER #define JTAG_NTRST_MASK 0x01 // Pin2 #define JTAG_TMS_MASK 0x02 // Pin3 #define JTAG_TCK_MASK 0x04 // Pin4 #define JTAG_TDI_MASK 0x08 // Pin5 #define JTAG_TDO_MASK 0x80 // Pin11 Hardware Inverted #else //SDT JTAG #define JTAG_NTRST_MASK 0x04 // Pin4 #define JTAG_TMS_MASK 0x02 // Pin3 #define JTAG_TCK_MASK 0x01 // Pin2 #define JTAG_TDI_MASK 0x40 // Pin8 #define JTAG_TDO_MASK 0x10 // Pin13 #endif extern int jtag_init(void); extern int jtag_rd_rdo(void); extern void jtag_wri_tck(void); extern void jtag_wri_tms(u8 new_val); extern void jtag_wri_tdi(u8 new_val); extern void jtag_wri_ntrst(u8 new_val); #endif /* end of jtag.h */