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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.61/] [tools/] [src/] [librlink/] [RlinkCommandExpect.hpp] - Blame information for rev 40

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

Line No. Rev Author Line
1 19 wfjm
// $Id: RlinkCommandExpect.hpp 492 2013-02-24 22:14:47Z mueller $
2 10 wfjm
//
3
// Copyright 2011- 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
// 2011-03-12   368   1.0    Initial version
17
// 2011-01-15   355   0.1    First draft
18
// ---------------------------------------------------------------------------
19
 
20
 
21
/*!
22
  \file
23 19 wfjm
  \version $Id: RlinkCommandExpect.hpp 492 2013-02-24 22:14:47Z mueller $
24 10 wfjm
  \brief   Declaration of class RlinkCommandExpect.
25
*/
26
 
27
#ifndef included_Retro_RlinkCommandExpect
28
#define included_Retro_RlinkCommandExpect 1
29
 
30
#include <cstdint>
31
#include <vector>
32
 
33
namespace Retro {
34
 
35
  class RlinkCommandExpect {
36
    public:
37
 
38
                    RlinkCommandExpect();
39
      explicit      RlinkCommandExpect(uint8_t stat, uint8_t statmsk=0);
40
                    RlinkCommandExpect(uint8_t stat, uint8_t statmsk,
41
                                       uint16_t data, uint16_t datamsk=0);
42
                    RlinkCommandExpect(uint8_t stat, uint8_t statmsk,
43
                                       const std::vector<uint16_t>& block);
44
                    RlinkCommandExpect(uint8_t stat, uint8_t statmsk,
45
                                       const std::vector<uint16_t>& block,
46
                                       const std::vector<uint16_t>& blockmsk);
47 19 wfjm
                   ~RlinkCommandExpect();
48 10 wfjm
 
49
      void          SetStatus(uint8_t stat, uint8_t statmsk=0);
50
      void          SetData(uint16_t data, uint16_t datamsk=0);
51
      void          SetBlock(const std::vector<uint16_t>& block);
52
      void          SetBlock(const std::vector<uint16_t>& block,
53
                             const std::vector<uint16_t>& blockmsk);
54
 
55
      uint8_t       StatusValue() const;
56
      uint8_t       StatusMask() const;
57
      uint16_t      DataValue() const;
58
      uint16_t      DataMask() const;
59
      const std::vector<uint16_t>& BlockValue() const;
60
      const std::vector<uint16_t>& BlockMask() const;
61
 
62
      bool          StatusCheck(uint8_t val) const;
63
      bool          DataCheck(uint16_t val) const;
64
      bool          BlockCheck(size_t ind, uint16_t val) const;
65
      size_t        BlockCheck(const uint16_t* pval, size_t size) const;
66
 
67
      bool          StatusIsChecked() const;
68
      bool          DataIsChecked() const;
69
      bool          BlockIsChecked(size_t ind) const;
70
 
71
      void          Dump(std::ostream& os, int ind=0, const char* text=0) const;
72
 
73
    protected:
74
      uint8_t       fStatusVal;             //!< status value
75
      uint8_t       fStatusMsk;             //!< status mask
76
      uint16_t      fDataVal;               //!< data value
77
      uint16_t      fDataMsk;               //!< data mask
78
      std::vector<uint16_t> fBlockVal;      //!< block value
79
      std::vector<uint16_t> fBlockMsk;      //!< block mask
80
  };
81
 
82
} // end namespace Retro
83
 
84
#include "RlinkCommandExpect.ipp"
85
 
86
#endif

powered by: WebSVN 2.1.0

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