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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.7/] [tools/] [src/] [librlink/] [RlinkCommandExpect.ipp] - Blame information for rev 33

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 wfjm
// $Id: RlinkCommandExpect.ipp 661 2015-04-03 18:28:41Z mueller $
2 10 wfjm
//
3 30 wfjm
// Copyright 2011-2015 by Walter F.J. Mueller 
4 10 wfjm
//
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 30 wfjm
// 2015-04-02   661   1.2    expect logic: remove stat from Expect, invert mask
17 28 wfjm
// 2014-12-20   616   1.1    add Done count methods (for rblk/wblk)
18 10 wfjm
// 2011-03-12   368   1.0    Initial version
19
// 2011-01-15   355   0.1    First draft
20
// ---------------------------------------------------------------------------
21
 
22
/*!
23
  \file
24 30 wfjm
  \version $Id: RlinkCommandExpect.ipp 661 2015-04-03 18:28:41Z mueller $
25 10 wfjm
  \brief   Implemenation (inline) of class RlinkCommandExpect.
26
*/
27
 
28 19 wfjm
// all method definitions in namespace Retro
29 10 wfjm
namespace Retro {
30
 
31
//------------------------------------------+-----------------------------------
32 19 wfjm
//! FIXME_docs
33 10 wfjm
 
34
inline void RlinkCommandExpect::SetData(uint16_t data, uint16_t datamsk)
35
{
36
  fDataVal = data;
37
  fDataMsk = datamsk;
38
  return;
39
}
40
 
41
//------------------------------------------+-----------------------------------
42 19 wfjm
//! FIXME_docs
43 10 wfjm
 
44 28 wfjm
inline void RlinkCommandExpect::SetDone(uint16_t done, bool check)
45
{
46
  fDataVal = done;
47 30 wfjm
  fDataMsk = check ? 0xffff : 0x0;
48 28 wfjm
  return;
49
}
50
 
51
//------------------------------------------+-----------------------------------
52
//! FIXME_docs
53
 
54 10 wfjm
inline void RlinkCommandExpect::SetBlock(const std::vector& block)
55
{
56
  fBlockVal = block;
57
  return;
58
}
59
 
60
//------------------------------------------+-----------------------------------
61 19 wfjm
//! FIXME_docs
62 10 wfjm
 
63
inline void RlinkCommandExpect::SetBlock(
64
                   const std::vector& block,
65
                   const std::vector& blockmsk)
66
{
67
  fBlockVal = block;
68
  fBlockMsk = blockmsk;
69
  return;
70
}
71
 
72
//------------------------------------------+-----------------------------------
73 19 wfjm
//! FIXME_docs
74 10 wfjm
 
75
inline uint16_t RlinkCommandExpect::DataValue() const
76
{
77
  return fDataVal;
78
}
79
 
80
//------------------------------------------+-----------------------------------
81 19 wfjm
//! FIXME_docs
82 10 wfjm
 
83
inline uint16_t RlinkCommandExpect::DataMask() const
84
{
85
  return fDataMsk;
86
}
87
 
88
//------------------------------------------+-----------------------------------
89 19 wfjm
//! FIXME_docs
90 10 wfjm
 
91 28 wfjm
inline uint16_t RlinkCommandExpect::DoneValue() const
92
{
93
  return fDataVal;
94
}
95
 
96
//------------------------------------------+-----------------------------------
97
//! FIXME_docs
98
 
99 10 wfjm
inline const std::vector& RlinkCommandExpect::BlockValue() const
100
{
101
  return fBlockVal;
102
}
103
 
104
//------------------------------------------+-----------------------------------
105 19 wfjm
//! FIXME_docs
106 10 wfjm
 
107
inline const std::vector& RlinkCommandExpect::BlockMask() const
108
{
109
  return fBlockMsk;
110
}
111
 
112
//------------------------------------------+-----------------------------------
113 19 wfjm
//! FIXME_docs
114 10 wfjm
 
115
inline bool RlinkCommandExpect::DataCheck(uint16_t val) const
116
{
117 30 wfjm
  return (val & fDataMsk) == fDataVal;
118 10 wfjm
}
119
 
120
//------------------------------------------+-----------------------------------
121 19 wfjm
//! FIXME_docs
122 10 wfjm
 
123 28 wfjm
inline bool RlinkCommandExpect::DoneCheck(uint16_t val) const
124
{
125
  return !DoneIsChecked() || val == fDataVal;
126
}
127
 
128
//------------------------------------------+-----------------------------------
129
//! FIXME_docs
130
 
131 10 wfjm
inline bool RlinkCommandExpect::DataIsChecked() const
132
{
133 30 wfjm
  return fDataMsk != 0x0;
134 10 wfjm
}
135
 
136 28 wfjm
//------------------------------------------+-----------------------------------
137
//! FIXME_docs
138
 
139
inline bool RlinkCommandExpect::DoneIsChecked() const
140
{
141 30 wfjm
  return fDataMsk != 0x0;
142 28 wfjm
}
143
 
144 10 wfjm
} // end namespace Retro

powered by: WebSVN 2.1.0

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