Subversion Repositories ngs

Rev

Blame | Last modification | View Log | Download | RSS feed | ?url?

  1. #ifndef _JTAG_H
  2. #define _JTAG_H
  3.  
  4. /*
  5.  *  INFO:
  6.  *     jtag.h (C) 2003  Dr. Yuri Klimets (www.jtag.tk, jtagtools.sf.net)  
  7.  *     E-mail: klimets@jtag.tk
  8.  *     Rev. 1.5 - 23.11.2003
  9.  *  
  10.  *  
  11.  *  DESCRIPTION:
  12.  *     Contains definitions for JTAG class
  13.  *     Allows to execute the following commands:
  14.  *        - RESET   - move TAP-controller from any state to RESET
  15.  *        - IDLE    - move TAP-controller from RESET state to Run/Idle state
  16.  *        - IRSCAN  - scan-in specified JTAG-command
  17.  *        - DRSCAN  - scan-in specified JTAG-data
  18.  *
  19.  *
  20.  *  NOTES:
  21.  *     1. _IRSCAN and _DRSCAN are the fast versions of IRSCAN and DRSCAN which
  22.  *        do not capture data from pin TDO
  23.  *     2. All data are shifted from the first byte to TDI
  24.  *     3. 0 and 1 in all data are represented as an ASCIIZ string of '1' and '0'
  25.  *     4. Use line '#define JTAG_LOG' for switching to verbose mode
  26.  *
  27.  *
  28.  *  DEPENDS:
  29.  *     1. Class TAP
  30.  *
  31.  *
  32.  *  DISCLAIMER:
  33.  *     This program is free software; you can redistribute it and/or modify
  34.  *     it under the terms of the GNU General Public License as published by
  35.  *     the Free Software Foundation; either version 2 of the License, or
  36.  *     (at your option) any later version.
  37.  *
  38.  *     This program is distributed in the hope that it will be useful,
  39.  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
  40.  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  41.  *     GNU General Public License for more details.
  42.  *
  43.  *     You should have received a copy of the GNU General Public License
  44.  *     along with this program; if not, write to the Free Software
  45.  *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  46. */  
  47.  
  48. //#define JTAG_LOG
  49. #include "tap.h"
  50.  
  51. class JTAG {
  52.  
  53.   // private properties of class JTAG
  54.   TAP* tap;      // pointer to instance of TAP class to get access to TAP controller
  55.   int  status;   // the status of last operation with class TAP (see defs TAP_ ...)
  56.  
  57.   // private methods of class JTAG
  58.   void TCK_CLOCK(int NUM=1);
  59.  
  60. public:
  61.   // public methods of class JTAG                                  
  62.   JTAG(int mode,int g_size);          // these parameters just translated to the constructor of TAP
  63.   ~JTAG();                            // delete objects and allocated memory
  64.  
  65.   int  GetStatus()                    // returns the status of last operation (see defs TAP_ ...)
  66.        {return status;}  
  67.  
  68.   void RESET();                       // move TAP-controller from any state to RESET
  69.   void IDLE();                        // move TAP-controller from RESET state to Run/Idle state
  70.   void IRSCAN(char * cmd1,char * out1); // scan-in specified in 'cmd1' JTAG-command, output data
  71.                                       // is stored in the 'out1'
  72.   void _IRSCAN(char * cmd1);           // scan-in specified in 'cmd1' JTAG-command
  73.   void DRSCAN(char * in1,char * out1);  // scan-in specified in 'in1' data, output data
  74.                                       // is stored in the 'out1'
  75.   void _DRSCAN(char * in1);            // scan-in specified in 'in1' data
  76.  
  77. };
  78.  
  79. #endif