diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 18:42:24 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 18:42:24 +0000 |
commit | f508189682b6fba62e08feeb1596f682bad5fff9 (patch) | |
tree | 28aeb0e6c19386c385c1ce5edf8a92c1bca15281 /src/devices/mem24/prog/mem24_prog.h | |
download | piklab-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/devices/mem24/prog/mem24_prog.h')
-rw-r--r-- | src/devices/mem24/prog/mem24_prog.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/devices/mem24/prog/mem24_prog.h b/src/devices/mem24/prog/mem24_prog.h new file mode 100644 index 0000000..86948c2 --- /dev/null +++ b/src/devices/mem24/prog/mem24_prog.h @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek <[email protected]> * + * * + * 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 MEM24_PROG_H +#define MEM24_PROG_H + +#include "progs/base/generic_prog.h" +#include "devices/mem24/mem24/mem24_memory.h" + +namespace Programmer +{ +//----------------------------------------------------------------------------- +class Mem24DeviceSpecific : public DeviceSpecific +{ +public: + Mem24DeviceSpecific(::Programmer::Base &base) : DeviceSpecific(base) {} + const Mem24::Data &device() const { return static_cast<const Mem24::Data &>(*_base.device()); } + bool read(Device::Array &data, const VerifyData *vdata); + bool write(const Device::Array &data); + bool verifyByte(uint index, BitValue d, const VerifyData &vdata); + virtual bool verifyPresence() = 0; + +protected: + virtual bool doRead(Device::Array &data, const VerifyData *vdata) = 0; + virtual bool doWrite(const Device::Array &data) = 0; +}; + +//----------------------------------------------------------------------------- +class Mem24Hardware : public Hardware +{ +public: + Mem24Hardware(::Programmer::Base &base, Port::Base *port, const QString &name) : Hardware(base, port, name) {} + const Mem24::Data &device() const { return static_cast<const Mem24::Data &>(*_base.device()); } +}; + +//----------------------------------------------------------------------------- +class Mem24Base : public Base +{ +public: + Mem24Base(const Group &group, const Mem24::Data *data, const char *name) : Base(group, data, name) {} + const Mem24::Data *device() const { return static_cast<const Mem24::Data *>(_device); } + +protected: + Mem24DeviceSpecific *specific() const { return static_cast<Mem24DeviceSpecific *>(_specific); } + virtual bool verifyDeviceId(); + virtual uint nbSteps(Task task, const Device::MemoryRange *range) const; + virtual bool initProgramming() { return true; } + virtual bool checkErase() { return true; } + virtual bool internalErase(const Device::MemoryRange &range); + virtual bool checkRead() { return true; } + virtual bool internalRead(Device::Memory *memory, const Device::MemoryRange &range, const VerifyData *vdata); + virtual bool checkProgram(const Device::Memory &) { return true; } + virtual bool internalProgram(const Device::Memory &memory, const Device::MemoryRange &range); +}; + +} // namespace + +#endif |