jtag.h (1394B)
1 /* Copyright 2012 Brian Swetland <swetland@frotz.net> 2 * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef _JTAG_H_ 17 #define _JTAG_H_ 18 19 int jtag_open(void); 20 int jtag_close(void); 21 22 /* move into RESET state */ 23 int jtag_reset(void); 24 25 /* clock count times, TDI=0, TMS=bits[0], bits >>= 1 */ 26 int jtag_move(int count, unsigned bits); 27 28 /* clock count-1 times, TMS=0, TDI=bits[0], bits >>= 1 29 * clock 1 time, TMS=1, TDI=bits[0] 30 * if out, capture TDO into out 31 */ 32 int jtag_shift(int count, unsigned bits, unsigned *out); 33 34 35 /* load sz bits into IR */ 36 int jtag_ir(unsigned sz, unsigned bits); 37 38 /* load sz bits into DR, capture sz bits into out if non-null */ 39 int jtag_dr(unsigned sz, unsigned bits, unsigned *out); 40 41 42 /* altera virtual jtag support */ 43 int jtag_open_virtual_device(unsigned iid); 44 int jtag_vir(unsigned vir); 45 int jtag_vdr(unsigned sz, unsigned bits, unsigned *out); 46 47 #endif