ConOpSys V2970  P004.07
ANVILEX control operating system
Communication_Link.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file Communication_Link.h
3 //! @brief Communication link 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/Engine/Communication_Link.h $
7 //! $Revision: 2849 $
8 //! $Date: 2021-08-20 12:37:56 +0500 (Fr, 20 Aug 2021) $
9 //! $Author: ggavrituhin $
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 system files
44 //------------------------------------------------------------------------------
45 
47 #include "Execution_Profile.h"
48 
49 //------------------------------------------------------------------------------
50 // Class definitions
51 //------------------------------------------------------------------------------
52 
53 //! @brief Communication data link class
55 {
56 
57  //----------------------------------------------------------------------------
58  // Public defines, methods and variables
59  //----------------------------------------------------------------------------
60 
61  public:
62 
63  //--------------------------------------------------------------------------
64  // Public methods
65  //--------------------------------------------------------------------------
66 
67  //!-------------------------------------------------------------------------
68  //! @brief Class constructor method.
69  //! @note None
70  //! \par Override
71  //! Not allowed
72  //! @attention Don't call this method directly.
73  //! \par UML diagram
74  //! @dotfile TCommunication_Link__TCommunication_Link.dt
75  //--------------------------------------------------------------------------
76 
78 
79  //!-------------------------------------------------------------------------
80  //! @brief Class destructor method.
81  //! @note None
82  //! \par Override
83  //! Not allowed
84  //! @attention Don't call this method directly.
85  //! \par UML diagram
86  //! @dotfile TCommunication_Link___TCommunication_Link.dt
87  //--------------------------------------------------------------------------
88 
90 
91  //!-------------------------------------------------------------------------
92  //! @brief Initialisation method.
93  //! @note None
94  //! @return None
95  //! \par Override
96  //! Requered
97  //! @attention None
98  //! \par UML diagram
99  //! @dotfile TCommunication_Link__Init.dt
100  //--------------------------------------------------------------------------
101 
102  VOID Init();
103 
104  //!-------------------------------------------------------------------------
105  //! @brief Finalisation method.
106  //! @note None
107  //! @return None
108  //! \par Override
109  //! Requered
110  //! @attention None
111  //! \par UML diagram
112  //! @dotfile TCommunication_Link__Done.dt
113  //--------------------------------------------------------------------------
114 
115  VOID Done();
116 
117  //!-------------------------------------------------------------------------
118  //! @brief PIO initialisation method
119  //! @note None
120  //! @return None
121  //! \par Override
122  //! Not allowed
123  //! @attention None
124  //! \par UML diagram
125  //! @dotfile TCommunication_Link__PIO_Init.dt
126  //--------------------------------------------------------------------------
127 
128  virtual VOID PIO_Init() = 0;
129 
130  //!-------------------------------------------------------------------------
131  //! @brief PIO reinitialisation as GPIO method
132  //! @note None
133  //! @return None
134  //! \par Override
135  //! Not allowed
136  //! @attention None
137  //! \par UML diagram
138  //! @dotfile TCommunication_Link__PIO_Done.dt
139  //--------------------------------------------------------------------------
140 
141  virtual VOID PIO_Done() = 0;
142 
143  //!-------------------------------------------------------------------------
144  //! @brief Start operation method.
145  //! @note Starts operation of the communication link
146  //! @return None
147  //! \par Override
148  //! Requered
149  //! @attention None
150  //! \par UML diagram
151  //! @dotfile TCommunication_Link__Start.dt
152  //--------------------------------------------------------------------------
153 
154  VOID Start();
155 
156  //!-------------------------------------------------------------------------
157  //! @brief Stop operation method.
158  //! @note Stops operation of the communication link
159  //! @return None
160  //! \par Override
161  //! Requered
162  //! @attention None
163  //! \par UML diagram
164  //! @dotfile TCommunication_Link__Stop.dt
165  //--------------------------------------------------------------------------
166 
167  VOID Stop();
168 
169  //!-------------------------------------------------------------------------
170  //! @brief Interrupt enabale method.
171  //! @note None
172  //! @return None
173  //! \par Override
174  //! Requered
175  //! @attention None
176  //! \par UML diagram
177  //! @dotfile TCommunication_Link__Interrupt_Enable.dt
178  //--------------------------------------------------------------------------
179 
180  VOID Interrupt_Enable( U32 u32_Priority );
181 
182  //!-------------------------------------------------------------------------
183  //! @brief Interrupt disable method.
184  //! @note None
185  //! @return None
186  //! \par Override
187  //! Requered
188  //! @attention None
189  //! \par UML diagram
190  //! @dotfile TCommunication_Link__Interrupt_Disable.dt
191  //--------------------------------------------------------------------------
192 
194 
195  //!-------------------------------------------------------------------------
196  //! @brief Data receive and data transmitted interrupt service method.
197  //! @note None
198  //! @return None
199  //! \par Override
200  //! Requered
201  //! @attention None
202  //! \par UML diagram
203  //! @dotfile TCommunication_Link__Interrupt.dt
204  //--------------------------------------------------------------------------
205 
206  VOID Interrupt();
207 
208  //!-------------------------------------------------------------------------
209  //! @brief Data receive interrupt service method.
210  //! @note None
211  //! @return None
212  //! \par Override
213  //! Not allowed
214  //! @attention None
215  //! \par UML diagram
216  //! @dotfile TCommunication_Link__RX_Interrupt.dt
217  //--------------------------------------------------------------------------
218 
219  VOID RX_Interrupt();
220 
221  //!-------------------------------------------------------------------------
222  //! @brief Data transmitted interrupt service method
223  //! @note None
224  //! @return None
225  //! \par Override
226  //! Requered
227  //! @attention None
228  //! \par UML diagram
229  //! @dotfile TCommunication_Link__TX_Interrupt.dt
230  //--------------------------------------------------------------------------
231 
232  VOID TX_Interrupt();
233 
234  //!-------------------------------------------------------------------------
235  //! @brief Log recieved byte count
236  //! @note None
237  //! @return None
238  //! \par Override
239  //! Not allowed
240  //! @attention None
241  //! \par UML diagram
242  //! @dotfile TCommunication_Link__Log_Recieved_Byte_Count.dt
243  //--------------------------------------------------------------------------
244 
246 
247  //!-------------------------------------------------------------------------
248  //! @brief Log empty data error. No data received but interrupt was generated
249  //! @note None
250  //! @return None
251  //! \par Override
252  //! Not allowed
253  //! @attention None
254  //! \par UML diagram
255  //! @dotfile TCommunication_Link__Log_Empty_Data_Error.dt
256  //--------------------------------------------------------------------------
257 
259 
260  //!-------------------------------------------------------------------------
261  //! @brief Log frame error
262  //! @note None
263  //! @return None
264  //! \par Override
265  //! Not allowed
266  //! @attention None
267  //! \par UML diagram
268  //! @dotfile TCommunication_Link__Log_Frame_Error.dt
269  //--------------------------------------------------------------------------
270 
272 
273  //!-------------------------------------------------------------------------
274  //! @brief Log buffer overrun error
275  //! @note None
276  //! @return None
277  //! \par Override
278  //! Not allowed
279  //! @attention None
280  //! \par UML diagram
281  //! @dotfile TCommunication_Link__Log_Overrun_Error.dt
282  //--------------------------------------------------------------------------
283 
285 
286  //!-------------------------------------------------------------------------
287  //! @brief Log parity error
288  //! @note None
289  //! @return None
290  //! \par Override
291  //! Not allowed
292  //! @attention None
293  //! \par UML diagram
294  //! @dotfile TCommunication_Link__Log_Parity_Error.dt
295  //--------------------------------------------------------------------------
296 
298 
299  //!-------------------------------------------------------------------------
300  //! @brief Log noise error
301  //! @note None
302  //! @return None
303  //! \par Override
304  //! Not allowed
305  //! @attention None
306  //! \par UML diagram
307  //! @dotfile TCommunication_Link__Log_Noise_Error.dt
308  //--------------------------------------------------------------------------
309 
311 
312  //!-------------------------------------------------------------------------
313  //! @brief Get rec empty data error count
314  //! @note None
315  //! @return U64 - Empty data error count
316  //! \par Override
317  //! Not allowed
318  //! @attention None
319  //! \par UML diagram
320  //! @dotfile TCommunication_Link__Get_Empty_Data_Error_Count.dt
321  //--------------------------------------------------------------------------
322 
324 
325  //!-------------------------------------------------------------------------
326  //! @brief Get recieved byte count
327  //! @note None
328  //! @return U64 - Recieved byte count
329  //! \par Override
330  //! Not allowed
331  //! @attention None
332  //! \par UML diagram
333  //! @dotfile TCommunication_Link__Get_Recieved_Byte_Count.dt
334  //--------------------------------------------------------------------------
335 
337 
338  //!-------------------------------------------------------------------------
339  //! @brief Get frame error count
340  //! @note None
341  //! @return U64 - Frame error count
342  //! \par Override
343  //! Not allowed
344  //! @attention None
345  //! \par UML diagram
346  //! @dotfile TCommunication_Link__Get_Frame_Error_Count.dt
347  //--------------------------------------------------------------------------
348 
350 
351  //!-------------------------------------------------------------------------
352  //! @brief Get buffer overrun error count
353  //! @note None
354  //! @return U64 - Buffer overrun error count
355  //! \par Override
356  //! Not allowed
357  //! @attention None
358  //! \par UML diagram
359  //! @dotfile TCommunication_Link__Get_Overrun_Error_Count.dt
360  //--------------------------------------------------------------------------
361 
363 
364  //!-------------------------------------------------------------------------
365  //! @brief Get parity error count
366  //! @note None
367  //! @return U64 - Parity error count
368  //! \par Override
369  //! Not allowed
370  //! @attention None
371  //! \par UML diagram
372  //! @dotfile TCommunication_Link__Get_Parity_Error_Count.dt
373  //--------------------------------------------------------------------------
374 
376 
377  //!-------------------------------------------------------------------------
378  //! @brief Get noise error count
379  //! @note None
380  //! @return U64 - Noise error count
381  //! \par Override
382  //! Not allowed
383  //! @attention None
384  //! \par UML diagram
385  //! @dotfile TCommunication_Link__Get_Noise_Error_Count.dt
386  //--------------------------------------------------------------------------
387 
389 
390  //!-------------------------------------------------------------------------
391  //! @brief 1 ms cyclic execution method
392  //! @note None
393  //! @return None
394  //! \par Override
395  //! Not allowed
396  //! @attention None
397  //! \par UML diagram
398  //! @dotfile TCommunication_Link__Execute_1ms.dt
399  //--------------------------------------------------------------------------
400 
401  virtual VOID Execute_1ms();
402 
403  //!-------------------------------------------------------------------------
404  //! @brief Background cyclic execution method
405  //! @note None
406  //! @return None
407  //! \par Override
408  //! Not allowed
409  //! @attention None
410  //! \par UML diagram
411  //! @dotfile TCommunication_Link__Execute.dt
412  //--------------------------------------------------------------------------
413 
414  virtual VOID Execute();
415 
416  //----------------------------------------------------------------------------
417  // Protected defines, methods and variables
418  //----------------------------------------------------------------------------
419 
420  protected:
421 
422  //!-------------------------------------------------------------------------
423  //! @brief Set transmit mode method
424  //! @note None
425  //! @return None
426  //! \par Override
427  //! Requered
428  //! @attention None
429  //! \par UML diagram
430  //! @dotfile TCommunication_Link__Set_Transmit_Mode.dt
431  //--------------------------------------------------------------------------
432 
433  virtual VOID Set_Transmit_Mode();
434 
435  //!-------------------------------------------------------------------------
436  //! @brief Set receive mode method
437  //! @note None
438  //! @return None
439  //! \par Override
440  //! Requered
441  //! @attention None
442  //! \par UML diagram
443  //! @dotfile TCommunication_Link__Set_Receive_Mode.dt
444  //--------------------------------------------------------------------------
445 
446  virtual VOID Set_Receive_Mode();
447 
448  //! @brief Execution profile object
450 
451  //----------------------------------------------------------------------------
452  // Private defines, methods and variables
453  //----------------------------------------------------------------------------
454 
455  private:
456 
457  //--------------------------------------------------------------------------
458  // Private variables
459  //--------------------------------------------------------------------------
460 
461  //! @brief Recieved byte counter
463 
464  //! @brief Empty data error counter
466 
467  //! @brief Frame error counter
469 
470  //! @brief Buffer overrun error counter
472 
473  //! @brief Parity error counter
475 
476  //! @brief Noise error counter
478 
479 };
480 
481 //------------------------------------------------------------------------------
482 // End of file
483 //------------------------------------------------------------------------------
unsigned long long U64
Binary 64-Bit unsigned integer datatype defenition.
Definition: Defines.h:213
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned long U32
Binary 32-Bit unsigned integer datatype defenition.
Definition: Defines.h:203
Execution profile class header file.
Execution profile class.
Definition: Execution_Profile.h:62