ConOpSys V2970  P004.07
ANVILEX control operating system
P020_12_KG3_PTE.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file P020_12_KG3_PTE.h
3 //! @brief KG3 PTE sensor emulation board P020.12 V1 T1 hardware driver 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/Hardware/P020_12_KG3_PTE/P020_12_KG3_PTE.h $
7 //! $Revision: 2305 $
8 //! $Date: 2020-12-25 03:00:01 +0500 (Пт, 25 дек 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 // TP020_12_KG3_PTE_T0
41 // Emulation of the DIO board.
42 //
43 // TP020_12_KG3_PTE_T1
44 //
45 //------------------------------------------------------------------------------
46 
47 //------------------------------------------------------------------------------
48 // Protecting header files from mutual, recursive inclusion.
49 //------------------------------------------------------------------------------
50 
51 #pragma once
52 
53 //------------------------------------------------------------------------------
54 // Include standard libraries header files
55 //------------------------------------------------------------------------------
56 
57 //------------------------------------------------------------------------------
58 // Include thrid party header files
59 //------------------------------------------------------------------------------
60 
61 //------------------------------------------------------------------------------
62 // Include ConOpSys header files
63 //------------------------------------------------------------------------------
64 
65 #include "Function_Block_Base.h"
66 
67 //------------------------------------------------------------------------------
68 // Macros
69 //------------------------------------------------------------------------------
70 
71 //------------------------------------------------------------------------------
72 // Class definitions
73 //------------------------------------------------------------------------------
74 
76 {
77 
78  //--------------------------------------------------------------------------
79  // Public defines, methods and variables
80  //--------------------------------------------------------------------------
81 
82  public:
83 
84  //------------------------------------------------------------------------
85  // Public defines
86  //------------------------------------------------------------------------
87 
88  // Register structure for digital I/O access
89  typedef struct
90  {
91 
92  //! @brief 0x00 : Module identification low register
94 
95  //! @brief 0x01 : Module identification high register
97 
98  union
99  {
100 
101  //! @brief 0x02 : PTE relay control
102  //Bit 15 : Reserved
103  //Bit 14 : Channel 4, realay 3 output control (RL111)
104  //Bit 13 : Channel 4, realay 2 output control (RL110)
105  //Bit 12 : Channel 4, realay 1 output control (RL109)
106  //Bit 11 : Reserved
107  //Bit 10 : Channel 3, realay 3 output control (RL108)
108  //Bit 9 : Channel 3, realay 2 output control (RL107)
109  //Bit 8 : Channel 3, realay 1 output control (RL106)
110  //Bit 7 : Reserved
111  //Bit 6 : Channel 2, realay 3 output control (RL105)
112  //Bit 5 : Channel 2, realay 2 output control (RL104)
113  //Bit 4 : Channel 2, realay 1 output control (RL103)
114  //Bit 3 : Reserved
115  //Bit 2 : Channel 1, realay 3 output control (RL102)
116  //Bit 1 : Channel 1, realay 2 output control (RL101)
117  //Bit 0 : Channel 1, realay 1 output control (RL100)
119 
120  //! @brief 0x02 : PTE relay control
121  //Bit 15 : Reserved
122  //Bit 14 : Channel 4, realay 3 output status (RL111)
123  //Bit 13 : Channel 4, realay 2 output status (RL110)
124  //Bit 12 : Channel 4, realay 1 output status (RL109)
125  //Bit 11 : Reserved
126  //Bit 10 : Channel 3, realay 3 output status (RL108)
127  //Bit 9 : Channel 3, realay 2 output status (RL107)
128  //Bit 8 : Channel 3, realay 1 output status (RL106)
129  //Bit 7 : Reserved
130  //Bit 6 : Channel 2, realay 3 output status (RL105)
131  //Bit 5 : Channel 2, realay 2 output status (RL104)
132  //Bit 4 : Channel 2, realay 1 output status (RL103)
133  //Bit 3 : Reserved
134  //Bit 2 : Channel 1, realay 3 output status (RL102)
135  //Bit 1 : Channel 1, realay 2 output status (RL101)
136  //Bit 0 : Channel 1, realay 1 output status (RL100)
138 
139  };
140 
141  //! @brief 0x03 : Set relay outputs
143 
144  //! @brief 0x04 : Clear relay outputs
146 
147  //! @brief 0x05 : Toggle relay outputs
149 
150  //! @brief 0x06 : Reserved
152 
153  //! @brief 0x07 : Reserved
155 
156  //! @brief 0x08 : Reserved
158 
159  //! @brief 0x09 : Reserved
161 
162  //! @brief 0x0A : Reserved
164 
165  //! @brief 0x0B : Reserved
167 
168  //! @brief 0x0C : Reserved
170 
171  //! @brief 0x0D : Reserved
173 
174  //! @brief 0x0E : Reserved
176 
177  //! @brief 0x0F : Reserved
179 
181 
182  //--------------------------------------------------------------------------
183  // Public methods
184  //--------------------------------------------------------------------------
185 
186  //!-------------------------------------------------------------------------
187  //! @brief Class constructor method.
188  //! @note None
189  //! \par Override
190  //! Not allowed
191  //! @attention Don't call this method directly.
192  //--------------------------------------------------------------------------
193 
195 
196  //!-------------------------------------------------------------------------
197  //! @brief Class destructor method.
198  //! @note None
199  //! \par Override
200  //! Not allowed
201  //! @attention Don't call this method directly.
202  //--------------------------------------------------------------------------
203 
205 
206  //!-------------------------------------------------------------------------
207  //! @brief Hardware mapping method.
208  //! @note None
209  //! @param [in] *struct_Registers_Base_Address - Base adress to register structure mapping
210  //! \par Override
211  //! Not allowed
212  //! @attention None
213  //--------------------------------------------------------------------------
214 
215  VOID Map( TP020_12_KG3_PTE_Registers *struct_Registers_Base_Address );
216 
217  //!-------------------------------------------------------------------------
218  //! @brief Function block initialisation method.
219  //! @note None
220  //! \par Override
221  //! Not allowed
222  //! @attention None
223  //--------------------------------------------------------------------------
224 
225  virtual VOID Init();
226 
227  //!-------------------------------------------------------------------------
228  //! @brief Function block execution method.
229  //! @note None
230  //! \par Override
231  //! Not allowed
232  //! @attention None
233  //--------------------------------------------------------------------------
234 
235  virtual VOID Execute();
236 
237  //!-------------------------------------------------------------------------
238  //! @brief Send information method.
239  //! @note None
240  //! \par Override
241  //! Not allowed
242  //! @attention None
243  //--------------------------------------------------------------------------
244 
245  U32 Get_Module_ID();
246 
247  //!-------------------------------------------------------------------------
248  //! @brief Send information about flow converter board driver over communication link protocol
249  //! @note This method sends information about flow converter driver over specified communication link protocol.
250  //! @param [in] *object_Protocol - Pointer to the communication link protocol
251  //! @return None
252  //! \par Override
253  //! Optional
254  //! @attention None
255  //--------------------------------------------------------------------------
256 
257  virtual VOID Send_Information( TProtocol_Base *object_Protocol );
258 
259  //!-------------------------------------------------------------------------
260  //! @brief Check channel limit data
261  //! @note None
262  //! @param [in] u8_Channel_Index - Checked value
263  //! @return U8 - Validated value
264  //! \par Override
265  //! Optional
266  //! @attention None
267  //--------------------------------------------------------------------------
268 
269  U8 Check_Limit_Channel_Index( U8 u8_Channel_Index );
270 
271  //--------------------------------------------------------------------------
272  // Public variables
273  //--------------------------------------------------------------------------
274 
275  //--------------------------------------------------------------------------
276  // Function block parameters
277  //--------------------------------------------------------------------------
278 
279  //--------------------------------------------------------------------------
280  // Function block input signals
281  //--------------------------------------------------------------------------
282 
283  //! @brief Channel 1
285 
286  //! @brief Channel 2
288 
289  //! @brief Channel 3
291 
292  //! @brief Channel 4
294 
295  //--------------------------------------------------------------------------
296  // Function block output signals
297  //--------------------------------------------------------------------------
298 
299  //--------------------------------------------------------------------------
300  // Protected defines, mathods and variables
301  //--------------------------------------------------------------------------
302 
303  protected:
304 
305  //----------------------------------------------------------------------------
306  // Private defines, mathods and variables
307  //--------------------------------------------------------------------------
308 
309  private:
310 
311  //! @brief Pointer to the memory area in FPGA address space
313 
314 };
315 
316 //------------------------------------------------------------------------------
317 // End of file
318 //------------------------------------------------------------------------------
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
unsigned short U16
Binary 16-Bit unsigned integer datatype defenition.
Definition: Defines.h:193
Function block base class header file.
Function block input connector class.
Definition: Block_Input_Connector.h:83
Function block base class for device.
Definition: Function_Block_Base.h:96
Definition: P020_12_KG3_PTE.h:76
TBlock_Input_Connector object_u8_Channel_1
Channel 1.
Definition: P020_12_KG3_PTE.h:284
U8 Check_Limit_Channel_Index(U8 u8_Channel_Index)
Check channel limit data.
Definition: P020_12_KG3_PTE.cpp:166
TBlock_Input_Connector object_u8_Channel_4
Channel 4.
Definition: P020_12_KG3_PTE.h:293
VOID Map(TP020_12_KG3_PTE_Registers *struct_Registers_Base_Address)
Hardware mapping method.
Definition: P020_12_KG3_PTE.cpp:100
virtual VOID Init()
Function block initialisation method.
Definition: P020_12_KG3_PTE.cpp:115
TP020_12_KG3_PTE_T1()
Class constructor method.
Definition: P020_12_KG3_PTE.cpp:68
volatile TP020_12_KG3_PTE_Registers * struct_Registers
Pointer to the memory area in FPGA address space.
Definition: P020_12_KG3_PTE.h:312
TBlock_Input_Connector object_u8_Channel_3
Channel 3.
Definition: P020_12_KG3_PTE.h:290
virtual VOID Execute()
Function block execution method.
Definition: P020_12_KG3_PTE.cpp:127
~TP020_12_KG3_PTE_T1()
Class destructor method.
Definition: P020_12_KG3_PTE.cpp:92
TBlock_Input_Connector object_u8_Channel_2
Channel 2.
Definition: P020_12_KG3_PTE.h:287
virtual VOID Send_Information(TProtocol_Base *object_Protocol)
Send information about flow converter board driver over communication link protocol.
Definition: P020_12_KG3_PTE.cpp:220
U32 Get_Module_ID()
Send information method.
Definition: P020_12_KG3_PTE.cpp:205
Definition: Protocol_Base.h:57
Definition: P020_12_KG3_PTE.h:90
U16 u16_Reserve_9
0x09 : Reserved
Definition: P020_12_KG3_PTE.h:160
U16 u16_Unit_ID_H
0x01 : Module identification high register
Definition: P020_12_KG3_PTE.h:96
U16 u16_Reserve_15
0x0F : Reserved
Definition: P020_12_KG3_PTE.h:178
U16 u16_Reserve_10
0x0A : Reserved
Definition: P020_12_KG3_PTE.h:163
U16 u16_Unit_ID_L
0x00 : Module identification low register
Definition: P020_12_KG3_PTE.h:93
U16 u16_Reserve_7
0x07 : Reserved
Definition: P020_12_KG3_PTE.h:154
U16 u16_Reserve_12
0x0C : Reserved
Definition: P020_12_KG3_PTE.h:169
U16 u16_Reserve_6
0x06 : Reserved
Definition: P020_12_KG3_PTE.h:151
U16 u16_Reserve_13
0x0D : Reserved
Definition: P020_12_KG3_PTE.h:172
U16 u16_Relay_Control
0x02 : PTE relay control
Definition: P020_12_KG3_PTE.h:118
U16 u16_Reserve_11
0x0B : Reserved
Definition: P020_12_KG3_PTE.h:166
U16 u16_Reserve_8
0x08 : Reserved
Definition: P020_12_KG3_PTE.h:157
U16 u16_Clear_Relay_Outputs
0x04 : Clear relay outputs
Definition: P020_12_KG3_PTE.h:145
U16 u16_Toggle_Relay_Outputs
0x05 : Toggle relay outputs
Definition: P020_12_KG3_PTE.h:148
U16 u16_Relay_Status
0x02 : PTE relay control
Definition: P020_12_KG3_PTE.h:137
U16 u16_Set_Relay_Outputs
0x03 : Set relay outputs
Definition: P020_12_KG3_PTE.h:142
U16 u16_Reserve_14
0x0E : Reserved
Definition: P020_12_KG3_PTE.h:175