00001 /*-------------------------------------------------------------------- 00002 * jtag_driver.h -- JTAG Bit Level Driver Abstract Definition 00003 *-------------------------------------------------------------------- 00004 * $Id: jtag_driver.h,v 1.1 2003/04/08 08:59:53 cgaudin Exp $ 00005 *-------------------------------------------------------------------- 00006 * This file is part of JTAG Framework 00007 * Copyright (c) in 2002, 2003 by 00008 * Julien Pilet <julien.pilet@epfl.ch> and 00009 * Stephane Magnenat <stephane.magnenat@epfl.ch> and 00010 * Cédric Gaudin <cedric.gaudin@epfl.ch> 00011 *-------------------------------------------------------------------- 00012 * JTAG Framework is free software; you can redistribute it 00013 * and/or modify it under the terms of the GNU General Public License 00014 * as published by the Free Software Foundation; either version 2 of 00015 * the License, or (at your option) any later version. 00016 * 00017 * JTAG Framework is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU General Public License 00023 * along with Foobar; if not, write to: 00024 * Free Software Foundation, Inc., 00025 * 59 Temple Place, 00026 * Suite 330, Boston, MA 02111-1307 USA 00027 *-------------------------------------------------------------------- 00028 * Platform independent 00029 *--------------------------------------------------------------------*/ 00030 00039 #ifndef _JTAG_DRIVER_H_ 00040 #define _JTAG_DRIVER_H_ 00041 00042 // Signals Constants 00043 #define SIGNAL_TMS 0 // JTAG Mode Select 00044 #define SIGNAL_TDI 1 // JTAG Data Input 00045 #define SIGNAL_CPU_RESET 2 // CPU RESET* 00046 00048 class JTAG_Driver 00049 { 00050 public: 00052 virtual bool init( int argc , 00053 char **argv ) = 0; 00054 00056 // \!param signal - signal to change 00057 // \!param value - binary value that signal must be 00058 // \!param clock - generate a clock edge 00059 // \!param test - use direct or buffered write 00060 virtual bool drive_signal( int signal , 00061 bool value , 00062 bool clock , 00063 bool test ) = 0; 00064 00066 // \!param bit_count - number of bits to exchange 00067 // \!param data - value to write to IC via TDI 00068 // \!param instruction - tell whether it's an instruction or 00069 // a data bit vector 00070 virtual unsigned long transfer_data( int bit_count , 00071 unsigned long data , 00072 bool instruction ) = 0; 00073 00075 virtual void flush() = 0; 00076 00078 virtual const char *getName() const = 0; 00079 00081 //virtual char *getErrorMessage() = 0; 00082 00083 }; 00084 00085 #endif // _JTAG_DRIVER_H_ 00086