ConOpSys V2970  P004.07
ANVILEX control operating system
Stack_Base.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file Stack_Base.h
3 //! @brief Stack base class header file.
4 //! @attention No special attention requered.
5 //! @copyright (C) 2015-2020 ANVILEX LLC
6 //! $HeadURL: https://192.168.3.4:8443/svn/P004_07/ConOpSys/Targets/STM32F429/STACK_STM32F429.h $
7 //! $Revision: 2081 $
8 //! $Date: 2020-09-13 15:34:05 +0500 (Вс, 13 сен 2020) $
9 //! $Author: minch $
10 //------------------------------------------------------------------------------
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are met:
14 //
15 // 1. Redistributions of source code must retain the above copyright notice,
16 // this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright notice,
19 // this list of conditions and the following disclaimer in the documentation
20 // and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of ANVILEX nor the names of its contributors may be
23 // used to endorse or promote products derived from this software without
24 // specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 // POSSIBILITY OF SUCH DAMAGE.
37 //
38 //------------------------------------------------------------------------------
39 
40 #pragma once
41 
42 //------------------------------------------------------------------------------
43 // Include standard libraries header files
44 //------------------------------------------------------------------------------
45 
46 //------------------------------------------------------------------------------
47 // Include thrid party header files
48 //------------------------------------------------------------------------------
49 
50 //------------------------------------------------------------------------------
51 // Include ConOpSys header files
52 //------------------------------------------------------------------------------
53 
54 #include "Defines.h"
55 
56 //------------------------------------------------------------------------------
57 // Class definitions
58 //------------------------------------------------------------------------------
59 
60 //! @brief Stack base class
62 {
63 
64  //----------------------------------------------------------------------------
65  // Public defines, methods and variables
66  //----------------------------------------------------------------------------
67 
68  public:
69 
70  //!-------------------------------------------------------------------------
71  //! @brief Class constructor method.
72  //! @note None
73  //! \par Override
74  //! Not allowed
75  //! @attention Don't call this method directly.
76  //--------------------------------------------------------------------------
77 
78  TStack_Base();
79 
80  //!-------------------------------------------------------------------------
81  //! @brief Class destructor method.
82  //! @note None
83  //! \par Override
84  //! Not allowed
85  //! @attention Don't call this method directly.
86  //--------------------------------------------------------------------------
87 
88  ~TStack_Base();
89 
90  //!-------------------------------------------------------------------------
91  //! @brief Return CPU stack base address method.
92  //! @note None
93  //! @return U32 - CPU stack base address
94  //! \par Override
95  //! Requered
96  //! @attention None
97  //--------------------------------------------------------------------------
98 
99  virtual U32 Get_Bottom_Address();
100 
101  //!-------------------------------------------------------------------------
102  //! @brief Return CPU stack end address method.
103  //! @note None
104  //! @return U32 - CPU stack end address
105  //! \par Override
106  //! Requered
107  //! @attention None
108  //--------------------------------------------------------------------------
109 
110  virtual U32 Get_Top_Address();
111 
112  //!-------------------------------------------------------------------------
113  //! @brief Return CPU stack size method.
114  //! @note None
115  //! @return U32 - CPU stack size in byts
116  //! \par Override
117  //! Requered
118  //! @attention None
119  //--------------------------------------------------------------------------
120 
121  virtual U32 Get_Size();
122 
123  //!-------------------------------------------------------------------------
124  //! @brief Return CPU stack dont usage space method.
125  //! @note None
126  //! @return U32 - CPU stack dont usage in byts
127  //! \par Override
128  //! Requered
129  //! @attention None
130  //--------------------------------------------------------------------------
131 
132  virtual U32 Get_Not_Usage_Space();
133 
134  //!-------------------------------------------------------------------------
135  //! @brief Return CPU stack usage space method.
136  //! @note None
137  //! @return U32 - CPU stack usage space in byts
138  //! \par Override
139  //! Requered
140  //! @attention None
141  //--------------------------------------------------------------------------
142 
143  virtual U32 Get_Usage_Space();
144 
145  //!-------------------------------------------------------------------------
146  //! @brief Stack excution method.
147  //! @note None
148  //! @return None
149  //! \par Override
150  //! Not allowed
151  //! @attention None
152  //--------------------------------------------------------------------------
153 
154  VOID Execute();
155 
156  //!-------------------------------------------------------------------------
157  //! @brief Return warning level stack status method.
158  //! @note None
159  //! @return BOOL - Stack warning flag status
160  //! @retval false - Stack overflow warning flag is low
161  //! @retval true - Stack overflow warning flag is set
162  //! \par Override
163  //! Not allowed
164  //! @attention None
165  //--------------------------------------------------------------------------
166 
168 
169  //!-------------------------------------------------------------------------
170  //! @brief Return trip level stack status method.
171  //! @note None
172  //! @return BOOL - Stack trip flag status
173  //! @retval false - Stack overflow trip flag is low
174  //! @retval true - Stack overflow trip flag is set
175  //! \par Override
176  //! Not allowed
177  //! @attention None
178  //--------------------------------------------------------------------------
179 
181 
182  //----------------------------------------------------------------------------
183  // Protected defines, methods and variables
184  //----------------------------------------------------------------------------
185 
186  protected:
187 
188  //----------------------------------------------------------------------------
189  // Private defines, methods and variables
190  //----------------------------------------------------------------------------
191 
192  private:
193 
194  //! @brief Stack warning level overflow
196 
197  //! @brief Stack trip level overflow
199 
200 };
201 
202 //------------------------------------------------------------------------------
203 // End of file
204 //------------------------------------------------------------------------------
205 
ConOpSys data type definitions header file.
int BOOL
Boolean datatype definition.
Definition: Defines.h:124
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned long U32
Binary 32-Bit unsigned integer datatype defenition.
Definition: Defines.h:203
Stack base class.
Definition: Stack_Base.h:62
BOOL bool_Warning_Overflow
Stack warning level overflow.
Definition: Stack_Base.h:195
VOID Execute()
Stack excution method.
Definition: Stack_Base.cpp:213
virtual U32 Get_Not_Usage_Space()
Return CPU stack dont usage space method.
Definition: Stack_Base.cpp:124
virtual U32 Get_Bottom_Address()
Return CPU stack base address method.
Definition: Stack_Base.cpp:80
virtual U32 Get_Usage_Space()
Return CPU stack usage space method.
Definition: Stack_Base.cpp:176
BOOL Get_Warning_Overflow_Flag()
Return warning level stack status method.
Definition: Stack_Base.cpp:188
virtual U32 Get_Size()
Return CPU stack size method.
Definition: Stack_Base.cpp:112
TStack_Base()
Class constructor method.
Definition: Stack_Base.cpp:64
~TStack_Base()
Class destructor method.
Definition: Stack_Base.cpp:72
virtual U32 Get_Top_Address()
Return CPU stack end address method.
Definition: Stack_Base.cpp:96
BOOL bool_Trip_Overflow
Stack trip level overflow.
Definition: Stack_Base.h:198
BOOL Get_Trip_Overflow_Flag()
Return trip level stack status method.
Definition: Stack_Base.cpp:200