OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [src/] [librw11/] [Rw11UnitTerm.hpp] - Blame information for rev 21

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 21 wfjm
// $Id: Rw11UnitTerm.hpp 515 2013-05-04 17:28:59Z mueller $
2 19 wfjm
//
3
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
// 
14
// Revision History: 
15
// Date         Rev Version  Comment
16 21 wfjm
// 2013-05-03   515   1.1    use AttachDone(),DetachCleanup(),DetachDone()
17 20 wfjm
// 2013-04-20   508   1.0.1  add 7bit and non-printable masking; add log file
18 19 wfjm
// 2013-04-13   504   1.0    Initial version
19
// 2013-02-19   490   0.1    First draft
20
// ---------------------------------------------------------------------------
21
 
22
 
23
/*!
24
  \file
25 21 wfjm
  \version $Id: Rw11UnitTerm.hpp 515 2013-05-04 17:28:59Z mueller $
26 19 wfjm
  \brief   Declaration of class Rw11UnitTerm.
27
*/
28
 
29
#ifndef included_Retro_Rw11UnitTerm
30
#define included_Retro_Rw11UnitTerm 1
31
 
32 20 wfjm
#include <iostream>
33
#include <fstream>
34 19 wfjm
#include <deque>
35
 
36
#include "Rw11VirtTerm.hpp"
37
 
38
#include "Rw11UnitVirt.hpp"
39
 
40
namespace Retro {
41
 
42
  class Rw11UnitTerm : public Rw11UnitVirt<Rw11VirtTerm> {
43
    public:
44
                    Rw11UnitTerm(Rw11Cntl* pcntl, size_t index);
45
                   ~Rw11UnitTerm();
46
 
47
      const std::string& ChannelId() const;
48
 
49 20 wfjm
      void          SetTo7bit(bool to7bit);
50
      void          SetToEnpc(bool toenpc);
51
      void          SetTi7bit(bool ti7bit);
52
      bool          To7bit() const;
53
      bool          ToEnpc() const;
54
      bool          Ti7bit() const;
55 19 wfjm
 
56 20 wfjm
      void          SetLog(const std::string& fname);
57
      const std::string&  Log() const;
58
 
59 19 wfjm
      virtual bool  RcvQueueEmpty();
60
      virtual size_t RcvQueueSize();
61
      virtual uint8_t RcvNext();
62
      virtual size_t Rcv(uint8_t* buf, size_t count);
63
 
64
      virtual bool  Snd(const uint8_t* buf, size_t count);
65
 
66
      virtual bool  RcvCallback(const uint8_t* buf, size_t count);
67
      virtual void  WakeupCntl();
68
 
69
      virtual void  Dump(std::ostream& os, int ind=0, const char* text=0) const;
70
 
71 20 wfjm
    // statistics counter indices
72
      enum stats {
73
        kStatNPreAttDrop = Rw11Unit::kDimStat,
74
        kDimStat
75
      };
76
 
77 19 wfjm
    protected:
78 21 wfjm
      virtual void  AttachDone();
79 19 wfjm
 
80
    protected:
81 20 wfjm
      bool          fTo7bit;                //<! discard parity bit on output
82
      bool          fToEnpc;                //<! escape non-printabls on output
83
      bool          fTi7bit;                //<! discard parity bit on input
84 19 wfjm
      std::deque<uint8_t>  fRcvQueue;       //<! input queue
85 20 wfjm
      std::string   fLogFname;              //<! log file name
86
      std::ofstream fLogStream;             //<! log file stream
87
      bool          fLogOptCrlf;            //<! log file: crlf option given
88
      bool          fLogCrPend;             //<! log file: cr pending
89
      bool          fLogLfLast;             //<! log file: lf was last char
90 19 wfjm
  };
91
 
92
} // end namespace Retro
93
 
94
#include "Rw11UnitTerm.ipp"
95
 
96
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.