ConOpSys V2970  P004.07
ANVILEX control operating system
P014_49_V1_0_FPGA.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file P014_49_V1_0_FPGA.h
3 //! @brief FPGA chip on CPU board P014.49 V1.0 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/P014_49_V1_0_CB/P014_49_V1_0_FPGA.h $
7 //! $Revision: 2262 $
8 //! $Date: 2020-12-05 07:20:48 +0500 (Sa, 05 Dez 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 //------------------------------------------------------------------------------
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 "FPGA_Base.h"
59 #include "P014_47_V1_0_PFOTX.h"
60 #include "P014_48_V1_0_PFORX.h"
61 #include "P013_49_V1_0_RTD.h"
62 #include "P005_03_V2_0_AI.h"
63 #include "P014_42_V1_0_RIO.h"
64 #include "P005_06_V2_0_DIO.h"
65 #include "PWM_3P3L.h"
66 
67 //------------------------------------------------------------------------------
68 // Include ConOpSys application header files
69 //------------------------------------------------------------------------------
70 
71 //------------------------------------------------------------------------------
72 // Macros
73 //------------------------------------------------------------------------------
74 
75 //------------------------------------------------------------------------------
76 // FPGA base address
77 //------------------------------------------------------------------------------
78 
79 #define IGBT_CONTROL_PORT_1_BASE_ADDRESS (0x60000040)
80 #define IGBT_STATUS_PORT_1_BASE_ADDRESS (0x60000048)
81 #define IGBT_CONTROL_PORT_2_BASE_ADDRESS (0x60000050)
82 #define IGBT_STATUS_PORT_2_BASE_ADDRESS (0x60000058)
83 #define IGBT_CONTROL_PORT_3_BASE_ADDRESS (0x60000060)
84 #define IGBT_STATUS_PORT_3_BASE_ADDRESS (0x60000068)
85 
86 #define SENSOR_LINK_1_BASE_ADDRESS (0x60000070)
87 #define SENSOR_LINK_2_BASE_ADDRESS (0x60000078)
88 
89 #define AI_BASE_ADDRESS (0x60000080)
90 
91 #define RTD_BASE_ADDRESS (0x60000010)
92 
93 #define RIO_BASE_ADDRESS (0x60000088)
94 
95 #define DIO_1_BASE_ADDRESS (0x60000020)
96 #define DIO_2_BASE_ADDRESS (0x60000030)
97 
98 
99 #define PWM_3P3L_BASE_ADDRESS (0x60000100)
100 
101 #define SENSOR_LINK_GRID_VOLTAGE_L12_BASE_ADDRESS (0x60000400)
102 #define SENSOR_LINK_GRID_VOLTAGE_L23_BASE_ADDRESS (0x60000410)
103 #define SENSOR_LINK_GRID_VOLTAGE_L31_BASE_ADDRESS (0x60000420)
104 
105 #define SENSOR_LINK_GSI_CURRENT_L1_BASE_ADDRESS (0x60000430)
106 #define SENSOR_LINK_GSI_CURRENT_L2_BASE_ADDRESS (0x60000440)
107 #define SENSOR_LINK_GSI_CURRENT_L3_BASE_ADDRESS (0x60000450)
108 
109 #define SENSOR_LINK_PV_INPUT_VOLTAGE_1_BASE_ADDRESS (0x60000460)
110 #define SENSOR_LINK_PV_INPUT_VOLTAGE_2_BASE_ADDRESS (0x60000470)
111 #define SENSOR_LINK_PV_INPUT_VOLTAGE_3_BASE_ADDRESS (0x60000480)
112 
113 #define SENSOR_LINK_PV_INPUT_CURRENT_1_BASE_ADDRESS (0x60000490)
114 #define SENSOR_LINK_PV_INPUT_CURRENT_2_BASE_ADDRESS (0x600004A0)
115 #define SENSOR_LINK_PV_INPUT_CURRENT_3_BASE_ADDRESS (0x600004B0)
116 
117 #define SENSOR_LINK_DC_BUS_VOLTAGE_TOP (0x600004C0)
118 #define SENSOR_LINK_DC_BUS_VOLTAGE_BOTTOM (0x600004D0)
119 
120 //------------------------------------------------------------------------------
121 //! @brief FPGA hardware abstraction level class
122 //------------------------------------------------------------------------------
123 
124 class TFPGA : public TFPGA_Base
125 {
126 
127  //----------------------------------------------------------------------------
128  // Public defines, methods and variables
129  //----------------------------------------------------------------------------
130 
131  public:
132 
133  // Constructor and destructor
134  TFPGA();
135  ~TFPGA();
136 
137  // Initialization and finalization methods
138  VOID Init();
139  VOID Done();
140 
141  // Configuration control
142  virtual VOID Configure();
143 
144  // Interrupt management methods
145  virtual VOID Interrupt_Enable( U32 u32_TickPriority );
146  virtual VOID Interrupt_Disable();
147 
148  // Register access methods
149  virtual VOID Write_U16( U16 u16_Address, U16 u16_Value );
150  virtual VOID Read_U16( U16 u16_Address, U16 *u16_Value );
151 
153 
154  //--------------------------------------------------------------------------
155  // Public objects
156  //--------------------------------------------------------------------------
157 
158  // FPGA units
172 
174 
176 
177  //----------------------------------------------------------------------------
178  // Protected defines, methods and variables
179  //----------------------------------------------------------------------------
180 
181  protected:
182 
183  //----------------------------------------------------------------------------
184  // Private defines, methods and variables
185  //----------------------------------------------------------------------------
186 
187  private:
188 
189 };
190 
191 //------------------------------------------------------------------------------
192 // Export references to the objects
193 //------------------------------------------------------------------------------
194 
195 //------------------------------------------------------------------------------
196 // Export references to the functions
197 //------------------------------------------------------------------------------
198 
200 
201 //------------------------------------------------------------------------------
202 // End Of File
203 //------------------------------------------------------------------------------
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
FPGA chip base class implementation file.
Analog input board P005.03 V2.0 hardware driver header file.
Digital I/O board P005.06 V2.0 hardware driver header file.
RTD input board P013.49 V1.0 hardware driver header file.
remore I/O board P014.42 V1.0 hardware driver header file.
Plastic fiber optic TX board P014.47 V1.0 hardware driver header file.
Plastic fiber optic RX board P014.48 V1.0 hardware driver header file.
VOID FPGA_Interrupt_Handler()
FPGA object interrupt handler.
Definition: P013_35_V1_3_CPU.cpp:117
3-phase 3-level pulse width modulator object header file.
FPGA base class.
Definition: FPGA_Base.h:81
FPGA hardware abstraction level class.
Definition: P014_49_V1_0_FPGA.h:125
TP014_47_V1_0_PFOTX object_IGBT_Control_Port_1
Definition: P014_49_V1_0_FPGA.h:159
TP014_48_V1_0_PFORX object_IGBT_Status_Port_3
Definition: P014_49_V1_0_FPGA.h:164
TP014_48_V1_0_PFORX object_IGBT_Status_Port_1
Definition: P014_49_V1_0_FPGA.h:160
TFPGA()
FPGA object conctructor.
Definition: P014_49_V1_0_FPGA.cpp:99
TP005_06_V2_0_DIO object_DIO_1
Definition: P014_49_V1_0_FPGA.h:170
VOID Test_Interconnect_Interface()
Definition: P014_49_V1_0_FPGA.cpp:234
TP014_48_V1_0_PFORX object_IGBT_Status_Port_2
Definition: P014_49_V1_0_FPGA.h:162
virtual VOID Interrupt_Enable(U32 u32_TickPriority)
Enable FPGA interrupt.
Definition: P014_49_V1_0_FPGA.cpp:175
virtual VOID Read_U16(U16 u16_Address, U16 *u16_Value)
Read U16 value from FPGA using generic access.
Definition: P014_49_V1_0_FPGA.cpp:224
virtual VOID Interrupt_Disable()
Disable FPGA interrupt.
Definition: P014_49_V1_0_FPGA.cpp:191
TP005_03_V2_0_AI object_AI
Definition: P014_49_V1_0_FPGA.h:167
~TFPGA()
FPGA object destructor.
Definition: P014_49_V1_0_FPGA.cpp:109
TP014_48_V1_0_PFORX object_Sensor_Link_1
Definition: P014_49_V1_0_FPGA.h:165
TP014_47_V1_0_PFOTX object_IGBT_Control_Port_2
Definition: P014_49_V1_0_FPGA.h:161
TP014_47_V1_0_PFOTX object_IGBT_Control_Port_3
Definition: P014_49_V1_0_FPGA.h:163
TP005_06_V2_0_DIO object_DIO_2
Definition: P014_49_V1_0_FPGA.h:171
VOID Done()
FPGA object finalisation method.
Definition: P014_49_V1_0_FPGA.cpp:136
TP014_42_V1_0_RIO object_RIO
Definition: P014_49_V1_0_FPGA.h:169
TP013_49_V1_0_RTD object_RTD
Definition: P014_49_V1_0_FPGA.h:168
VOID Init()
FPGA object initialization method.
Definition: P014_49_V1_0_FPGA.cpp:119
virtual VOID Write_U16(U16 u16_Address, U16 u16_Value)
Write U16 value into FPGA using generic access.
Definition: P014_49_V1_0_FPGA.cpp:208
U32 u32_Test_Interconnect_Error_Counter
Definition: P014_49_V1_0_FPGA.h:175
TP014_48_V1_0_PFORX object_Sensor_Link_2
Definition: P014_49_V1_0_FPGA.h:166
virtual VOID Configure()
Force load FPGA configuration from extern memory.
Definition: P014_49_V1_0_FPGA.cpp:150
TPWM_3P3L object_PWM_3P3L
Definition: P014_49_V1_0_FPGA.h:173
Analog input P005.03 V2.0 board class.
Definition: P005_03_V2_0_AI.h:69
Digital I/O P005.06 V2.0 board TP005_06_V2_0_DIO class.
Definition: P005_06_V2_0_DIO.h:70
KG2 RTD P013.49 V1.0 board class.
Definition: P013_49_V1_0_RTD.h:62
Remote I/O board P014.42 V2.0 class.
Definition: P014_42_V1_0_RIO.h:73
Plastic fiber optic TX board P014.47 V1.0 class.
Definition: P014_47_V1_0_PFOTX.h:73
Plastic fiber optic RX board P014.48 V1.0 class.
Definition: P014_48_V1_0_PFORX.h:73
3-phase 3-level pulse width modulator object class
Definition: PWM_3P3L.h:71