1 /*******************************************************/ 2 /* file: ports.h */ 3 /* abstract: This file contains extern declarations */ 4 /* for providing stimulus to the JTAG ports.*/ 5 /*******************************************************/ 6 7 #ifndef ports_dot_h 8 #define ports_dot_h 9 10 #include "cpld_jtag.h" 11 12 /* these constants are used to send the appropriate ports to setPort */ 13 /* they should be enumerated types, but some of the microcontroller */ 14 /* compilers don't like enumerated types */ 15 #define TCK (short) 0 16 #define TMS (short) 1 17 #define TDI (short) 2 18 19 /* set the port "p" (TCK, TMS, or TDI) to val (0 or 1) */ 20 extern void setPort(jtag_gpio_t* const gpio, short p, short val); 21 22 /* read the TDO bit and store it in val */ 23 extern unsigned char readTDOBit(jtag_gpio_t* const gpio); 24 25 /* make clock go down->up->down*/ 26 extern void pulseClock(jtag_gpio_t* const gpio); 27 28 /* read the next byte of data from the xsvf file */ 29 extern void readByte(unsigned char *data); 30 31 extern void waitTime(jtag_gpio_t* const gpio, long microsec); 32 33 #endif 34