changeset 11:520f45b72ba7

Add debug_frame flag to enable print-out frame when received
author Thinker K.F. Li <thinker@branda.to>
date Tue, 24 Feb 2009 14:33:23 +0800
parents cc106f278d7d
children 68ecd42850d3
files py_avrjtag/jtagdev.py
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/py_avrjtag/jtagdev.py	Tue Feb 24 13:32:04 2009 +0800
+++ b/py_avrjtag/jtagdev.py	Tue Feb 24 14:33:23 2009 +0800
@@ -1,6 +1,8 @@
 import tms_ptns
 import cmd_proto
 
+debug_frame = 0
+
 class jtagdev(object):
     ST_RESET = 0
     ST_IDLE = 1
@@ -55,6 +57,9 @@
         
         if not frame:
             return None
+        if debug_frame:
+            print repr(frame)
+            pass
         
         cmd = cmd_proto.cmd()
         r = cmd.from_frame(frame)
@@ -117,6 +122,17 @@
         self.state = self.ST_EXIT1_IR
         pass
 
+    def shift_IR_n_out(self, data, nbits):
+        self.seq = (self.seq + 1) % 256
+
+        if self.state != self.ST_SHIFT_IR:
+            raise RuntimeError, 'Invalid state'
+
+        self._send_nbits_data_cmd(cmd_proto.CPCMD_SHIFT_TDI_TDO,
+                                  nbits, data)
+        self.state = self.ST_EXIT1_IR
+        pass
+
     def shift_DR(self, data, nbits):
         self.seq = (self.seq + 1) % 256