ConOpSys V2970  P004.07
ANVILEX control operating system
Trace_Recorder.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file Trace_Recorder.h
3 //! @brief Trace recorder class header file.
4 //! @attention No special attention requered.
5 //! @copyright (C) 2020-2021 ANVILEX LLC
6 //! $HeadURL: $
7 //! $Revision: $
8 //! $Date: $
9 //! $Author: $
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 project files
44 //------------------------------------------------------------------------------
45 
46 //#include "Defines.h"
47 #include "Application_Resource_Configuration.h"
48 //#include "System_Date.h"
49 //#include "Protocol_Base.h"
50 #include "SPI_Memory_Base.h"
51 #include "S25FL512.h"
52 
53 //------------------------------------------------------------------------------
54 // Trace recorder buffer defines
55 //------------------------------------------------------------------------------
56 
57 #define TRACE_RECORDER_BUFFER_SIZE 512
58 #define TRACE_RECORDER_BUFFERS_COUNT 2
59 
60 //------------------------------------------------------------------------------
61 // Class definitions
62 //------------------------------------------------------------------------------
63 
64 //! @brief Trace recorder class
66 {
67 
68  //----------------------------------------------------------------------------
69  // Public defines, methods and variables
70  //----------------------------------------------------------------------------
71 
72  public:
73 
74  //!-------------------------------------------------------------------------
75  //! @brief Class constructor method
76  //! @note None
77  //! \par Override
78  //! Not allowed
79  //! @attention Don't call this method directly.
80  //--------------------------------------------------------------------------
81 
83 
84  //!-------------------------------------------------------------------------
85  //! @brief Class destructor method
86  //! @note None
87  //! \par Override
88  //! Not allowed
89  //! @attention Don't call this method directly.
90  //--------------------------------------------------------------------------
91 
92  virtual ~TTrace_Recorder();
93 
94  //!-------------------------------------------------------------------------
95  //! @brief Class initialisation method
96  //! @note None
97  //! @return None
98  //! \par Override
99  //! Not allowed
100  //! @attention None
101  //--------------------------------------------------------------------------
102 
103  virtual VOID Init();
104 
105  //!-------------------------------------------------------------------------
106  //! @brief Class finalisation method
107  //! @note None
108  //! @return None
109  //! \par Override
110  //! Not allowed
111  //! @attention None
112  //--------------------------------------------------------------------------
113 
114  virtual VOID Done();
115 
116  //!-------------------------------------------------------------------------
117  //! @brief Memory type assignment method.
118  //! @note Assign SPI memory
119  //! @param [in] *object_Memory_Pointer - Pointer to object of memory class
120  //! @return None
121  //! \par Override
122  //! Not allowed
123  //! @attention None
124  //--------------------------------------------------------------------------
125 
126 // BOOL Assign_Memory( TSPI_Memory_Base *object_Memory_Pointer );
127  BOOL Assign_Memory( TS25FL512 *object_Memory_Pointer );
128 
129  //!-------------------------------------------------------------------------
130  //! @brief Frame create method
131  //! @note None
132  //! @return None
133  //! \par Override
134  //! Not allowed
135  //! @attention None
136  //--------------------------------------------------------------------------
137 
138  VOID Frame_Create();
139 
140  //!-------------------------------------------------------------------------
141  //! @brief Frame close method
142  //! @note None
143  //! @return None
144  //! \par Override
145  //! Not allowed
146  //! @attention None
147  //--------------------------------------------------------------------------
148 
149  VOID Frame_Close();
150 
151  //----------------------------------------------------------------------------
152  // Protected defines, methods and variables
153  //----------------------------------------------------------------------------
154 
155  protected:
156 
157  //----------------------------------------------------------------------------
158  // Private defines, methods and variables
159  //----------------------------------------------------------------------------
160 
161  private:
162 
163  //--------------------------------------------------------------------------
164  // Private defines
165  //--------------------------------------------------------------------------
166 
167  //! @brief Trace buffer structure definition
168  typedef struct
169  {
170 
171  //! @brief Event buffer
172 // TEvent_Manager_Base::TEvent_Generic_Record struct_Buffer[ TRACE_RECORDER_BUFFER_SIZE ];
173  U8 struct_Buffer[ TRACE_RECORDER_BUFFER_SIZE ];
174 
175  //! @brief Data buffer flush request
177 
178  } TTrace_Buffer;
179 
180  //--------------------------------------------------------------------------
181  // Private variables
182  //--------------------------------------------------------------------------
183 
184  //! @brief Pointer to event memory object
185 // TSPI_Memory_Base *object_SPI_Memory = (TSPI_Memory_Base*)NULL;
187 
188  //! @brief Trace buffers
190 
191 };
192 
193 //------------------------------------------------------------------------------
194 // End of file
195 //------------------------------------------------------------------------------
int BOOL
Boolean datatype definition.
Definition: Defines.h:124
#define NULL
Definition: Defines.h:388
unsigned char U8
Binary 8-Bit unsigned integer datatype defenition.
Definition: Defines.h:183
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
SPI NAND FLASH memory chip S25FL512 hardware driver class header file.
SPI connected memory base class header file.
#define TRACE_RECORDER_BUFFERS_COUNT
Definition: Trace_Recorder.h:58
#define TRACE_RECORDER_BUFFER_SIZE
Definition: Trace_Recorder.h:57
NAND memory hardware driver.
Definition: S25FL512.h:62
Trace recorder class.
Definition: Trace_Recorder.h:66
virtual ~TTrace_Recorder()
Class destructor method.
Definition: Trace_Recorder.cpp:74
TTrace_Buffer struct_Trace_Buffer[TRACE_RECORDER_BUFFERS_COUNT]
Trace buffers.
Definition: Trace_Recorder.h:189
TS25FL512 * object_SPI_Memory
Pointer to event memory object.
Definition: Trace_Recorder.h:186
virtual VOID Init()
Class initialisation method.
Definition: Trace_Recorder.cpp:82
VOID Frame_Close()
Frame close method.
Definition: Trace_Recorder.cpp:152
BOOL Assign_Memory(TS25FL512 *object_Memory_Pointer)
Memory type assignment method.
Definition: Trace_Recorder.cpp:101
virtual VOID Done()
Class finalisation method.
Definition: Trace_Recorder.cpp:91
TTrace_Recorder()
Class constructor method.
Definition: Trace_Recorder.cpp:66
VOID Frame_Create()
Frame create method.
Definition: Trace_Recorder.cpp:143
Trace buffer structure definition.
Definition: Trace_Recorder.h:169
BOOL bool_Flush_Request
Data buffer flush request.
Definition: Trace_Recorder.h:176