summaryrefslogtreecommitdiffstats
path: root/src/progs/bootloader/base/bootloader.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/bootloader/base/bootloader.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/bootloader/base/bootloader.h')
-rw-r--r--src/progs/bootloader/base/bootloader.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/progs/bootloader/base/bootloader.h b/src/progs/bootloader/base/bootloader.h
new file mode 100644
index 0000000..08a0730
--- /dev/null
+++ b/src/progs/bootloader/base/bootloader.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+ * Copyright (C) 2007 Nicolas Hadacek <hadacek@kde.org> *
+ * *
+ * 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 BOOTLOADER_H
+#define BOOTLOADER_H
+
+#include "devices/pic/prog/pic_prog.h"
+
+namespace Bootloader
+{
+//-----------------------------------------------------------------------------
+class Hardware : public ::Programmer::PicHardware
+{
+public:
+ Hardware(::Programmer::Base &base, Port::Base *port) : ::Programmer::PicHardware(base, port, QString::null) {}
+ virtual bool write(Pic::MemoryRangeType type, const Device::Array &data) = 0;
+ virtual bool read(Pic::MemoryRangeType type, Device::Array &data, const ::Programmer::VerifyData *vdata) = 0;
+ virtual bool internalConnectHardware() = 0;
+ virtual bool openPort() { return _port->open(); }
+};
+
+//-----------------------------------------------------------------------------
+class DeviceSpecific : public ::Programmer::PicDeviceSpecific
+{
+public:
+ DeviceSpecific(::Programmer::Base &base) : ::Programmer::PicDeviceSpecific(base) {}
+ Hardware &hardware() { return static_cast<Hardware &>(*_base.hardware()); }
+ virtual bool setPowerOff() { return false; }
+ virtual bool setPowerOn() { return false; }
+ virtual bool setTargetPowerOn(bool) { return true; }
+ virtual bool doRead(Pic::MemoryRangeType type, Device::Array &data, const ::Programmer::VerifyData *vdata) { return hardware().read(type, data, vdata); }
+ virtual bool doWrite(Pic::MemoryRangeType type, const Device::Array &data, bool) { return hardware().write(type, data); }
+};
+
+} // namespace
+
+#endif