summaryrefslogtreecommitdiffstats
path: root/src/progs/direct/base/direct_18F.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
commitf508189682b6fba62e08feeb1596f682bad5fff9 (patch)
tree28aeb0e6c19386c385c1ce5edf8a92c1bca15281 /src/progs/direct/base/direct_18F.h
downloadpiklab-f508189682b6fba62e08feeb1596f682bad5fff9.tar.gz
piklab-f508189682b6fba62e08feeb1596f682bad5fff9.zip
Added KDE3 version of PikLab
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/progs/direct/base/direct_18F.h')
-rw-r--r--src/progs/direct/base/direct_18F.h107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/progs/direct/base/direct_18F.h b/src/progs/direct/base/direct_18F.h
new file mode 100644
index 0000000..c3cbcf8
--- /dev/null
+++ b/src/progs/direct/base/direct_18F.h
@@ -0,0 +1,107 @@
+/***************************************************************************
+ * Copyright (C) 2006 Nicolas Hadacek <hadacek@kde.org> *
+ * Copyright (C) 2003-2005 Alain Gibaud <alain.gibaud@free.fr> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ ***************************************************************************/
+#ifndef DIRECT_18F_H
+#define DIRECT_18F_H
+
+#include "direct_18.h"
+
+namespace Direct
+{
+//-----------------------------------------------------------------------------
+class P18F : public P18
+{
+public:
+ P18F(::Programmer::Base &base) : P18(base) {}
+ virtual bool doRead(Pic::MemoryRangeType type, Device::Array &data, const ::Programmer::VerifyData *vdata);
+ virtual bool doWrite(Pic::MemoryRangeType, const Device::Array &data, bool force);
+ virtual bool doEraseCommand(uint cmd1, uint cmd2);
+ virtual bool doEraseRange(Pic::MemoryRangeType type);
+ virtual bool doErase(bool isProtected);
+
+ bool skipMaskWords(Pic::MemoryRangeType type, const Device::Array &data,
+ uint &i, uint nb, bool force);
+ void setPointer(Pic::MemoryRangeType type, uint offset);
+ void setCodePointer(uint address);
+ enum Type { Code, Eeprom, Erase };
+ virtual void program(Type type);
+ virtual uint programHighTime(Type type) const { return (type==Code ? 1000 : 5000); }
+ virtual uint programLowTime() { return 5; }
+ virtual void configureSinglePanel() {}
+ virtual void unlockEeprom();
+ virtual void directAccess(Pic::MemoryRangeType type);
+};
+
+//-----------------------------------------------------------------------------
+class P18F1220 : public P18F
+{
+public:
+ P18F1220(::Programmer::Base &base) : P18F(base) {}
+ virtual void program(Type type);
+};
+
+//-----------------------------------------------------------------------------
+class P18F242 : public P18F
+{
+public:
+ P18F242(::Programmer::Base &base) : P18F(base) {}
+ virtual void configureSinglePanel();
+};
+
+//-----------------------------------------------------------------------------
+class P18F2539 : public P18F242
+{
+public:
+ P18F2539(::Programmer::Base &base) : P18F242(base) {}
+ virtual bool doErase(bool isProtected);
+ virtual bool doEraseCommand(uint cmd1, uint cmd2);
+};
+
+//-----------------------------------------------------------------------------
+class P18F2439 : public P18F2539
+{
+public:
+ P18F2439(::Programmer::Base &base) : P18F2539(base) {}
+ virtual bool doEraseRange(Pic::MemoryRangeType type);
+};
+
+//-----------------------------------------------------------------------------
+class P18F2221 : public P18F
+{
+public:
+ P18F2221(::Programmer::Base &base) : P18F(base) {}
+ virtual bool doEraseRange(Pic::MemoryRangeType type);
+ virtual bool doErase(bool isProtected);
+ virtual uint programLowTime() { return 100; }
+ virtual void unlockEeprom() {}
+};
+
+//-----------------------------------------------------------------------------
+class P18F6527 : public P18F2221
+{
+public:
+ P18F6527(::Programmer::Base &base) : P18F2221(base) {}
+ virtual bool doErase(bool isProtected);
+};
+
+//-----------------------------------------------------------------------------
+class P18F6310 : public P18F
+{
+public:
+ P18F6310(::Programmer::Base &base) : P18F(base) {}
+ virtual bool canEraseRange(Pic::MemoryRangeType) const { return false; }
+ virtual uint programHighTime(Type type) const { return (type==Code ? 2000 : 30000); }
+ virtual uint programLowTime() { return 120; }
+ virtual bool doEraseRange(Pic::MemoryRangeType) { return false; }
+ virtual bool doErase(bool isProtected);
+};
+
+} // namespace
+
+#endif