w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11CntlLP11.hpp
Go to the documentation of this file.
1// $Id: Rw11CntlLP11.hpp 1185 2019-07-12 17:29:12Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2019-05-30 1155 1.2.3 size->fuse rename
8// 2019-04-14 1131 1.2.2 remove SetOnline(), use UnitSetup()
9// 2019-04-07 1127 1.2.1 add fQueBusy and queue protection
10// 2019-03-17 1123 1.2 buf.val in msb; add lp11_buf readout
11// 2017-04-02 865 1.1.1 Dump(): add detail arg
12// 2014-12-29 623 1.1 adopt to Rlink V4 attn logic
13// 2013-05-01 513 1.0 Initial version
14// ---------------------------------------------------------------------------
15
16
21#ifndef included_Retro_Rw11CntlLP11
22#define included_Retro_Rw11CntlLP11 1
23
24#include "Rw11CntlBase.hpp"
25#include "Rw11UnitLP11.hpp"
26
27namespace Retro {
28
29 class Rw11CntlLP11 : public Rw11CntlBase<Rw11UnitLP11,1> {
30 public:
31
34
35 void Config(const std::string& name, uint16_t base, int lam);
36
37 virtual void Start();
38
39 virtual void UnitSetup(size_t ind);
40
41 void SetRlim(uint16_t rlim);
42 uint16_t Rlim() const;
43
44 uint16_t Itype() const;
45 bool Buffered() const;
46 uint16_t FifoSize() const;
47
48 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
49 int detail=0) const;
50
51 // some constants (also defined in cpp)
52 static const uint16_t kIbaddr = 0177514;
53 static const int kLam = 8;
54
55 static const uint16_t kCSR = 000;
56 static const uint16_t kBUF = 002;
57
58 static const uint16_t kProbeOff = kCSR;
59 static const bool kProbeInt = true;
60 static const bool kProbeRem = true;
61
62 static const uint16_t kFifoMaxSize = 127;
63
64 static const uint16_t kCSR_M_ERROR = kWBit15;
65 static const uint16_t kCSR_V_RLIM = 12;
66 static const uint16_t kCSR_B_RLIM = 007;
67 static const uint16_t kCSR_V_TYPE = 8;
68 static const uint16_t kCSR_B_TYPE = 0007;
69 static const uint16_t kBUF_M_VAL = kWBit15;
70 static const uint16_t kBUF_V_FUSE = 8;
71 static const uint16_t kBUF_B_FUSE = 0177;
72 static const uint16_t kBUF_M_DATA = 0177;
73
74 // statistics counter indices
75 enum stats {
82 };
83
84 protected:
86 void ProcessUnbuf(uint16_t buf);
87 void WriteChar(uint8_t ochr);
88 void ProcessBuf(const RlinkCommand& cmd, bool prim);
89 int RcvHandler();
90
91 protected:
92 size_t fPC_buf;
93 uint16_t fRlim;
94 uint16_t fItype;
95 uint16_t fFsize;
96 uint16_t fRblkSize;
97 bool fQueBusy;
98 };
99
100} // end namespace Retro
101
102#include "Rw11CntlLP11.ipp"
103
104#endif
static const uint16_t kWBit15
Definition: Rbits.hpp:47
Implemenation (inline) of Rw11CntlBase.
static const uint16_t kBUF_B_FUSE
buf.fuse bit mask
virtual void Start()
FIXME_docs.
uint16_t fItype
interface type
static const uint16_t kBUF_M_DATA
buf data mask
static const uint16_t kCSR
CSR reg offset.
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
uint16_t FifoSize() const
FIXME_docs.
void SetRlim(uint16_t rlim)
FIXME_docs.
static const uint16_t kBUF_M_VAL
buf.val mask
uint16_t fRlim
interrupt rate limit
static const int kLam
LP11 default lam.
uint16_t Itype() const
FIXME_docs.
virtual void UnitSetup(size_t ind)
FIXME_docs.
bool Buffered() const
FIXME_docs.
uint16_t fRblkSize
rblk chunk size
static const uint16_t kIbaddr
LP11 default address.
uint16_t Rlim() const
FIXME_docs.
bool fQueBusy
rcv queue busy
int AttnHandler(RlinkServer::AttnArgs &args)
FIXME_docs.
static const uint16_t kCSR_V_RLIM
csr.rlim shift
void Config(const std::string &name, uint16_t base, int lam)
FIXME_docs.
static const bool kProbeRem
probr rem active
static const bool kProbeInt
probe int active
static const uint16_t kCSR_M_ERROR
csr.err mask
static const uint16_t kCSR_B_TYPE
csr.type bit mask
uint16_t fFsize
fifo size
void WriteChar(uint8_t ochr)
FIXME_docs.
Rw11CntlLP11()
Default constructor.
~Rw11CntlLP11()
Destructor.
static const uint16_t kFifoMaxSize
maximal fifo size
static const uint16_t kProbeOff
probe address offset (rcsr)
void ProcessBuf(const RlinkCommand &cmd, bool prim)
FIXME_docs.
static const uint16_t kBUF
BUF reg offset.
static const uint16_t kCSR_B_RLIM
csr.rlim bit mask
size_t fPC_buf
PrimClist: buf index.
static const uint16_t kCSR_V_TYPE
csr.type shift
void ProcessUnbuf(uint16_t buf)
FIXME_docs.
static const uint16_t kBUF_V_FUSE
buf.fuse shift
int RcvHandler()
FIXME_docs.
@ kStatNPage
send pages
@ kStatNNull
send null char
@ kStatNQue
queue rblk
@ kStatNLine
send lines
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47