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 20

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

Line No. Rev Author Line
1 20 wfjm
// $Id: Rw11UnitTerm.hpp 508 2013-04-20 18:43:28Z 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 20 wfjm
// 2013-04-20   508   1.0.1  add 7bit and non-printable masking; add log file
17 19 wfjm
// 2013-04-13   504   1.0    Initial version
18
// 2013-02-19   490   0.1    First draft
19
// ---------------------------------------------------------------------------
20
 
21
 
22
/*!
23
  \file
24 20 wfjm
  \version $Id: Rw11UnitTerm.hpp 508 2013-04-20 18:43:28Z mueller $
25 19 wfjm
  \brief   Declaration of class Rw11UnitTerm.
26
*/
27
 
28
#ifndef included_Retro_Rw11UnitTerm
29
#define included_Retro_Rw11UnitTerm 1
30
 
31 20 wfjm
#include <iostream>
32
#include <fstream>
33 19 wfjm
#include <deque>
34
 
35
#include "Rw11VirtTerm.hpp"
36
 
37
#include "Rw11UnitVirt.hpp"
38
 
39
namespace Retro {
40
 
41
  class Rw11UnitTerm : public Rw11UnitVirt<Rw11VirtTerm> {
42
    public:
43
                    Rw11UnitTerm(Rw11Cntl* pcntl, size_t index);
44
                   ~Rw11UnitTerm();
45
 
46
      const std::string& ChannelId() const;
47
 
48 20 wfjm
      void          SetTo7bit(bool to7bit);
49
      void          SetToEnpc(bool toenpc);
50
      void          SetTi7bit(bool ti7bit);
51
      bool          To7bit() const;
52
      bool          ToEnpc() const;
53
      bool          Ti7bit() const;
54 19 wfjm
 
55 20 wfjm
      void          SetLog(const std::string& fname);
56
      const std::string&  Log() const;
57
 
58 19 wfjm
      virtual bool  RcvQueueEmpty();
59
      virtual size_t RcvQueueSize();
60
      virtual uint8_t RcvNext();
61
      virtual size_t Rcv(uint8_t* buf, size_t count);
62
 
63
      virtual bool  Snd(const uint8_t* buf, size_t count);
64
 
65
      virtual bool  RcvCallback(const uint8_t* buf, size_t count);
66
      virtual void  WakeupCntl();
67
 
68
      virtual void  Dump(std::ostream& os, int ind=0, const char* text=0) const;
69
 
70 20 wfjm
    // statistics counter indices
71
      enum stats {
72
        kStatNPreAttDrop = Rw11Unit::kDimStat,
73
        kDimStat
74
      };
75
 
76 19 wfjm
    protected:
77
      virtual void  AttachSetup();
78
 
79
    protected:
80 20 wfjm
      bool          fTo7bit;                //<! discard parity bit on output
81
      bool          fToEnpc;                //<! escape non-printabls on output
82
      bool          fTi7bit;                //<! discard parity bit on input
83 19 wfjm
      std::deque<uint8_t>  fRcvQueue;       //<! input queue
84 20 wfjm
      std::string   fLogFname;              //<! log file name
85
      std::ofstream fLogStream;             //<! log file stream
86
      bool          fLogOptCrlf;            //<! log file: crlf option given
87
      bool          fLogCrPend;             //<! log file: cr pending
88
      bool          fLogLfLast;             //<! log file: lf was last char
89 19 wfjm
  };
90
 
91
} // end namespace Retro
92
 
93
#include "Rw11UnitTerm.ipp"
94
 
95
#endif

powered by: WebSVN 2.1.0

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