projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Nothing major.
[goodfet]
/
client
/
GoodFET.py
diff --git
a/client/GoodFET.py
b/client/GoodFET.py
index
b335b4d
..
f80a46d
100755
(executable)
--- a/
client/GoodFET.py
+++ b/
client/GoodFET.py
@@
-10,6
+10,7
@@
import sys, time, string, cStringIO, struct, glob, serial, os;
class GoodFET:
class GoodFET:
+ """GoodFET Client Library"""
def __init__(self, *args, **kargs):
self.data=[0];
def timeout(self):
def __init__(self, *args, **kargs):
self.data=[0];
def timeout(self):
@@
-17,7
+18,7
@@
class GoodFET:
def serInit(self, port=None):
"""Open the serial port"""
def serInit(self, port=None):
"""Open the serial port"""
- if port is None:
+ if port is None
and os.environ.get("GOODFET")!=None
:
glob_list = glob.glob(os.environ.get("GOODFET"));
if len(glob_list) > 0:
port = glob_list[0];
glob_list = glob.glob(os.environ.get("GOODFET"));
if len(glob_list) > 0:
port = glob_list[0];
@@
-47,7
+48,7
@@
class GoodFET:
if(self.verb!=0x7F):
print "Verb %02x is wrong. Incorrect firmware?" % self.verb;
#print "Connected."
if(self.verb!=0x7F):
print "Verb %02x is wrong. Incorrect firmware?" % self.verb;
#print "Connected."
- def writecmd(self, app, verb, count, data=[], blocks=1):
+ def writecmd(self, app, verb, count
=0
, data=[], blocks=1):
"""Write a command and some data to the GoodFET."""
self.serialport.write(chr(app));
self.serialport.write(chr(verb));
"""Write a command and some data to the GoodFET."""
self.serialport.write(chr(app));
self.serialport.write(chr(verb));
@@
-152,7
+153,6
@@
class GoodFET:
def SPIsetup(self):
"""Moved the FET into the SPI application."""
self.writecmd(0x01,0x10,0,self.data); #SPI/SETUP
def SPIsetup(self):
"""Moved the FET into the SPI application."""
self.writecmd(0x01,0x10,0,self.data); #SPI/SETUP
-
def SPItrans8(self,byte):
"""Read and write 8 bits by SPI."""
def SPItrans8(self,byte):
"""Read and write 8 bits by SPI."""
@@
-207,14
+207,6
@@
class GoodFET:
0];
self.SPItrans(data);
return ord(self.data[4]);
0];
self.SPItrans(data);
return ord(self.data[4]);
-# def SPIpeekblock(self,adr):
-# """Grab a block from an SPI Flash ROM. Block size is unknown"""
-# data=[(adr&0xFF0000)>>16,
-# (adr&0xFF00)>>8,
-# adr&0xFF];
-
-# self.writecmd(0x01,0x02,3,data);
-# return self.data;
def SPIpeekblock(self,adr,blocks=1):
"""Grab a few block from an SPI Flash ROM. Block size is unknown"""
data=[(adr&0xFF0000)>>16,
def SPIpeekblock(self,adr,blocks=1):
"""Grab a few block from an SPI Flash ROM. Block size is unknown"""
data=[(adr&0xFF0000)>>16,
@@
-260,6
+252,7
@@
class GoodFET:
if device==0:
device="???"
return "%s %s" % (man,device);
if device==0:
device="???"
return "%s %s" % (man,device);
+
def MSP430setup(self):
"""Move the FET into the MSP430 JTAG application."""
print "Initializing MSP430.";
def MSP430setup(self):
"""Move the FET into the MSP430 JTAG application."""
print "Initializing MSP430.";