From f508189682b6fba62e08feeb1596f682bad5fff9 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 24 Feb 2010 18:42:24 +0000 Subject: Added KDE3 version of PikLab git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/progs/direct/base/direct_mem24.h | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/progs/direct/base/direct_mem24.h (limited to 'src/progs/direct/base/direct_mem24.h') diff --git a/src/progs/direct/base/direct_mem24.h b/src/progs/direct/base/direct_mem24.h new file mode 100644 index 0000000..64f2a9d --- /dev/null +++ b/src/progs/direct/base/direct_mem24.h @@ -0,0 +1,47 @@ +/***************************************************************************\ + * Copyright (C) 2006 Nicolas Hadacek * + * * + * 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_MEM24_H +#define DIRECT_MEM24_H + +#include "devices/mem24/prog/mem24_prog.h" +#include "direct.h" + +namespace Direct +{ + +class Mem24DeviceSpecific : public ::Programmer::Mem24DeviceSpecific +{ +public: + Mem24DeviceSpecific(::Programmer::Base &base); + virtual Hardware &hardware() { return static_cast(*_base.hardware()); } + const Mem24::Data &device() const { return static_cast(*::Programmer::DeviceSpecific::_base.device()); } + virtual bool init() { return true; } + virtual bool setPowerOff(); + virtual bool setPowerOn(); + virtual bool setTargetPowerOn(bool) { return true; } + virtual bool verifyPresence(); + +private: + virtual bool doRead(Device::Array &data, const ::Programmer::VerifyData *vdata); + virtual bool doWrite(const Device::Array &data); + bool start(); + bool stop(); + BitValue readByte(State ack); + bool writeByte(BitValue value, bool &acked); + bool writeByteAck(BitValue value); + void set(State clock, State data); + void setData(State data); + enum Operation { Write, Read }; + uint controlByte(uint address, Operation operation) const; + bool setAddress(uint address); +}; + +} // namespace + +#endif -- cgit v1.2.1