summaryrefslogtreecommitdiffstats
path: root/src/progs/pickit1/base/pickit1.h
blob: 75e1d82e185c3bb34b55b3010de73c3fd1e56128 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/***************************************************************************
 * Copyright (C) 2006 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 PICKIT1_H
#define PICKIT1_H

#include "progs/pickit2/base/pickit.h"
#include "pickit1_data.h"

namespace Pickit1
{
//-----------------------------------------------------------------------------
class Array : public Pickit::Array
{
public:
  Array() : Pickit::Array(8, 'Z', PrintAlphaNum) {}
};

//-----------------------------------------------------------------------------
class USBPort : public Pickit::USBPort
{
public:
  USBPort(Log::Base &log) : Pickit::USBPort(0x0032, log) {}
  virtual Pickit::Array array() const { return Array(); }

private:
  virtual uint readEndPoint() const { return 0x81; }
  virtual uint writeEndPoint() const { return 0x01; }
};

//-----------------------------------------------------------------------------
class Hardware : public Pickit::Hardware
{
public:
  Hardware(::Programmer::Base &base) : Pickit::Hardware(base, new USBPort(base)) {}
};

//----------------------------------------------------------------------------
class Baseline : public Pickit::Baseline
{
public:
  Baseline(::Programmer::Base &base) : Pickit::Baseline(base) {}
  virtual char entryMode() const { return data(device().name()).entryMode; }
  virtual bool init();
  virtual uint nbWrites(Pic::MemoryRangeType) const { return 1; }
  virtual bool incrementPC(uint nb);
};

//----------------------------------------------------------------------------
class P16F : public Pickit::P16F
{
public:
  P16F(::Programmer::Base &base) : Pickit::P16F(base) {}
  virtual char entryMode() const { return data(device().name()).entryMode; }
  virtual bool init();
  virtual uint nbWrites(Pic::MemoryRangeType) const { return 1; }
};

class P16F716 : public P16F
{
public:
  P16F716(::Programmer::Base &base) : P16F(base) {}
  virtual bool init();
};

} // namespace

#endif