ConOpSys V2970  P004.07
ANVILEX control operating system
P015_09_V1_0_Crowbar.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file P015_09_V1_0_Crowbar.h
3 //! @brief Control board P015.09 CB crowbar 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/P015_09_V1_0/P015_09_V1_0_Crowbar.h $
7 //! $Revision: 2549 $
8 //! $Date: 2021-03-25 14:39:32 +0500 (Do, 25 Mrz 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 //------------------------------------------------------------------------------
41 // Protecting header files from mutual, recursive inclusion.
42 //------------------------------------------------------------------------------
43 
44 #pragma once
45 
46 //------------------------------------------------------------------------------
47 // Include standard libraries header files
48 //------------------------------------------------------------------------------
49 
50 //------------------------------------------------------------------------------
51 // Include thrid party header files
52 //------------------------------------------------------------------------------
53 
54 //------------------------------------------------------------------------------
55 // Include ConOpSys header files
56 //------------------------------------------------------------------------------
57 
58 #include "Function_Block_Base.h"
59 
60 //------------------------------------------------------------------------------
61 // Include ConOpSys application header files
62 //------------------------------------------------------------------------------
63 
64 //------------------------------------------------------------------------------
65 // Class definition
66 //------------------------------------------------------------------------------
67 
68 //! @brief Board P015.09 rotor crowbar class
70 {
71 
72  //----------------------------------------------------------------------------
73  // Public defines, methods and variables
74  //----------------------------------------------------------------------------
75 
76  public:
77 
78  //--------------------------------------------------------------------------
79  // Public definies
80  //--------------------------------------------------------------------------
81 
82  //! @brief Register structure for generic access
83  typedef struct
84  {
85 
86  //! @brief 0x00 : Unit identification L read register
88 
89  //! @brief 0x01 : Unit identification H read register
91 
92  union
93  {
94 
95  //! @brief 0x02 : Status register
97 
98  //! @brief 0x02 : Control register
100 
101  };
102 
103  } TP015_09_V1_0_Crowbar_Registers;
104 
105  //--------------------------------------------------------------------------
106  // Public methods
107  //--------------------------------------------------------------------------
108 
109  //!-------------------------------------------------------------------------
110  //! @brief Class constructor method.
111  //! @note None
112  //! \par Override
113  //! Not allowed
114  //! @attention Don't call this method directly.
115  //--------------------------------------------------------------------------
116 
118 
119  //!-------------------------------------------------------------------------
120  //! @brief Class destructor method.
121  //! @note None
122  //! \par Override
123  //! Not allowed
124  //! @attention Don't call this method directly.
125  //--------------------------------------------------------------------------
126 
127  virtual ~TP015_09_V1_0_Crowbar();
128 
129  //!-------------------------------------------------------------------------
130  //! @brief Hardware mapping method.
131  //! @note None
132  //! @param [in] *struct_Registers_Base_Address - Pointer to mapped memory region
133  //! \par Override
134  //! Not allowed
135  //! @attention None
136  //--------------------------------------------------------------------------
137 
138  VOID Map( TP015_09_V1_0_Crowbar_Registers *struct_Registers_Base_Address );
139 
140  //!-------------------------------------------------------------------------
141  //! @brief Initialisation method.
142  //! @note None
143  //! \par Override
144  //! Not allowed
145  //! @attention None
146  //--------------------------------------------------------------------------
147 
148  virtual VOID Init();
149 
150  //!-------------------------------------------------------------------------
151  //! @brief Function block inputs execution method.
152  //! @note None
153  //! \par Override
154  //! Not allowed
155  //! @attention None
156  //--------------------------------------------------------------------------
157 
158  virtual VOID Execute_Inputs(); // Execute inputs
159 
160  //!-------------------------------------------------------------------------
161  //! @brief Function block execution method.
162  //! @note None
163  //! \par Override
164  //! Not allowed
165  //! @attention None
166  //--------------------------------------------------------------------------
167 
168  virtual VOID Execute();
169 
170  //!-------------------------------------------------------------------------
171  //! @brief Function block outputs execution method.
172  //! @note None
173  //! \par Override
174  //! Not allowed
175  //! @attention None
176  //--------------------------------------------------------------------------
177 
178  virtual VOID Execute_Outputs();
179 
180  //!-------------------------------------------------------------------------
181  //! @brief Send function block diagnostic information method.
182  //! @note None
183  //! @param [in] *object_Protocol - Pointer to communication protocol
184  //! \par Override
185  //! Not allowed
186  //! @attention None
187  //--------------------------------------------------------------------------
188 
189  virtual VOID Send_Information( TProtocol_Base *object_Protocol );
190 
191  //--------------------------------------------------------------------------
192  // Function block input signals
193  //--------------------------------------------------------------------------
194 
195  //! @brief Crowbar enable signal
197 
198  //--------------------------------------------------------------------------
199  // Function block output signals
200  //--------------------------------------------------------------------------
201 
202  //! @brief Crowbar error signal
204 
205  //----------------------------------------------------------------------------
206  // Protected defines, methods and variables
207  //----------------------------------------------------------------------------
208 
209  protected:
210 
211  //----------------------------------------------------------------------------
212  // Private defines, methods and variables
213  //----------------------------------------------------------------------------
214 
215  private:
216 
217  //--------------------------------------------------------------------------
218  // Private defines
219  //--------------------------------------------------------------------------
220 
221  //! @brief Crowbar control register structure
222  typedef union
223  {
224 
225  //! @brief Crowbqr control register as U16 value
227 
228  //! @brief Crowbar control register bits
229  struct
230  {
231 
232  //! @brief Bit 0 - Crowbar control
234 
235  //! @brief Bit 1 - Not used
236  U16 :1;
237 
238  //! @brief Bit 2 - Not used
239  U16 :1;
240 
241  //! @brief Bit 3 - Not used
242  U16 :1;
243 
244  //! @brief Bit 4 - Not used
245  U16 :1;
246 
247  //! @brief Bit 5 - Not used
248  U16 :1;
249 
250  //! @brief Bit 6 - Not used
251  U16 :1;
252 
253  //! @brief Bit 7 - Not used
254  U16 :1;
255 
256  //! @brief Bit 8 - Not used
257  U16 :1;
258 
259  //! @brief Bit 9 - Not used
260  U16 :1;
261 
262  //! @brief Bit 10 - Not used
263  U16 :1;
264 
265  //! @brief Bit 11 - Not used
266  U16 :1;
267 
268  //! @brief Bit 12 - Not used
269  U16 :1;
270 
271  //! @brief Bit 13 - Not used
272  U16 :1;
273 
274  //! @brief Bit 14 - Not used
275  U16 :1;
276 
277  //! @brief Bit 15 - Not used
278  U16 :1;
279 
280  };
281 
282  } TControl_Register;
283 
284  //! @brief Crowbar status register structure
285  typedef union
286  {
287 
288  //! @brief Crowbar status register as U16 value
290 
291  //! @brief Crowbar status register bits
292  struct
293  {
294 
295  //! @brief Bit 0 - Crowbar status
297 
298  //! @brief Bit 1 - Not used
299  U16 :1;
300 
301  //! @brief Bit 2 - Not used
302  U16 :1;
303 
304  //! @brief Bit 3 - Not used
305  U16 :1;
306 
307  //! @brief Bit 4 - Not used
308  U16 :1;
309 
310  //! @brief Bit 5 - Not used
311  U16 :1;
312 
313  //! @brief Bit 6 - Not used
314  U16 :1;
315 
316  //! @brief Bit 7 - Not used
317  U16 :1;
318 
319  //! @brief Bit 8 - Not used
320  U16 :1;
321 
322  //! @brief Bit 9 - Not used
323  U16 :1;
324 
325  //! @brief Bit 10 - Not used
326  U16 :1;
327 
328  //! @brief Bit 11 - Not used
329  U16 :1;
330 
331  //! @brief Bit 12 - Not used
332  U16 :1;
333 
334  //! @brief Bit 13 - Not used
335  U16 :1;
336 
337  //! @brief Bit 14 - Not used
338  U16 :1;
339 
340  //! @brief Bit 15 - Not used
341  U16 :1;
342 
343  };
344 
345  } TStatus_Register;
346 
347  //--------------------------------------------------------------------------
348  // Private variables
349  //--------------------------------------------------------------------------
350 
351  //! @brief Pointer to the mapped hardware
353 
354 };
355 
356 //------------------------------------------------------------------------------
357 
358 //! @brief Board P015.09 rotor crowbar class of type 2
360 {
361 
362  //----------------------------------------------------------------------------
363  // Public defines, methods and variables
364  //----------------------------------------------------------------------------
365 
366  public:
367 
368  //--------------------------------------------------------------------------
369  // Public definies
370  //--------------------------------------------------------------------------
371 
372  //! @brief Register structure for generic access
373  typedef struct
374  {
375 
376  //! @brief 0x00 : Unit identification register
378 
379  //! @brief 0x01 : Unit identification register
381 
382  //! @brief Control and status registers
383  union
384  {
385 
386  //! @brief 0x02 : Status register
388 
389  //! @brief 0x02 : Control register
391 
392  };
393 
394  } TP015_09_V1_Crowbar_Registers;
395 
396  //--------------------------------------------------------------------------
397  // Public methods
398  //--------------------------------------------------------------------------
399 
400  //!-------------------------------------------------------------------------
401  //! @brief Class constructor method.
402  //! @note None
403  //! \par Override
404  //! Not allowed
405  //! @attention Don't call this method directly.
406  //--------------------------------------------------------------------------
407 
409 
410  //!-------------------------------------------------------------------------
411  //! @brief Class destructor method.
412  //! @note None
413  //! \par Override
414  //! Not allowed
415  //! @attention Don't call this method directly.
416  //--------------------------------------------------------------------------
417 
418  virtual ~TP015_09_V1_Crowbar_T2();
419 
420  //!-------------------------------------------------------------------------
421  //! @brief Hardware mapping method.
422  //! @note None
423  //! @param [in] *struct_Registers_Base_Address - Pointer to mapped memory region
424  //! \par Override
425  //! Not allowed
426  //! @attention None
427  //--------------------------------------------------------------------------
428 
429  VOID Map( TP015_09_V1_Crowbar_Registers *struct_Registers_Base_Address );
430 
431  //!-------------------------------------------------------------------------
432  //! @brief Initialisation method.
433  //! @note None
434  //! \par Override
435  //! Not allowed
436  //! @attention None
437  //--------------------------------------------------------------------------
438 
439  virtual VOID Init();
440 
441  //!-------------------------------------------------------------------------
442  //! @brief Function block execution method.
443  //! @note None
444  //! \par Override
445  //! Not allowed
446  //! @attention None
447  //--------------------------------------------------------------------------
448 
449  virtual VOID Execute();
450 
451  //!-------------------------------------------------------------------------
452  //! @brief Send function block diagnostic information method.
453  //! @note None
454  //! @param [in] *object_Protocol - Pointer to communication protocol
455  //! \par Override
456  //! Not allowed
457  //! @attention None
458  //--------------------------------------------------------------------------
459 
460  virtual VOID Send_Information( TProtocol_Base *object_Protocol );
461 
462  //--------------------------------------------------------------------------
463  // Function block input signals
464  //--------------------------------------------------------------------------
465 
466  //! @brief Crowbar enable signal
468 
469  //--------------------------------------------------------------------------
470  // Function block output signals
471  //--------------------------------------------------------------------------
472 
473  //! @brief Crowbar error signal
475 
476  //----------------------------------------------------------------------------
477  // Protected defines, methods and variables
478  //----------------------------------------------------------------------------
479 
480  protected:
481 
482  //----------------------------------------------------------------------------
483  // Private defines, methods and variables
484  //----------------------------------------------------------------------------
485 
486  private:
487 
488  //--------------------------------------------------------------------------
489  // Private defines
490  //--------------------------------------------------------------------------
491 
492  //! @brief Crowbar control register structure
493  typedef union
494  {
495 
496  //! @brief Crowbqr control register as U16 value
498 
499  //! @brief Crowbar control register bits
500  struct
501  {
502 
503  //! @brief Bit 0 - Crowbar control
505 
506  //! @brief Bit 1 - Not used
507  U16 :1;
508 
509  //! @brief Bit 2 - Not used
510  U16 :1;
511 
512  //! @brief Bit 3 - Not used
513  U16 :1;
514 
515  //! @brief Bit 4 - Not used
516  U16 :1;
517 
518  //! @brief Bit 5 - Not used
519  U16 :1;
520 
521  //! @brief Bit 6 - Not used
522  U16 :1;
523 
524  //! @brief Bit 7 - Not used
525  U16 :1;
526 
527  //! @brief Bit 8 - Not used
528  U16 :1;
529 
530  //! @brief Bit 9 - Not used
531  U16 :1;
532 
533  //! @brief Bit 10 - Not used
534  U16 :1;
535 
536  //! @brief Bit 11 - Not used
537  U16 :1;
538 
539  //! @brief Bit 12 - Not used
540  U16 :1;
541 
542  //! @brief Bit 13 - Not used
543  U16 :1;
544 
545  //! @brief Bit 14 - Not used
546  U16 :1;
547 
548  //! @brief Bit 15 - Not used
549  U16 :1;
550 
551  };
552 
553  } TControl_Register;
554 
555  //! @brief Crowbar status register structure
556  typedef union
557  {
558 
559  //! @brief Crowbar status register as U16 value
561 
562  //! @brief Crowbar status register bits
563  struct
564  {
565 
566  //! @brief Bit 0 - Crowbar status
568 
569  //! @brief Bit 1 - Not used
570  U16 :1;
571 
572  //! @brief Bit 2 - Not used
573  U16 :1;
574 
575  //! @brief Bit 3 - Not used
576  U16 :1;
577 
578  //! @brief Bit 4 - Not used
579  U16 :1;
580 
581  //! @brief Bit 5 - Not used
582  U16 :1;
583 
584  //! @brief Bit 6 - Not used
585  U16 :1;
586 
587  //! @brief Bit 7 - Not used
588  U16 :1;
589 
590  //! @brief Bit 8 - Not used
591  U16 :1;
592 
593  //! @brief Bit 9 - Not used
594  U16 :1;
595 
596  //! @brief Bit 10 - Not used
597  U16 :1;
598 
599  //! @brief Bit 11 - Not used
600  U16 :1;
601 
602  //! @brief Bit 12 - Not used
603  U16 :1;
604 
605  //! @brief Bit 13 - Not used
606  U16 :1;
607 
608  //! @brief Bit 14 - Not used
609  U16 :1;
610 
611  //! @brief Bit 15 - Not used
612  U16 :1;
613 
614  };
615 
616  } TStatus_Register;
617 
618  //--------------------------------------------------------------------------
619  // Private variables
620  //--------------------------------------------------------------------------
621 
622  //! @brief Pointer to the mapped hardware registers
624 
625 };
626 
627 //------------------------------------------------------------------------------
628 // End of file
629 //------------------------------------------------------------------------------
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
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 output connector class.
Definition: Block_Output_Connector.h:59
Function block base class for device.
Definition: Function_Block_Base.h:96
Board P015.09 rotor crowbar class.
Definition: P015_09_V1_0_Crowbar.h:70
virtual VOID Execute_Outputs()
Function block outputs execution method.
Definition: P015_09_V1_0_Crowbar.cpp:142
TBlock_Input_Connector object_bool_Crowbar_Control
Crowbar enable signal.
Definition: P015_09_V1_0_Crowbar.h:196
TP015_09_V1_0_Crowbar()
Class constructor method.
Definition: P015_09_V1_0_Crowbar.cpp:66
virtual VOID Send_Information(TProtocol_Base *object_Protocol)
Send function block diagnostic information method.
Definition: P015_09_V1_0_Crowbar.cpp:156
TBlock_Output_Connector object_bool_Crowbar_Error
Crowbar error signal.
Definition: P015_09_V1_0_Crowbar.h:203
VOID Map(TP015_09_V1_0_Crowbar_Registers *struct_Registers_Base_Address)
Hardware mapping method.
Definition: P015_09_V1_0_Crowbar.cpp:95
virtual VOID Init()
Initialisation method.
Definition: P015_09_V1_0_Crowbar.cpp:107
volatile TP015_09_V1_0_Crowbar_Registers * struct_Registers
Pointer to the mapped hardware.
Definition: P015_09_V1_0_Crowbar.h:352
virtual VOID Execute()
Function block execution method.
Definition: P015_09_V1_0_Crowbar.cpp:133
virtual ~TP015_09_V1_0_Crowbar()
Class destructor method.
Definition: P015_09_V1_0_Crowbar.cpp:87
virtual VOID Execute_Inputs()
Function block inputs execution method.
Definition: P015_09_V1_0_Crowbar.cpp:116
Board P015.09 rotor crowbar class of type 2.
Definition: P015_09_V1_0_Crowbar.h:360
virtual VOID Execute()
Function block execution method.
Definition: P015_09_V1_0_Crowbar.cpp:225
TP015_09_V1_Crowbar_T2()
Class constructor method.
Definition: P015_09_V1_0_Crowbar.cpp:176
TBlock_Input_Connector object_bool_Crowbar_Control
Crowbar enable signal.
Definition: P015_09_V1_0_Crowbar.h:467
TBlock_Output_Connector object_bool_Crowbar_Status
Crowbar error signal.
Definition: P015_09_V1_0_Crowbar.h:474
virtual ~TP015_09_V1_Crowbar_T2()
Class destructor method.
Definition: P015_09_V1_0_Crowbar.cpp:197
VOID Map(TP015_09_V1_Crowbar_Registers *struct_Registers_Base_Address)
Hardware mapping method.
Definition: P015_09_V1_0_Crowbar.cpp:205
virtual VOID Init()
Initialisation method.
Definition: P015_09_V1_0_Crowbar.cpp:217
volatile TP015_09_V1_Crowbar_Registers * struct_Registers
Pointer to the mapped hardware registers.
Definition: P015_09_V1_0_Crowbar.h:623
virtual VOID Send_Information(TProtocol_Base *object_Protocol)
Send function block diagnostic information method.
Definition: P015_09_V1_0_Crowbar.cpp:260
Definition: Protocol_Base.h:57
Register structure for generic access.
Definition: P015_09_V1_0_Crowbar.h:84
U16 u16_Unit_ID_L
0x00 : Unit identification L read register
Definition: P015_09_V1_0_Crowbar.h:87
U16 u16_Status_Register
0x02 : Status register
Definition: P015_09_V1_0_Crowbar.h:96
U16 u16_Control_Register
0x02 : Control register
Definition: P015_09_V1_0_Crowbar.h:99
U16 u16_Unit_ID_H
0x01 : Unit identification H read register
Definition: P015_09_V1_0_Crowbar.h:90
Register structure for generic access.
Definition: P015_09_V1_0_Crowbar.h:374
U16 u16_Unit_ID_H
0x01 : Unit identification register
Definition: P015_09_V1_0_Crowbar.h:380
U16 u16_Status_Register
0x02 : Status register
Definition: P015_09_V1_0_Crowbar.h:387
U16 u16_Unit_ID_L
0x00 : Unit identification register
Definition: P015_09_V1_0_Crowbar.h:377
U16 u16_Control_Register
0x02 : Control register
Definition: P015_09_V1_0_Crowbar.h:390
U16 u16_Control_Register
Crowbqr control register as U16 value.
Definition: P015_09_V1_0_Crowbar.h:226
U16 u16_Crowbar_Control
Bit 0 - Crowbar control.
Definition: P015_09_V1_0_Crowbar.h:233
U16 u16_Crowbar_Status
Bit 0 - Crowbar status.
Definition: P015_09_V1_0_Crowbar.h:296
U16 u16_Status_Register
Crowbar status register as U16 value.
Definition: P015_09_V1_0_Crowbar.h:289
U16 u16_Raw_Data
Crowbqr control register as U16 value.
Definition: P015_09_V1_0_Crowbar.h:497
U16 b1_Crowbar_Control
Bit 0 - Crowbar control.
Definition: P015_09_V1_0_Crowbar.h:504
U16 u16_Status_Register
Crowbar status register as U16 value.
Definition: P015_09_V1_0_Crowbar.h:560
U16 b1_Crowbar_Status
Bit 0 - Crowbar status.
Definition: P015_09_V1_0_Crowbar.h:567