CVS: python/msp430 jtag.py,1.20,1.21
Chris Liechti <[email protected]>
| Newsgroups | gmane.comp.hardware.texas-instruments.msp430.gcc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/mspgcc/python/msp430
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29614/python/msp430
Modified Files:
jtag.py
Log Message:
clenaups
Index: jtag.py
===================================================================
RCS file: /cvsroot/mspgcc/python/msp430/jtag.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -w -d -r1.20 -r1.21
--- jtag.py 9 Mar 2006 21:00:52 -0000 1.20
+++ jtag.py 13 Mar 2006 23:21:29 -0000 1.21
@@ -38,7 +38,7 @@
#ctypes backend variations:
CTYPES_MSPGCC = "ctypes/mspgcc lib"
-CTYPES_TI = "ctypes/TI lib"
+CTYPES_TI = "ctypes/TI or 3rd party lib"
#exceptions
class JTAGException(Exception): pass
@@ -362,36 +362,39 @@
# ---------- direct use API ---------------
def open(self, lpt=None):
- """Initialize and open port"""
+ """Initialize and open port."""
if lpt is None:
_parjtag.open()
else:
_parjtag.open(lpt)
def connect(self):
- """Connect to devcice"""
+ """Connect to devcice."""
_parjtag.connect()
def close(self):
- """Release device from JTAG"""
+ """Release device from JTAG."""
_parjtag.release()
def setDebugLevel(self, level):
- """Set level of debuggig messages."""
+ """Set level of debugging messages."""
global DEBUG
DEBUG = level
+ #this option is only available in the mspgcc library
if backend == CTYPES_MSPGCC:
_parjtag.configure(DEBUG_OPTION, level)
def setRamsize(self, ramsize):
- """Set download chunk size"""
+ """Set download chunk size."""
if DEBUG > 1: sys.stderr.write("* setRamsize(%d)\n" % ramsize)
+ #this option is only available in the mspgcc library
if backend == CTYPES_MSPGCC:
_parjtag.configure(RAMSIZE_OPTION, ramsize)
else:
if DEBUG > 1: sys.stderr.write("* setRamsize ignored for %s backend\n" % backend)
def downloadData(self, startaddress, data):
+ """Write data to given address."""
_parjtag.memwrite(startaddress, data)
def uploadData(self, startaddress, size):
@@ -400,16 +403,18 @@
return _parjtag.memread(startaddress, size)
def reset(self, execute=0, release=0):
- """perform a reset and optionaly release device."""
+ """Perform a reset and optionally release device."""
if self.verbose:
sys.stderr.write("Reset %sdevice...\n" % (release and 'and release ' or ''))
sys.stderr.flush()
_parjtag.reset(execute, release)
def getCPURegister(self, regnum):
+ """Read CPU register."""
return _parjtag.regread(regnum)
def setCPURegister(self, regnum, value):
+ """Write CPU register."""
_parjtag.regwrite(regnum, value)
# ---------- action based API ---------------
@@ -454,7 +459,8 @@
raise JTAGException("Cannot do erase check against data with not knowing the actual data")
def progess_update(self, count, total):
- """Textual progress output. Override in subclass to implement a different output"""
+ """Textual progress output. Override in subclass to implement a
+ different output."""
sys.stderr.write("\r%d%%" % (100*count/total))
sys.stderr.flush()
@@ -493,7 +499,7 @@
#sys.stderr.write("Load PC with 0x%04x ...\n" % address)
def actionFunclet(self, timeout=1):
- """Download and start funclet. Timeout in seconds"""
+ """Download and start funclet. Timeout in seconds."""
if self.data is not None:
if self.verbose:
sys.stderr.write("Download and execute funclet...\n")
@@ -520,6 +526,7 @@
# simple, stupid module test
if __name__ == '__main__':
+ print "Backend: %s" % (backend, )
jtagobj = JTAG()
jtagobj.open()
try:
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642