Root/Software/xc3sprog/iobase.h

1/* JTAG low level functions and base class for cables
2
3Copyright (C) 2004 Andrew Rogers
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation; either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
18
19
20
21
22#ifndef IOBASE_H
23#define IOBASE_H
24
25class IOBase
26{
27 public:
28  enum tapState_t{
29    TEST_LOGIC_RESET=0,
30    RUN_TEST_IDLE=1,
31    SELECT_DR_SCAN=2,
32    CAPTURE_DR=3,
33    SHIFT_DR=4,
34    EXIT1_DR=5,
35    PAUSE_DR=6,
36    EXIT2_DR=7,
37    UPDATE_DR=8,
38    SELECT_IR_SCAN=9,
39    CAPTURE_IR=10,
40    SHIFT_IR=11,
41    EXIT1_IR=12,
42    PAUSE_IR=13,
43    EXIT2_IR=14,
44    UPDATE_IR=15,
45    UNKNOWN=999
46  };
47 protected:
48  tapState_t current_state;
49  virtual bool txrx(bool tms, bool tdi){}
50  virtual void tx(bool tms, bool tdi){}
51  int nextTapState(bool tms);
52 public:
53  IOBase();
54  virtual int shiftTDITDO(const unsigned char *tdi, unsigned char *tdo, int length, bool last=true);
55  virtual int shiftTDI(const unsigned char *tdi, int length, bool last=true);
56  virtual int shiftTDO(unsigned char *tdo, int length, bool last=true);
57  virtual int shift(bool tdi, int length, bool last=true);
58  virtual int setTapState(tapState_t state);
59  virtual void tapTestLogicReset();
60  virtual void cycleTCK(int n, bool tdi=1);
61};
62
63
64
65#endif // IOBASE_H
66

Archive Download this file

Branches:
master



interactive