ConOpSys V2970  P004.07
ANVILEX control operating system
P013_35_V1_3_CPU.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file P013_35_V1_3_CPU.h
3 //! @brief CPU board P013.35 V1.3 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/P013_35_V1_3_CPU/P013_35_V1_3_CPU.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 #pragma once
41 
42 //------------------------------------------------------------------------------
43 // Include system headers
44 //------------------------------------------------------------------------------
45 
46 //------------------------------------------------------------------------------
47 // Include project headers
48 //------------------------------------------------------------------------------
49 
50 #include "Target_Base.h"
51 
52 //------------------------------------------------------------------------------
53 // FPGA base address
54 //------------------------------------------------------------------------------
55 
56 #define FPGA_BASE (0x60000000)
57 //#define FPGA_SIZE (0x00010000)
58 
59 //------------------------------------------------------------------------------
60 // Slot base address definitions
61 //------------------------------------------------------------------------------
62 
63 //#define FPGA_SLOT_1 (FPGA_BASE + 0x00000020)
64 //#define FPGA_SLOT_2 (FPGA_BASE + 0x00000040)
65 //#define FPGA_SLOT_3 (FPGA_BASE + 0x00000060)
66 //#define FPGA_SLOT_4 (FPGA_BASE + 0x00000080)
67 //#define FPGA_SLOT_5 (FPGA_BASE + 0x000000A0)
68 //#define FPGA_SLOT_6 (FPGA_BASE + 0x000000C0)
69 //#define FPGA_SLOT_7 (FPGA_BASE + 0x000000E0)
70 //#define FPGA_SLOT_8 (FPGA_BASE + 0x00000100)
71 //#define FPGA_SLOT_9 (FPGA_BASE + 0x00000120)
72 //#define FPGA_SLOT_10 (FPGA_BASE + 0x00000140)
73 
74 //#define FPGA_SLOT_11 (FPGA_BASE + 0x00000160)
75 //#define FPGA_SLOT_12 (FPGA_BASE + 0x00000180)
76 //#define FPGA_SLOT_13 (FPGA_BASE + 0x000001A0)
77 //#define FPGA_SLOT_14 (FPGA_BASE + 0x000001C0)
78 //#define FPGA_SLOT_15 (FPGA_BASE + 0x000001E0)
79 //#define FPGA_SLOT_16 (FPGA_BASE + 0x00000200)
80 //#define FPGA_SLOT_17 (FPGA_BASE + 0x00000220)
81 //#define FPGA_SLOT_18 (FPGA_BASE + 0x00000240)
82 //#define FPGA_SLOT_19 (FPGA_BASE + 0x00000260)
83 //#define FPGA_SLOT_20 (FPGA_BASE + 0x00000280)
84 //#define FPGA_SLOT_21 (FPGA_BASE + 0x000002A0)
85 //#define FPGA_SLOT_22 (FPGA_BASE + 0x000002C0)
86 //#define FPGA_SLOT_23 (FPGA_BASE + 0x000002E0)
87 //#define FPGA_SLOT_24 (FPGA_BASE + 0x00000300)
88 //#define FPGA_SLOT_25 (FPGA_BASE + 0x00000320)
89 //#define FPGA_SLOT_26 (FPGA_BASE + 0x00000340)
90 //#define FPGA_SLOT_27 (FPGA_BASE + 0x00000360)
91 //#define FPGA_SLOT_28 (FPGA_BASE + 0x00000380)
92 //#define FPGA_SLOT_29 (FPGA_BASE + 0x000003A0)
93 //#define FPGA_SLOT_30 (FPGA_BASE + 0x000003C0)
94 //#define FPGA_SLOT_31 (FPGA_BASE + 0x000003E0)
95 //#define FPGA_SLOT_32 (FPGA_BASE + 0x00000400)
96 
97 //------------------------------------------------------------------------------
98 // Internal moduls base address definitions
99 //------------------------------------------------------------------------------
100 
101 //------------------------------------------------------------------------------
102 //
103 //------------------------------------------------------------------------------
104 
105 class TTarget_P013_35_V1_3_CPU : public TTarget_Base
106 {
107 
108  //----------------------------------------------------------------------------
109  // Public defines, methods and variables
110  //----------------------------------------------------------------------------
111 
112  public:
113 
114  // Initialization and finalization methods
115  VOID Init(); //!< Initialisation method
116  VOID Done(); //!< Finalisation method
117 
118  // Core clock
127 
128  virtual VOID FPGA_Configure();
129 
130  virtual U32 Get_CPU_Reset_Source();
131  virtual U32 Get_CPU_Device_ID();
132  virtual U32 Get_CPU_Revision();
133  virtual U32 Get_CPU_Unique_Device_ID( U32 u32_Index );
134  virtual U32 Get_CPU_Flash_Size();
135  virtual U32 Get_CPU_RAM_Size();
136 
137  virtual U32 Get_CPU_Stack_Base();
138  virtual U32 Get_CPU_Stack_Size();
139 
140  virtual U32 Get_CPU_Heap_Base();
141  virtual U32 Get_CPU_Heap_Size();
142 
143  // Interrupt management methods
144  virtual VOID FPGA_Interrupt_Enable( U32 u32_TickPriority ); //!< Enable interrupt method
145  virtual VOID FPGA_Interrupt_Disable(); //!< Disable interrupt method
146 
147  // Register generic access methods
148  virtual VOID FPGA_Write_U16( U16 u16_Address, U16 u16_Value ); //!< Write 16 bit data into FPGA register
149  virtual VOID FPGA_Read_U16( U16 u16_Address, U16 *u16_Value ); //!< Read 16 bit data from FPGA register
150 
151  //----------------------------------------------------------------------------
152  // Protected defines, methods and variables
153  //----------------------------------------------------------------------------
154 
155  protected:
156 
157  //----------------------------------------------------------------------------
158  // Private defines, methods and variables
159  //----------------------------------------------------------------------------
160 
161  private:
162 
163  // System Clock Frequency (Core Clock)
171 
172  // Error flag
174 
175 };
176 
177 //------------------------------------------------------------------------------
178 // Export external references
179 //------------------------------------------------------------------------------
180 
181 extern void System_Init( void );
182 
184 
185 //------------------------------------------------------------------------------
186 // End Of File
187 //------------------------------------------------------------------------------
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: P013_35_V1_3_CPU.h:106
virtual VOID FPGA_Write_U16(U16 u16_Address, U16 u16_Value)
Write 16 bit data into FPGA register.
Definition: P013_35_V1_3_CPU.cpp:247
U32 u32_TCLK1
Definition: P013_35_V1_3_CPU.h:168
virtual VOID FPGA_Interrupt_Enable(U32 u32_TickPriority)
Enable interrupt method.
Definition: P013_35_V1_3_CPU.cpp:224
U32 u32_IWDG
Definition: P013_35_V1_3_CPU.h:170
virtual VOID FPGA_Configure()
Definition: P013_35_V1_3_CPU.cpp:175
virtual U32 Get_CPU_Heap_Base()
Definition: P013_35_V1_3_CPU.cpp:485
VOID System_Core_Clock_Update()
Definition: P013_35_V1_3_CPU.cpp:271
virtual U32 Get_CPU_Heap_Size()
Definition: P013_35_V1_3_CPU.cpp:494
U32 u32_PCLK2
Definition: P013_35_V1_3_CPU.h:167
U32 Get_SYSCLK_Frequency()
Definition: P013_35_V1_3_CPU.cpp:277
VOID Init()
Initialisation method.
Definition: P013_35_V1_3_CPU.cpp:131
U32 Get_TCLK2_Frequency()
Returns the TCLK2 frequency
Definition: P013_35_V1_3_CPU.cpp:365
U32 u32_HCLK
Definition: P013_35_V1_3_CPU.h:165
U32 Get_TCLK1_Frequency()
Returns the TCLK1 frequency
Definition: P013_35_V1_3_CPU.cpp:348
U32 u32_TCLK2
Definition: P013_35_V1_3_CPU.h:169
U32 Get_PCLK2_Frequency()
Returns the PCLK2 frequency
Definition: P013_35_V1_3_CPU.cpp:331
U32 u32_Error_Flag
Definition: P013_35_V1_3_CPU.h:173
virtual U32 Get_CPU_Stack_Base()
Definition: P013_35_V1_3_CPU.cpp:467
virtual U32 Get_CPU_Unique_Device_ID(U32 u32_Index)
Definition: P013_35_V1_3_CPU.cpp:429
VOID Done()
Finalisation method.
Definition: P013_35_V1_3_CPU.cpp:161
U32 u32_SYSCLK
Definition: P013_35_V1_3_CPU.h:164
U32 Get_PCLK1_Frequency()
Returns the PCLK1 frequency
Definition: P013_35_V1_3_CPU.cpp:314
virtual U32 Get_CPU_Flash_Size()
Definition: P013_35_V1_3_CPU.cpp:444
U32 Get_IWDG_Frequency()
Returns the IWDG frequency
Definition: P013_35_V1_3_CPU.cpp:380
virtual VOID FPGA_Read_U16(U16 u16_Address, U16 *u16_Value)
Read 16 bit data from FPGA register.
Definition: P013_35_V1_3_CPU.cpp:259
virtual U32 Get_CPU_Revision()
Definition: P013_35_V1_3_CPU.cpp:416
virtual U32 Get_CPU_RAM_Size()
Definition: P013_35_V1_3_CPU.cpp:456
virtual U32 Get_CPU_Device_ID()
Definition: P013_35_V1_3_CPU.cpp:403
virtual U32 Get_CPU_Reset_Source()
Definition: P013_35_V1_3_CPU.cpp:390
U32 Get_HCLK_Frequency()
Returns the HCLK frequency
Definition: P013_35_V1_3_CPU.cpp:297
virtual VOID FPGA_Interrupt_Disable()
Disable interrupt method.
Definition: P013_35_V1_3_CPU.cpp:236
virtual U32 Get_CPU_Stack_Size()
Definition: P013_35_V1_3_CPU.cpp:476
U32 u32_PCLK1
Definition: P013_35_V1_3_CPU.h:166