ConOpSys V2970  P004.07
ANVILEX control operating system
Target_P017_11_V1.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file Target_P017_11_V1.h
3 //! @brief Target board P017.11 V1 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/P017_11_V1/Target_P017_11_V1.h $
7 //! $Revision: 2280 $
8 //! $Date: 2020-12-12 16:29:27 +0500 (Sa, 12 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 system headers
48 //------------------------------------------------------------------------------
49 
50 //------------------------------------------------------------------------------
51 // Include project headers
52 //------------------------------------------------------------------------------
53 
54 #include "Target_Base.h"
55 
56 //------------------------------------------------------------------------------
57 // FPGA base address
58 //------------------------------------------------------------------------------
59 
60 #define FPGA_BASE (0x60000000)
61 //#define FPGA_SIZE (0x00010000)
62 
63 //------------------------------------------------------------------------------
64 // Slot base address definitions
65 //------------------------------------------------------------------------------
66 
67 #define FPGA_MODULE_EXTERNAL_SLOT_1_BASE_ADDRESS (FPGA_BASE+(0x00000020))
68 #define FPGA_MODULE_EXTERNAL_SLOT_2_BASE_ADDRESS (FPGA_BASE+(0x00000040))
69 #define FPGA_MODULE_EXTERNAL_SLOT_3_BASE_ADDRESS (FPGA_BASE+(0x00000060))
70 #define FPGA_MODULE_EXTERNAL_SLOT_4_BASE_ADDRESS (FPGA_BASE+(0x00000080))
71 #define FPGA_MODULE_EXTERNAL_SLOT_6_BASE_ADDRESS (FPGA_BASE+(0x000000A0))
72 #define FPGA_MODULE_EXTERNAL_SLOT_11_BASE_ADDRESS (FPGA_BASE+(0x000000C0))
73 #define FPGA_MODULE_EXTERNAL_SLOT_12_BASE_ADDRESS (FPGA_BASE+(0x000000E0))
74 #define FPGA_MODULE_EXTERNAL_SLOT_13_BASE_ADDRESS (FPGA_BASE+(0x00000100))
75 #define FPGA_MODULE_EXTERNAL_SLOT_14_BASE_ADDRESS (FPGA_BASE+(0x00000120))
76 #define FPGA_MODULE_EXTERNAL_SLOT_16_BASE_ADDRESS (FPGA_BASE+(0x00000140))
77 #define FPGA_MODULE_EXTERNAL_SLOT_17_BASE_ADDRESS (FPGA_BASE+(0x00000160))
78 
79 #define FPGA_MODULE_INTERNAL_SLOT_1_BASE_ADDRESS (FPGA_BASE+(0x00000180))
80 #define FPGA_MODULE_INTERNAL_SLOT_2_BASE_ADDRESS (FPGA_BASE+(0x000001A0))
81 
82 //------------------------------------------------------------------------------
83 //
84 //------------------------------------------------------------------------------
85 
86 class TTarget_P017_11_V1 : public TTarget_Base
87 {
88 
89  //----------------------------------------------------------------------------
90  // Public methods, variables and definitions
91  //----------------------------------------------------------------------------
92 
93  public:
94 
95  // Initialization and finalization methods
96  VOID Init(); //!< Initialisation method
97  VOID Done(); //!< Finalisation method
98 
99  // Core clock
108 
109  virtual BOOL FPGA_Configure();
110 
111  virtual U32 Get_CPU_Reset_Source();
112  virtual TTarget_Base::TReset_Source Get_Reset_Source();
113  virtual U32 Get_CPU_Device_ID();
114  virtual U32 Get_CPU_Revision();
115  virtual U32 Get_CPU_Unique_Device_ID( U32 u32_Index );
116  virtual U32 Get_CPU_Flash_Size();
117  virtual U32 Get_CPU_RAM_Size();
118 
119  virtual U32 Get_CPU_Stack_Base();
120  virtual U32 Get_CPU_Stack_Size();
121 
122  virtual U32 Get_CPU_Heap_Base();
123  virtual U32 Get_CPU_Heap_Size();
124 
125  // Interrupt management methods
126  virtual VOID FPGA_Interrupt_Enable( U32 u32_TickPriority ); //!< Enable interrupt method
127  virtual VOID FPGA_Interrupt_Disable(); //!< Disable interrupt method
128 
129  // Register generic access methods
130  virtual VOID FPGA_Write_U16( U16 u16_Address, U16 u16_Value ); //!< Write 16 bit data into FPGA register
131  virtual VOID FPGA_Read_U16( U16 u16_Address, U16 *u16_Value ); //!< Read 16 bit data from FPGA register
132 
133  //----------------------------------------------------------------------------
134  // Protected methods, variables and definitions
135  //----------------------------------------------------------------------------
136 
137  protected:
138 
139  //----------------------------------------------------------------------------
140  // Private methods, variables and definitions
141  //----------------------------------------------------------------------------
142 
143  private:
144 
145  // System Clock Frequency (Core Clock)
153 
154  // Error flag
156 
157 };
158 
159 //------------------------------------------------------------------------------
160 // Export external references
161 //------------------------------------------------------------------------------
162 
163 extern "C" void System_Init( void );
164 
165 extern "C" VOID FPGA_Interrupt_Handler();
166 
167 //------------------------------------------------------------------------------
168 // End of file
169 //------------------------------------------------------------------------------
170 
int BOOL
Boolean datatype definition.
Definition: Defines.h:124
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
void System_Init(void)
Definition: P013_35_V1_3_CPU.cpp:94
VOID FPGA_Interrupt_Handler()
FPGA object interrupt handler.
Definition: P013_35_V1_3_CPU.cpp:117
Definition: Target_P017_11_V1.h:87
virtual U32 Get_CPU_Heap_Size()
Definition: Target_P017_11_V1.cpp:1721
virtual U32 Get_CPU_Revision()
Definition: Target_P017_11_V1.cpp:1621
virtual U32 Get_CPU_Reset_Source()
Definition: Target_P017_11_V1.cpp:1583
U32 Get_PCLK2_Frequency()
Returns the PCLK2 frequency
Definition: Target_P017_11_V1.cpp:1524
virtual U32 Get_CPU_Stack_Size()
Definition: Target_P017_11_V1.cpp:1686
U32 Get_TCLK1_Frequency()
Returns the TCLK1 frequency
Definition: Target_P017_11_V1.cpp:1541
VOID System_Core_Clock_Update()
Definition: Target_P017_11_V1.cpp:1344
virtual U32 Get_CPU_Stack_Base()
Definition: Target_P017_11_V1.cpp:1672
VOID Init()
Initialisation method.
Definition: Target_P017_11_V1.cpp:1168
U32 Get_PCLK1_Frequency()
Returns the PCLK1 frequency
Definition: Target_P017_11_V1.cpp:1507
U32 Get_TCLK2_Frequency()
Returns the TCLK2 frequency
Definition: Target_P017_11_V1.cpp:1558
U32 u32_SYSCLK
Definition: Target_P017_11_V1.h:146
U32 Get_HCLK_Frequency()
Returns the HCLK frequency
Definition: Target_P017_11_V1.cpp:1490
U32 u32_IWDG
Definition: Target_P017_11_V1.h:152
virtual TTarget_Base::TReset_Source Get_Reset_Source()
Definition: Target_P017_11_V1.cpp:1596
U32 u32_HCLK
Definition: Target_P017_11_V1.h:147
virtual VOID FPGA_Read_U16(U16 u16_Address, U16 *u16_Value)
Read 16 bit data from FPGA register.
Definition: Target_P017_11_V1.cpp:1332
virtual U32 Get_CPU_Flash_Size()
Definition: Target_P017_11_V1.cpp:1649
U32 u32_TCLK2
Definition: Target_P017_11_V1.h:151
virtual VOID FPGA_Interrupt_Disable()
Disable interrupt method.
Definition: Target_P017_11_V1.cpp:1297
virtual U32 Get_CPU_Device_ID()
Definition: Target_P017_11_V1.cpp:1608
virtual U32 Get_CPU_Heap_Base()
Definition: Target_P017_11_V1.cpp:1707
U32 u32_TCLK1
Definition: Target_P017_11_V1.h:150
U32 u32_Error_Flag
Definition: Target_P017_11_V1.h:155
virtual VOID FPGA_Write_U16(U16 u16_Address, U16 u16_Value)
Write 16 bit data into FPGA register.
Definition: Target_P017_11_V1.cpp:1316
virtual VOID FPGA_Interrupt_Enable(U32 u32_TickPriority)
Enable interrupt method.
Definition: Target_P017_11_V1.cpp:1279
VOID Done()
Finalisation method.
Definition: Target_P017_11_V1.cpp:1200
U32 u32_PCLK1
Definition: Target_P017_11_V1.h:148
U32 u32_PCLK2
Definition: Target_P017_11_V1.h:149
U32 Get_SYSCLK_Frequency()
Definition: Target_P017_11_V1.cpp:1470
U32 Get_IWDG_Frequency()
Returns the IWDG frequency
Definition: Target_P017_11_V1.cpp:1573
virtual U32 Get_CPU_Unique_Device_ID(U32 u32_Index)
Definition: Target_P017_11_V1.cpp:1634
virtual U32 Get_CPU_RAM_Size()
Definition: Target_P017_11_V1.cpp:1661
virtual BOOL FPGA_Configure()
Force load FPGA configuration from extern memory.
Definition: Target_P017_11_V1.cpp:1216