summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2013-10-14 21:49:19 +0200
committerMichael Buesch <m@bues.ch>2013-10-14 21:49:19 +0200
commit14d054a561a9e21ad8559dfde62be3bc2c752f97 (patch)
treee76add489ad5419b5012f0222661e9d7eb4ed19b
parent8aa6c9c4157c708020743c63814ba70fd365db67 (diff)
downloadtoprammer-14d054a561a9e21ad8559dfde62be3bc2c752f97.tar.xz
toprammer-14d054a561a9e21ad8559dfde62be3bc2c752f97.zip
Microchip: Clear sig and eeprom support flags on chips that don't support them
Signed-off-by: Michael Buesch <m@bues.ch>
-rw-r--r--libtoprammer/chip.py2
-rw-r--r--libtoprammer/chips/microchip8/microchip8_common.py12
-rw-r--r--libtoprammer/chips/microchip8/microchip8_singlePMarea.py1
3 files changed, 14 insertions, 1 deletions
diff --git a/libtoprammer/chip.py b/libtoprammer/chip.py
index 7fa9ba8..e564daa 100644
--- a/libtoprammer/chip.py
+++ b/libtoprammer/chip.py
@@ -27,7 +27,7 @@ from generic_algorithms import *
from ihex import *
-class Chip:
+class Chip(object):
SUPPORT_ERASE = (1 << 0)
SUPPORT_SIGREAD = (1 << 1)
SUPPORT_PROGMEMREAD = (1 << 2)
diff --git a/libtoprammer/chips/microchip8/microchip8_common.py b/libtoprammer/chips/microchip8/microchip8_common.py
index ec0be85..f849895 100644
--- a/libtoprammer/chips/microchip8/microchip8_common.py
+++ b/libtoprammer/chips/microchip8/microchip8_common.py
@@ -41,6 +41,8 @@ class Chip_Microchip8_common(Chip):
# EEPROM access: default off, if exists override it
hasEEPROM = False
+ # Signature bytes access: default on, if doesn't exist, override it
+ hasSigBytes = True
# default delays - can be overridden
delayTdly5 = 0.00000015
@@ -49,6 +51,16 @@ class Chip_Microchip8_common(Chip):
delayTdly = 0.000001
delayTera = 0.01
+ @classmethod
+ def getSupportFlags(cls):
+ flags = super(Chip_Microchip8_common, cls).getSupportFlags()
+ if not cls.hasEEPROM:
+ flags &= ~(Chip.SUPPORT_EEPROMREAD |\
+ Chip.SUPPORT_EEPROMWRITE)
+ if not cls.hasSigBytes:
+ flags &= ~Chip.SUPPORT_SIGREAD
+ return flags
+
def __init__(self,
chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
signature,
diff --git a/libtoprammer/chips/microchip8/microchip8_singlePMarea.py b/libtoprammer/chips/microchip8/microchip8_singlePMarea.py
index 8eea33b..a3bacb7 100644
--- a/libtoprammer/chips/microchip8/microchip8_singlePMarea.py
+++ b/libtoprammer/chips/microchip8/microchip8_singlePMarea.py
@@ -27,6 +27,7 @@ class microchip8_singlePMarea(Chip_Microchip8_common):
CMD_END_PROGRAMMING = 0x0E
userIDLocationSize = 4
+ hasSigBytes = False
voltageVDD = 5
voltageVPP = 13
bues.ch cgit interface