ConOpSys V2970  P004.07
ANVILEX control operating system
P020_36_V1_0_DCBIO.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file P020_36_V1_0_DCBIO.h
3 //! @brief Control board P015.09 CB d.c. bus 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/P020_36_V1_0_DCBIO.h $
7 //! $Revision: 2545 $
8 //! $Date: 2021-03-25 13:28:47 +0500 (Чт, 25 мар 2021) $
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 //------------------------------------------------------------------------------
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 // Macros
66 //------------------------------------------------------------------------------
67 
68 //------------------------------------------------------------------------------
69 // Class definitions
70 //------------------------------------------------------------------------------
71 
72 //! @brief DC bus board P015.05 V1.0 class
74 {
75 
76  //----------------------------------------------------------------------------
77  // Public defines, methods and variables
78  //----------------------------------------------------------------------------
79 
80  public:
81 
82  // Register structure for generic access
83  typedef struct
84  {
85 
86  union
87  {
88  U16 u16_Status; //!< Status register
89  U16 u16_Control; //!< Control register
90  };
91 
99 
101 
102  //--------------------------------------------------------------------------
103  // Public methods
104  //--------------------------------------------------------------------------
105 
106  // Constructor and destructor
107  TP020_36_V1_0_DCBIO(); //!< Constructor method
108  virtual ~TP020_36_V1_0_DCBIO(); //!< Destructor method
109 
110  VOID Map( TP020_36_V1_0_DCBIO_Registers *struct_Registers_Base_Address ); //!< Hardware mapping method
111  virtual VOID Init(); //!< Initialisation method
112  virtual VOID Execute_Inputs(); //!< Execute inputs
113  virtual VOID Execute(); //!< Execution method
114  virtual VOID Execute_Outputs(); //!< Execute outputs
115  virtual VOID Send_Information( TProtocol_Base *object_Protocol ); //!< Send information about functional block
116 
117  //--------------------------------------------------------------------------
118  // Blocks inputs
119  //--------------------------------------------------------------------------
120 
121  // Block parameters
122  TBlock_Input_Connector object_f32_Analog_Input_Full_Scale; //!< Analog input channel fill scale value. Also used for channel total gain adjustment.
123 
124  TBlock_Input_Connector object_f32_Analog_Input_Offset; //!< Analog input channel offset
125 
126  // Block inputs
128 
130 
132 
134 
136 
138 
140 
141  //--------------------------------------------------------------------------
142  // Blocks outputs
143  //--------------------------------------------------------------------------
144 
145  TBlock_Output_Connector object_f32_Analog_Input_Data; //!< Analog input data block output connector
146 
147  TBlock_Output_Connector object_bool_Hardware_Error; //!< Critical hardware error flag
148 
149  TBlock_Output_Connector object_bool_Hardware_Limit_Error; //!< Hardware limit reached error flag
150 
151  TBlock_Output_Connector object_bool_Software_Limit_Error; // !< Software limit reached error flag
152 
154 
156 
158 
160 
162 
163  //--------------------------------------------------------------------------
164  // Public variables
165  //--------------------------------------------------------------------------
166 
167  U16 u16_Analog_Input_Status; //!< Analog input status
168 
169  I16 i16_Analog_Input_Data; //!< Analog input data block output as I16
170 
171  //----------------------------------------------------------------------------
172  // Protected defines, methods and variables
173  //----------------------------------------------------------------------------
174 
175  protected:
176 
177  //----------------------------------------------------------------------------
178  // Private defines, methods and variables
179  //----------------------------------------------------------------------------
180 
181  private:
182 
183  //--------------------------------------------------------------------------
184  // Private defines
185  //--------------------------------------------------------------------------
186 
187  typedef union
188  {
189 
191 
192  struct
193  {
194 
195  U16 :1; // Bit 0 - Not used
196  U16 :1; // Bit 1 - Not used
197  U16 :1; // Bit 2 - Not used
198  U16 :1; // Bit 3 - Not used
199  U16 :1; // Bit 4 - Not used
200  U16 :1; // Bit 5 - Not used
201  U16 :1; // Bit 6 - Not used
202  U16 :1; // Bit 7 - Not used
203  U16 :1; // Bit 8 - Not used
204  U16 :1; // Bit 9 - Not used
205  U16 :1; // Bit 10 - Not used
206  U16 :1; // Bit 11 - Not used
207  U16 :1; // Bit 12 - Not used
208  U16 :1; // Bit 13 - Not used
209  U16 :1; // Bit 14 - Not used
210  U16 :1; // Bit 15 - Not used
211  };
212 
213  } TStatus;
214 
215  //--------------------------------------------------------------------------
216  // Private variables
217  //--------------------------------------------------------------------------
218 
219  volatile TP020_36_V1_0_DCBIO_Registers *struct_Registers; //!< Pointer to register in FPGA
222 
223  F32 f32_Gain; //!< Effective gain of the voltage measurement channel
224  F32 f32_Offset; //!< Effective offset of the voltage measurement channel
225 
226 };
227 
228 //------------------------------------------------------------------------------
229 // End of file
230 //------------------------------------------------------------------------------
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
float F32
IEEE-754 32-Bit single presession floating point numbers datatype defenition.
Definition: Defines.h:324
short I16
2s Compliment 16-Bit signed integer datatype defenition
Definition: Defines.h:196
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
DC bus board P015.05 V1.0 class.
Definition: P020_36_V1_0_DCBIO.h:74
TBlock_Output_Connector object_bool_Ballast_Fault_2
Ballast fault 2.
Definition: P020_36_V1_0_DCBIO.h:161
U16 u16_Control
Definition: P020_36_V1_0_DCBIO.h:221
TBlock_Input_Connector object_f32_Analog_Input_Full_Scale
Analog input channel fill scale value. Also used for channel total gain adjustment.
Definition: P020_36_V1_0_DCBIO.h:122
TBlock_Input_Connector object_f32_Analog_Input_Offset
Analog input channel offset.
Definition: P020_36_V1_0_DCBIO.h:124
TBlock_Output_Connector object_bool_Hardware_Error
Critical hardware error flag.
Definition: P020_36_V1_0_DCBIO.h:147
virtual VOID Send_Information(TProtocol_Base *object_Protocol)
Send information about functional block.
Definition: P020_36_V1_0_DCBIO.cpp:227
U16 u16_Analog_Input_Status
Analog input status.
Definition: P020_36_V1_0_DCBIO.h:167
VOID Map(TP020_36_V1_0_DCBIO_Registers *struct_Registers_Base_Address)
Hardware mapping method.
Definition: P020_36_V1_0_DCBIO.cpp:120
TBlock_Output_Connector object_bool_Ballast_Error
Ballast status signal.
Definition: P020_36_V1_0_DCBIO.h:153
U16 u16_Status
Definition: P020_36_V1_0_DCBIO.h:220
I16 i16_Analog_Input_Data
Analog input data block output as I16.
Definition: P020_36_V1_0_DCBIO.h:169
virtual VOID Execute()
Execution method.
Definition: P020_36_V1_0_DCBIO.cpp:186
TBlock_Input_Connector object_f32_DC_BUS_GAIN
DC BUS gain.
Definition: P020_36_V1_0_DCBIO.h:131
TP020_36_V1_0_DCBIO()
Constructor method.
Definition: P020_36_V1_0_DCBIO.cpp:66
TBlock_Input_Connector object_f32_Ballast_Setpoint_2
Ballast setpoint 2.
Definition: P020_36_V1_0_DCBIO.h:135
TBlock_Input_Connector object_bool_Precharge_Enable
Precharge enable.
Definition: P020_36_V1_0_DCBIO.h:137
TBlock_Output_Connector object_f32_Analog_Input_Data
Analog input data block output connector.
Definition: P020_36_V1_0_DCBIO.h:145
TBlock_Output_Connector object_f32_DC_BUS_Voltage
DC BUS voltage.
Definition: P020_36_V1_0_DCBIO.h:155
virtual VOID Init()
Initialisation method.
Definition: P020_36_V1_0_DCBIO.cpp:132
virtual ~TP020_36_V1_0_DCBIO()
Destructor method.
Definition: P020_36_V1_0_DCBIO.cpp:112
F32 f32_Gain
Effective gain of the voltage measurement channel.
Definition: P020_36_V1_0_DCBIO.h:223
volatile TP020_36_V1_0_DCBIO_Registers * struct_Registers
Pointer to register in FPGA.
Definition: P020_36_V1_0_DCBIO.h:219
F32 f32_Offset
Effective offset of the voltage measurement channel.
Definition: P020_36_V1_0_DCBIO.h:224
TBlock_Output_Connector object_bool_Ballast_Fault_1
Ballast fault 1.
Definition: P020_36_V1_0_DCBIO.h:159
TBlock_Output_Connector object_bool_Software_Limit_Error
Definition: P020_36_V1_0_DCBIO.h:151
virtual VOID Execute_Outputs()
Execute outputs.
Definition: P020_36_V1_0_DCBIO.cpp:194
TBlock_Input_Connector object_bool_Ballast_Control
Ballast status.
Definition: P020_36_V1_0_DCBIO.h:127
TBlock_Output_Connector object_bool_Precharge_Fault
Precharge fault.
Definition: P020_36_V1_0_DCBIO.h:157
TBlock_Output_Connector object_bool_Hardware_Limit_Error
Hardware limit reached error flag.
Definition: P020_36_V1_0_DCBIO.h:149
TBlock_Input_Connector object_f32_DC_BUS_Offset
DC BUS offset.
Definition: P020_36_V1_0_DCBIO.h:129
virtual VOID Execute_Inputs()
Execute inputs.
Definition: P020_36_V1_0_DCBIO.cpp:149
TBlock_Input_Connector object_bool_Emergency_Stop
Precharge enable.
Definition: P020_36_V1_0_DCBIO.h:139
TBlock_Input_Connector object_f32_Ballast_Setpoint_1
Ballast setpoint 1.
Definition: P020_36_V1_0_DCBIO.h:133
Definition: Protocol_Base.h:57
Definition: P020_36_V1_0_DCBIO.h:84
U16 u16_Reserve_0x03
Definition: P020_36_V1_0_DCBIO.h:94
U16 u16_Status
Status register.
Definition: P020_36_V1_0_DCBIO.h:88
U16 u16_Control
Control register.
Definition: P020_36_V1_0_DCBIO.h:89
U16 u16_Reserve_0x06
Definition: P020_36_V1_0_DCBIO.h:97
U16 u16_Reserve_0x05
Definition: P020_36_V1_0_DCBIO.h:96
U16 u16_Reserve_0x01
Definition: P020_36_V1_0_DCBIO.h:92
U16 u16_Reserve_0x07
Definition: P020_36_V1_0_DCBIO.h:98
U16 u16_Reserve_0x04
Definition: P020_36_V1_0_DCBIO.h:95
U16 u16_Reserve_0x02
Definition: P020_36_V1_0_DCBIO.h:93
U16 u16_Status
Definition: P020_36_V1_0_DCBIO.h:190