};
def setup(self):
- """Move the FET into the SPI application."""
+ """Move the FET into the AVR application."""
self.writecmd(self.AVRAPP,0x10,0,self.data); #SPI/SETUP
def trans(self,data):
--- /dev/null
+#!/usr/bin/env python
+# GoodFET SPI and SPIFlash Client Library
+#
+# (C) 2009 Travis Goodspeed <travis at radiantmachines.com>
+#
+# This code is being rewritten and refactored. You've been warned!
+
+import sys, time, string, cStringIO, struct, glob, serial, os;
+
+from GoodFET import GoodFET;
+
+class GoodFETSmartCard(GoodFET):
+ SMARTCARDAPP=0x73;
+ APP=SMARTCARDAPP;
+
+ def setup(self):
+ """Move the FET into the SmartCard application."""
+ self.writecmd(self.APP,0x10,0,self.data);
+ def start(self):
+ """Start the connection, reat ATR."""
+ self.writecmd(self.APP,0x20,0,None);
h.write_hex_file(f);
if(sys.argv[1]=="status"):
print "Status: %s" %client.CCstatusstr();
+if(sys.argv[1]=="info"):
+ print "%s" % client.CCidentstr();
if(sys.argv[1]=="erase"):
print "Status: %s" % client.CCstatusstr();
client.CCchiperase();
--- /dev/null
+#!/usr/bin/env python
+
+import sys;
+import binascii;
+
+from GoodFETSmartCard import GoodFETSmartCard;
+from intelhex import IntelHex16bit, IntelHex;
+
+#Initialize FET and set baud rate
+client=GoodFETSmartCard();
+client.serInit()
+
+#Connect to target
+client.start();