ConOpSys V2970  P004.07
ANVILEX control operating system
System_COM0.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file System_COM0.h
3 //! @brief Virtual communication link COM0 class header file.
4 //! @copyright ANVILEX LLC
5 //! @attention No special attention requered.
6 //! $HeadURL: https://192.168.3.4:8443/svn/P004_07/ConOpSys/Targets/Generic/System_COM0.h $
7 //! $Revision: 2203 $
8 //! $Date: 2020-11-21 14:58:09 +0500 (Sa, 21 Nov 2020) $
9 //! $Author: minch $
10 //
11 // Copyright(C) 2019-2020 ANVILEX LLC
12 //
13 // Redistribution and use in source and binary forms, with or without
14 // modification, are permitted provided that the following conditions are met:
15 //
16 // 1. Redistributions of source code must retain the above copyright notice,
17 // this list of conditions and the following disclaimer.
18 //
19 // 2. Redistributions in binary form must reproduce the above copyright notice,
20 // this list of conditions and the following disclaimer in the documentation
21 // and/or other materials provided with the distribution.
22 //
23 // 3. Neither the name of ANVILEX nor the names of its contributors may be
24 // used to endorse or promote products derived from this software without
25 // specific prior written permission.
26 //
27 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
31 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 // POSSIBILITY OF SUCH DAMAGE.
38 //
39 //------------------------------------------------------------------------------
40 
41 #pragma once
42 
43 //------------------------------------------------------------------------------
44 // System includes
45 //------------------------------------------------------------------------------
46 
47 #include "Communication_Link.h"
48 
49 //------------------------------------------------------------------------------
50 // Project includes
51 //------------------------------------------------------------------------------
52 
53 //------------------------------------------------------------------------------
54 // forward references
55 //------------------------------------------------------------------------------
56 
57 //------------------------------------------------------------------------------
58 // macros
59 //------------------------------------------------------------------------------
60 
61 //------------------------------------------------------------------------------
62 // enums
63 //------------------------------------------------------------------------------
64 
65 //------------------------------------------------------------------------------
66 // Defines
67 //------------------------------------------------------------------------------
68 
69 //------------------------------------------------------------------------------
70 // Define command strings
71 //------------------------------------------------------------------------------
72 
73 //------------------------------------------------------------------------------
74 // Struct
75 //------------------------------------------------------------------------------
76 
77 //------------------------------------------------------------------------------
78 // Externe variables
79 //------------------------------------------------------------------------------
80 
81 //------------------------------------------------------------------------------
82 // Function prototypes
83 //------------------------------------------------------------------------------
84 
85 //------------------------------------------------------------------------------
86 // Export variables
87 //------------------------------------------------------------------------------
88 
89 //! @brief Virtual communication link COM0 class
90 class TCOM0 : public TCommunication_Link
91 {
92 
93  //----------------------------------------------------------------------------
94  // Public methods, variables and definitions
95  //----------------------------------------------------------------------------
96 
97  public:
98 
99  //!-------------------------------------------------------------------------
100  //! @brief Virtual communication link COM0 initialisation method.
101  //! @note None
102  //! @return None
103  //! \par Override
104  //! Not allowed
105  //! @attention None
106  //--------------------------------------------------------------------------
107 
108  VOID Init();
109 
110  //!-------------------------------------------------------------------------
111  //! @brief Virtual communication link COM0 finalisation method.
112  //! @note None
113  //! @return None
114  //! \par Override
115  //! Not allowed
116  //! @attention None
117  //--------------------------------------------------------------------------
118 
119  VOID Done();
120 
121  //!-------------------------------------------------------------------------
122  //! @brief PIO initialisation method
123  //! @note None
124  //! @return None
125  //! \par Override
126  //! Not allowed
127  //! @attention None
128  //--------------------------------------------------------------------------
129 
130  virtual VOID PIO_Init();
131 
132  //!-------------------------------------------------------------------------
133  //! @brief PIO reinitialisation as GPIO method
134  //! @note None
135  //! @return None
136  //! \par Override
137  //! Not allowed
138  //! @attention None
139  //--------------------------------------------------------------------------
140 
141  virtual VOID PIO_Done();
142 
143  // Interrupt and interrupt control methods
144 // VOID Interrupt_Enable( U32 u32_Priority ); //!< Interrupt enabale
145 // VOID Interrupt_Disable(); //!< Interrupt disable
146 
147  // Interrupt management method
148 // VOID Interrupt(); //!< Interrupt method
149 
150  //!-------------------------------------------------------------------------
151  //! @brief Virtual communication link COM0 emulation method.
152  //! @note None
153  //! @return None
154  //! \par Override
155  //! Not allowed
156  //! @attention None
157  //--------------------------------------------------------------------------
158 
159  VOID Emulation();
160 
161  //----------------------------------------------------------------------------
162  // Protected methods, variables and definitions
163  //----------------------------------------------------------------------------
164 
165  protected:
166 
167  virtual VOID Communication_Data_Transmit( U8 u8_Transmit_Value );
168 
169  //----------------------------------------------------------------------------
170  // Private methods, variables and definitions
171  //----------------------------------------------------------------------------
172 
173  private:
174 
175  //! @brief Emulation data buffer
177 
178  //! @brief Emulation data index
180 
181  //! @brief Emulation data size
183 
184 };
185 
186 //------------------------------------------------------------------------------
187 
188 //------------------------------------------------------------------------------
189 // ANVILEX: By virtual communication link COM0 no interrupt requered, but
190 // if external data source present RX and TX interrupt can be
191 // implemented and enabled.
192 //------------------------------------------------------------------------------
193 
194 //extern "C" void System_COM0_RX_Interrupt_Handler( void );
195 //extern "C" void System_COM0_TX_Interrupt_Handler( void );
196 
197 //------------------------------------------------------------------------------
198 // End Of File
199 //------------------------------------------------------------------------------
unsigned char U8
Binary 8-Bit unsigned integer datatype defenition.
Definition: Defines.h:183
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned long U32
Binary 32-Bit unsigned integer datatype defenition.
Definition: Defines.h:203
Virtual communication link COM0 class.
Definition: System_COM0.h:91
virtual VOID PIO_Done()
PIO reinitialisation as GPIO method.
Definition: System_COM0.cpp:207
VOID Emulation()
Virtual communication link COM0 emulation method.
Definition: System_COM0.cpp:215
U32 u32_Emulation_Data_Size
Emulation data size.
Definition: System_COM0.h:182
VOID Init()
Virtual communication link COM0 initialisation method.
Definition: System_COM0.cpp:109
U8 u8_Emulation_Data_Buffer[256]
Emulation data buffer.
Definition: System_COM0.h:176
virtual VOID Communication_Data_Transmit(U8 u8_Transmit_Value)
Communication data transmit method.
Definition: System_COM0.cpp:236
VOID Done()
Virtual communication link COM0 finalisation method.
Definition: System_COM0.cpp:143
U32 u32_Emulation_Data_Index
Emulation data index.
Definition: System_COM0.h:179
virtual VOID PIO_Init()
PIO initialisation method.
Definition: System_COM0.cpp:199