

테스트용 코드 업로드
J8 - 포인트센서 연결 테스트 코드 ADC, DAC, DIO, SCI, Modbus 테스트 완료 SPI(write 미완)
@4d2d1b45b623e493776e104e746dcc60cd6b0594
+++ ArcCTRL-23-NEXTSQ-CPU1/.ccsproject
... | ... | @@ -0,0 +1,7 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<?ccsproject version="1.0"?> | |
3 | +<projectOptions> | |
4 | + <deviceFamily value="C2000"/> | |
5 | + <isTargetManual value="false"/> | |
6 | + <connection value="common/targetdb/connections/SD560V2USB_Connection.xml"/> | |
7 | +</projectOptions> |
+++ ArcCTRL-23-NEXTSQ-CPU1/.cproject
... | ... | @@ -0,0 +1,210 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | +<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> | |
3 | + <storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings"> | |
4 | + <cconfiguration id="com.ti.ccstudio.buildDefinitions.C2000.Debug.40640217"> | |
5 | + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.C2000.Debug.40640217" moduleId="org.eclipse.cdt.core.settings" name="Debug"> | |
6 | + <macros> | |
7 | + <stringMacro name="USERNAME" type="VALUE_TEXT" value="KimJeongWoo"/> | |
8 | + </macros> | |
9 | + <externalSettings/> | |
10 | + <extensions> | |
11 | + <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> | |
12 | + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
13 | + <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
14 | + <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
15 | + <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
16 | + </extensions> | |
17 | + </storageModule> | |
18 | + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> | |
19 | + <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.C2000.Debug.40640217" name="Debug" parent="com.ti.ccstudio.buildDefinitions.C2000.Debug" postannouncebuildStep="" postbuildStep="copy /Y "${PROJECT_BUILD_DIR}/${BuildArtifactFileName}" "${PROJECT_LOC}/../EZDSP/${BuildArtifactFileName}""> | |
20 | + <folderInfo id="com.ti.ccstudio.buildDefinitions.C2000.Debug.40640217." name="/" resourcePath=""> | |
21 | + <toolChain id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.DebugToolchain.1044398768" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerDebug.1052615317"> | |
22 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1786601052" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> | |
23 | + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=TMS320C28XX.TMS320F28377D"/> | |
24 | + <listOptionValue builtIn="false" value="DEVICE_CORE_ID=C28xx_CPU1"/> | |
25 | + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> | |
26 | + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=COFF"/> | |
27 | + <listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=F2837xD_Headers_nonBIOS_cpu1.cmd"/> | |
28 | + <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> | |
29 | + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> | |
30 | + <listOptionValue builtIn="false" value="PRODUCTS="/> | |
31 | + <listOptionValue builtIn="false" value="PRODUCT_MACRO_IMPORTS={}"/> | |
32 | + <listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> | |
33 | + </option> | |
34 | + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.79028410" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="22.6.0.LTS" valueType="string"/> | |
35 | + <targetPlatform id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.targetPlatformDebug.626489137" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.targetPlatformDebug"/> | |
36 | + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.builderDebug.299456899" name="GNU Make.Debug" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.builderDebug"/> | |
37 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.compilerDebug.1483997395" name="C2000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.compilerDebug"> | |
38 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.LARGE_MEMORY_MODEL.103449086" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.LARGE_MEMORY_MODEL" value="true" valueType="boolean"/> | |
39 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.UNIFIED_MEMORY.623525340" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.UNIFIED_MEMORY" value="true" valueType="boolean"/> | |
40 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION.736228654" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION.28" valueType="enumerated"/> | |
41 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT.1262026149" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT.fpu32" valueType="enumerated"/> | |
42 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT.1616211215" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT.cla1" valueType="enumerated"/> | |
43 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT.796923203" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT.vcu2" valueType="enumerated"/> | |
44 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT.695846318" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT.tmu0" valueType="enumerated"/> | |
45 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL.328553500" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL.3" valueType="enumerated"/> | |
46 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_FOR_SPEED.68149489" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_FOR_SPEED.5" valueType="enumerated"/> | |
47 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FP_MODE.766971843" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FP_MODE" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FP_MODE.relaxed" valueType="enumerated"/> | |
48 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH.482943887" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH" valueType="includePath"> | |
49 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/> | |
50 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/driverlib/f2837xd/driverlib"/> | |
51 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/f2837xd/headers/include"/> | |
52 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/f2837xd/common/include"/> | |
53 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/device"/> | |
54 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/FPU/include/fpu32"/> | |
55 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../Common_Resource/EasyDSP_Resource"/> | |
56 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../Common_Resource/CodeLibrary"/> | |
57 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../Common_Resource/CommonLibrary"/> | |
58 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/Main_Resource/include"/> | |
59 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/Main_Resource"/> | |
60 | + </option> | |
61 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ADVICE__PERFORMANCE.137722406" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ADVICE__PERFORMANCE" value="--advice:performance=all" valueType="string"/> | |
62 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEFINE.535833324" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEFINE" valueType="definedSymbols"> | |
63 | + <listOptionValue builtIn="false" value="CPU1"/> | |
64 | + <listOptionValue builtIn="false" value="_FLASH"/> | |
65 | + <listOptionValue builtIn="false" value="__cplusplus"/> | |
66 | + </option> | |
67 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEBUGGING_MODEL.406789639" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/> | |
68 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SYMDEBUG__DWARF_VERSION.790896090" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SYMDEBUG__DWARF_VERSION" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SYMDEBUG__DWARF_VERSION.4" valueType="enumerated"/> | |
69 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.RTTI.1050082044" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.RTTI" value="true" valueType="boolean"/> | |
70 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CPP_DEFAULT.1676190735" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CPP_DEFAULT" value="true" valueType="boolean"/> | |
71 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WARNING.791236894" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WARNING" valueType="stringList"> | |
72 | + <listOptionValue builtIn="false" value="225"/> | |
73 | + </option> | |
74 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP.618294724" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP.off" valueType="enumerated"/> | |
75 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DISPLAY_ERROR_NUMBER.1393638008" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> | |
76 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI.1714081029" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI.coffabi" valueType="enumerated"/> | |
77 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS.729696053" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS"/> | |
78 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS.91182267" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS"/> | |
79 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS.1060229409" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS"/> | |
80 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM2_SRCS.43202162" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM2_SRCS"/> | |
81 | + </tool> | |
82 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerDebug.1052615317" name="C2000 Linker" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerDebug"> | |
83 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.STACK_SIZE.19090122" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.STACK_SIZE" value="0x200" valueType="string"/> | |
84 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.MAP_FILE.1666604626" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.MAP_FILE" value="${ProjName}.map" valueType="string"/> | |
85 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.OUTPUT_FILE.1666083505" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/> | |
86 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.LIBRARY.939891060" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.LIBRARY" valueType="libs"> | |
87 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/FPU/lib/c28x_fpu_dsp_library.lib"/> | |
88 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/FPUfastRTS/c28/lib/rts2800_fpu32_fast_supplement.lib"/> | |
89 | + <listOptionValue builtIn="false" value="libc.a"/> | |
90 | + </option> | |
91 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.SEARCH_PATH.36018046" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.SEARCH_PATH" valueType="libPaths"> | |
92 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/FPU/lib"/> | |
93 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/FPUfastRTS/c28/lib"/> | |
94 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/lib"/> | |
95 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/> | |
96 | + </option> | |
97 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.PRIORITY.728753153" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.PRIORITY" value="true" valueType="boolean"/> | |
98 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DIAG_WRAP.92357409" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DIAG_WRAP.off" valueType="enumerated"/> | |
99 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DISPLAY_ERROR_NUMBER.824855182" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> | |
100 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.XML_LINK_INFO.107487242" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.XML_LINK_INFO" value="${ProjName}_linkInfo.xml" valueType="string"/> | |
101 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD_SRCS.890760016" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD_SRCS"/> | |
102 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD2_SRCS.355129147" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD2_SRCS"/> | |
103 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__GEN_CMDS.1788070690" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__GEN_CMDS"/> | |
104 | + </tool> | |
105 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.1079301353" name="C2000 Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex"/> | |
106 | + </toolChain> | |
107 | + </folderInfo> | |
108 | + <sourceEntries> | |
109 | + <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> | |
110 | + </sourceEntries> | |
111 | + </configuration> | |
112 | + </storageModule> | |
113 | + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> | |
114 | + </cconfiguration> | |
115 | + <cconfiguration id="com.ti.ccstudio.buildDefinitions.C2000.Release.1697767616"> | |
116 | + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.C2000.Release.1697767616" moduleId="org.eclipse.cdt.core.settings" name="Release"> | |
117 | + <externalSettings/> | |
118 | + <extensions> | |
119 | + <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> | |
120 | + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
121 | + <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
122 | + <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
123 | + <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
124 | + </extensions> | |
125 | + </storageModule> | |
126 | + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> | |
127 | + <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.C2000.Release.1697767616" name="Release" parent="com.ti.ccstudio.buildDefinitions.C2000.Release"> | |
128 | + <folderInfo id="com.ti.ccstudio.buildDefinitions.C2000.Release.1697767616." name="/" resourcePath=""> | |
129 | + <toolChain id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.ReleaseToolchain.1224743178" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerRelease.633439359"> | |
130 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1444794707" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> | |
131 | + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=TMS320C28XX.TMS320F28377D"/> | |
132 | + <listOptionValue builtIn="false" value="DEVICE_CORE_ID="/> | |
133 | + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> | |
134 | + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=COFF"/> | |
135 | + <listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=2837x_FLASH_lnk_cpu1.cmd"/> | |
136 | + <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> | |
137 | + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> | |
138 | + <listOptionValue builtIn="false" value="PRODUCTS="/> | |
139 | + <listOptionValue builtIn="false" value="PRODUCT_MACRO_IMPORTS={}"/> | |
140 | + <listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> | |
141 | + </option> | |
142 | + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.692816616" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="22.6.0.LTS" valueType="string"/> | |
143 | + <targetPlatform id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.targetPlatformRelease.1689213711" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.targetPlatformRelease"/> | |
144 | + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.builderRelease.814910229" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.builderRelease"/> | |
145 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.compilerRelease.1279592470" name="C2000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.compilerRelease"> | |
146 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.LARGE_MEMORY_MODEL.68847834" name="Option deprecated, set by default (--large_memory_model, -ml)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.LARGE_MEMORY_MODEL" value="true" valueType="boolean"/> | |
147 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.UNIFIED_MEMORY.1014872002" name="Unified memory (--unified_memory, -mt)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.UNIFIED_MEMORY" value="true" valueType="boolean"/> | |
148 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION.144593138" name="Processor version (--silicon_version, -v)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION.28" valueType="enumerated"/> | |
149 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT.1155517353" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT.fpu32" valueType="enumerated"/> | |
150 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT.1644651209" name="Specify CLA support (--cla_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT.cla1" valueType="enumerated"/> | |
151 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT.258070210" name="Specify VCU support (--vcu_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT.vcu2" valueType="enumerated"/> | |
152 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT.303313117" name="Specify TMU support (--tmu_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT.tmu0" valueType="enumerated"/> | |
153 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH.1706592829" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH" valueType="includePath"> | |
154 | + <listOptionValue builtIn="false" value="${PROJECT_ROOT}"/> | |
155 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../Common_Resource/CodeLibrary/PLL"/> | |
156 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../Common_Resource/CodeLibrary"/> | |
157 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/> | |
158 | + </option> | |
159 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WARNING.1744357271" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WARNING" valueType="stringList"> | |
160 | + <listOptionValue builtIn="false" value="225"/> | |
161 | + </option> | |
162 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP.1713452828" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP.off" valueType="enumerated"/> | |
163 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DISPLAY_ERROR_NUMBER.187801156" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> | |
164 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI.1311132154" name="Application binary interface [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI.coffabi" valueType="enumerated"/> | |
165 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS.1320174793" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS"/> | |
166 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS.316580898" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS"/> | |
167 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS.1851774821" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS"/> | |
168 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM2_SRCS.1649168406" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM2_SRCS"/> | |
169 | + </tool> | |
170 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerRelease.633439359" name="C2000 Linker" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerRelease"> | |
171 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.STACK_SIZE.1306439479" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.STACK_SIZE" value="0x200" valueType="string"/> | |
172 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.MAP_FILE.1160787138" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.MAP_FILE" value="${ProjName}.map" valueType="string"/> | |
173 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.OUTPUT_FILE.1276732010" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/> | |
174 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.LIBRARY.1801259657" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.LIBRARY" valueType="libs"> | |
175 | + <listOptionValue builtIn="false" value="libc.a"/> | |
176 | + </option> | |
177 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.SEARCH_PATH.482647902" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.SEARCH_PATH" valueType="libPaths"> | |
178 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/lib"/> | |
179 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/> | |
180 | + </option> | |
181 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DIAG_WRAP.20084738" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DIAG_WRAP.off" valueType="enumerated"/> | |
182 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DISPLAY_ERROR_NUMBER.2137149019" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> | |
183 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.XML_LINK_INFO.411319784" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.XML_LINK_INFO" value="${ProjName}_linkInfo.xml" valueType="string"/> | |
184 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD_SRCS.1206619189" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD_SRCS"/> | |
185 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD2_SRCS.2067866622" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD2_SRCS"/> | |
186 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__GEN_CMDS.317608921" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__GEN_CMDS"/> | |
187 | + </tool> | |
188 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.1014016477" name="C2000 Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex"/> | |
189 | + </toolChain> | |
190 | + </folderInfo> | |
191 | + </configuration> | |
192 | + </storageModule> | |
193 | + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> | |
194 | + </cconfiguration> | |
195 | + </storageModule> | |
196 | + <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> | |
197 | + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> | |
198 | + <project id="Master4.0-Test-Firmware.com.ti.ccstudio.buildDefinitions.C2000.ProjectType.1729653242" name="C2000" projectType="com.ti.ccstudio.buildDefinitions.C2000.ProjectType"/> | |
199 | + </storageModule> | |
200 | + <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> | |
201 | + <storageModule moduleId="scannerConfiguration"/> | |
202 | + <storageModule moduleId="refreshScope" versionNumber="2"> | |
203 | + <configuration configurationName="Debug"> | |
204 | + <resource resourceType="PROJECT" workspacePath="/V2H6K01-23-ENEMAN-CPU1"/> | |
205 | + </configuration> | |
206 | + <configuration configurationName="Release"> | |
207 | + <resource resourceType="PROJECT" workspacePath="/V2H6K01-23-ENEMAN-CPU1"/> | |
208 | + </configuration> | |
209 | + </storageModule> | |
210 | +</cproject>(파일 끝에 줄바꿈 문자 없음) |
+++ ArcCTRL-23-NEXTSQ-CPU1/.gitignore
... | ... | @@ -0,0 +1,1 @@ |
1 | +/Debug/ |
+++ ArcCTRL-23-NEXTSQ-CPU1/.launches/ArcCtrl-23-NEXTSQ-CPU1.launch
... | ... | @@ -0,0 +1,22 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | +<launchConfiguration type="com.ti.ccstudio.debug.launchType.device.debugging"> | |
3 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_LOAD_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1" value="ALL"/> | |
4 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_LOAD_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2" value="ALL"/> | |
5 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_LOAD_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/CPU1_CLA1" value="ALL"/> | |
6 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_LOAD_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/CPU2_CLA1" value="ALL"/> | |
7 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_LOAD_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/IcePick_C_0" value="ALL"/> | |
8 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1" value="${build_artifact:ArcCtrl-23-NEXTSQ-CPU1}"/> | |
9 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2" value="${build_artifact:ArcCtrl-23-NEXTSQ-CPU1}"/> | |
10 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1" value="ArcCtrl-23-NEXTSQ-CPU1"/> | |
11 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2" value="ArcCtrl-23-NEXTSQ-CPU1"/> | |
12 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:ArcCtrl-23-NEXTSQ-CPU1}"/> | |
13 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1" value="${build_artifact:ArcCtrl-23-NEXTSQ-CPU1}"/> | |
14 | + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> | |
15 | + <listEntry value="/ArcCtrl-23-NEXTSQ-CPU1"/> | |
16 | + </listAttribute> | |
17 | + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> | |
18 | + <listEntry value="4"/> | |
19 | + </listAttribute> | |
20 | + <stringAttribute key="org.eclipse.debug.core.source_locator_id" value="com.ti.ccstudio.debug.sourceLocator"/> | |
21 | + <stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;cpuSpecificContainer cpuName=&quot;Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1&quot;&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;project name=&amp;quot;ArcCtrl-23-NEXTSQ-CPU1&amp;quot; referencedProjects=&amp;quot;true&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.project&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;productsSource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.products.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;deviceLibrarySource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.device.library.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;librarySource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.library.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;project name=&amp;quot;V2H6K01-23-ENEMAN-CPU1&amp;quot; referencedProjects=&amp;quot;true&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.project&quot;/&gt;&#13;&#10;&lt;/cpuSpecificContainer&gt;&#13;&#10;" typeId="com.ti.ccstudio.debug.containerType.cpu.specific"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;cpuSpecificContainer cpuName=&quot;Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2&quot;&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;project name=&amp;quot;ArcCtrl-23-NEXTSQ-CPU1&amp;quot; referencedProjects=&amp;quot;true&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.project&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;productsSource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.products.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;deviceLibrarySource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.device.library.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;librarySource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.library.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;project name=&amp;quot;V2H6K01-23-ENEMAN-CPU1&amp;quot; referencedProjects=&amp;quot;true&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.project&quot;/&gt;&#13;&#10;&lt;/cpuSpecificContainer&gt;&#13;&#10;" typeId="com.ti.ccstudio.debug.containerType.cpu.specific"/> </sourceContainers> </sourceLookupDirector> "/> | |
22 | +</launchConfiguration> |
+++ ArcCTRL-23-NEXTSQ-CPU1/.launches/V2H6K01-23-ENEMAN-CPU1.launch
... | ... | @@ -0,0 +1,20 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | +<launchConfiguration type="com.ti.ccstudio.debug.launchType.device.debugging"> | |
3 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1" value="<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <PropertyValues> <property id="ConnectOnStartup"> <curValue>1</curValue> </property> <property id="EnableInstalledBreakpoint"> <curValue>1</curValue> </property> <property id="IgnoreSoftLaunchFailures"> <curValue>0</curValue> </property> </PropertyValues> "/> | |
4 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2" value="<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <PropertyValues> <property id="ConnectOnStartup"> <curValue>1</curValue> </property> <property id="EnableInstalledBreakpoint"> <curValue>1</curValue> </property> <property id="IgnoreSoftLaunchFailures"> <curValue>0</curValue> </property> </PropertyValues> "/> | |
5 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1" value="${build_artifact:V2H6K01-23-ENEMAN-CPU1}"/> | |
6 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2" value="${build_artifact:V2H6K01-23-ENEMAN-CPU1}"/> | |
7 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1" value="V2H6K01-23-ENEMAN-CPU1"/> | |
8 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2" value="V2H6K01-23-ENEMAN-CPU1"/> | |
9 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:V2H6K01-23-ENEMAN-CPU1}"/> | |
10 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1" value="${build_artifact:V2H6K01-23-ENEMAN-CPU1}"/> | |
11 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2" value="${build_artifact:V2H6K01-23-ENEMAN-CPU1}"/> | |
12 | + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> | |
13 | + <listEntry value="/V2H6K01-23-ENEMAN-CPU1"/> | |
14 | + </listAttribute> | |
15 | + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> | |
16 | + <listEntry value="4"/> | |
17 | + </listAttribute> | |
18 | + <stringAttribute key="org.eclipse.debug.core.source_locator_id" value="com.ti.ccstudio.debug.sourceLocator"/> | |
19 | + <stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;cpuSpecificContainer cpuName=&quot;Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1&quot;&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;project name=&amp;quot;V2H6K01-23-ENEMAN-CPU1&amp;quot; referencedProjects=&amp;quot;true&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.project&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;productsSource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.products.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;deviceLibrarySource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.device.library.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;librarySource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.library.source&quot;/&gt;&#13;&#10;&lt;/cpuSpecificContainer&gt;&#13;&#10;" typeId="com.ti.ccstudio.debug.containerType.cpu.specific"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;cpuSpecificContainer cpuName=&quot;Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2&quot;&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;project name=&amp;quot;V2H6K01-23-ENEMAN-CPU1&amp;quot; referencedProjects=&amp;quot;true&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.project&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;productsSource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.products.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;deviceLibrarySource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.device.library.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;librarySource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.library.source&quot;/&gt;&#13;&#10;&lt;/cpuSpecificContainer&gt;&#13;&#10;" typeId="com.ti.ccstudio.debug.containerType.cpu.specific"/> </sourceContainers> </sourceLookupDirector> "/> | |
20 | +</launchConfiguration> |
+++ ArcCTRL-23-NEXTSQ-CPU1/.project
... | ... | @@ -0,0 +1,45 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<projectDescription> | |
3 | + <name>ArcCtrl-23-NEXTSQ-CPU1</name> | |
4 | + <comment></comment> | |
5 | + <projects> | |
6 | + </projects> | |
7 | + <buildSpec> | |
8 | + <buildCommand> | |
9 | + <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> | |
10 | + <arguments> | |
11 | + </arguments> | |
12 | + </buildCommand> | |
13 | + <buildCommand> | |
14 | + <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> | |
15 | + <triggers>full,incremental,</triggers> | |
16 | + <arguments> | |
17 | + </arguments> | |
18 | + </buildCommand> | |
19 | + </buildSpec> | |
20 | + <natures> | |
21 | + <nature>com.ti.ccstudio.core.ccsNature</nature> | |
22 | + <nature>org.eclipse.cdt.core.cnature</nature> | |
23 | + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> | |
24 | + <nature>org.eclipse.cdt.core.ccnature</nature> | |
25 | + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> | |
26 | + </natures> | |
27 | + <linkedResources> | |
28 | + <link> | |
29 | + <name>Common_Resource</name> | |
30 | + <type>2</type> | |
31 | + <locationURI>copy_PARENT/Common_Resource</locationURI> | |
32 | + </link> | |
33 | + <link> | |
34 | + <name>TI_Lib</name> | |
35 | + <type>2</type> | |
36 | + <locationURI>copy_PARENT/TI_Lib</locationURI> | |
37 | + </link> | |
38 | + </linkedResources> | |
39 | + <variableList> | |
40 | + <variable> | |
41 | + <name>copy_PARENT</name> | |
42 | + <value>file:/D:/Project.Git/ArcCtrl-23-Firmware</value> | |
43 | + </variable> | |
44 | + </variableList> | |
45 | +</projectDescription> |
+++ ArcCTRL-23-NEXTSQ-CPU1/.settings/.gitignore
... | ... | @@ -0,0 +1,1 @@ |
1 | +/org.eclipse.core.resources.derived.prefs |
+++ ArcCTRL-23-NEXTSQ-CPU1/.settings/org.eclipse.cdt.codan.core.prefs
... | ... | @@ -0,0 +1,111 @@ |
1 | +eclipse.preferences.version=1 | |
2 | +inEditor=false | |
3 | +onBuild=false | |
4 | +org.eclipse.cdt.codan.checkers.errnoreturn=Warning | |
5 | +org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return\\")",implicit\=>false} | |
6 | +org.eclipse.cdt.codan.checkers.errreturnvalue=Error | |
7 | +org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused return value\\")"} | |
8 | +org.eclipse.cdt.codan.checkers.localvarreturn=-Warning | |
9 | +org.eclipse.cdt.codan.checkers.localvarreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Returning the address of a local variable\\")"} | |
10 | +org.eclipse.cdt.codan.checkers.nocommentinside=-Error | |
11 | +org.eclipse.cdt.codan.checkers.nocommentinside.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Nesting comments\\")"} | |
12 | +org.eclipse.cdt.codan.checkers.nolinecomment=-Error | |
13 | +org.eclipse.cdt.codan.checkers.nolinecomment.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Line comments\\")"} | |
14 | +org.eclipse.cdt.codan.checkers.noreturn=Error | |
15 | +org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return value\\")",implicit\=>false} | |
16 | +org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=Error | |
17 | +org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Abstract class cannot be instantiated\\")"} | |
18 | +org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=Error | |
19 | +org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Ambiguous problem\\")"} | |
20 | +org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=Warning | |
21 | +org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment in condition\\")"} | |
22 | +org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=Error | |
23 | +org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment to itself\\")"} | |
24 | +org.eclipse.cdt.codan.internal.checkers.BlacklistProblem=-Warning | |
25 | +org.eclipse.cdt.codan.internal.checkers.BlacklistProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Function or method is blacklisted\\")",blacklist\=>()} | |
26 | +org.eclipse.cdt.codan.internal.checkers.CStyleCastProblem=-Warning | |
27 | +org.eclipse.cdt.codan.internal.checkers.CStyleCastProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"C-Style cast instead of C++ cast\\")",checkMacro\=>true} | |
28 | +org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=Warning | |
29 | +org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No break at end of case\\")",no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false,enable_fallthrough_quickfix_param\=>false} | |
30 | +org.eclipse.cdt.codan.internal.checkers.CatchByReference=Warning | |
31 | +org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Catching by reference is recommended\\")",unknown\=>false,exceptions\=>()} | |
32 | +org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=Error | |
33 | +org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Circular inheritance\\")"} | |
34 | +org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=Warning | |
35 | +org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class members should be properly initialized\\")",skip\=>true} | |
36 | +org.eclipse.cdt.codan.internal.checkers.CopyrightProblem=-Warning | |
37 | +org.eclipse.cdt.codan.internal.checkers.CopyrightProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Lack of copyright information\\")",regex\=>".*Copyright.*"} | |
38 | +org.eclipse.cdt.codan.internal.checkers.DecltypeAutoProblem=Error | |
39 | +org.eclipse.cdt.codan.internal.checkers.DecltypeAutoProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid 'decltype(auto)' specifier\\")"} | |
40 | +org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=Error | |
41 | +org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Field cannot be resolved\\")"} | |
42 | +org.eclipse.cdt.codan.internal.checkers.FloatCompareProblem=-Warning | |
43 | +org.eclipse.cdt.codan.internal.checkers.FloatCompareProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Direct float comparison\\")"} | |
44 | +org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=Error | |
45 | +org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Function cannot be resolved\\")"} | |
46 | +org.eclipse.cdt.codan.internal.checkers.GotoStatementProblem=-Warning | |
47 | +org.eclipse.cdt.codan.internal.checkers.GotoStatementProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Goto statement used\\")"} | |
48 | +org.eclipse.cdt.codan.internal.checkers.InvalidArguments=Error | |
49 | +org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid arguments\\")"} | |
50 | +org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=Error | |
51 | +org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid template argument\\")"} | |
52 | +org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=Error | |
53 | +org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Label statement not found\\")"} | |
54 | +org.eclipse.cdt.codan.internal.checkers.MagicNumberProblem=-Warning | |
55 | +org.eclipse.cdt.codan.internal.checkers.MagicNumberProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Avoid magic numbers\\")",checkArray\=>true,checkOperatorParen\=>true,exceptions\=>(1,0,-1,2,1.0,0.0,-1.0)} | |
56 | +org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=Error | |
57 | +org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Member declaration not found\\")"} | |
58 | +org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=Error | |
59 | +org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Method cannot be resolved\\")"} | |
60 | +org.eclipse.cdt.codan.internal.checkers.MissCaseProblem=-Warning | |
61 | +org.eclipse.cdt.codan.internal.checkers.MissCaseProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Missing cases in switch\\")"} | |
62 | +org.eclipse.cdt.codan.internal.checkers.MissDefaultProblem=-Warning | |
63 | +org.eclipse.cdt.codan.internal.checkers.MissDefaultProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Missing default in switch\\")",defaultWithAllEnums\=>false} | |
64 | +org.eclipse.cdt.codan.internal.checkers.MissReferenceProblem=-Warning | |
65 | +org.eclipse.cdt.codan.internal.checkers.MissReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Missing reference return value in assignment operator\\")"} | |
66 | +org.eclipse.cdt.codan.internal.checkers.MissSelfCheckProblem=-Warning | |
67 | +org.eclipse.cdt.codan.internal.checkers.MissSelfCheckProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Missing self check in assignment operator\\")"} | |
68 | +org.eclipse.cdt.codan.internal.checkers.MultipleDeclarationsProblem=-Warning | |
69 | +org.eclipse.cdt.codan.internal.checkers.MultipleDeclarationsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Multiple variable declaration\\")"} | |
70 | +org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info | |
71 | +org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Name convention for function\\")",pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} | |
72 | +org.eclipse.cdt.codan.internal.checkers.NoDiscardProblem=Warning | |
73 | +org.eclipse.cdt.codan.internal.checkers.NoDiscardProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Return value not evaluated\\")",macro\=>true} | |
74 | +org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=Warning | |
75 | +org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class has a virtual method and non-virtual destructor\\")"} | |
76 | +org.eclipse.cdt.codan.internal.checkers.OverloadProblem=Error | |
77 | +org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid overload\\")"} | |
78 | +org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=Error | |
79 | +org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redeclaration\\")"} | |
80 | +org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=Error | |
81 | +org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redefinition\\")"} | |
82 | +org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning | |
83 | +org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Return with parenthesis\\")"} | |
84 | +org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning | |
85 | +org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Format String Vulnerability\\")"} | |
86 | +org.eclipse.cdt.codan.internal.checkers.ShallowCopyProblem=-Warning | |
87 | +org.eclipse.cdt.codan.internal.checkers.ShallowCopyProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Miss copy constructor or assignment operator\\")",onlynew\=>false} | |
88 | +org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=Warning | |
89 | +org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Statement has no effect\\")",macro\=>true,exceptions\=>()} | |
90 | +org.eclipse.cdt.codan.internal.checkers.StaticVariableInHeaderProblem=-Warning | |
91 | +org.eclipse.cdt.codan.internal.checkers.StaticVariableInHeaderProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Static variable in header file\\")"} | |
92 | +org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=Warning | |
93 | +org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suggested parenthesis around expression\\")",paramNot\=>false} | |
94 | +org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=Warning | |
95 | +org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suspicious semicolon\\")",else\=>false,afterelse\=>false} | |
96 | +org.eclipse.cdt.codan.internal.checkers.SymbolShadowingProblem=-Warning | |
97 | +org.eclipse.cdt.codan.internal.checkers.SymbolShadowingProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Symbol shadowing\\")",paramFuncParameters\=>true} | |
98 | +org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=Error | |
99 | +org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Type cannot be resolved\\")"} | |
100 | +org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=Warning | |
101 | +org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused function declaration\\")",macro\=>true} | |
102 | +org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=Warning | |
103 | +org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused static function\\")",macro\=>true} | |
104 | +org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=Warning | |
105 | +org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused variable declaration in file scope\\")",macro\=>true,exceptions\=>("@(\#)","$Id")} | |
106 | +org.eclipse.cdt.codan.internal.checkers.UsingInHeaderProblem=-Warning | |
107 | +org.eclipse.cdt.codan.internal.checkers.UsingInHeaderProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Using directive in header\\")"} | |
108 | +org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=Error | |
109 | +org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Symbol is not resolved\\")"} | |
110 | +org.eclipse.cdt.codan.internal.checkers.VirtualMethodCallProblem=-Error | |
111 | +org.eclipse.cdt.codan.internal.checkers.VirtualMethodCallProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Virtual method call in constructor/destructor\\")"} |
+++ ArcCTRL-23-NEXTSQ-CPU1/.settings/org.eclipse.cdt.core.prefs
... | ... | @@ -0,0 +1,6 @@ |
1 | +doxygen/doxygen_new_line_after_brief=true | |
2 | +doxygen/doxygen_use_brief_tag=false | |
3 | +doxygen/doxygen_use_javadoc_tags=true | |
4 | +doxygen/doxygen_use_pre_tag=false | |
5 | +doxygen/doxygen_use_structural_commands=false | |
6 | +eclipse.preferences.version=1 |
+++ ArcCTRL-23-NEXTSQ-CPU1/.settings/org.eclipse.cdt.debug.core.prefs
... | ... | @@ -0,0 +1,2 @@ |
1 | +eclipse.preferences.version=1 | |
2 | +org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker |
+++ ArcCTRL-23-NEXTSQ-CPU1/.settings/org.eclipse.core.resources.prefs
... | ... | @@ -0,0 +1,88 @@ |
1 | +eclipse.preferences.version=1 | |
2 | +encoding//CodeLibrary/DigitalFilter.cpp=UTF-8 | |
3 | +encoding//CodeLibrary/SOAPPLL.cpp=UTF-8 | |
4 | +encoding//CodeLibrary/SOGIPLL.cpp=UTF-8 | |
5 | +encoding//Debug/CodeLibrary/subdir_rules.mk=UTF-8 | |
6 | +encoding//Debug/CodeLibrary/subdir_vars.mk=UTF-8 | |
7 | +encoding//Debug/Common_Resource/BoardLibrary/subdir_rules.mk=UTF-8 | |
8 | +encoding//Debug/Common_Resource/BoardLibrary/subdir_vars.mk=UTF-8 | |
9 | +encoding//Debug/Common_Resource/CodeLibrary/CRC/subdir_rules.mk=UTF-8 | |
10 | +encoding//Debug/Common_Resource/CodeLibrary/CRC/subdir_vars.mk=UTF-8 | |
11 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/CRC/subdir_rules.mk=UTF-8 | |
12 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/CRC/subdir_vars.mk=UTF-8 | |
13 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/DigitalCtrl/subdir_rules.mk=UTF-8 | |
14 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/DigitalCtrl/subdir_vars.mk=UTF-8 | |
15 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/DigitalFilter/subdir_rules.mk=UTF-8 | |
16 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/DigitalFilter/subdir_vars.mk=UTF-8 | |
17 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/Ntc/subdir_rules.mk=UTF-8 | |
18 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/Ntc/subdir_vars.mk=UTF-8 | |
19 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/PLL/subdir_rules.mk=UTF-8 | |
20 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/PLL/subdir_vars.mk=UTF-8 | |
21 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/TimeSharing/subdir_rules.mk=UTF-8 | |
22 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/TimeSharing/subdir_vars.mk=UTF-8 | |
23 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/Util/subdir_rules.mk=UTF-8 | |
24 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/Util/subdir_vars.mk=UTF-8 | |
25 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/subdir_rules.mk=UTF-8 | |
26 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/subdir_vars.mk=UTF-8 | |
27 | +encoding//Debug/Common_Resource/CodeLibrary/DigitalCtrl/subdir_rules.mk=UTF-8 | |
28 | +encoding//Debug/Common_Resource/CodeLibrary/DigitalCtrl/subdir_vars.mk=UTF-8 | |
29 | +encoding//Debug/Common_Resource/CodeLibrary/DigitalFilter/subdir_rules.mk=UTF-8 | |
30 | +encoding//Debug/Common_Resource/CodeLibrary/DigitalFilter/subdir_vars.mk=UTF-8 | |
31 | +encoding//Debug/Common_Resource/CodeLibrary/Ntc/subdir_rules.mk=UTF-8 | |
32 | +encoding//Debug/Common_Resource/CodeLibrary/Ntc/subdir_vars.mk=UTF-8 | |
33 | +encoding//Debug/Common_Resource/CodeLibrary/PLL/subdir_rules.mk=UTF-8 | |
34 | +encoding//Debug/Common_Resource/CodeLibrary/PLL/subdir_vars.mk=UTF-8 | |
35 | +encoding//Debug/Common_Resource/CodeLibrary/TimeSharing/subdir_rules.mk=UTF-8 | |
36 | +encoding//Debug/Common_Resource/CodeLibrary/TimeSharing/subdir_vars.mk=UTF-8 | |
37 | +encoding//Debug/Common_Resource/CodeLibrary/Util/subdir_rules.mk=UTF-8 | |
38 | +encoding//Debug/Common_Resource/CodeLibrary/Util/subdir_vars.mk=UTF-8 | |
39 | +encoding//Debug/Common_Resource/CommonLibrary/source/subdir_rules.mk=UTF-8 | |
40 | +encoding//Debug/Common_Resource/CommonLibrary/source/subdir_vars.mk=UTF-8 | |
41 | +encoding//Debug/Common_Resource/CommonLibrary/subdir_rules.mk=UTF-8 | |
42 | +encoding//Debug/Common_Resource/CommonLibrary/subdir_vars.mk=UTF-8 | |
43 | +encoding//Debug/Common_Resource/EasyDSP_Resource/subdir_rules.mk=UTF-8 | |
44 | +encoding//Debug/Common_Resource/EasyDSP_Resource/subdir_vars.mk=UTF-8 | |
45 | +encoding//Debug/Common_Resource/subdir_rules.mk=UTF-8 | |
46 | +encoding//Debug/Common_Resource/subdir_vars.mk=UTF-8 | |
47 | +encoding//Debug/Main_Resource/source/subdir_rules.mk=UTF-8 | |
48 | +encoding//Debug/Main_Resource/source/subdir_vars.mk=UTF-8 | |
49 | +encoding//Debug/Main_Resource/subdir_rules.mk=UTF-8 | |
50 | +encoding//Debug/Main_Resource/subdir_vars.mk=UTF-8 | |
51 | +encoding//Debug/TI/common/cmd/subdir_rules.mk=UTF-8 | |
52 | +encoding//Debug/TI/common/cmd/subdir_vars.mk=UTF-8 | |
53 | +encoding//Debug/TI/common/deprecated/driverlib/subdir_rules.mk=UTF-8 | |
54 | +encoding//Debug/TI/common/deprecated/driverlib/subdir_vars.mk=UTF-8 | |
55 | +encoding//Debug/TI/common/deprecated/third_party/fatfs/port/subdir_rules.mk=UTF-8 | |
56 | +encoding//Debug/TI/common/deprecated/third_party/fatfs/port/subdir_vars.mk=UTF-8 | |
57 | +encoding//Debug/TI/common/deprecated/third_party/fatfs/src/subdir_rules.mk=UTF-8 | |
58 | +encoding//Debug/TI/common/deprecated/third_party/fatfs/src/subdir_vars.mk=UTF-8 | |
59 | +encoding//Debug/TI/common/deprecated/utils/subdir_rules.mk=UTF-8 | |
60 | +encoding//Debug/TI/common/deprecated/utils/subdir_vars.mk=UTF-8 | |
61 | +encoding//Debug/TI/common/source/subdir_rules.mk=UTF-8 | |
62 | +encoding//Debug/TI/common/source/subdir_vars.mk=UTF-8 | |
63 | +encoding//Debug/TI/driverlib/subdir_rules.mk=UTF-8 | |
64 | +encoding//Debug/TI/driverlib/subdir_vars.mk=UTF-8 | |
65 | +encoding//Debug/TI/headers/cmd/subdir_rules.mk=UTF-8 | |
66 | +encoding//Debug/TI/headers/cmd/subdir_vars.mk=UTF-8 | |
67 | +encoding//Debug/TI/headers/source/subdir_rules.mk=UTF-8 | |
68 | +encoding//Debug/TI/headers/source/subdir_vars.mk=UTF-8 | |
69 | +encoding//Debug/TI_Lib/FPU/lib/subdir_rules.mk=UTF-8 | |
70 | +encoding//Debug/TI_Lib/FPU/lib/subdir_vars.mk=UTF-8 | |
71 | +encoding//Debug/TI_Lib/FPUfastRTS/c28/lib/subdir_rules.mk=UTF-8 | |
72 | +encoding//Debug/TI_Lib/FPUfastRTS/c28/lib/subdir_vars.mk=UTF-8 | |
73 | +encoding//Debug/TI_Lib/device/subdir_rules.mk=UTF-8 | |
74 | +encoding//Debug/TI_Lib/device/subdir_vars.mk=UTF-8 | |
75 | +encoding//Debug/TI_Lib/driverlib/f2837xd/driverlib/ccs/Debug/subdir_rules.mk=UTF-8 | |
76 | +encoding//Debug/TI_Lib/driverlib/f2837xd/driverlib/ccs/Debug/subdir_vars.mk=UTF-8 | |
77 | +encoding//Debug/TI_Lib/driverlib/f2837xd/driverlib/ccs/Release/subdir_rules.mk=UTF-8 | |
78 | +encoding//Debug/TI_Lib/driverlib/f2837xd/driverlib/ccs/Release/subdir_vars.mk=UTF-8 | |
79 | +encoding//Debug/TI_Lib/driverlib/f2837xd/driverlib/subdir_rules.mk=UTF-8 | |
80 | +encoding//Debug/TI_Lib/driverlib/f2837xd/driverlib/subdir_vars.mk=UTF-8 | |
81 | +encoding//Debug/TI_Lib/f2837xd/headers/source/subdir_rules.mk=UTF-8 | |
82 | +encoding//Debug/TI_Lib/f2837xd/headers/source/subdir_vars.mk=UTF-8 | |
83 | +encoding//Debug/makefile=UTF-8 | |
84 | +encoding//Debug/objects.mk=UTF-8 | |
85 | +encoding//Debug/sources.mk=UTF-8 | |
86 | +encoding//Debug/subdir_rules.mk=UTF-8 | |
87 | +encoding//Debug/subdir_vars.mk=UTF-8 | |
88 | +encoding//Main_Resource/source/RunStopSeq.cpp=UTF-8 |
+++ ArcCTRL-23-NEXTSQ-CPU1/F2837xD_Headers_nonBIOS_cpu1.cmd
... | ... | @@ -0,0 +1,246 @@ |
1 | +MEMORY | |
2 | +{ | |
3 | + PAGE 0: /* Program Memory */ | |
4 | + PAGE 1: /* Data Memory */ | |
5 | + ACCESSPROTECTION : origin = 0x0005F4C0, length = 0x00000040 | |
6 | + ADCA : origin = 0x00007400, length = 0x00000080 | |
7 | + ADCB : origin = 0x00007480, length = 0x00000080 | |
8 | + ADCC : origin = 0x00007500, length = 0x00000080 | |
9 | + ADCD : origin = 0x00007580, length = 0x00000080 | |
10 | + ADCARESULT : origin = 0x00000B00, length = 0x00000018 | |
11 | + ADCBRESULT : origin = 0x00000B20, length = 0x00000018 | |
12 | + ADCCRESULT : origin = 0x00000B40, length = 0x00000018 | |
13 | + ADCDRESULT : origin = 0x00000B60, length = 0x00000018 | |
14 | + ANALOGSUBSYS : origin = 0x0005D180, length = 0x00000048 | |
15 | + CANA : origin = 0x00048000, length = 0x00000200 | |
16 | + CANB : origin = 0x0004A000, length = 0x00000200 | |
17 | + CLA1 : origin = 0x00001400, length = 0x00000080 | |
18 | + CLB1DATAEXCH : origin = 0x00003200, length = 0x00000200 | |
19 | + CLB2DATAEXCH : origin = 0x00003600, length = 0x00000200 | |
20 | + CLB3DATAEXCH : origin = 0x00003A00, length = 0x00000200 | |
21 | + CLB4DATAEXCH : origin = 0x00003E00, length = 0x00000200 | |
22 | + CLB1LOGICCFG : origin = 0x00003000, length = 0x00000052 | |
23 | + CLB2LOGICCFG : origin = 0x00003400, length = 0x00000052 | |
24 | + CLB3LOGICCFG : origin = 0x00003800, length = 0x00000052 | |
25 | + CLB4LOGICCFG : origin = 0x00003C00, length = 0x00000052 | |
26 | + CLB1LOGICCTRL : origin = 0x00003100, length = 0x00000040 | |
27 | + CLB2LOGICCTRL : origin = 0x00003500, length = 0x00000040 | |
28 | + CLB3LOGICCTRL : origin = 0x00003900, length = 0x00000040 | |
29 | + CLB4LOGICCTRL : origin = 0x00003D00, length = 0x00000040 | |
30 | + CLBXBAR : origin = 0x00007A40, length = 0x00000040 | |
31 | + CLKCFG : origin = 0x0005D200, length = 0x00000032 | |
32 | + CMPSS1 : origin = 0x00005C80, length = 0x00000020 | |
33 | + CMPSS2 : origin = 0x00005CA0, length = 0x00000020 | |
34 | + CMPSS3 : origin = 0x00005CC0, length = 0x00000020 | |
35 | + CMPSS4 : origin = 0x00005CE0, length = 0x00000020 | |
36 | + CMPSS5 : origin = 0x00005D00, length = 0x00000020 | |
37 | + CMPSS6 : origin = 0x00005D20, length = 0x00000020 | |
38 | + CMPSS7 : origin = 0x00005D40, length = 0x00000020 | |
39 | + CMPSS8 : origin = 0x00005D60, length = 0x00000020 | |
40 | + CPUTIMER0 : origin = 0x00000C00, length = 0x00000008 | |
41 | + CPUTIMER1 : origin = 0x00000C08, length = 0x00000008 | |
42 | + CPUTIMER2 : origin = 0x00000C10, length = 0x00000008 | |
43 | + CPUSYS : origin = 0x0005D300, length = 0x00000082 | |
44 | + DACA : origin = 0x00005C00, length = 0x00000008 | |
45 | + DACB : origin = 0x00005C10, length = 0x00000008 | |
46 | + DACC : origin = 0x00005C20, length = 0x00000008 | |
47 | + DCSMCOMMON : origin = 0x0005F070, length = 0x00000008 | |
48 | + DCSMZ1 : origin = 0x0005F000, length = 0x00000024 | |
49 | + DCSMZ2 : origin = 0x0005F040, length = 0x00000024 | |
50 | + DEVCFG : origin = 0x0005D000, length = 0x0000012E | |
51 | + DMACLASRCSEL : origin = 0x00007980, length = 0x0000001A | |
52 | + DMA : origin = 0x00001000, length = 0x00000200 | |
53 | + ECAP1 : origin = 0x00005000, length = 0x00000020 | |
54 | + ECAP2 : origin = 0x00005020, length = 0x00000020 | |
55 | + ECAP3 : origin = 0x00005040, length = 0x00000020 | |
56 | + ECAP4 : origin = 0x00005060, length = 0x00000020 | |
57 | + ECAP5 : origin = 0x00005080, length = 0x00000020 | |
58 | + ECAP6 : origin = 0x000050A0, length = 0x00000020 | |
59 | + EMIF1CONFIG : origin = 0x0005F480, length = 0x00000020 | |
60 | + EMIF2CONFIG : origin = 0x0005F4A0, length = 0x00000020 | |
61 | + EMIF1 : origin = 0x00047000, length = 0x00000070 | |
62 | + EMIF2 : origin = 0x00047800, length = 0x00000070 | |
63 | + EPWM1 : origin = 0x00004000, length = 0x00000100 | |
64 | + EPWM2 : origin = 0x00004100, length = 0x00000100 | |
65 | + EPWM3 : origin = 0x00004200, length = 0x00000100 | |
66 | + EPWM4 : origin = 0x00004300, length = 0x00000100 | |
67 | + EPWM5 : origin = 0x00004400, length = 0x00000100 | |
68 | + EPWM6 : origin = 0x00004500, length = 0x00000100 | |
69 | + EPWM7 : origin = 0x00004600, length = 0x00000100 | |
70 | + EPWM8 : origin = 0x00004700, length = 0x00000100 | |
71 | + EPWM9 : origin = 0x00004800, length = 0x00000100 | |
72 | + EPWM10 : origin = 0x00004900, length = 0x00000100 | |
73 | + EPWM11 : origin = 0x00004A00, length = 0x00000100 | |
74 | + EPWM12 : origin = 0x00004B00, length = 0x00000100 | |
75 | + EPWMXBAR : origin = 0x00007A00, length = 0x00000040 | |
76 | + EQEP1 : origin = 0x00005100, length = 0x00000022 | |
77 | + EQEP2 : origin = 0x00005140, length = 0x00000022 | |
78 | + EQEP3 : origin = 0x00005180, length = 0x00000022 | |
79 | + FLASH0CTRL : origin = 0x0005F800, length = 0x00000182 | |
80 | + FLASH0ECC : origin = 0x0005FB00, length = 0x00000028 | |
81 | + FLASHPUMPSEMAPHORE : origin = 0x00050024, length = 0x00000002 | |
82 | + GPIOCTRL : origin = 0x00007C00, length = 0x00000180 | |
83 | + GPIODATA : origin = 0x00007F00, length = 0x00000030 | |
84 | + I2CA : origin = 0x00007300, length = 0x00000022 | |
85 | + I2CB : origin = 0x00007340, length = 0x00000022 | |
86 | + INPUTXBAR : origin = 0x00007900, length = 0x00000020 | |
87 | + IPC : origin = 0x00050000, length = 0x00000024 | |
88 | + MEMORYERROR : origin = 0x0005F500, length = 0x00000040 | |
89 | + MEMCFG : origin = 0x0005F400, length = 0x00000080 | |
90 | + MCBSPA : origin = 0x00006000, length = 0x00000024 | |
91 | + MCBSPB : origin = 0x00006040, length = 0x00000024 | |
92 | + NMIINTRUPT : origin = 0x00007060, length = 0x00000007 | |
93 | + OUTPUTXBAR : origin = 0x00007A80, length = 0x00000040 | |
94 | + PIECTRL : origin = 0x00000CE0, length = 0x0000001A | |
95 | + PIEVECTTABLE : origin = 0x00000D00, length = 0x00000200 | |
96 | + ROMPREFETCH : origin = 0x0005E608, length = 0x00000002 | |
97 | + ROMWAITSTATE : origin = 0x0005F540, length = 0x00000002 | |
98 | + SCIA : origin = 0x00007200, length = 0x00000010 | |
99 | + SCIB : origin = 0x00007210, length = 0x00000010 | |
100 | + SCIC : origin = 0x00007220, length = 0x00000010 | |
101 | + SCID : origin = 0x00007230, length = 0x00000010 | |
102 | + SDFM1 : origin = 0x00005E00, length = 0x00000080 | |
103 | + SDFM2 : origin = 0x00005E80, length = 0x00000080 | |
104 | + SPIA : origin = 0x00006100, length = 0x00000010 | |
105 | + SPIB : origin = 0x00006110, length = 0x00000010 | |
106 | + SPIC : origin = 0x00006120, length = 0x00000010 | |
107 | + SYNCSOC : origin = 0x00007940, length = 0x00000006 | |
108 | + UPP : origin = 0x00006200, length = 0x00000048 | |
109 | + WD : origin = 0x00007000, length = 0x0000002B | |
110 | + XBAR : origin = 0x00007920, length = 0x00000020 | |
111 | + XINT : origin = 0x00007070, length = 0x0000000B | |
112 | + | |
113 | +} | |
114 | + | |
115 | + | |
116 | +SECTIONS | |
117 | +{ | |
118 | +/*** PIE Vect Table and Boot ROM Variables Structures ***/ | |
119 | +UNION run = PIEVECTTABLE | |
120 | +{ | |
121 | + PieVectTableFile | |
122 | + GROUP | |
123 | + { | |
124 | + EmuKeyVar | |
125 | + EmuBModeVar | |
126 | + EmuBootPinsVar | |
127 | + FlashCallbackVar | |
128 | + FlashScalingVar | |
129 | + } | |
130 | +} | |
131 | + | |
132 | + AccessProtectionRegsFile : > ACCESSPROTECTION, type=NOINIT | |
133 | + AdcaRegsFile : > ADCA, type=NOINIT | |
134 | + AdcbRegsFile : > ADCB, type=NOINIT | |
135 | + AdccRegsFile : > ADCC, type=NOINIT | |
136 | + AdcdRegsFile : > ADCD, type=NOINIT | |
137 | + AdcaResultRegsFile : > ADCARESULT, type=NOINIT | |
138 | + AdcbResultRegsFile : > ADCBRESULT, type=NOINIT | |
139 | + AdccResultRegsFile : > ADCCRESULT, type=NOINIT | |
140 | + AdcdResultRegsFile : > ADCDRESULT, type=NOINIT | |
141 | + AnalogSubsysRegsFile : > ANALOGSUBSYS, type=NOINIT | |
142 | + CanaRegsFile : > CANA, type=NOINIT | |
143 | + CanbRegsFile : > CANB, type=NOINIT | |
144 | + Cla1RegsFile : > CLA1, type=NOINIT | |
145 | + Clb1DataExchRegsFile : > CLB1DATAEXCH, type=NOINIT | |
146 | + Clb2DataExchRegsFile : > CLB2DATAEXCH, type=NOINIT | |
147 | + Clb3DataExchRegsFile : > CLB3DATAEXCH, type=NOINIT | |
148 | + Clb4DataExchRegsFile : > CLB4DATAEXCH, type=NOINIT | |
149 | + Clb1LogicCfgRegsFile : > CLB1LOGICCFG, type=NOINIT | |
150 | + Clb2LogicCfgRegsFile : > CLB2LOGICCFG, type=NOINIT | |
151 | + Clb3LogicCfgRegsFile : > CLB3LOGICCFG, type=NOINIT | |
152 | + Clb4LogicCfgRegsFile : > CLB4LOGICCFG, type=NOINIT | |
153 | + Clb1LogicCtrlRegsFile : > CLB1LOGICCTRL, type=NOINIT | |
154 | + Clb2LogicCtrlRegsFile : > CLB2LOGICCTRL, type=NOINIT | |
155 | + Clb3LogicCtrlRegsFile : > CLB3LOGICCTRL, type=NOINIT | |
156 | + Clb4LogicCtrlRegsFile : > CLB4LOGICCTRL, type=NOINIT | |
157 | + ClbXbarRegsFile : > CLBXBAR, type=NOINIT | |
158 | + ClkCfgRegsFile : > CLKCFG, type=NOINIT | |
159 | + Cmpss1RegsFile : > CMPSS1, type=NOINIT | |
160 | + Cmpss2RegsFile : > CMPSS2, type=NOINIT | |
161 | + Cmpss3RegsFile : > CMPSS3, type=NOINIT | |
162 | + Cmpss4RegsFile : > CMPSS4, type=NOINIT | |
163 | + Cmpss5RegsFile : > CMPSS5, type=NOINIT | |
164 | + Cmpss6RegsFile : > CMPSS6, type=NOINIT | |
165 | + Cmpss7RegsFile : > CMPSS7, type=NOINIT | |
166 | + Cmpss8RegsFile : > CMPSS8, type=NOINIT | |
167 | + CpuTimer0RegsFile : > CPUTIMER0, type=NOINIT | |
168 | + CpuTimer1RegsFile : > CPUTIMER1, type=NOINIT | |
169 | + CpuTimer2RegsFile : > CPUTIMER2, type=NOINIT | |
170 | + CpuSysRegsFile : > CPUSYS, type=NOINIT | |
171 | + DacaRegsFile : > DACA, type=NOINIT | |
172 | + DacbRegsFile : > DACB, type=NOINIT | |
173 | + DaccRegsFile : > DACC, type=NOINIT | |
174 | + DcsmCommonRegsFile : > DCSMCOMMON, type=NOINIT | |
175 | + DcsmZ1RegsFile : > DCSMZ1, type=NOINIT | |
176 | + DcsmZ2RegsFile : > DCSMZ2, type=NOINIT | |
177 | + DevCfgRegsFile : > DEVCFG, type=NOINIT | |
178 | + DmaClaSrcSelRegsFile : > DMACLASRCSEL, type=NOINIT | |
179 | + DmaRegsFile : > DMA, type=NOINIT | |
180 | + ECap1RegsFile : > ECAP1, type=NOINIT | |
181 | + ECap2RegsFile : > ECAP2, type=NOINIT | |
182 | + ECap3RegsFile : > ECAP3, type=NOINIT | |
183 | + ECap4RegsFile : > ECAP4, type=NOINIT | |
184 | + ECap5RegsFile : > ECAP5, type=NOINIT | |
185 | + ECap6RegsFile : > ECAP6, type=NOINIT | |
186 | + Emif1ConfigRegsFile : > EMIF1CONFIG, type=NOINIT | |
187 | + Emif2ConfigRegsFile : > EMIF2CONFIG, type=NOINIT | |
188 | + Emif1RegsFile : > EMIF1, type=NOINIT | |
189 | + Emif2RegsFile : > EMIF2, type=NOINIT | |
190 | + EPwm1RegsFile : > EPWM1, type=NOINIT | |
191 | + EPwm2RegsFile : > EPWM2, type=NOINIT | |
192 | + EPwm3RegsFile : > EPWM3, type=NOINIT | |
193 | + EPwm4RegsFile : > EPWM4, type=NOINIT | |
194 | + EPwm5RegsFile : > EPWM5, type=NOINIT | |
195 | + EPwm6RegsFile : > EPWM6, type=NOINIT | |
196 | + EPwm7RegsFile : > EPWM7, type=NOINIT | |
197 | + EPwm8RegsFile : > EPWM8, type=NOINIT | |
198 | + EPwm9RegsFile : > EPWM9, type=NOINIT | |
199 | + EPwm10RegsFile : > EPWM10, type=NOINIT | |
200 | + EPwm11RegsFile : > EPWM11, type=NOINIT | |
201 | + EPwm12RegsFile : > EPWM12, type=NOINIT | |
202 | + EPwmXbarRegsFile : > EPWMXBAR, type=NOINIT | |
203 | + EQep1RegsFile : > EQEP1, type=NOINIT | |
204 | + EQep2RegsFile : > EQEP2, type=NOINIT | |
205 | + EQep3RegsFile : > EQEP3, type=NOINIT | |
206 | + Flash0CtrlRegsFile : > FLASH0CTRL, type=NOINIT | |
207 | + Flash0EccRegsFile : > FLASH0ECC, type=NOINIT | |
208 | + FlashPumpSemaphoreRegsFile : > FLASHPUMPSEMAPHORE, type=NOINIT | |
209 | + GpioCtrlRegsFile : > GPIOCTRL, type=NOINIT | |
210 | + GpioDataRegsFile : > GPIODATA, type=NOINIT | |
211 | + I2caRegsFile : > I2CA, type=NOINIT | |
212 | + I2cbRegsFile : > I2CB, type=NOINIT | |
213 | + InputXbarRegsFile : > INPUTXBAR, type=NOINIT | |
214 | + IpcRegsFile : > IPC, type=NOINIT | |
215 | + MemoryErrorRegsFile : > MEMORYERROR, type=NOINIT | |
216 | + MemCfgRegsFile : > MEMCFG, type=NOINIT | |
217 | + McbspaRegsFile : > MCBSPA, type=NOINIT | |
218 | + McbspbRegsFile : > MCBSPB, type=NOINIT | |
219 | + NmiIntruptRegsFile : > NMIINTRUPT, type=NOINIT | |
220 | + OutputXbarRegsFile : > OUTPUTXBAR, type=NOINIT | |
221 | + PieCtrlRegsFile : > PIECTRL, type=NOINIT | |
222 | + PieVectTableFile : > PIEVECTTABLE, type=NOINIT | |
223 | + RomPrefetchRegsFile : > ROMPREFETCH, type=NOINIT | |
224 | + RomWaitStateRegsFile : > ROMWAITSTATE, type=NOINIT | |
225 | + SciaRegsFile : > SCIA, type=NOINIT | |
226 | + ScibRegsFile : > SCIB, type=NOINIT | |
227 | + ScicRegsFile : > SCIC, type=NOINIT | |
228 | + ScidRegsFile : > SCID, type=NOINIT | |
229 | + Sdfm1RegsFile : > SDFM1, type=NOINIT | |
230 | + Sdfm2RegsFile : > SDFM2, type=NOINIT | |
231 | + SpiaRegsFile : > SPIA, type=NOINIT | |
232 | + SpibRegsFile : > SPIB, type=NOINIT | |
233 | + SpicRegsFile : > SPIC, type=NOINIT | |
234 | + SyncSocRegsFile : > SYNCSOC, type=NOINIT | |
235 | + UppRegsFile : > UPP, type=NOINIT | |
236 | + WdRegsFile : > WD, type=NOINIT | |
237 | + XbarRegsFile : > XBAR, type=NOINIT | |
238 | + XintRegsFile : > XINT, type=NOINIT | |
239 | +} | |
240 | + | |
241 | +/* | |
242 | +//=========================================================================== | |
243 | +// End of file. | |
244 | +//=========================================================================== | |
245 | +*/ | |
246 | + |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/Cpu1DeviceDefine.h
... | ... | @@ -0,0 +1,59 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : DeviceDefine.h | |
4 | +// Created on : 2019. 06. 09. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef _DEVICE_DEFINE_H_ | |
11 | +#define _DEVICE_DEFINE_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +#include "easy28x_driverlib_v10.8.h" | |
18 | +#include "CodeLibrary.h" | |
19 | +#include "CommonLib.h" | |
20 | + | |
21 | + | |
22 | +#include "OffsetProcess.h" | |
23 | +#include "FaultProcess.h" | |
24 | + | |
25 | +#include "SystemFunc.h" | |
26 | +#include "DigitalFilter.h" | |
27 | + | |
28 | +//--------------------------------------------// | |
29 | +//#include "VdcCtrl.h" | |
30 | +//#include "VbatCtrl.h" | |
31 | +//#include "IbatCtrl.h" | |
32 | +//#include "VdabCtrl.h" | |
33 | +//#include "VboostCtrl.h" | |
34 | +//#include "IdabCtrl.h" | |
35 | + | |
36 | +//#include "IinvHarResCtrl.h" | |
37 | +#include "Realy.h" | |
38 | + | |
39 | +//#include "Status.h" | |
40 | +#include "RunStopSeq.h" | |
41 | +#include "Pll.h" | |
42 | +//#include "IinvHarResCtrl.h" | |
43 | +//#include "IinvCtrl.h" | |
44 | +#include "SoftStart.h" | |
45 | + | |
46 | +#include "Cpu1DmaSet.h" | |
47 | + | |
48 | + | |
49 | + | |
50 | +//#include "Test_ModeFunc.h" | |
51 | +#include "SelectCPU.h" | |
52 | + | |
53 | + | |
54 | + | |
55 | +#ifdef __cplusplus | |
56 | +} | |
57 | +#endif /* extern "C" */ | |
58 | + | |
59 | +#endif /* _DEVICE_DEFINE_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/Cpu1DmaSet.h
... | ... | @@ -0,0 +1,50 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-ME-CPU1 | |
3 | +// File Name : Dma_Map.h | |
4 | +// Created on : 2022. 9. 29. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | +#ifndef MAIN_RESOURCE_INCLUDE_DMA_H_ | |
10 | +#define MAIN_RESOURCE_INCLUDE_DMA_H_ | |
11 | + | |
12 | +#ifdef __cplusplus | |
13 | +extern "C" { | |
14 | +#endif | |
15 | + | |
16 | +extern interrupt void Cpu1Dma1Isr(void); | |
17 | + | |
18 | + | |
19 | + | |
20 | + | |
21 | +#pragma SET_DATA_SECTION("DMARAM1") | |
22 | + | |
23 | +#pragma SET_DATA_SECTION() | |
24 | + | |
25 | +#pragma SET_DATA_SECTION("DMARAM3") | |
26 | + | |
27 | +#pragma SET_DATA_SECTION() | |
28 | + | |
29 | +#pragma SET_DATA_SECTION("DMARAM2") | |
30 | + | |
31 | +#pragma SET_DATA_SECTION() | |
32 | + | |
33 | +#pragma SET_DATA_SECTION("DMARAM4") | |
34 | + | |
35 | +#pragma SET_DATA_SECTION() | |
36 | + | |
37 | +extern void InitDma(void); | |
38 | +extern void InitDma1(void); | |
39 | +extern void InitDma2(void); | |
40 | +extern void InitDma3(void); | |
41 | +extern void InitDma4(void); | |
42 | +extern void InitDma5(void); | |
43 | +extern void InitDma6(void); | |
44 | + | |
45 | + | |
46 | + | |
47 | +#ifdef __cplusplus | |
48 | +} | |
49 | +#endif /* extern "C" */ | |
50 | +#endif /* MAIN_RESOURCE_INCLUDE_DMA_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/DigitalFilter.h
... | ... | @@ -0,0 +1,90 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : DigitalFilter.h | |
4 | +// Created on : 2019. 06. 09. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef _DIGITALFILTER_H_ | |
11 | +#define _DIGITALFILTER_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | +#pragma SET_DATA_SECTION(".DigitalFilter") | |
19 | + | |
20 | +extern struct sLpf1st LPF1stVbe; | |
21 | +extern struct sLpf1st LPF1stIbe; | |
22 | +extern struct sLpf1st Lpf_UV_CH3; | |
23 | + | |
24 | +extern struct sLpf1st LPF1stVds; | |
25 | +extern struct sLpf1st LPF1stVqs; | |
26 | + | |
27 | +extern struct sLpf1st LPF1stVde; | |
28 | +extern struct sLpf1st LPF1stVqe; | |
29 | + | |
30 | + | |
31 | +extern struct sLpf1st LPF1stIa; | |
32 | +extern struct sLpf1st LPF1stIb; | |
33 | +extern struct sLpf1st LPF1stIc; | |
34 | + | |
35 | +extern struct sLpf1st LPF1stIds; | |
36 | +extern struct sLpf1st LPF1stIqs; | |
37 | + | |
38 | +extern struct sLpf1st LPF1stIde; | |
39 | +extern struct sLpf1st LPF1stIqe; | |
40 | + | |
41 | +extern struct sLpf1st LPF1stVab; | |
42 | +extern struct sLpf1st LPF1stVbc; | |
43 | +extern struct sLpf1st LPF1stVca; | |
44 | + | |
45 | +extern struct sLpf1st LpfFreqOut; | |
46 | +extern struct sLpf1st LPF1stFreqOutExt; | |
47 | + | |
48 | +extern struct sLpf1st LPF1stVabExt; | |
49 | +extern struct sLpf1st LPF1stVbcExt; | |
50 | +extern struct sLpf1st LPF1stVcaExt; | |
51 | + | |
52 | +extern struct sLpf1st LPF1stVdsExt; | |
53 | +extern struct sLpf1st LPF1stVqsExt; | |
54 | + | |
55 | +extern struct sLpf1st LPF1stVdeExt; | |
56 | +extern struct sLpf1st LPF1stVqeExt; | |
57 | + | |
58 | +extern float FcutVabc; | |
59 | +extern float FcutIabc; | |
60 | +extern float Fcut_VIS_CH2; | |
61 | +extern float FcutVbe; | |
62 | +extern float FcutIbe; | |
63 | + | |
64 | +extern float FcutIdqs; | |
65 | +extern float FcutIdqe; | |
66 | +extern float FcutVdqs; | |
67 | +extern float FcutVdqe; | |
68 | +extern float FcutVdqeExt; | |
69 | + | |
70 | +extern float FcutFreq; | |
71 | + | |
72 | +#pragma SET_DATA_SECTION() | |
73 | + | |
74 | + | |
75 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
76 | + | |
77 | +extern void Lpf1stRun(); | |
78 | + | |
79 | +#pragma SET_CODE_SECTION() | |
80 | + | |
81 | + | |
82 | +extern void InitLpf1st(); | |
83 | +extern void Lpf1stCoefUpdate(); | |
84 | + | |
85 | + | |
86 | +#ifdef __cplusplus | |
87 | +} | |
88 | +#endif /* extern "C" */ | |
89 | + | |
90 | +#endif /* _DIGITALFILTER_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/FaultProcess.h
... | ... | @@ -0,0 +1,74 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : FaultProcess.h | |
4 | +// Created on : 2022. 11. 12. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef MAIN_RESOURCE_INCLUDE_FAULTPROCESS_H_ | |
11 | +#define MAIN_RESOURCE_INCLUDE_FAULTPROCESS_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | +#pragma SET_DATA_SECTION(".FaultProcess") | |
19 | + | |
20 | +extern int EnbHFTAd; | |
21 | +extern int EnbHFTGateSet; | |
22 | +extern int EnbHFTGateEtc; | |
23 | +extern int EnbFLTSyncOut; | |
24 | +extern int EnbFLTSyncIn; | |
25 | + | |
26 | +//extern unsigned int SetCanMeWait; | |
27 | +//extern unsigned int CntCanMeWait; | |
28 | +//extern unsigned int CanMeRxIsrCntOld; | |
29 | +// | |
30 | +//extern unsigned int SetCanBeWait; | |
31 | +//extern unsigned int CntCanBeWait; | |
32 | +//extern unsigned int CanBeRxIsrCntOld; | |
33 | +// | |
34 | +//extern unsigned int CanMeOff; | |
35 | +//extern unsigned int CanBeOff; | |
36 | + | |
37 | +extern unsigned int FlagLatch; | |
38 | + | |
39 | +#pragma SET_DATA_SECTION() | |
40 | + | |
41 | + | |
42 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
43 | + | |
44 | +extern void FaultChecker(); | |
45 | + | |
46 | +#pragma SET_CODE_SECTION() | |
47 | + | |
48 | + | |
49 | + | |
50 | + | |
51 | +extern void InitFaultSet(); | |
52 | +extern void InitFaultFreq(); | |
53 | +extern void FaultFreq(); | |
54 | +extern void SystemRestart(); | |
55 | +extern void InitProtectionSet(); | |
56 | +extern void InitInstFaultLevelSet(); | |
57 | +extern void ContectTypeFault(); | |
58 | +extern void FaultVac(); | |
59 | +extern void InitFaultVac(); | |
60 | + | |
61 | +extern void InitOverTempLevelSet(); | |
62 | +extern void OverTempFault(); | |
63 | +extern void DisconnectTempFault(); | |
64 | + | |
65 | + | |
66 | + | |
67 | +extern void FaultLatchData(); | |
68 | + | |
69 | + | |
70 | +#ifdef __cplusplus | |
71 | +} | |
72 | +#endif /* extern "C" */ | |
73 | + | |
74 | +#endif /* MAIN_RESOURCE_INCLUDE_FAULTPROCESS_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/IbatCtrl.h
... | ... | @@ -0,0 +1,48 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : IbatCtrl.h | |
4 | +// Created on : 2023. 07. 26. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef MAIN_RESOURCE_INCLUDE_IBATCTRL_H_ | |
11 | +#define MAIN_RESOURCE_INCLUDE_IBATCTRL_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | + | |
19 | +#pragma SET_DATA_SECTION(".IbatCtrl") | |
20 | + | |
21 | +extern struct sPiCtrl PiIbat; | |
22 | +extern struct sRampGen IbatRefRamp; | |
23 | +extern float DelIbat; | |
24 | + | |
25 | +#pragma SET_DATA_SECTION() | |
26 | + | |
27 | + | |
28 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
29 | + | |
30 | +extern float IbatCtrl(void); | |
31 | + | |
32 | +#pragma SET_CODE_SECTION() | |
33 | + | |
34 | + | |
35 | +extern void IbatCtrlReset(void); | |
36 | +extern void IbatCtrlGainUpdate(void); | |
37 | +extern void InitIbatCtrl(void); | |
38 | + | |
39 | + | |
40 | + | |
41 | + | |
42 | + | |
43 | + | |
44 | +#ifdef __cplusplus | |
45 | +} | |
46 | +#endif /* extern "C" */ | |
47 | + | |
48 | +#endif /* MAIN_RESOURCE_INCLUDE_IBATCTRL_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/IdabCtrl.h
... | ... | @@ -0,0 +1,48 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : IbatCtrl.h | |
4 | +// Created on : 2023. 08. 22. | |
5 | +// Description : | |
6 | +// Author : KwonJeongMin | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef MAIN_RESOURCE_INCLUDE_IDABCTRL_H_ | |
11 | +#define MAIN_RESOURCE_INCLUDE_IDABCTRL_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | + | |
19 | +#pragma SET_DATA_SECTION(".IdabCtrl") | |
20 | + | |
21 | +extern struct sPiCtrl PiIdab; | |
22 | +extern struct sRampGen IdabRefRamp; | |
23 | +extern float DelIdab; | |
24 | + | |
25 | +#pragma SET_DATA_SECTION() | |
26 | + | |
27 | + | |
28 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
29 | + | |
30 | +extern float IdabCtrl(void); | |
31 | + | |
32 | +#pragma SET_CODE_SECTION() | |
33 | + | |
34 | + | |
35 | +extern void IdabCtrlReset(void); | |
36 | +extern void IdabCtrlGainUpdate(void); | |
37 | +extern void InitIdabCtrl(void); | |
38 | + | |
39 | + | |
40 | + | |
41 | + | |
42 | + | |
43 | + | |
44 | +#ifdef __cplusplus | |
45 | +} | |
46 | +#endif /* extern "C" */ | |
47 | + | |
48 | +#endif /* MAIN_RESOURCE_INCLUDE_IBATCTRL_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/OffsetProcess.h
... | ... | @@ -0,0 +1,46 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : OffsetProcess.h | |
4 | +// Created on : 2019. 06. 09. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef _OFFSETPROCESS_H_ | |
11 | +#define _OFFSETPROCESS_H_ | |
12 | +#ifdef __cplusplus | |
13 | +extern "C" { | |
14 | +#endif | |
15 | + | |
16 | + | |
17 | +#pragma SET_DATA_SECTION(".OffsetProcess") | |
18 | + | |
19 | +extern unsigned int FlagOffset; | |
20 | + | |
21 | +extern int CntAdcOffsetWait; | |
22 | +extern int SetAdcOffsetWait; | |
23 | +extern int CntOffsetWait; | |
24 | +extern int SetOffsetWait; | |
25 | + | |
26 | +extern unsigned int CntOffsetAvg; | |
27 | +extern unsigned int SetOffsetAvg; | |
28 | + | |
29 | +extern unsigned int CntAdcOffsetSum; | |
30 | +extern unsigned int SetAdcOffsetSum; | |
31 | + | |
32 | +extern int SetFaultAdcOffset; | |
33 | + | |
34 | +extern unsigned int AdcOffsetCalCh; | |
35 | + | |
36 | +#pragma SET_DATA_SECTION() | |
37 | + | |
38 | + | |
39 | +extern void OffsetProcess(); | |
40 | +extern void AutoOffsetCal(int AdcCh); | |
41 | + | |
42 | + | |
43 | +#ifdef __cplusplus | |
44 | +} | |
45 | +#endif /* extern "C" */ | |
46 | +#endif /* _OFFSETPROCESS_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/Pll.h
... | ... | @@ -0,0 +1,59 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : PLL.h | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef PLL_H_ | |
11 | +#define PLL_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +#include "CodeLibrary.h" | |
18 | + | |
19 | + | |
20 | +#pragma SET_DATA_SECTION(".Pll") | |
21 | + | |
22 | +extern float Theta, ThetaComp; | |
23 | +extern float SinTheta, CosTheta; | |
24 | + | |
25 | +extern float CosThetaComp; | |
26 | +extern float SinThetaComp; | |
27 | + | |
28 | +extern float ErrTheta; | |
29 | + | |
30 | +extern float FreqOut; | |
31 | +extern float FreqOutFlt; | |
32 | + | |
33 | +extern float ThetaExt; | |
34 | +extern float SinThetaExt, CosThetaExt; | |
35 | +extern float FreqOutExt; | |
36 | +//extern float FreqOutExtFlt; | |
37 | + | |
38 | +extern struct sSogiFll1ph SogiFll1ph; | |
39 | + | |
40 | +#pragma SET_DATA_SECTION() | |
41 | + | |
42 | + | |
43 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
44 | + | |
45 | +extern void PllRun(void); | |
46 | + | |
47 | +#pragma SET_CODE_SECTION() | |
48 | + | |
49 | + | |
50 | +extern void InitPll(void); | |
51 | +extern void PllReset(void); | |
52 | + | |
53 | + | |
54 | + | |
55 | +#ifdef __cplusplus | |
56 | +} | |
57 | +#endif /* extern "C" */ | |
58 | + | |
59 | +#endif /* PLL_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/Realy.h
... | ... | @@ -0,0 +1,61 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : MCCB.h | |
4 | +// Created on : 2019. 06. 09. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef Relay_H_ | |
11 | +#define Relay_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | +#pragma SET_DATA_SECTION(".Relay") | |
19 | + | |
20 | +extern unsigned FlagAcPreCharge; | |
21 | +extern unsigned FlagBatPreCharge; | |
22 | + | |
23 | +extern float AcRelaySetVolt; | |
24 | +extern float BatRelaySetVolt; | |
25 | + | |
26 | +extern int StatusAcPreCharge; | |
27 | +extern int StatusBatPreCharge; | |
28 | + | |
29 | +extern int CntAcPreChargeWait, SetAcPreChargeWait; | |
30 | +extern int CntBatPreChargeWait, SetBatPreChargeWait; | |
31 | + | |
32 | +extern int CntPreAcPreRelayWait, SetPreAcPreRelayWait; | |
33 | +extern int CntPreAcRelayWait, SetPreAcRelayWait; | |
34 | +extern int CntPreAcRelayDetect, SetPreAcRelayDetect; | |
35 | +extern int CntPreAcPreRelayDetect, SetPreAcPreRelayDetect; | |
36 | +extern int CntPreAcRelayDelay, SetPreAcRelayDelay; | |
37 | + | |
38 | +extern int CntPreBatPreRelayWait, SetPreBatPreRelayWait; | |
39 | +extern int CntPreBatRelayWait, SetPreBatRelayWait; | |
40 | +extern int CntPreBatRelayDetect, SetPreBatRelayDetect; | |
41 | +extern int CntPreBatPreRelayDetect, SetPreBatPreRelayDetect; | |
42 | +extern int CntPreBatRelayDelay, SetPreBatRelayDelay; | |
43 | + | |
44 | +#pragma SET_DATA_SECTION() | |
45 | + | |
46 | +extern void PreChargeAcRelay(float AcRelaySetVolt); | |
47 | +extern void PreChargeBatRelay(float BatRelaySetVolt); | |
48 | + | |
49 | +extern void InitRelay(void); | |
50 | +extern void InitAcRelay(void); | |
51 | +extern void InitBatRelay(void); | |
52 | +extern void InitRelayTime(void); | |
53 | +extern void InitCntAcPreCharge(void); | |
54 | +extern void InitCntBatPreCharge(void); | |
55 | + | |
56 | + | |
57 | +#ifdef __cplusplus | |
58 | +} | |
59 | +#endif /* extern "C" */ | |
60 | + | |
61 | +#endif /* Relay_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/RunStopSeq.h
... | ... | @@ -0,0 +1,42 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : RunStopSeq.h | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | +#ifndef _RUNSTOPSEQ_H_ | |
10 | +#define _RUNSTOPSEQ_H_ | |
11 | +#ifdef __cplusplus | |
12 | +extern "C" { | |
13 | +#endif | |
14 | + | |
15 | + | |
16 | +#pragma SET_DATA_SECTION(".RunStopSeq") | |
17 | + | |
18 | +extern int InvReady; | |
19 | +extern int BeReady; | |
20 | +extern unsigned int SetBuilupTime; | |
21 | +extern unsigned int CntBuilupTime; | |
22 | + | |
23 | + | |
24 | +#pragma SET_DATA_SECTION() | |
25 | + | |
26 | + | |
27 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
28 | + | |
29 | +extern void RunStopSeq(); | |
30 | +extern void Remote(); | |
31 | + | |
32 | +#pragma SET_CODE_SECTION() | |
33 | + | |
34 | + | |
35 | +extern void RefLimit(); | |
36 | +extern void TowerLampCtrl(); | |
37 | + | |
38 | + | |
39 | +#ifdef __cplusplus | |
40 | +} | |
41 | +#endif /* extern "C" */ | |
42 | +#endif /* _RUNSTOPSEQ_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/SelectCPU.h
... | ... | @@ -0,0 +1,29 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : SelectCPU.h | |
4 | +// Created on : 2022. 11. 6. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef MAIN_RESOURCE_INCLUDE_SELECTCPU_H_ | |
11 | +#define MAIN_RESOURCE_INCLUDE_SELECTCPU_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +extern void SetCPU2ForPeripheral(void); | |
18 | +extern void SetCPU2ForGsRam(void); | |
19 | + | |
20 | +extern void InitSciGpio(); | |
21 | +extern void InitCanGpio(); | |
22 | + | |
23 | + | |
24 | + | |
25 | +#ifdef __cplusplus | |
26 | +} | |
27 | +#endif /* extern "C" */ | |
28 | + | |
29 | +#endif /* MAIN_RESOURCE_INCLUDE_SELECTCPU_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/Softstart.h
... | ... | @@ -0,0 +1,41 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : SoftstartCtrl.h | |
4 | +// Created on : 2023. 09. 22. | |
5 | +// Description : | |
6 | +// Author : KwonJeongMin | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef MAIN_RESOURCE_INCLUDE_SOFTSTARTCTRL_H_ | |
11 | +#define MAIN_RESOURCE_INCLUDE_SOFTSTARTCTRL_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +#pragma SET_DATA_SECTION(".SoftStart") | |
18 | + | |
19 | +extern struct sRampGen SoftStartCtrlRamp; | |
20 | +extern float DelSoftStartCtrl; | |
21 | +extern float SoftStartCtrl; | |
22 | +extern float SoftStartDuty; | |
23 | + | |
24 | +#pragma SET_DATA_SECTION() | |
25 | + | |
26 | + | |
27 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
28 | + | |
29 | +extern void SoftStart(void); | |
30 | + | |
31 | +#pragma SET_CODE_SECTION() | |
32 | + | |
33 | +extern void SoftStartReset(void); | |
34 | +extern void InitSoftStart(void); | |
35 | + | |
36 | + | |
37 | +#ifdef __cplusplus | |
38 | +} | |
39 | +#endif /* extern "C" */ | |
40 | + | |
41 | +#endif /* MAIN_RESOURCE_INCLUDE_SOFTSTARTCTRL_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/SystemFunc.h
... | ... | @@ -0,0 +1,29 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : SystemFunc.h | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef _SYSTEMFUNC_H_ | |
11 | +#define _SYSTEMFUNC_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | + | |
19 | + | |
20 | + | |
21 | + | |
22 | + | |
23 | + | |
24 | + | |
25 | +#ifdef __cplusplus | |
26 | +} | |
27 | +#endif /* extern "C" */ | |
28 | + | |
29 | +#endif /* _SYSTEMFUNC_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/Test_ModeFunc.h
... | ... | @@ -0,0 +1,33 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : VdcCtrl.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | +#ifndef _TEST_MODEFUNC_H_ | |
10 | +#define _TEST_MODEFUNC_H_ | |
11 | + | |
12 | +#ifdef __cplusplus | |
13 | +extern "C" { | |
14 | +#endif | |
15 | + | |
16 | + | |
17 | + | |
18 | +extern void TestRoutineTsamp(void); | |
19 | +extern void TestRoutineT500us(void); | |
20 | +extern void TestRoutineT2ms(void); | |
21 | +extern void TestRoutineT10ms(void); | |
22 | +extern void TestRoutineT100ms(void); | |
23 | +extern void TestRoutineT500ms(void); | |
24 | + | |
25 | + | |
26 | + | |
27 | + | |
28 | + | |
29 | +#ifdef __cplusplus | |
30 | +} | |
31 | +#endif /* extern "C" */ | |
32 | + | |
33 | +#endif /* _SYSTEMVAR_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/include/TimerSet.h
... | ... | @@ -0,0 +1,26 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : TimerSet.h | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef MAIN_RESOURCE_INCLUDE_TIMERSET_H_ | |
11 | +#define MAIN_RESOURCE_INCLUDE_TIMERSET_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | +extern void InitCPUTimers(void); | |
19 | + | |
20 | + | |
21 | + | |
22 | +#ifdef __cplusplus | |
23 | +} | |
24 | +#endif /* extern "C" */ | |
25 | + | |
26 | +#endif /* MAIN_RESOURCE_INCLUDE_TIMERSET_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/Cpu1DmaSet.cpp
... | ... | @@ -0,0 +1,48 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : Dma.cpp | |
4 | +// Created on : 2023. 7. 14. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu1DeviceDefine.h" | |
11 | + | |
12 | +//-------------------------------------------------------------------// | |
13 | +// DMA를 사용하려고 하는 메모리의 영역이 DMA를 지원하는지 확인해야함 // | |
14 | +// EX) Flash 영역에서는 DMA 사용 안됨, LS메모리도 마찬가지 // | |
15 | +// // | |
16 | +//-------------------------------------------------------------------// | |
17 | + | |
18 | + | |
19 | +void InitDma() | |
20 | +{ | |
21 | + SysCtl_selectSecMaster(0, SYSCTL_SEC_MASTER_DMA); | |
22 | + | |
23 | + DMA_initController(); | |
24 | + InitDma1(); | |
25 | +} | |
26 | + | |
27 | + | |
28 | +void InitDma1() | |
29 | +{ | |
30 | + DMA_configAddresses(DMA_CH1_BASE, &Adc.RawData, (const void*)ADCARESULT_BASE); | |
31 | + DMA_configBurst(DMA_CH1_BASE, 8, 1, 1); | |
32 | + DMA_configTransfer(DMA_CH1_BASE, 4, 0x19, 1); | |
33 | + DMA_configWrap(DMA_CH1_BASE, 0xFFFF, 0, 0xFFFF, 0); | |
34 | + DMA_configMode(DMA_CH1_BASE, DMA_TRIGGER_ADCA1, (DMA_CFG_ONESHOT_ENABLE | DMA_CFG_CONTINUOUS_ENABLE | DMA_CFG_SIZE_16BIT)); | |
35 | + DMA_setInterruptMode(DMA_CH1_BASE, DMA_INT_AT_END); | |
36 | + DMA_enableTrigger(DMA_CH1_BASE); | |
37 | + DMA_enableInterrupt(DMA_CH1_BASE); | |
38 | + DMA_startChannel(DMA_CH1_BASE); | |
39 | + | |
40 | + Interrupt_register(INT_DMA_CH1, &Cpu1Dma1Isr); | |
41 | + Interrupt_enable(INT_DMA_CH1); | |
42 | +} | |
43 | + | |
44 | + | |
45 | + | |
46 | + | |
47 | + | |
48 | + |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/Cpu1Main.cpp
... | ... | @@ -0,0 +1,200 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : CPU1_Main.cpp | |
4 | +// Created on : 2023. 07. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu1DeviceDefine.h" | |
11 | + | |
12 | + | |
13 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
14 | +interrupt void Cpu1Epwm1Isr(void); | |
15 | +interrupt void Cpu1Dma1Isr(void); | |
16 | +#pragma SET_CODE_SECTION() | |
17 | + | |
18 | +int main(void) | |
19 | +{ | |
20 | + | |
21 | + CpuInfo(); | |
22 | + | |
23 | + Device_init(); | |
24 | + Device_initGPIO(); | |
25 | + Interrupt_initModule(); | |
26 | + Interrupt_initVectorTable(); | |
27 | + //todo 에뮬레이터 사용중에는 해당 함수를 주석 처리하고 사용. | |
28 | + //추후 부트모드를 검출 할 수 있는 레지스터를 찾아서 조건문 처리 되도록 변경할 것 | |
29 | + //-------------------------------------------------------------------------------// | |
30 | +// easyDSP_Boot_Sync(); | |
31 | + //-------------------------------------------------------------------------------// | |
32 | + easyDSP_SCI_Init(); | |
33 | + | |
34 | + SetCPU2ForPeripheral(); //모든 기능 CPU1로 변경 | |
35 | + SetCPU2ForGsRam(); | |
36 | + | |
37 | + InitEPwm(); | |
38 | + | |
39 | + //todo 임시 수정 할 것 | |
40 | + InitTimeSharing(InvPwmFreq / 2.0); | |
41 | + Interrupt_enable(INT_EPWM1); | |
42 | + Interrupt_register(INT_EPWM1, &Cpu1Epwm1Isr); | |
43 | + | |
44 | + InitAdc(); | |
45 | + InitDma(); | |
46 | + | |
47 | + InitScale(); | |
48 | + InitDigitalIOSet(); | |
49 | + InitDspTempSensor(); | |
50 | + | |
51 | + IPC_clearFlagLtoR(IPC_CPU1_L_CPU2_R, IPC_FLAG_ALL); | |
52 | + | |
53 | + InitRelay(); | |
54 | + | |
55 | + InitSystemParameter(); | |
56 | + InitPll(); | |
57 | + | |
58 | + InitFaultSet(); | |
59 | + InitLpf1st(); | |
60 | + | |
61 | + InitSpi(); //for EEPROM Test | |
62 | + | |
63 | + InitRTC(); | |
64 | + | |
65 | + InitModbusSci(); | |
66 | + | |
67 | + InitSci(); | |
68 | +// | |
69 | +//// InitAID(); | |
70 | + | |
71 | + | |
72 | + /////////////////////DAC Test///////////////// | |
73 | + EALLOW; | |
74 | + DacaRegs.DACCTL.bit.DACREFSEL = 1; | |
75 | + DacaRegs.DACOUTEN.bit.DACOUTEN = 1; | |
76 | + | |
77 | + DacbRegs.DACCTL.bit.DACREFSEL = 1; | |
78 | + DacbRegs.DACOUTEN.bit.DACOUTEN = 1; | |
79 | + | |
80 | + DaccRegs.DACCTL.bit.DACREFSEL = 1; | |
81 | + DaccRegs.DACOUTEN.bit.DACOUTEN = 1; | |
82 | + EDIS; | |
83 | + /////////////////////DAC Test///////////////// | |
84 | + | |
85 | + Dout.Exor.all = 0x0010; // for Test - Buzzer off | |
86 | + | |
87 | + Interrupt_enableMaster(); | |
88 | + | |
89 | + EINT; | |
90 | + ERTM; | |
91 | + | |
92 | + for (;;) | |
93 | + { | |
94 | + if (ModeSystem == Normal) | |
95 | + { | |
96 | + | |
97 | + if (OS_Time.T500us.Flag == 1) | |
98 | + { | |
99 | + RoutineT500us(); | |
100 | + OS_Time.T500us.Flag = 0; | |
101 | + } | |
102 | + | |
103 | + else if (OS_Time.T2ms.Flag == 1) | |
104 | + { | |
105 | + RoutineT2ms(); // 2ms routine | |
106 | + OS_Time.T2ms.Flag = 0; | |
107 | + } | |
108 | + else if (OS_Time.T10ms.Flag == 1) | |
109 | + { | |
110 | + RoutineT10ms(); | |
111 | + OS_Time.T10ms.Flag = 0; | |
112 | + } | |
113 | + else if (OS_Time.T100ms.Flag == 1) | |
114 | + { | |
115 | +// Dout.Data.bit.LedCpu1 ^= 1; | |
116 | + | |
117 | + RoutineT100ms(); | |
118 | + OS_Time.T100ms.Flag = 0; | |
119 | + } | |
120 | + else if (OS_Time.T500ms.Flag == 1) | |
121 | + { | |
122 | + RoutineT500ms(); | |
123 | + OS_Time.T500ms.Flag = 0; | |
124 | + } | |
125 | + else if (OS_Time.T1s.Flag == 1) | |
126 | + { | |
127 | + RoutineT1s(); | |
128 | + OS_Time.T1s.Flag = 0; | |
129 | + } | |
130 | + } | |
131 | + else | |
132 | + { | |
133 | + ModeSystem = Normal; | |
134 | + } | |
135 | + | |
136 | + } | |
137 | + | |
138 | +} | |
139 | + | |
140 | + | |
141 | + | |
142 | +unsigned int Cpu1Dma1IsrCnt = 0; | |
143 | + | |
144 | +interrupt void Cpu1Dma1Isr(void) | |
145 | +{ | |
146 | + AdcIntInterruptClear(); //내부 ADC 인터럽트 전체 클리어 | |
147 | + Cpu1Dma1IsrCnt++; | |
148 | + AdcResult(); | |
149 | +// AutoOffsetCal(AdcOffsetCalCh); | |
150 | + | |
151 | + //Cpu2 호출 | |
152 | + HWREG(IPC_BASE + IPC_O_SET) = 0x000001; | |
153 | + | |
154 | + if (ModeSystem == Normal) | |
155 | + { | |
156 | + if (SystemReady == 0) | |
157 | + { | |
158 | + if (FlagOffset != 3) OffsetProcess(); | |
159 | + else SystemReady = 1; | |
160 | + } | |
161 | + else | |
162 | + { | |
163 | + RoutineTsamp(); | |
164 | + } | |
165 | + | |
166 | + } | |
167 | +// else if (ModeSystem == Test_Mode) | |
168 | +// { | |
169 | +// if (SystemReady == 0) | |
170 | +// { | |
171 | +// if (FlagOffset != 3) OffsetProcess(); | |
172 | +// else SystemReady = 1; | |
173 | +// } | |
174 | +// else | |
175 | +// { | |
176 | +// TestRoutineTsamp(); | |
177 | +// } | |
178 | +// } | |
179 | + | |
180 | + Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP7); | |
181 | + | |
182 | + return; | |
183 | + | |
184 | +} | |
185 | + | |
186 | +unsigned int Cpu1Epwm1IsrCnt = 0; | |
187 | + | |
188 | + | |
189 | +interrupt void Cpu1Epwm1Isr(void) | |
190 | +{ | |
191 | + Cpu1Epwm1IsrCnt++; | |
192 | + OS_Time.Sharing(); | |
193 | + | |
194 | + | |
195 | + EPWM_clearEventTriggerInterruptFlag(EPWM1_BASE); | |
196 | + Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3); | |
197 | + | |
198 | + return; | |
199 | +} | |
200 | + |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/DigitalFilter.cpp
... | ... | @@ -0,0 +1,133 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : DigitalFilter.cpp | |
4 | +// Created on : 2023. 07. 26 | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu1DeviceDefine.h" | |
11 | +#include "DigitalFilter.h" | |
12 | + | |
13 | +struct sLpf1st Lpf_UV_CH1; | |
14 | +struct sLpf1st Lpf_VIS_CH1; | |
15 | +struct sLpf1st Lpf_IR_CH1; | |
16 | + | |
17 | +struct sLpf1st Lpf_UV_CH2; | |
18 | +struct sLpf1st Lpf_VIS_CH2; | |
19 | +struct sLpf1st Lpf_IR_CH2; | |
20 | + | |
21 | +struct sLpf1st Lpf_UV_CH3; | |
22 | +struct sLpf1st Lpf_VIS_CH3; | |
23 | +struct sLpf1st Lpf_IR_CH3; | |
24 | + | |
25 | +struct sLpf1st Lpf_UV_CH4; | |
26 | +struct sLpf1st Lpf_VIS_CH4; | |
27 | +struct sLpf1st Lpf_IR_CH4; | |
28 | + | |
29 | +struct sLpf1st LpfVnwInv; | |
30 | +struct sLpf1st LpfIacInv; | |
31 | +struct sLpf1st LpfIuInv; | |
32 | + | |
33 | +struct sLpf1st LpfIwInv; | |
34 | +struct sLpf1st LpfIacGrid; | |
35 | +struct sLpf1st LpfIuGrid; | |
36 | + | |
37 | +struct sLpf1st LpfIwGrid; | |
38 | +struct sLpf1st LpfIzct; | |
39 | +struct sLpf1st LpfIuGridExt; | |
40 | +struct sLpf1st LpfIwGridExt; | |
41 | + | |
42 | +struct sLpf1st LpfVdeGrid; | |
43 | +struct sLpf1st LpfVqeGrid; | |
44 | + | |
45 | +struct sLpf1st LpfVdeInv; | |
46 | +struct sLpf1st LpfVqeInv; | |
47 | + | |
48 | +struct sLpf1st LpfIdeGrid; | |
49 | +struct sLpf1st LpfIqeGrid; | |
50 | + | |
51 | +struct sLpf1st LpfIdeInv; | |
52 | +struct sLpf1st LpfIqeInv; | |
53 | + | |
54 | +struct sLpf1st LpfFreqOut; | |
55 | + | |
56 | +float Fcut_UV_CH1 = 2000; | |
57 | +float Fcut_VIS_CH1 = 2000; | |
58 | +float Fcut_IR_CH1 = 2000; | |
59 | + | |
60 | +float Fcut_UV_CH2 = 2000; | |
61 | +float Fcut_VIS_CH2 = 2000; | |
62 | +float Fcut_IR_CH2 = 2000; | |
63 | + | |
64 | +float Fcut_UV_CH3 = 2000; | |
65 | +float Fcut_VIS_CH3 = 2000; | |
66 | +float Fcut_IR_CH3 = 2000; | |
67 | + | |
68 | +float Fcut_UV_CH4 = 2000; | |
69 | +float Fcut_VIS_CH4 = 2000; | |
70 | +float Fcut_IR_CH4 = 2000; | |
71 | + | |
72 | + | |
73 | +void InitLpf1st(void) | |
74 | +{ | |
75 | + Lpf_UV_CH1.Init(&Fcut_UV_CH1, Tsamp, &CH1_UV); | |
76 | + Lpf_VIS_CH1.Init(&Fcut_VIS_CH1, Tsamp, &CH1_VIS); | |
77 | + Lpf_IR_CH1.Init(&Fcut_IR_CH1, Tsamp, &CH1_IR); | |
78 | + | |
79 | + Lpf_UV_CH2.Init(&Fcut_UV_CH2, Tsamp, &CH2_UV); | |
80 | + Lpf_VIS_CH2.Init(&Fcut_VIS_CH2, Tsamp, &CH2_VIS); | |
81 | + Lpf_IR_CH2.Init(&Fcut_IR_CH2, Tsamp, &CH2_IR); | |
82 | + | |
83 | + Lpf_UV_CH3.Init(&Fcut_UV_CH3, Tsamp, &CH3_UV); | |
84 | + Lpf_VIS_CH3.Init(&Fcut_VIS_CH3, Tsamp, &CH3_VIS); | |
85 | + Lpf_IR_CH3.Init(&Fcut_IR_CH3, Tsamp, &CH3_IR); | |
86 | + | |
87 | + Lpf_UV_CH4.Init(&Fcut_UV_CH4, Tsamp, &CH4_UV); | |
88 | + Lpf_VIS_CH4.Init(&Fcut_VIS_CH4, Tsamp, &CH4_VIS); | |
89 | + Lpf_IR_CH4.Init(&Fcut_IR_CH4, Tsamp, &CH4_IR); | |
90 | + | |
91 | +} | |
92 | + | |
93 | +void Lpf1stCoefUpdate(void) | |
94 | +{ | |
95 | + | |
96 | + Lpf_UV_CH1.CoeffUpdate(); | |
97 | + Lpf_VIS_CH1.CoeffUpdate(); | |
98 | + Lpf_IR_CH1.CoeffUpdate(); | |
99 | + | |
100 | + Lpf_UV_CH2.CoeffUpdate(); | |
101 | + Lpf_VIS_CH2.CoeffUpdate(); | |
102 | + Lpf_IR_CH2.CoeffUpdate(); | |
103 | + | |
104 | + Lpf_UV_CH3.CoeffUpdate(); | |
105 | + Lpf_VIS_CH3.CoeffUpdate(); | |
106 | + Lpf_IR_CH3.CoeffUpdate(); | |
107 | + | |
108 | + Lpf_UV_CH4.CoeffUpdate(); | |
109 | + Lpf_VIS_CH4.CoeffUpdate(); | |
110 | + Lpf_IR_CH4.CoeffUpdate(); | |
111 | + | |
112 | + | |
113 | +} | |
114 | + | |
115 | +void Lpf1stRun() | |
116 | +{ | |
117 | + CH1_UV_Flt = Lpf_UV_CH1.Run(); | |
118 | + CH1_VIS_Flt = Lpf_VIS_CH1.Run(); | |
119 | + CH1_IR_Flt = Lpf_IR_CH1.Run(); | |
120 | + | |
121 | + CH2_UV_Flt = Lpf_UV_CH2.Run(); | |
122 | + CH2_VIS_Flt = Lpf_VIS_CH2.Run(); | |
123 | + CH2_IR_Flt = Lpf_IR_CH2.Run(); | |
124 | + | |
125 | + CH3_UV_Flt = Lpf_UV_CH3.Run(); | |
126 | + CH3_VIS_Flt = Lpf_VIS_CH3.Run(); | |
127 | + CH3_IR_Flt = Lpf_IR_CH3.Run(); | |
128 | + | |
129 | + CH4_UV_Flt = Lpf_UV_CH4.Run(); | |
130 | + CH4_VIS_Flt = Lpf_VIS_CH4.Run(); | |
131 | + CH4_IR_Flt = Lpf_IR_CH4.Run(); | |
132 | + | |
133 | +} |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/EpwmSet.cpp
... | ... | @@ -0,0 +1,276 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : GateCtrl.cpp | |
4 | +// Created on : 2023. 07. 24. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu1DeviceDefine.h" | |
11 | + | |
12 | + | |
13 | +float InvPwmFreq = 40.0e3; //Set Inverter PWM Frequency | |
14 | +float BoostPwmFreq = 40.0e3; //Set Boost PWM Frequency | |
15 | +float DabPwmFreq = 40.0e3; //Set DAB PWM Frequency | |
16 | + | |
17 | +unsigned int InvPwmPrd = 0; //Initialize Inverter PWM Period | |
18 | +unsigned int BoostPwmPrd = 0; //Initialize Boost PWM Period | |
19 | +unsigned int DabPwmPrd = 0; //Initialize DAB PWM Period | |
20 | + | |
21 | +float InvDeadtime = 0.7e-6; //Set Inverter Dead Time | |
22 | +float BoostDeadtime = 0.7e-6; //Set Boost Dead Time | |
23 | +float DabDeadtime = 0.7e-6; //Set DAB Dead Time | |
24 | + | |
25 | +unsigned int TestCnt1 = 0; //Initialize PWM Test Count1 | |
26 | +unsigned int TestCnt2 = 0; //Initialize PWM Test Count2 | |
27 | +unsigned int TestCnt3 = 0; //Initialize PWM Test Count3 | |
28 | +unsigned int TestCnt4 = 0; //Initialize PWM Test Count4 | |
29 | +unsigned int TestCnt5 = 0; //Initialize PWM Test Count5 | |
30 | +unsigned int TestCnt6 = 0; //Initialize PWM Test Count6 | |
31 | +unsigned int TestCnt7 = 0; //Initialize PWM Test Count7 | |
32 | + | |
33 | +int FlagTestInvGatingInput = 0; //Initialize Inverter PWM Gating Test Flag | |
34 | +int FlagTestBoostGatingInput = 0; //Initialize Boost PWM Gating Test Flag | |
35 | +int FlagTestDabGatingInput = 0; //Initialize DAB PWM Gating Test Flag | |
36 | + | |
37 | + | |
38 | + | |
39 | + | |
40 | +void InitEPwm() //EPWM Initialize Function | |
41 | +{ | |
42 | + | |
43 | + SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC); //Disable Peripheral | |
44 | + SysCtl_setEPWMClockDivider(SYSCTL_EPWMCLK_DIV_1); //EPWMClock = system_clock / SYSCTL_EPWMCLK_DIV | |
45 | + | |
46 | + InitEPwm1Gpio(); //Initialize PWM1 GPIO | |
47 | + InitEPwm2Gpio(); //Initialize PWM2 GPIO | |
48 | + InitEPwm3Gpio(); //Initialize PWM3 GPIO | |
49 | + InitEPwm4Gpio(); //Initialize PWM4 GPIO | |
50 | + InitEPwm5Gpio(); //Initialize PWM5 GPIO | |
51 | + InitEPwm6Gpio(); //Initialize PWM6 GPIO | |
52 | + InitEPwm7Gpio(); //Initialize PWM7 GPIO | |
53 | + InitGateEnbGpio(); //Initialize PWM Gate Enable GPIO | |
54 | + | |
55 | + //Booster | |
56 | + InitEPwm1(BoostPwmFreq, BoostDeadtime, TB_COUNT_UPDOWN, 0); //Initialize PWM1 | |
57 | + BoostPwmPrd = EPwm1Regs.TBPRD; //Set Boost PWM Period | |
58 | + | |
59 | + //Dab | |
60 | + //LvSide | |
61 | + InitEPwm2(DabPwmFreq, DabDeadtime, TB_COUNT_UPDOWN, 0); //Initialize PWM2 | |
62 | + InitEPwm3(DabPwmFreq, DabDeadtime, TB_COUNT_UPDOWN, 0); //Initialize PWM3 | |
63 | + | |
64 | + //HvSide | |
65 | + InitEPwm4(DabPwmFreq, DabDeadtime, TB_COUNT_UPDOWN, 0); //Initialize PWM4 | |
66 | + InitEPwm5(DabPwmFreq, DabDeadtime, TB_COUNT_UPDOWN, 0); //Initialize PWM5 | |
67 | + | |
68 | + DabPwmPrd = EPwm2Regs.TBPRD; //Set DAB PWM Period | |
69 | + | |
70 | + //Inverter | |
71 | + InitEPwm6(InvPwmFreq, InvDeadtime, TB_COUNT_UPDOWN, 0); //Initialize PWM6 | |
72 | + InitEPwm7(InvPwmFreq, InvDeadtime, TB_COUNT_UPDOWN, 0); //Initialize PWM7 | |
73 | + InvPwmPrd = EPwm6Regs.TBPRD; //Set Inverter PWM Period | |
74 | + | |
75 | + | |
76 | + SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC); //Enable Peripheral | |
77 | +} | |
78 | + | |
79 | +void PwmTestCode() //Define PWM Test Function | |
80 | +{ | |
81 | +// if (FlagTestBoostGatingInput == 1) //If Boost Gating Input Test Flag is TRUE | |
82 | +// { | |
83 | +// EPwm1Regs.CMPA.bit.CMPA = TestCnt1; //Set Compare Register | |
84 | +// FlagBoostGatingInput = 1; //Set Boost Gating Input Flag | |
85 | +// } | |
86 | +// else //Other Case | |
87 | +// { | |
88 | +// FlagBoostGatingInput = 0; //Set Boost Gating Input Flag | |
89 | +// EPwm1Regs.CMPA.bit.CMPA = 0; //Reset Compare Register | |
90 | +// } | |
91 | +// | |
92 | +// if (FlagTestDabGatingInput == 1) //If DAB Gating Input Test Flag is TRUE | |
93 | +// { | |
94 | +// | |
95 | +// EPwm2Regs.CMPA.bit.CMPA = TestCnt2; //Set Compare Register | |
96 | +// EPwm3Regs.CMPA.bit.CMPA = TestCnt3; //Set Compare Register | |
97 | +// //EPWM3번은 EPWM2번에 대해 상보 | |
98 | +// EPwm4Regs.CMPA.bit.CMPA = TestCnt4; //Set Compare Register | |
99 | +// EPwm5Regs.CMPA.bit.CMPA = TestCnt5; //Set Compare Register | |
100 | +// //EPWM5번은 EPWM4번에 대해 상보 | |
101 | +// | |
102 | +// EPwm2Regs.TBPHS.bit.TBPHS = 0; //Reset Phase Shift Register | |
103 | +// EPwm3Regs.TBPHS.bit.TBPHS = 0; //Reset Phase Shift Register | |
104 | +// EPwm4Regs.TBPHS.bit.TBPHS = TdabPhCnt; //Set Phase Shift Register | |
105 | +// EPwm5Regs.TBPHS.bit.TBPHS = TdabPhCnt; //Set Phase Shift Register | |
106 | +// | |
107 | +// FlagDabGatingInput = 1; //Set DAB Gating Input Flag | |
108 | +// } | |
109 | +// else | |
110 | +// { | |
111 | +// | |
112 | +// EPwm2Regs.CMPA.bit.CMPA = 0; //Reset Compare Register | |
113 | +// EPwm3Regs.CMPA.bit.CMPA = 0; //Reset Compare Register | |
114 | +// EPwm4Regs.CMPA.bit.CMPA = 0; //Reset Compare Register | |
115 | +// EPwm5Regs.CMPA.bit.CMPA = 0; //Reset Compare Register | |
116 | +// | |
117 | +// EPwm2Regs.TBPHS.bit.TBPHS = 0; //Reset Phase Shift Register | |
118 | +// EPwm3Regs.TBPHS.bit.TBPHS = 0; //Reset Phase Shift Register | |
119 | +// EPwm4Regs.TBPHS.bit.TBPHS = 0; //Reset Phase Shift Register | |
120 | +// EPwm5Regs.TBPHS.bit.TBPHS = 0; //Reset Phase Shift Register | |
121 | +// | |
122 | +// FlagDabGatingInput = 0; //Reset DAB Gating Input Flag | |
123 | +// } | |
124 | +// | |
125 | +// if (FlagTestInvGatingInput == 1) //If Inverter Gating Input Test Flag is TRUE | |
126 | +// { | |
127 | +// EPwm6Regs.CMPA.bit.CMPA = TestCnt6; //Set Compare Register | |
128 | +// EPwm7Regs.CMPA.bit.CMPA = TestCnt7; //Set Compare Register | |
129 | +// | |
130 | +// FlagInvGatingInput = 1; //Set Inverter Gating Input Flag | |
131 | +// } | |
132 | +// else //Other Case | |
133 | +// { | |
134 | +// EPwm6Regs.CMPA.bit.CMPA = 0; //Reset Compare Register | |
135 | +// EPwm7Regs.CMPA.bit.CMPA = 0; //Reset Compare Register | |
136 | +// FlagInvGatingInput = 0; //Reset Inverter Gating Input Flag | |
137 | +// } | |
138 | +// | |
139 | +// GateOutEnable(); //Call Gate Out Enable Function | |
140 | +} | |
141 | + | |
142 | +void GateOutEnable(void) //Define Gate Out Enable Function | |
143 | +{ | |
144 | +// if(FlagBoostGating == 1) //If Boost Gating Flag is TRUE | |
145 | +// { | |
146 | +// EALLOW; //Release Register Protection | |
147 | +// EPwm1Regs.TZCLR.bit.OST = 1; //One-Shot Flag Clear | |
148 | +// EDIS; //Lock Register Protection | |
149 | +// } | |
150 | +// else | |
151 | +// { | |
152 | +// EALLOW; //Release Register Protection | |
153 | +// EPwm1Regs.TZFRC.bit.OST = 1; //Force Trip Zones One Shot Event | |
154 | +// EDIS; //Lock Register Protection | |
155 | +// } | |
156 | +// | |
157 | +// if(FlagDabGating == 1) | |
158 | +// { | |
159 | +// EALLOW; //Release Register Protection | |
160 | +// EPwm2Regs.TZCLR.bit.OST = 1; //One-Shot Flag Clear | |
161 | +// EPwm3Regs.TZCLR.bit.OST = 1; //One-Shot Flag Clear | |
162 | +// EPwm4Regs.TZCLR.bit.OST = 1; //One-Shot Flag Clear | |
163 | +// EPwm5Regs.TZCLR.bit.OST = 1; //One-Shot Flag Clear | |
164 | +// EDIS; //Lock Register Protection | |
165 | +// } | |
166 | +// else | |
167 | +// { | |
168 | +// EALLOW; //Release Register Protection | |
169 | +// EPwm2Regs.TZFRC.bit.OST = 1; //Force Trip Zones One Shot Event | |
170 | +// EPwm3Regs.TZFRC.bit.OST = 1; //Force Trip Zones One Shot Event | |
171 | +// EPwm4Regs.TZFRC.bit.OST = 1; //Force Trip Zones One Shot Event | |
172 | +// EPwm5Regs.TZFRC.bit.OST = 1; //Force Trip Zones One Shot Event | |
173 | +// EDIS; //Lock Register Protection | |
174 | +// } | |
175 | +// | |
176 | +// if(FlagInvGating == 1) | |
177 | +// { | |
178 | +// EALLOW; //Release Register Protection | |
179 | +// EPwm6Regs.TZCLR.bit.OST = 1; //One-Shot Flag Clear | |
180 | +// EPwm7Regs.TZCLR.bit.OST = 1; //One-Shot Flag Clear | |
181 | +// EDIS; //Lock Register Protection | |
182 | +// } | |
183 | +// else | |
184 | +// { | |
185 | +// EALLOW; //Release Register Protection | |
186 | +// EPwm6Regs.TZFRC.bit.OST = 1; //Force Trip Zones One Shot Event | |
187 | +// EPwm7Regs.TZFRC.bit.OST = 1; //Force Trip Zones One Shot Event | |
188 | +// EDIS; //Lock Register Protection | |
189 | +// } | |
190 | +// | |
191 | +// | |
192 | +// GPIO_GATE_ENB = ~(FlagInvGating | FlagBoostGating | FlagDabGating);//GPIO GATE Enable Pin = Enable = FALSE | |
193 | +} | |
194 | + | |
195 | +void GateOutDisable(void) //Define GPIO Gate Out Disable Function | |
196 | +{ | |
197 | + GPIO_GATE_ENB = ~(0); //GPIO GATE Enable Pin = Disable = TRUE | |
198 | +} | |
199 | + | |
200 | +int DabPwmComp = 0; //Initialize DAB PWM Compare | |
201 | + | |
202 | +void PwmCntUpDate(void) //Define PWM Count Update Function | |
203 | +{ | |
204 | +// //Boost | |
205 | +// EPwm1Regs.CMPA.bit.CMPA = TboostCnt; //Set Compare Register Boost Count | |
206 | +// | |
207 | +// //For Buck-Boost Test Start | |
208 | +// //LvSide | |
209 | +//// EPwm2Regs.CMPA.bit.CMPA = DabPwmPrd + DabPwmComp; //Set Compare Register DAB Count + Full Duty * 1/2 | |
210 | +//// EPwm3Regs.CMPA.bit.CMPA = DabPwmPrd + DabPwmComp; //Set Compare Register DAB Count + Full Duty * 1/2 | |
211 | +// //For Buck-Boost Test End | |
212 | +// | |
213 | +// //LvSide | |
214 | +// EPwm2Regs.CMPA.bit.CMPA = DabPwmPrd * 0.5 + DabPwmComp; //Set Compare Register DAB Count + Full Duty * 1/2 | |
215 | +// EPwm3Regs.CMPA.bit.CMPA = DabPwmPrd * 0.5 + DabPwmComp; //Set Compare Register DAB Count + Full Duty * 1/2 | |
216 | +// | |
217 | +// //For Inverter Test Start | |
218 | +// //HvSide | |
219 | +// EPwm4Regs.CMPA.bit.CMPA = DabPwmPrd + DabPwmComp; //Set Compare Register DAB Count + Full Duty * 1/2 | |
220 | +// EPwm5Regs.CMPA.bit.CMPA = DabPwmPrd + DabPwmComp; //Set Compare Register DAB Count + Full Duty * 1/2 | |
221 | +// //For Inverter Test End | |
222 | +// | |
223 | +//// //HvSide | |
224 | +//// EPwm4Regs.CMPA.bit.CMPA = DabPwmPrd * 0.5 + DabPwmComp; //Set Compare Register DAB Count + Full Duty * 1/2 | |
225 | +//// EPwm5Regs.CMPA.bit.CMPA = DabPwmPrd * 0.5 + DabPwmComp; //Set Compare Register DAB Count + Full Duty * 1/2 | |
226 | +// | |
227 | +// EPwm2Regs.TBPHS.bit.TBPHS = 0; //Set Phase Shift = 0 | |
228 | +// EPwm3Regs.TBPHS.bit.TBPHS = 0; //Set Phase Shift = 0 | |
229 | +// EPwm4Regs.TBPHS.bit.TBPHS = TdabPhCnt; //Set Phase Shift = DAB Phase Shift Count | |
230 | +// EPwm5Regs.TBPHS.bit.TBPHS = TdabPhCnt; //Set Phase Shift = DAB Phase Shift Count | |
231 | +// | |
232 | +// | |
233 | +// //Inverter | |
234 | +// EPwm6Regs.CMPA.bit.CMPA = TinvACnt; //Set Compare Register Inverter Count | |
235 | +// EPwm7Regs.CMPA.bit.CMPA = TinvBCnt; //Set Compare Register Inverter Count | |
236 | +// | |
237 | +// GateOutEnable(); //Call Gate Out Enable Function | |
238 | +} | |
239 | + | |
240 | + | |
241 | +void InitGateEnbGpio() //Define Initialize Gate Enable GPIO Function | |
242 | +{ | |
243 | + GPIO_setMasterCore(95, GPIO_CORE_CPU1); //CPU1 Control GPIO 95 Pin | |
244 | + GPIO_setPinConfig(GPIO_95_GPIO95); //Select GPIO 95 Pin | |
245 | + GPIO_setDirectionMode(95, GPIO_DIR_MODE_OUT); //GPIO 95 Pin Output | |
246 | + GPIO_setPadConfig(95, GPIO_PIN_TYPE_STD); //GPIO 95 Pin Push-pull output | |
247 | + GPIO_setQualificationMode(95, GPIO_QUAL_ASYNC); //GPIO 95 Pin No synchronization | |
248 | + GPIO_writePin(95, 1); //GPIO 95 Pin HIGH = Disable | |
249 | +} | |
250 | + | |
251 | + | |
252 | +void GatePulseGenerate() //Define Gate Pulse Generate Function | |
253 | +{ | |
254 | +// TinvACnt = LIMITER((unsigned int) (TinvA * InvPwmPrd), (InvPwmPrd - 30), 0.); //Inverter PWM Count of A Branch | |
255 | +// TinvBCnt = LIMITER((unsigned int) (TinvB * InvPwmPrd), (InvPwmPrd - 30), 0.); //Inverter PWM Count of B Branch | |
256 | +// TboostCnt = LIMITER((unsigned int) (Tboost * BoostPwmPrd), (BoostPwmPrd - 200), 200.); //Boost PWM Count | |
257 | +// | |
258 | +//// TdabPh = PiIbat.out; //DAB Phase Shift Time | |
259 | +//// TdabPh = LIMITER(TdabPh, 1, -1); //DAB Phase Shift Time Limit -1 = Min, 1 = Max | |
260 | +// | |
261 | +// if(TdabPh <= 0) //DAB Phase Shift Time Limit Smaller than 0 | |
262 | +// { | |
263 | +// EPwm4Regs.TBCTL.bit.PHSDIR = TB_UP; //DAB Phase Direction = 1 | |
264 | +// EPwm5Regs.TBCTL.bit.PHSDIR = TB_UP; //DAB Phase Direction = 1 | |
265 | +// } | |
266 | +// else | |
267 | +// { | |
268 | +// EPwm4Regs.TBCTL.bit.PHSDIR = TB_DOWN; //DAB Phase Direction = 0 | |
269 | +// EPwm5Regs.TBCTL.bit.PHSDIR = TB_DOWN; //DAB Phase Direction = 0 | |
270 | +// } | |
271 | +// | |
272 | +// TdabPhCnt = LIMITER((fabs(TdabPh) * DabPwmPrd), DabPwmPrd, -DabPwmPrd); //DAB PWM Count | |
273 | +} | |
274 | + | |
275 | + | |
276 | + |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/FaultProcess.cpp
... | ... | @@ -0,0 +1,399 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : FaultProcess.cpp | |
4 | +// Created on : 2023. 07. 26. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu1DeviceDefine.h" | |
11 | + | |
12 | +void InitFaultSet() | |
13 | +{ | |
14 | + memset(&Fault, 0, (sizeof(Fault) / sizeof(int))); | |
15 | + InitProtectionSet(); | |
16 | +} | |
17 | + | |
18 | +void InitInstFaultLevelSet() | |
19 | +{ | |
20 | + //Bat 순시 과전압 | |
21 | + FT_UV_OV.Ratio = 1.00; // 105% | |
22 | + FT_UV_OV.SetLevel = FT_UV_OV.Ratio * SET_FT_UV_Level; | |
23 | + | |
24 | + //Bat 순시 저전압 | |
25 | + FT_VIS_OV.Ratio = 1.0; // 105% | |
26 | + FT_VIS_OV.SetLevel = FT_VIS_OV.Ratio * SET_FT_VIS_Level; | |
27 | + | |
28 | + //Bat 순시 과전류 | |
29 | + FT_IR_OV.Ratio = 1.00; | |
30 | + FT_IR_OV.SetLevel = FT_IR_OV.Ratio * SET_FT_IR_Level; | |
31 | + | |
32 | + | |
33 | +} | |
34 | +void InitOverTempLevelSet() | |
35 | +{ | |
36 | + | |
37 | + //AC Switch Inverter Over Temperature | |
38 | + OtNtc5.SetLevel = 85.; | |
39 | + | |
40 | + //AC Switch Inverter Over Temperature | |
41 | + OtNtc6.SetLevel = 85.; | |
42 | +} | |
43 | + | |
44 | +void InitProtectionSet() | |
45 | +{ | |
46 | + InitInstFaultLevelSet(); | |
47 | +// InitOverTempLevelSet(); | |
48 | +// InitFaultFreq(); | |
49 | +// InitFaultVac(); | |
50 | +} | |
51 | + | |
52 | +void FaultInstType() | |
53 | +{ | |
54 | +// if (CH4_UV_Flt > FT_UV_OV.SetLevel) Fault.Sw1.bit.CH4_UV_OV |= 1; | |
55 | +// if (CH4_VIS_Flt > FT_VIS_OV.SetLevel) Fault.Sw1.bit.CH4_VIS_OV |= 1; | |
56 | +// if (CH4_IR_Flt > FT_IR_OV.SetLevel) Fault.Sw1.bit.CH4_IR_OV |= 1; | |
57 | + | |
58 | + if ((CH4_UV_Flt > FT_UV_OV.SetLevel) | |
59 | + &&(CH4_VIS_Flt > FT_VIS_OV.SetLevel)) Fault.Sw1.bit.CH4_UV_OV |= 1; | |
60 | + | |
61 | +} | |
62 | + | |
63 | +void OverTempFault() | |
64 | +{ | |
65 | +// if (VntcBoost > OtDcSwBoost.SetLevel) Fault.Sw1.bit.OtDcSwBoost |= 1; | |
66 | +// if (VntcLvDab > OtDcSwLvDab.SetLevel) Fault.Sw1.bit.OtDcSwLvDab |= 1; | |
67 | +// if (VntcHvDab > OtAcSwHvDab.SetLevel) Fault.Sw1.bit.OtAcSwHvDab |= 1; | |
68 | +// if (VntcInv > OtAcSwInv.SetLevel) Fault.Sw1.bit.OtAcSwInv |= 1; | |
69 | +// | |
70 | +// if (Vntc5 > OtNtc5.SetLevel) Fault.Sw1.bit.OtNtc5 |= 1; | |
71 | +// if (Vntc6 > OtNtc6.SetLevel) Fault.Sw1.bit.OtNtc6 |= 1; | |
72 | + | |
73 | +} | |
74 | + | |
75 | +void InitFaultVac(void) | |
76 | +{ | |
77 | +// FT_Combo_1.Ratio = 1.1; | |
78 | +// FT_Combo_1.SetLevel = FT_Combo_1.Ratio * VacRatePeak; | |
79 | +// FT_Combo_1.SetTime = 0.16; | |
80 | +// FT_Combo_1.SetCnt = FT_Combo_1.SetTime * INV_T10ms; | |
81 | +// FT_Combo_1.ChkCnt = 0; | |
82 | +// FT_Combo_1.SetStableCnt = FT_Combo_1.SetCnt; | |
83 | +// FT_Combo_1.StableCnt = 0; | |
84 | +// | |
85 | +// UvVgrid.Ratio = 0.9; | |
86 | +// UvVgrid.SetLevel = UvVgrid.Ratio * VacRatePeak; | |
87 | +// UvVgrid.SetTime = 0.16; | |
88 | +// UvVgrid.SetCnt = UvVgrid.SetTime * INV_T10ms; | |
89 | +// UvVgrid.ChkCnt = 0; | |
90 | +// UvVgrid.SetStableCnt = UvVgrid.SetCnt; | |
91 | +// UvVgrid.StableCnt = 0; | |
92 | +} | |
93 | + | |
94 | +void FaultVac() //10ms | |
95 | +{ | |
96 | +// if (FlagOffset == 3) | |
97 | +// { | |
98 | +// if (VqeGridFlt < UvVgrid.SetLevel) | |
99 | +// { | |
100 | +// if (++UvVgrid.ChkCnt > UvVgrid.SetCnt) | |
101 | +// { | |
102 | +// Fault.Sw1.bit.CH1_VIS_OV |= 1; | |
103 | +// UvVgrid.ChkCnt = 0; | |
104 | +// } | |
105 | +// | |
106 | +// UvVgrid.StableCnt = 0; | |
107 | +// } | |
108 | +// else if (VqeGridFlt > FT_Combo_1.SetLevel) | |
109 | +// { | |
110 | +// if (++FT_Combo_1.ChkCnt > FT_Combo_1.SetCnt) | |
111 | +// { | |
112 | +// Fault.Sw1.bit.CH1_UV_OV |= 1; | |
113 | +// FT_Combo_1.ChkCnt = 0; | |
114 | +// } | |
115 | +// | |
116 | +// FT_Combo_1.StableCnt = 0; | |
117 | +// } | |
118 | +// else | |
119 | +// { | |
120 | +// if ((++FT_Combo_1.StableCnt > FT_Combo_1.SetStableCnt) && (++UvVgrid.StableCnt > UvVgrid.SetStableCnt)) | |
121 | +// { | |
122 | +// FT_Combo_1.ChkCnt = 0; | |
123 | +// FT_Combo_1.StableCnt = 0; | |
124 | +// UvVgrid.ChkCnt = 0; | |
125 | +// UvVgrid.StableCnt = 0; | |
126 | +// } | |
127 | +// } | |
128 | +// } | |
129 | +// else | |
130 | +// { | |
131 | +// UvVgrid.ChkCnt = 0; | |
132 | +// UvVgrid.StableCnt = 0; | |
133 | +// FT_Combo_1.ChkCnt = 0; | |
134 | +// FT_Combo_1.StableCnt = 0; | |
135 | +// } | |
136 | +} | |
137 | + | |
138 | +void InitFaultFreq(void) | |
139 | +{ | |
140 | +// OfVac.SetLevel = 60.5; | |
141 | +// OfVac.SetTime = 0.1; | |
142 | +// OfVac.SetCnt = OfVac.SetTime * INV_T10ms; | |
143 | +// OfVac.ChkCnt = 0; | |
144 | +// OfVac.SetStableCnt = OfVac.SetCnt; | |
145 | +// OfVac.StableCnt = 0; | |
146 | +// | |
147 | +// UfVac.SetLevel = 59.3; | |
148 | +// UfVac.SetTime = 0.1; | |
149 | +// UfVac.SetCnt = UfVac.SetTime * INV_T10ms; | |
150 | +// UfVac.ChkCnt = 0; | |
151 | +// UfVac.SetStableCnt = UfVac.SetCnt; | |
152 | +// UfVac.StableCnt = 0; | |
153 | + | |
154 | +} | |
155 | + | |
156 | +void FaultFreq(void) //10ms | |
157 | +{ | |
158 | +// if (FlagOffset == 3) | |
159 | +// { | |
160 | +// if (FreqOutFlt > OfVac.SetLevel) | |
161 | +// { | |
162 | +// if (++OfVac.ChkCnt > OfVac.SetCnt) | |
163 | +// { | |
164 | +// Fault.Sw1.bit.CH1_IR_OV |= 1; | |
165 | +// OfVac.ChkCnt = 0; | |
166 | +// } | |
167 | +// | |
168 | +// OfVac.StableCnt = 0; | |
169 | +// } | |
170 | +// else if (FreqOutFlt < UfVac.SetLevel) | |
171 | +// { | |
172 | +// if (++UfVac.ChkCnt > UfVac.SetCnt) | |
173 | +// { | |
174 | +// Fault.Sw1.bit.CH2_UV_OV |= 1; | |
175 | +// UfVac.ChkCnt = 0; | |
176 | +// } | |
177 | +// | |
178 | +// UfVac.StableCnt = 0; | |
179 | +// } | |
180 | +// else | |
181 | +// { | |
182 | +// if ((++OfVac.StableCnt > OfVac.SetStableCnt) && (++UfVac.StableCnt > UfVac.SetStableCnt)) | |
183 | +// { | |
184 | +// OfVac.ChkCnt = 0; | |
185 | +// OfVac.StableCnt = 0; | |
186 | +// UfVac.ChkCnt = 0; | |
187 | +// UfVac.StableCnt = 0; | |
188 | +// } | |
189 | +// } | |
190 | +// } | |
191 | +} | |
192 | + | |
193 | +void ContectTypeFault() | |
194 | +{ | |
195 | + //Emergency Stop | |
196 | +// Fault.Sw2.bit.Switch_EmergencyStop |= Din.Data.bit.ButtonEstop; | |
197 | + | |
198 | +} | |
199 | + | |
200 | +void DisconnectTempFault() | |
201 | +{ | |
202 | + if (FlagOffset == 3) | |
203 | + { | |
204 | + | |
205 | + } | |
206 | +} | |
207 | + | |
208 | +//unsigned int SetCanMeWait = 5; | |
209 | +//unsigned int CntCanMeWait = 0; | |
210 | +//unsigned int CanMeRxIsrCntOld = 0; | |
211 | +// | |
212 | +//unsigned int SetCanBeWait = 5; | |
213 | +//unsigned int CntCanBeWait = 0; | |
214 | +//unsigned int CanBeRxIsrCntOld = 0; | |
215 | +// | |
216 | +//unsigned int CanMeOff = 0; | |
217 | +//unsigned int CanBeOff = 0; | |
218 | + | |
219 | +unsigned int TraceWaitCnt = 0; | |
220 | +unsigned int TraceWaitSet = 800; | |
221 | + | |
222 | + | |
223 | +void FaultProcess() | |
224 | +{ | |
225 | + SystemFault = 1; | |
226 | +// SystemReady = 0; | |
227 | + | |
228 | + Dout.Data.bit.Ch00 = 1; | |
229 | + Dout.Data.bit.Ch01 = 1; | |
230 | + | |
231 | +// GateOutDisable(); | |
232 | +// FlagInvGating = 0; | |
233 | +// FlagInvGatingInput = 0; | |
234 | +// | |
235 | +// FlagBoostGating = 0; | |
236 | +// FlagBoostGatingInput = 0; | |
237 | +// | |
238 | +// FlagDabGating = 0; | |
239 | +// FlagDabGatingInput = 0; | |
240 | +// | |
241 | +// CmdChargeStart = 0; | |
242 | +// CmdDischargeStart = 0; | |
243 | +// | |
244 | +// FlagRunInv = 0; | |
245 | +// CmdInvStart = 0; | |
246 | +// CmdInvOPset = 99; | |
247 | +// | |
248 | +// FlagRunBoost = 0; | |
249 | +// CmdBoostStart = 0; | |
250 | +// CmdBoostOPset = 99; | |
251 | +// | |
252 | +// FlagRunDab = 0; | |
253 | +// CmdDabStart = 0; | |
254 | +// CmdDabOPset = 99; | |
255 | +// | |
256 | +// InvReady = 0; | |
257 | +// | |
258 | +// IbatRef = 0.; | |
259 | +// | |
260 | +//// IqeRef = 0.; | |
261 | +//// IdeRef = 0.; | |
262 | +// | |
263 | +//// VbatRef = 0.; | |
264 | +//// VdabRef = 0.; | |
265 | +// | |
266 | +//// InitCntAcPreCharge(); | |
267 | +//// FlagAcPreCharge = 0; | |
268 | +//// StatusAcPreCharge = 0; | |
269 | +// | |
270 | +// DigitalInput(); | |
271 | +// InitAcRelay(); | |
272 | +// DigitalOutput(); | |
273 | +// | |
274 | +// TinvA = 0; | |
275 | +// TinvB = 0; | |
276 | +// TinvACnt = 0; | |
277 | +// TinvBCnt = 0; | |
278 | +// | |
279 | +// Tboost = 0; | |
280 | +// TboostCnt = 0; | |
281 | +// | |
282 | +// TdabA = 0; | |
283 | +// TdabB = 0; | |
284 | +// TdabC = 0; | |
285 | +// TdabD = 0; | |
286 | +// TdabPh = 0; | |
287 | +// | |
288 | +// TdabACnt = 0; | |
289 | +// TdabBCnt = 0; | |
290 | +// TdabCCnt = 0; | |
291 | +// TdabDCnt = 0; | |
292 | +// TdabPhCnt = 0; | |
293 | + | |
294 | + FaultLatchData(); | |
295 | + | |
296 | +// if(FlagTrace == 1) | |
297 | +// { | |
298 | +// if(TraceWaitCnt++ > TraceWaitSet) | |
299 | +// { | |
300 | +// FlagTrace = 0; | |
301 | +// } | |
302 | +// } | |
303 | +// else | |
304 | +// { | |
305 | +// TraceWaitCnt = TraceWaitSet; | |
306 | +// } | |
307 | + | |
308 | + | |
309 | + | |
310 | +} | |
311 | + | |
312 | +unsigned int FlagLatch = 0; | |
313 | + | |
314 | +void FaultLatchData() | |
315 | +{ | |
316 | +// if (FlagLatch == 0) | |
317 | +// { | |
318 | +// FaultLatch.Vbat = Vbat; | |
319 | +// FaultLatch.Ibat = Ibat; | |
320 | +// | |
321 | +// FaultLatch.Vboost = Vboost; | |
322 | +// FaultLatch.Vdab = Vdab; | |
323 | +// FaultLatch.GFD = GFD; | |
324 | +// FaultLatch.VdcH = VdcH; | |
325 | +// FaultLatch.VdcL = VdcL; | |
326 | +// FaultLatch.VunGrid = VunGrid; | |
327 | +// FaultLatch.VnwGrid = VnwGrid; | |
328 | +// FaultLatch.IuInv = IuInv; | |
329 | +// FaultLatch.IwInv = IwInv; | |
330 | +// | |
331 | +// FaultLatch.Izct = Izct; | |
332 | +// FaultLatch.IuGridExt = IuGridExt; | |
333 | +// FaultLatch.IwGridExt = IwGridExt; | |
334 | +// | |
335 | +// FaultLatch.VntcBoost = VntcBoost; | |
336 | +// FaultLatch.VntcLvDab = VntcLvDab; | |
337 | +// FaultLatch.VntcHvDab = VntcHvDab; | |
338 | +// FaultLatch.VntcInv = VntcInv; | |
339 | +// FaultLatch.Vntc5 = | |
340 | +// | |
341 | +// FaultLatch.VunInv = VunInv; | |
342 | +// FaultLatch.VnwInv = VnwInv; | |
343 | +// FaultLatch.IuGrid = IuGrid; | |
344 | +// FaultLatch.IwGrid = IwGrid; | |
345 | +// | |
346 | +// FlagLatch = 1; | |
347 | +// | |
348 | +// } | |
349 | + | |
350 | +} | |
351 | + | |
352 | +void FaultChecker() | |
353 | +{ | |
354 | + FaultInstType(); | |
355 | + ContectTypeFault(); | |
356 | + OverTempFault(); | |
357 | + | |
358 | + if ((Fault.Sw1.all != 0) || (Fault.Sw2.all != 0) || (Fault.Sw3.all != 0)) | |
359 | + { | |
360 | + FaultProcess(); | |
361 | + } | |
362 | + | |
363 | + if (SystemFault == 1) | |
364 | + { | |
365 | + if (CmdFaultReset == 33) | |
366 | + { | |
367 | + FaultReset = 1; | |
368 | + CmdFaultReset = 99; | |
369 | + } | |
370 | + } | |
371 | + else CmdFaultReset = 99, FaultReset = 0; | |
372 | + | |
373 | + if (SystemFault == 0) FaultReset = 0; | |
374 | + else if ((SystemFault == 1) && (FaultReset == 1)) SystemRestart(); | |
375 | + | |
376 | +} | |
377 | + | |
378 | +void SystemRestart() | |
379 | +{ | |
380 | + SystemFault = 0; | |
381 | + | |
382 | + Dout.Data.bit.Ch00 = 0; | |
383 | + Dout.Data.bit.Ch01 = 0; | |
384 | + | |
385 | + Fault.Sw1.all = 0; | |
386 | + Fault.Sw2.all = 0; | |
387 | + Fault.Sw3.all = 0; | |
388 | + | |
389 | + FlagOffset = 0; | |
390 | + SystemReady = 0; | |
391 | + | |
392 | + FaultReset = 0; | |
393 | + | |
394 | + InitAcRelay(); | |
395 | + memset(&FaultLatch, 0, (sizeof(FaultLatch) / sizeof(int))); | |
396 | + FlagLatch = 0; | |
397 | + | |
398 | +} | |
399 | + |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/OffsetProcess.cpp
... | ... | @@ -0,0 +1,183 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : OffsetProcess.cpp | |
4 | +// Created on : 2023. 08. 08. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#include "Cpu1DeviceDefine.h" | |
12 | + | |
13 | +unsigned int FlagOffset = 0; | |
14 | + | |
15 | +int CntAdcOffsetWait = 20000; | |
16 | +int SetAdcOffsetWait = 20000; | |
17 | +int CntOffsetWait = 400; | |
18 | +int SetOffsetWait = 400; | |
19 | + | |
20 | +unsigned int CntOffsetAvg = 0; | |
21 | +unsigned int SetOffsetAvg = 16384; | |
22 | + | |
23 | +unsigned int CntAdcOffsetSum = 0; | |
24 | +unsigned int SetAdcOffsetSum = 16384; | |
25 | + | |
26 | +int SetFaultAdcOffset = 32767 * 0.01; | |
27 | + | |
28 | +void OffsetProcess() | |
29 | +{ | |
30 | +// WatchdogRun(); | |
31 | + AdcResult(); | |
32 | + | |
33 | + PllRun(); | |
34 | + | |
35 | + Lpf1stRun(); | |
36 | +// InvVdc = 1. / (CH3_UV_Flt + 1.e-32); | |
37 | + | |
38 | + RmsAvgSum(); | |
39 | +// FaultChecker(); | |
40 | + | |
41 | + if (FaultReset == 0) | |
42 | + { | |
43 | + if (FlagOffset == 0) | |
44 | + { | |
45 | + | |
46 | + --CntAdcOffsetWait; | |
47 | + if (CntAdcOffsetWait <= 0) | |
48 | + { | |
49 | +// Adc.Offset[1] = ADC_OFFSET1V5; //Ibat | |
50 | +// Adc.Offset[6] = ADC_OFFSET1V5; //IuGrid | |
51 | +// Adc.Offset[7] = ADC_OFFSET1V5; //IwGrid | |
52 | +// | |
53 | +// Adc.Offset[11] = ADC_OFFSET1V5; //IuInv | |
54 | +// Adc.Offset[12] = ADC_OFFSET1V5; //IwInv | |
55 | +// | |
56 | +// Adc.Offset[18] = ADC_OFFSET1V5; //IuGridExt | |
57 | +// Adc.Offset[19] = ADC_OFFSET1V5; //IwGridExt | |
58 | +// | |
59 | +// | |
60 | +// Adc.OffsetSum[1] = 0.; //Ibat | |
61 | +// Adc.OffsetSum[6] = 0.; //IuGrid | |
62 | +// Adc.OffsetSum[7] = 0.; //IwGrid | |
63 | +// | |
64 | +// Adc.OffsetSum[11] = 0.; //IuInv | |
65 | +// Adc.OffsetSum[12] = 0.; //IwInv | |
66 | +// | |
67 | +// Adc.OffsetSum[18] = 0.; //IuGridExt | |
68 | +// Adc.OffsetSum[19] = 0.; //IwGridExt | |
69 | +// | |
70 | +// Adc.OffsetDelt[1] = 0.; //Ibat | |
71 | +// Adc.OffsetDelt[6] = 0.; //IuGrid | |
72 | +// Adc.OffsetDelt[7] = 0.; //IwGrid | |
73 | +// | |
74 | +// Adc.OffsetDelt[11] = 0.; //IuInv | |
75 | +// Adc.OffsetDelt[12] = 0.; //IwInv | |
76 | +// | |
77 | +// Adc.OffsetDelt[18] = 0.; //IuGridExt | |
78 | +// Adc.OffsetDelt[19] = 0.; //IwGridExt | |
79 | + | |
80 | + FlagOffset = 1; | |
81 | + CntAdcOffsetWait = SetAdcOffsetWait; | |
82 | + } | |
83 | + } | |
84 | + else if (FlagOffset == 1) | |
85 | + { | |
86 | + Adc.OffsetSum[2] += Adc.RawData[2] - ADC_OFFSET1V5; //Ibat | |
87 | + Adc.OffsetSum[3] += Adc.RawData[3] - ADC_OFFSET1V5; //IuGrid | |
88 | + Adc.OffsetSum[4] += Adc.RawData[4] - ADC_OFFSET1V5; //IwGrid | |
89 | + | |
90 | + Adc.OffsetSum[5] += Adc.RawData[5] - ADC_OFFSET1V5; //IuInv | |
91 | + Adc.OffsetSum[8] += Adc.RawData[8] - ADC_OFFSET1V5; //IwInv | |
92 | + Adc.OffsetSum[10] += Adc.RawData[10] - ADC_OFFSET1V5; //IwInv | |
93 | + | |
94 | + Adc.OffsetSum[11] += Adc.RawData[11] - ADC_OFFSET1V5; //Ibat | |
95 | + Adc.OffsetSum[12] += Adc.RawData[12] - ADC_OFFSET1V5; //IuGrid | |
96 | + Adc.OffsetSum[13] += Adc.RawData[13] - ADC_OFFSET1V5; //IwGrid | |
97 | + | |
98 | + Adc.OffsetSum[18] += Adc.RawData[18] - ADC_OFFSET1V5; //IuInv | |
99 | + Adc.OffsetSum[19] += Adc.RawData[19] - ADC_OFFSET1V5; //IwInv | |
100 | + Adc.OffsetSum[20] += Adc.RawData[20] - ADC_OFFSET1V5; //IwInv | |
101 | + | |
102 | + | |
103 | + if (++CntOffsetAvg >= SetOffsetAvg) | |
104 | + { | |
105 | + //todo 나중에 최적화 할 것. | |
106 | + | |
107 | + Adc.OffsetDelt[2] = Adc.OffsetSum[2] / SetOffsetAvg; | |
108 | + Adc.OffsetDelt[3] = Adc.OffsetSum[3] / SetOffsetAvg; | |
109 | + Adc.OffsetDelt[4] = Adc.OffsetSum[4] / SetOffsetAvg; | |
110 | + | |
111 | + Adc.OffsetDelt[5] = Adc.OffsetSum[5] / SetOffsetAvg; | |
112 | + Adc.OffsetDelt[8] = Adc.OffsetSum[8] / SetOffsetAvg; | |
113 | + Adc.OffsetDelt[10] = Adc.OffsetSum[10] / SetOffsetAvg; | |
114 | + | |
115 | + Adc.OffsetDelt[11] = Adc.OffsetSum[11] / SetOffsetAvg; | |
116 | + Adc.OffsetDelt[12] = Adc.OffsetSum[12] / SetOffsetAvg; | |
117 | + Adc.OffsetDelt[13] = Adc.OffsetSum[13] / SetOffsetAvg; | |
118 | + | |
119 | + Adc.OffsetDelt[18] = Adc.OffsetSum[18] / SetOffsetAvg; | |
120 | + Adc.OffsetDelt[19] = Adc.OffsetSum[19] / SetOffsetAvg; | |
121 | + Adc.OffsetDelt[20] = Adc.OffsetSum[20] / SetOffsetAvg; | |
122 | + | |
123 | + | |
124 | +// if (fabs(AdcExt.Offset[18]) > SetFaultAdcOffset) Fault.Sw3.bit.Offset_IL |= 1; | |
125 | +// if (fabs(AdcExt.Offset[19]) > SetFaultAdcOffset) Fault.Sw3.bit.Offset_IL |= 1; | |
126 | +// if (fabs(AdcExt.Offset[20]) > SetFaultAdcOffset) Fault.Sw3.bit.Offset_IL |= 1; | |
127 | +// if (fabs(AdcExt.Offset[21]) > SetFaultAdcOffset) Fault.Sw3.bit.Offset_Iabc |= 1; | |
128 | +// if (fabs(AdcExt.Offset[22]) > SetFaultAdcOffset) Fault.Sw3.bit.Offset_Iabc |= 1; | |
129 | +// if (fabs(AdcExt.Offset[23]) > SetFaultAdcOffset) Fault.Sw3.bit.Offset_Iabc |= 1; | |
130 | +// if (fabs(AdcExt.Offset[24]) > SetFaultAdcOffset) Fault.Sw3.bit.Offset_Ibe |= 1; | |
131 | + | |
132 | + CntOffsetAvg = 0; | |
133 | + FlagOffset = 3; | |
134 | + CntOffsetWait = SetOffsetWait; | |
135 | + } | |
136 | + } | |
137 | + } | |
138 | +} | |
139 | + | |
140 | + | |
141 | +unsigned int AutoOffsetCnt = 0; | |
142 | +unsigned int AutoOffsetSet = 16384; | |
143 | +unsigned int FlagAutoOffset = 0; | |
144 | + | |
145 | +unsigned int AdcOffsetCalCh = 0; | |
146 | +unsigned int OffsetCalSeq = 0; | |
147 | + | |
148 | + | |
149 | +void AutoOffsetCal(int AdcCh) | |
150 | +{ | |
151 | + | |
152 | + if (FlagAutoOffset == 1) | |
153 | + { | |
154 | + if(OffsetCalSeq == 0) | |
155 | + { | |
156 | + Adc.OffsetSum[AdcCh] = 0; | |
157 | + OffsetCalSeq = 1; | |
158 | + } | |
159 | + else | |
160 | + { | |
161 | + if (AutoOffsetCnt++ < AutoOffsetSet) | |
162 | + { | |
163 | + Adc.OffsetSum[AdcCh] += Adc.RawData[AdcCh] - Adc.OffsetDefault[AdcCh]; | |
164 | + } | |
165 | + else | |
166 | + { | |
167 | + Adc.OffsetDelt[AdcCh] = Adc.OffsetSum[AdcCh] / AutoOffsetCnt; | |
168 | + AutoOffsetCnt = 0; | |
169 | + FlagAutoOffset = 0; | |
170 | + OffsetCalSeq = 0; | |
171 | + | |
172 | + } | |
173 | + } | |
174 | + | |
175 | + | |
176 | + | |
177 | + | |
178 | + } | |
179 | + | |
180 | + | |
181 | + | |
182 | +} | |
183 | + |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/Pll.cpp
... | ... | @@ -0,0 +1,75 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : Pll.cpp | |
4 | +// Created on : 2023. 08. 08. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#include "Cpu1DeviceDefine.h" | |
12 | + | |
13 | +float CosThetaComp = 0.; | |
14 | +float SinThetaComp = 0.; | |
15 | +float ErrTheta = 0.; | |
16 | + | |
17 | +float Theta = 0., ThetaComp = 0.; | |
18 | +float SinTheta = 0., CosTheta = 1.; | |
19 | + | |
20 | +float FreqOut = 0.; | |
21 | +float FreqOutFlt = 0.; | |
22 | + | |
23 | + | |
24 | +struct sSogiFll1ph SogiFll1ph; | |
25 | + | |
26 | +void InitPll(void) | |
27 | +{ | |
28 | +// memset(&SogiFll1ph, 0, sizeof(SogiFll1ph) / sizeof(int)); | |
29 | +// SogiFll1ph.Init(FreqRate, Tsamp, VacPeakMax, &VacGrid, &IacInv); | |
30 | + | |
31 | +} | |
32 | + | |
33 | +void PllReset(void) | |
34 | +{ | |
35 | +// SogiFll1ph.Init(FreqRate, Tsamp, VacPeakMax, &VacGrid, &IacInv); | |
36 | +} | |
37 | + | |
38 | +void PllRun(void) | |
39 | +{ | |
40 | +// SogiFll1ph.Run(); | |
41 | +// | |
42 | +// Theta = SogiFll1ph.Theta; | |
43 | +// WeHat = SogiFll1ph.WeHat; | |
44 | +// FreqOut = SogiFll1ph.FreqOut; | |
45 | +// | |
46 | +// SinTheta = SogiFll1ph.SinTheta; | |
47 | +// CosTheta = SogiFll1ph.CosTheta; | |
48 | +// | |
49 | +// VdsGrid = VacGrid; | |
50 | +// VqsGrid = SogiFll1ph.Vs_Osg_Qu[0]; | |
51 | +// | |
52 | +// VdeGrid = CosTheta * VdsGrid + SinTheta * VqsGrid; | |
53 | +// VqeGrid = -SinTheta * VdsGrid + CosTheta * VqsGrid; | |
54 | +// | |
55 | +// VdsInv = VacInv; | |
56 | +// VqsInv = SogiFll1ph.Vs_Osg_Qu[0]; | |
57 | +// | |
58 | +// VdeInv = CosTheta * VdsInv + SinTheta * VqsInv; | |
59 | +// VqeInv = -SinTheta * VdsInv + CosTheta * VqsInv; | |
60 | +// | |
61 | +// IdsInv = IacInv; | |
62 | +// IqsInv = SogiFll1ph.Is_Osg_Qu[0]; | |
63 | +// | |
64 | +// IdeInv = CosTheta * IdsInv + SinTheta * IqsInv; | |
65 | +// IqeInv = -SinTheta * IdsInv + CosTheta * IqsInv; | |
66 | +// | |
67 | +// IdsGrid = IacGrid; | |
68 | +// IqsGrid = SogiFll1ph.Is_Osg_Qu[0]; | |
69 | +// | |
70 | +// IdeGrid = CosTheta * IdsGrid + SinTheta * IqsGrid; | |
71 | +// IqeGrid = -SinTheta * IdsGrid + CosTheta * IqsGrid; | |
72 | + | |
73 | + | |
74 | +} | |
75 | + |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/Relay.cpp
... | ... | @@ -0,0 +1,243 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : Relay.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | +#include "Cpu1DeviceDefine.h" | |
10 | + | |
11 | +//----Main-AcRelay(ALZ51B12)--------// | |
12 | +// Operate time : Max. 15ms // | |
13 | +// Release time : Max. 5ms // | |
14 | +//----------------------------------// | |
15 | + | |
16 | +//---AcPreCharge-Relay(ALDP112W)----// | |
17 | +// Operate Time : Max. 10ms // | |
18 | +// Release time : Max. 10ms // | |
19 | +//----------------------------------// | |
20 | + | |
21 | +//---DcPreCharge-Relay()------------// | |
22 | + | |
23 | +unsigned int FlagAcPreCharge = 0; | |
24 | +unsigned int FlagBatPreCharge = 0; | |
25 | + | |
26 | +float AcRelaySetVolt = 20;//250 | |
27 | +float BatRelaySetVolt = 250.;//130; | |
28 | + | |
29 | +void InitRelay() | |
30 | +{ | |
31 | + InitRelayTime(); | |
32 | + InitCntAcPreCharge(); | |
33 | + InitCntBatPreCharge(); | |
34 | + InitAcRelay(); | |
35 | + InitBatRelay(); | |
36 | + DigitalOutput(); | |
37 | + delay_ms(100L); | |
38 | +} | |
39 | + | |
40 | +void InitAcRelay() | |
41 | +{ | |
42 | +// Dout.Data.bit.RelayGridPreCharge = 0; | |
43 | +// Dout.Data.bit.RelayGridUN = 0; | |
44 | +// Dout.Data.bit.RelayGridNW = 0; | |
45 | +// | |
46 | +// Dout.Data.bit.RelayLoadUN = 0; | |
47 | +// Dout.Data.bit.RelayLoadNW = 0; | |
48 | +} | |
49 | + | |
50 | +void InitBatRelay() | |
51 | +{ | |
52 | +// Dout.Data.bit.RelayBatPreCharge = 0; | |
53 | +// Dout.Data.bit.RelayBatP = 0; | |
54 | +// Dout.Data.bit.RelayBatN = 0; | |
55 | +} | |
56 | + | |
57 | +void InitRelayTime() | |
58 | +{ | |
59 | + SetAcPreChargeWait = (int) (0.5 * INV_T2ms); | |
60 | + SetBatPreChargeWait = (int) (0.5 * INV_T2ms); | |
61 | + | |
62 | + SetPreAcPreRelayWait = (int) (0.5 * INV_T2ms); | |
63 | + SetPreAcRelayWait = (int) (5. * INV_T2ms); | |
64 | + SetPreAcRelayDetect = (int) (0.5 * INV_T2ms); | |
65 | + SetPreAcPreRelayDetect = (int) (0.5 * INV_T2ms); | |
66 | + SetPreAcRelayDelay = (int) (0.5 * INV_T2ms); | |
67 | + | |
68 | + SetPreBatPreRelayWait = (int) (0.5 * INV_T2ms); | |
69 | + SetPreBatRelayWait = (int) (3. * INV_T2ms); | |
70 | + SetPreBatRelayDetect = (int) (0.5 * INV_T2ms); | |
71 | + SetPreBatPreRelayDetect = (int) (0.5 * INV_T2ms); | |
72 | + SetPreBatRelayDelay = (int) (0.5 * INV_T2ms); | |
73 | +} | |
74 | + | |
75 | +void InitCntAcPreCharge() | |
76 | +{ | |
77 | + CntPreAcPreRelayWait = SetPreAcPreRelayWait; | |
78 | + CntPreAcRelayWait = SetPreAcRelayWait; | |
79 | + CntPreAcPreRelayDetect = SetPreAcPreRelayDetect; | |
80 | + CntPreAcRelayDetect = SetPreAcRelayDetect; | |
81 | + CntPreAcRelayDelay = SetPreAcRelayDelay; | |
82 | + CntAcPreChargeWait = 0; | |
83 | +} | |
84 | + | |
85 | +void InitCntBatPreCharge() | |
86 | +{ | |
87 | + CntPreBatPreRelayWait = SetPreBatPreRelayWait; | |
88 | + CntPreBatRelayWait = SetPreBatRelayWait; | |
89 | + CntPreBatRelayDetect = SetPreBatRelayDetect; | |
90 | + CntPreBatPreRelayDetect = SetPreBatPreRelayDetect; | |
91 | + CntPreBatRelayDelay = SetPreBatRelayDelay; | |
92 | + CntBatPreChargeWait = 0; | |
93 | +} | |
94 | + | |
95 | +int CntBatPreChargeWait = 0, SetBatPreChargeWait = 0; | |
96 | +int CntPreBatPreRelayWait = 0, SetPreBatPreRelayWait = 0; | |
97 | +int CntPreBatPreRelayDetect = 0, SetPreBatPreRelayDetect = 0; | |
98 | +int CntPreBatRelayWait = 0, SetPreBatRelayWait = 0; | |
99 | +int CntPreBatRelayDetect = 0, SetPreBatRelayDetect = 0; | |
100 | +int CntPreBatRelayDelay = 0, SetPreBatRelayDelay = 0; | |
101 | +int StatusBatPreCharge = 0; | |
102 | + | |
103 | +void PreChargeBatRelay(float BatRelaySetVolt) | |
104 | +{ | |
105 | +// if ((FlagRunBoost == 1) || (ModeSystem == 1)) FlagBatPreCharge = FlagBatPreCharge; | |
106 | +// else FlagBatPreCharge = 0, StatusBatPreCharge = 0; | |
107 | +// | |
108 | +// if ((FlagBatPreCharge == 1) && (SystemFault == 0)) | |
109 | +// { | |
110 | +// if (StatusBatPreCharge == 0) | |
111 | +// { | |
112 | +// if (--CntPreBatPreRelayWait <= 0) | |
113 | +// { | |
114 | +// Dout.Data.bit.RelayBatPreCharge = 1; | |
115 | +// Dout.Data.bit.RelayBatN = 1; | |
116 | +// CntPreBatPreRelayWait = SetPreBatPreRelayWait; | |
117 | +// } | |
118 | +// | |
119 | +// if ((Dout.Data.bit.RelayBatPreCharge == 1) && (Dout.Data.bit.RelayBatN == 1)) | |
120 | +// { | |
121 | +// if (--CntPreBatRelayWait <= 0) | |
122 | +// { | |
123 | +// CntPreBatRelayWait = SetPreBatRelayWait; | |
124 | +// | |
125 | +// if (CH1_IR_Flt > BatRelaySetVolt) | |
126 | +// { | |
127 | +// Dout.Data.bit.RelayBatP = 1; | |
128 | +// } | |
129 | +// else Fault.Sw1.bit.DcPreCharge |= 1; | |
130 | +// } | |
131 | +// } | |
132 | +// if ((Dout.Data.bit.RelayBatP == 1) && (Dout.Data.bit.RelayBatN == 1)) | |
133 | +// { | |
134 | +// if (--CntPreBatRelayDelay <= 0) | |
135 | +// { | |
136 | +// if (++CntBatPreChargeWait > SetBatPreChargeWait) | |
137 | +// { | |
138 | +// InitCntBatPreCharge(); | |
139 | +// Dout.Data.bit.RelayBatPreCharge = 0; | |
140 | +// CntBatPreChargeWait = 0; | |
141 | +// StatusBatPreCharge = 1; | |
142 | +// } | |
143 | +// } | |
144 | +// } | |
145 | +// } | |
146 | +// if (StatusBatPreCharge == 1) FlagBatPreCharge = 0; | |
147 | +// } | |
148 | +// else | |
149 | +// { | |
150 | +// FlagBatPreCharge = 0; | |
151 | +// InitCntBatPreCharge(); | |
152 | +// } | |
153 | + | |
154 | +} | |
155 | + | |
156 | +int CntAcPreChargeWait = 0, SetAcPreChargeWait = 0; | |
157 | +int CntPreAcPreRelayWait = 0, SetPreAcPreRelayWait = 0; | |
158 | +int CntPreAcPreRelayDetect = 0, SetPreAcPreRelayDetect = 0; | |
159 | +int CntPreAcRelayWait = 0, SetPreAcRelayWait = 0; | |
160 | +int CntPreAcRelayDetect = 0, SetPreAcRelayDetect = 0; | |
161 | +int CntPreAcRelayDelay = 0, SetPreAcRelayDelay = 0; | |
162 | +int StatusAcPreCharge = 0; | |
163 | + | |
164 | +float RelayAcOntimeMin = -2.82; | |
165 | +float RelayAcOntimeMax = -2.50; | |
166 | + | |
167 | +void PreChargeAcRelay(float AcRelaySetVolt) | |
168 | +{ | |
169 | +// if ((FlagRunInv == 1) || (ModeSystem == 1)) FlagAcPreCharge = FlagAcPreCharge; | |
170 | +// else FlagAcPreCharge = 0, StatusAcPreCharge = 0; | |
171 | +// | |
172 | +// if ((FlagAcPreCharge == 1) && (SystemFault == 0)) | |
173 | +// { | |
174 | +// if (StatusAcPreCharge == 0) | |
175 | +// { | |
176 | +// if (--CntPreAcPreRelayWait <= 0) | |
177 | +// { | |
178 | +//// if ((Theta >= RelayAcOntimeMin) && (Theta <= RelayAcOntimeMax)) | |
179 | +//// { | |
180 | +// Dout.Data.bit.RelayGridPreCharge = 1; | |
181 | +// CntPreAcPreRelayWait = SetPreAcPreRelayWait; | |
182 | +//// } | |
183 | +// } | |
184 | +// if (Dout.Data.bit.RelayGridPreCharge == 1) | |
185 | +// { | |
186 | +// if (--CntPreAcRelayWait <= 0) | |
187 | +// { | |
188 | +// CntPreAcRelayWait = SetPreAcRelayWait; | |
189 | +// | |
190 | +// if (CH3_UV_Flt > AcRelaySetVolt) | |
191 | +// { | |
192 | +//// if ((Theta >= RelayAcOntimeMin) && (Theta >= RelayAcOntimeMax)) | |
193 | +//// { | |
194 | +// Dout.Data.bit.RelayGridUN = 1; | |
195 | +// Dout.Data.bit.RelayGridNW = 1; | |
196 | +//// } | |
197 | +// } | |
198 | +// else Fault.Sw1.bit.AcPreCharge = 1; | |
199 | +// } | |
200 | +// } | |
201 | +// | |
202 | +// if ((Dout.Data.bit.RelayGridUN == 1) && (Dout.Data.bit.RelayGridNW == 1)) | |
203 | +// { | |
204 | +// if (--CntPreAcRelayDelay <= 0) | |
205 | +// { | |
206 | +// if (++CntAcPreChargeWait > SetAcPreChargeWait) | |
207 | +// { | |
208 | +// InitCntAcPreCharge(); | |
209 | +// Dout.Data.bit.RelayGridPreCharge = 0; | |
210 | +// | |
211 | +// CntAcPreChargeWait = 0; | |
212 | +// StatusAcPreCharge = 1; | |
213 | +// } | |
214 | +// } | |
215 | +// } | |
216 | +// } | |
217 | +// if (StatusAcPreCharge == 1) FlagAcPreCharge = 0; | |
218 | +// } | |
219 | +// else | |
220 | +// { | |
221 | +// FlagAcPreCharge = 0; | |
222 | +// InitCntAcPreCharge(); | |
223 | +// } | |
224 | + | |
225 | + //todo 동작시 접점 확인 및 폴트 추가 할 것 | |
226 | +} | |
227 | + | |
228 | +unsigned int FlagLoadRelayOn = 0; | |
229 | + | |
230 | +void LoadRelay() | |
231 | +{ | |
232 | +// if(FlagLoadRelayOn == 1) | |
233 | +// { | |
234 | +// Dout.Data.bit.RelayLoadUN = 1; | |
235 | +// Dout.Data.bit.RelayLoadNW = 1; | |
236 | +// } | |
237 | +// else | |
238 | +// { | |
239 | +// Dout.Data.bit.RelayLoadUN = 0; | |
240 | +// Dout.Data.bit.RelayLoadNW = 0; | |
241 | +// } | |
242 | + | |
243 | +} |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/RoutineT100ms.cpp
... | ... | @@ -0,0 +1,40 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : RoutineT100ms.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu1DeviceDefine.h" | |
11 | + | |
12 | +int sendChar = 0; | |
13 | +int recievChar = 0; | |
14 | + | |
15 | +void RoutineT100ms() | |
16 | +{ | |
17 | + | |
18 | + ModbusARxDataUpdate(); | |
19 | + ModbusATxDataUpdate(); | |
20 | + | |
21 | + NtcRead(); | |
22 | + | |
23 | +// SCI_writeCharBlockingFIFO(SCID_BASE, sendChar); // for NEXTION SCI-D Test | |
24 | + | |
25 | + // | |
26 | + // Wait for RRDY/RXFFST = 1 for 1 data available in FIFO | |
27 | + // | |
28 | +// while(SCI_getRxFIFOStatus(SCID_BASE) == SCI_FIFO_RX0) | |
29 | +// { | |
30 | +// ; | |
31 | +// } | |
32 | +// | |
33 | +// // | |
34 | +// // Check received character | |
35 | +// // | |
36 | +// receivedChar = SCI_readCharBlockingFIFO(SCID_BASE); | |
37 | + | |
38 | + | |
39 | +} | |
40 | + |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/RoutineT10ms.cpp
... | ... | @@ -0,0 +1,17 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : RoutineT10ms.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | + | |
12 | +#include "Cpu1DeviceDefine.h" | |
13 | + | |
14 | +void RoutineT10ms() | |
15 | +{ | |
16 | + | |
17 | +} |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/RoutineT2ms.cpp
... | ... | @@ -0,0 +1,22 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : RoutineT2ms.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | + | |
12 | +#include "Cpu1DeviceDefine.h" | |
13 | + | |
14 | + | |
15 | +void RoutineT2ms() | |
16 | +{ | |
17 | + | |
18 | +// RunStopSeq(); | |
19 | + | |
20 | + | |
21 | +} | |
22 | + |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/RoutineT500ms.cpp
... | ... | @@ -0,0 +1,94 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : RoutineT500ms.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu1DeviceDefine.h" | |
11 | + | |
12 | +int FlagAdcReset = 0; | |
13 | +int Testpcs5 = 0; | |
14 | + | |
15 | +int off_duration = 3; | |
16 | +int on_duration = 1; | |
17 | +int cnt = 0; | |
18 | +bool led_state = false; // LED 상태를 추적하는 플래그 | |
19 | + | |
20 | +void RoutineT500ms() | |
21 | +{ | |
22 | + ScaleUpdate(); | |
23 | + OffsetUpdate(); | |
24 | + Lpf1stCoefUpdate(); | |
25 | + | |
26 | + if(FlagAdcReset == 1) | |
27 | + { | |
28 | + SetupAdcSoc(); | |
29 | + FlagAdcReset = 0; | |
30 | + } | |
31 | + | |
32 | + if(SystemFault == 1) | |
33 | + { | |
34 | + if(Dout.Data.bit.Ch03 == 0) | |
35 | + { | |
36 | + Dout.Data.bit.Ch03 = 1; | |
37 | + } | |
38 | + | |
39 | + if (!led_state && ++cnt >= off_duration) | |
40 | + { | |
41 | + | |
42 | + Dout.Data.bit.Ch02 = 0; | |
43 | +// Dout.Data.bit.Ch03 = 1; | |
44 | + | |
45 | + led_state = true; // LED 상태 업데이트 | |
46 | + | |
47 | + cnt = 0; // 카운터 초기화 | |
48 | + } | |
49 | + else if (led_state && ++cnt >= on_duration) | |
50 | + { | |
51 | + Dout.Data.bit.Ch02 = 1; | |
52 | + Dout.Data.bit.Ch03 = 0; | |
53 | + | |
54 | + led_state = false; // LED 상태 업데이트 | |
55 | + | |
56 | + cnt = 0; // 카운터 초기화 | |
57 | + on_duration += 1; // 다음 켜짐 시간 증가 | |
58 | + | |
59 | + // on_duration이 너무 커지면 리셋 | |
60 | + if (on_duration > off_duration) { | |
61 | + on_duration = 1; // 켜짐 시간 초기화 | |
62 | + } | |
63 | + } | |
64 | + } | |
65 | + else | |
66 | + { | |
67 | + Dout.Data.bit.Ch02 = 0; | |
68 | + Dout.Data.bit.Ch03 = 0; | |
69 | + } | |
70 | + | |
71 | + ////////////////////////////////////// | |
72 | + if(State_RTC_Write_complete == 1) | |
73 | + { | |
74 | +// RtcWriteTime(); | |
75 | + SPI_RTC_Write_Sequence(); | |
76 | + | |
77 | +// State_RTC_Write_complete = 0; | |
78 | + } | |
79 | + | |
80 | + if(Testpcs5 == 1) | |
81 | + { | |
82 | + SPI_RTC_Read_Sequence(); | |
83 | +// Testpcs5 = 0; | |
84 | +// RtcRun(); | |
85 | + | |
86 | + } | |
87 | +} | |
88 | + | |
89 | +void RoutineT1s() | |
90 | +{ | |
91 | + | |
92 | +} | |
93 | + | |
94 | + |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/RoutineT500us.cpp
... | ... | @@ -0,0 +1,29 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : RoutineT500us.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#include "Cpu1DeviceDefine.h" | |
12 | + | |
13 | + uint32_t Testpcs9 = 0; | |
14 | + | |
15 | +void RoutineT500us() | |
16 | +{ | |
17 | + | |
18 | + DigitalInput(); | |
19 | + DigitalOutput(); | |
20 | + | |
21 | + ModbusALLResponse(); | |
22 | + | |
23 | +// ContectTypeFault(); | |
24 | + | |
25 | +// Testpcs9 = GPIO_readPortData(GPIO_PORT_A); | |
26 | +// Din.DataRaw.all = GPIO_readPortData(GPIO_PORT_A); | |
27 | + | |
28 | +} | |
29 | + |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/RoutineTsamp.cpp
... | ... | @@ -0,0 +1,61 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : RoutineTsamp.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu1DeviceDefine.h" | |
11 | + | |
12 | + int Testpcs4 = 0; | |
13 | + int Adc_BUTTON = 0; | |
14 | + | |
15 | + int Chk_Botton = 0; | |
16 | + int Chk_Botton_pre = 0; | |
17 | + | |
18 | + | |
19 | + | |
20 | +void RoutineTsamp() | |
21 | +{ | |
22 | + | |
23 | + DacaRegs.DACVALS.bit.DACVALS = Testpcs1; | |
24 | + DacbRegs.DACVALS.bit.DACVALS = Testpcs2; | |
25 | + DaccRegs.DACVALS.bit.DACVALS = Testpcs3; | |
26 | + | |
27 | +// PllRun(); | |
28 | + Lpf1stRun(); | |
29 | + FaultChecker(); | |
30 | + | |
31 | + if(Testpcs4 == 1) | |
32 | + { | |
33 | + EepromWriteAdcScale(); | |
34 | + Testpcs4 = 0; | |
35 | + } | |
36 | + if(Testpcs4 == 2) | |
37 | + { | |
38 | + EepromReadAdcScale(); | |
39 | + Testpcs4 = 0; | |
40 | + } | |
41 | + | |
42 | +// receivedChar = SCI_readCharBlockingFIFO(SCIC_BASE); | |
43 | +// SCI_writeCharBlockingFIFO(SCIC_BASE, receivedChar); | |
44 | + | |
45 | + ModbusACheckBuffer(); | |
46 | + | |
47 | + Chk_Botton = Din.Data.bit.Button; | |
48 | + | |
49 | + if((Chk_Botton_pre == 0)&& (Chk_Botton == 1)) | |
50 | + { | |
51 | + FaultReset = 1; | |
52 | + } | |
53 | + else | |
54 | + { | |
55 | + FaultReset = 0; | |
56 | + } | |
57 | + Chk_Botton_pre = Chk_Botton; | |
58 | + | |
59 | + | |
60 | +} | |
61 | + |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/RunStopSeq.cpp
... | ... | @@ -0,0 +1,139 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : RunStopSeq.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu1DeviceDefine.h" | |
11 | + | |
12 | +int InvReady = 0; | |
13 | +int BoostReady = 0; | |
14 | +int DabReady = 0; | |
15 | + | |
16 | +int FlagGridConnectedOperation = 0; //계통 연계 운전 플래그 | |
17 | +int FlagIsolatedOperation = 0; //자립 운전 플래그 | |
18 | +int FlagSoftStart = 0; //자립 운전 시 DAB 소프트 스타트 플래그 | |
19 | + | |
20 | +unsigned int SetBuilupTime = 1000; //2s초 기다림 | |
21 | +unsigned int InvCntBuilupTime = 0; //인버터 빌드업 시간 | |
22 | +unsigned int DabCntBuilupTime = 0; //DAB 빌드업 시간 | |
23 | + | |
24 | + | |
25 | +void RunStopSeq() //2ms | |
26 | +{ | |
27 | + | |
28 | +} | |
29 | + | |
30 | +// RefLimit(); //Vbe 레퍼런스 리미트 및 DC-Link 레퍼런스 리미트 | |
31 | +// | |
32 | +// if ((SystemFault == 0) && (SystemReady == 1)) | |
33 | +// { | |
34 | +// // Inverter | |
35 | +// if ((CmdInvOPset == 55) && (FlagDcLinkDischarge == 0)) // 통신 또는 외부에서 인버터 동작명령 커맨드 입력, 방전시퀀스중에 기동 시작하면 컨버터 이상동작 야기함 | |
36 | +// { | |
37 | +// FlagAcPreCharge = 1; //초충 동작 명령 | |
38 | +// if (StatusAcPreCharge == 1) CmdRunInv = 1; //초충 완료 후 인버터 동작시작 | |
39 | +// | |
40 | +// if((CmdBeOPset == 99)&& (CmdRunInv == 1)) | |
41 | +// { | |
42 | +// if ((++CntBuilupTime > SetBuilupTime) && (VdcAvg > VdcRefSet - 10.)) | |
43 | +// { | |
44 | +// CmdBeOPset = 55; | |
45 | +// } | |
46 | +// } | |
47 | +// else CntBuilupTime = 0; | |
48 | +// } | |
49 | +// else | |
50 | +// { | |
51 | +// CmdRunInv = 0; | |
52 | +// CmdInvOPset = 99; | |
53 | +// //BE 먼저 종료 후 인버터 종료 하도록 시퀀스 고칠 것 | |
54 | +// CmdBeOPset = 99; // inverter 종료시 Be도 같이 종료 되도록 변경 | |
55 | +// CntBuilupTime = 0; | |
56 | +// InitAcMMC(); | |
57 | +// } | |
58 | +// | |
59 | +// //BE(Converter) | |
60 | +// if (CmdBeOPset == 55) | |
61 | +// { | |
62 | +// //임시 위치 | |
63 | +// //Be동작시 방전저항 off | |
64 | +// BeDischargeRlyoOff(); | |
65 | +// //todo 방전 릴레이 동작시간 반영해서 대기 카운터 들어가야함 | |
66 | +// if((Status.bit.ParallelMode == 1) && (Status.bit.VbeParaMode == 1))//병렬운전시 Master,Slave 모두 Inverter 빌드업 완료된거 확인 후 컨버터 기동 | |
67 | +// { | |
68 | +// if(FlagParaInvBuilup == 1) CmdRunBe = 1; | |
69 | +// } | |
70 | +// else | |
71 | +// { | |
72 | +// CmdRunBe = 1; | |
73 | +// } | |
74 | +// } | |
75 | +// else | |
76 | +// { | |
77 | +// if((Status.bit.Master != 1) && (Status.bit.ParallelMode == 1)) | |
78 | +// { | |
79 | +// BeDischargeRlyoOff(); | |
80 | +// | |
81 | +// CmdRunBe = 0; | |
82 | +// CmdBeOPset = 99; | |
83 | +// } | |
84 | +// else | |
85 | +// { | |
86 | +// BeDischargeRlyoOn(); | |
87 | +// if ((Din.Data.bit.Mmc == 0) && (CmdInvOPset ==99) && (CmdRunBe == 1)) | |
88 | +// { | |
89 | +// //Dc-Link Discharging wait | |
90 | +// if(CH3_UV_Flt > 50.) | |
91 | +// { | |
92 | +// //------------------------------- | |
93 | +// //DC-Link 방전을 위해 Be게이트를 유지 | |
94 | +// //임시코드 수정 할 것 | |
95 | +// FlagDcLinkDischarge = 1; | |
96 | +// } | |
97 | +// else | |
98 | +// { | |
99 | +// //임시코드 수정 할 것 | |
100 | +// FlagDcLinkDischarge = 0; | |
101 | +// //------------------------------- | |
102 | +// CmdRunBe = 0; | |
103 | +// CmdBeOPset = 99; | |
104 | +// } | |
105 | +// } | |
106 | +// } | |
107 | +// } | |
108 | +// } | |
109 | +// else | |
110 | +// { | |
111 | +// if((Status.bit.Master != 1) && (Status.bit.ParallelMode == 1)) BeDischargeRlyoOff(); | |
112 | +// else BeDischargeRlyoOn(); | |
113 | +// } | |
114 | + | |
115 | + | |
116 | + | |
117 | +void RefLimit() //10ms.. | |
118 | +{ | |
119 | +// if((Status.bit.ParallelMode == 1) && (Status.bit.VbeParaMode == 1)) | |
120 | +// { | |
121 | +// if(VbeParaRefSet > VbeMax ) VbeParaRefSet = VbeMax; | |
122 | +// else if (VbeParaRefSet < VbeMin ) VbeParaRef = VbeMin; | |
123 | +// | |
124 | +// VdcRefSet = VbeParaRefSet * 1.1; | |
125 | +// } | |
126 | +// else | |
127 | +// { | |
128 | +// if(VbeRefSet > VbeMax ) VbeRefSet = VbeMax; | |
129 | +// else if (VbeRefSet < VbeMin ) VbeRef = VbeMin; | |
130 | +// | |
131 | +// VdcRefSet = VbeRefSet * 1.1; | |
132 | +// } | |
133 | +// | |
134 | +// if(VdcRefSet > VdcMax ) VdcRefSet = VdcMax; | |
135 | +// else if(VdcRefSet < VdcMin ) VdcRefSet = VdcMin; | |
136 | +} | |
137 | + | |
138 | + | |
139 | + |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/SelectCPU.cpp
... | ... | @@ -0,0 +1,122 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : SelectCPU.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu1DeviceDefine.h" | |
11 | + | |
12 | +void SetCPU2ForPeripheral() | |
13 | +{ | |
14 | + InitSciGpio(); | |
15 | +// SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_SCIB, SYSCTL_CPUSEL_CPU2); | |
16 | +// SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_SCIC, SYSCTL_CPUSEL_CPU2); | |
17 | +// SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_SCID, SYSCTL_CPUSEL_CPU2); | |
18 | + | |
19 | + SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_SCIB, SYSCTL_CPUSEL_CPU1); | |
20 | + SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_SCIC, SYSCTL_CPUSEL_CPU1); | |
21 | + SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_SCID, SYSCTL_CPUSEL_CPU1); | |
22 | + | |
23 | + InitCanGpio(); | |
24 | +// SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_CANA, SYSCTL_CPUSEL_CPU2); | |
25 | +// SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_CANB, SYSCTL_CPUSEL_CPU2); | |
26 | + | |
27 | + SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_CANA, SYSCTL_CPUSEL_CPU1); | |
28 | + SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_CANB, SYSCTL_CPUSEL_CPU1); | |
29 | + | |
30 | + SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_ADCA, SYSCTL_CPUSEL_CPU1); | |
31 | + SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_ADCB, SYSCTL_CPUSEL_CPU1); | |
32 | + SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_ADCC, SYSCTL_CPUSEL_CPU1); | |
33 | + SysCtl_selectCPUForPeripheralInstance(SYSCTL_CPUSEL_ADCD, SYSCTL_CPUSEL_CPU1); | |
34 | + | |
35 | + | |
36 | + | |
37 | +} | |
38 | + | |
39 | +void SetCPU2ForGsRam() | |
40 | +{ | |
41 | +// MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS7, MEMCFG_GSRAMMASTER_CPU2); | |
42 | +// MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS8, MEMCFG_GSRAMMASTER_CPU2); | |
43 | +// MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS9, MEMCFG_GSRAMMASTER_CPU2); | |
44 | +// MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS10, MEMCFG_GSRAMMASTER_CPU2); | |
45 | +// MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS11, MEMCFG_GSRAMMASTER_CPU2); | |
46 | +// MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS12, MEMCFG_GSRAMMASTER_CPU2); | |
47 | +// MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS13, MEMCFG_GSRAMMASTER_CPU2); | |
48 | + | |
49 | + MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS7, MEMCFG_GSRAMMASTER_CPU1); | |
50 | + MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS8, MEMCFG_GSRAMMASTER_CPU1); | |
51 | + MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS9, MEMCFG_GSRAMMASTER_CPU1); | |
52 | + MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS10, MEMCFG_GSRAMMASTER_CPU1); | |
53 | + MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS11, MEMCFG_GSRAMMASTER_CPU1); | |
54 | + MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS12, MEMCFG_GSRAMMASTER_CPU1); | |
55 | + MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS13, MEMCFG_GSRAMMASTER_CPU1); | |
56 | + | |
57 | +} | |
58 | + | |
59 | + | |
60 | + | |
61 | +void InitCanGpio() | |
62 | +{ | |
63 | + | |
64 | + EALLOW; | |
65 | + | |
66 | + GPIO_setMasterCore(18, GPIO_CORE_CPU2); | |
67 | + GPIO_setMasterCore(19, GPIO_CORE_CPU2); | |
68 | + | |
69 | + GPIO_setPinConfig(GPIO_18_CANRXA); | |
70 | + GPIO_setPinConfig(GPIO_19_CANTXA); | |
71 | + | |
72 | + GPIO_setMasterCore(21, GPIO_CORE_CPU2); | |
73 | + GPIO_setMasterCore(20, GPIO_CORE_CPU2); | |
74 | + | |
75 | + GPIO_setPinConfig(GPIO_21_CANRXB); | |
76 | + GPIO_setPinConfig(GPIO_20_CANTXB); | |
77 | + | |
78 | + EDIS; | |
79 | +} | |
80 | + | |
81 | +void InitSciGpio() | |
82 | +{ | |
83 | + //SCIB | |
84 | + GPIO_setMasterCore(71, GPIO_CORE_CPU2); | |
85 | + GPIO_setPinConfig(GPIO_71_SCIRXDB); | |
86 | + GPIO_setDirectionMode(71, GPIO_DIR_MODE_IN); | |
87 | + GPIO_setPadConfig(71, GPIO_PIN_TYPE_PULLUP); | |
88 | + GPIO_setQualificationMode(71, GPIO_QUAL_ASYNC); | |
89 | + | |
90 | + GPIO_setMasterCore(70, GPIO_CORE_CPU2); | |
91 | + GPIO_setPinConfig(GPIO_70_SCITXDB); | |
92 | + GPIO_setDirectionMode(70, GPIO_DIR_MODE_OUT); | |
93 | + GPIO_setPadConfig(70, GPIO_PIN_TYPE_STD); | |
94 | + GPIO_setQualificationMode(70, GPIO_QUAL_ASYNC); | |
95 | + | |
96 | + //SCIC | |
97 | + GPIO_setMasterCore(139, GPIO_CORE_CPU2); | |
98 | + GPIO_setPinConfig(GPIO_139_SCIRXDC); | |
99 | + GPIO_setDirectionMode(139, GPIO_DIR_MODE_IN); | |
100 | + GPIO_setPadConfig(139, GPIO_PIN_TYPE_PULLUP); | |
101 | + GPIO_setQualificationMode(139, GPIO_QUAL_ASYNC); | |
102 | + | |
103 | + GPIO_setMasterCore(140, GPIO_CORE_CPU2); | |
104 | + GPIO_setPinConfig(GPIO_140_SCITXDC); | |
105 | + GPIO_setDirectionMode(140, GPIO_DIR_MODE_OUT); | |
106 | + GPIO_setPadConfig(140, GPIO_PIN_TYPE_STD); | |
107 | + GPIO_setQualificationMode(140, GPIO_QUAL_ASYNC); | |
108 | + | |
109 | + //SCID | |
110 | + GPIO_setMasterCore(105, GPIO_CORE_CPU2); | |
111 | + GPIO_setPinConfig(GPIO_105_SCIRXDD); | |
112 | + GPIO_setDirectionMode(105, GPIO_DIR_MODE_IN); | |
113 | + GPIO_setPadConfig(105, GPIO_PIN_TYPE_PULLUP); | |
114 | + GPIO_setQualificationMode(105, GPIO_QUAL_ASYNC); | |
115 | + | |
116 | + GPIO_setMasterCore(104, GPIO_CORE_CPU2); | |
117 | + GPIO_setPinConfig(GPIO_104_SCITXDD); | |
118 | + GPIO_setDirectionMode(104, GPIO_DIR_MODE_OUT); | |
119 | + GPIO_setPadConfig(104, GPIO_PIN_TYPE_STD); | |
120 | + GPIO_setQualificationMode(104, GPIO_QUAL_ASYNC); | |
121 | + | |
122 | +} |
+++ ArcCTRL-23-NEXTSQ-CPU1/Main_Resource/source/SoftStart.cpp
... | ... | @@ -0,0 +1,53 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : SoftStart.cpp | |
4 | +// Created on : 2023. 09. 22. | |
5 | +// Description : | |
6 | +// Author : KwonJeongMin | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu1DeviceDefine.h" | |
11 | + | |
12 | +struct sRampGen SoftStartCtrlRamp; | |
13 | +float DelSoftStartCtrl = 0.1; | |
14 | +float SoftStartCtrl = 0.97; | |
15 | +float SoftStartDuty = 0.97; | |
16 | + | |
17 | +void InitSoftStart(void) | |
18 | +{ | |
19 | + SoftStartCtrlRamp.Init(&SoftStartCtrl, &DelSoftStartCtrl, Tsamp); | |
20 | + SoftStartCtrlRamp.UpdateSlope(); | |
21 | + SoftStartCtrlRamp.out = 0.97; | |
22 | +} | |
23 | + | |
24 | +void SoftStartReset(void) | |
25 | +{ | |
26 | + SoftStartCtrlRamp.Reset(); | |
27 | +} | |
28 | + | |
29 | +void SoftStart(void) | |
30 | +{ | |
31 | +// SoftStartCtrl = LIMITER(SoftStartCtrl , 0.97 , 0.5); | |
32 | +// SoftStartDuty = SoftStartCtrlRamp.Run(); | |
33 | +// SoftStartDuty = LIMITER(SoftStartDuty , 0.97 , 0.5); | |
34 | +// | |
35 | +// //LV Side | |
36 | +// EPwm2Regs.CMPA.bit.CMPA = DabPwmPrd * SoftStartDuty; | |
37 | +// EPwm2Regs.CMPB.bit.CMPB = DabPwmPrd - EPwm2Regs.CMPA.bit.CMPA; | |
38 | +// EPwm3Regs.CMPA.bit.CMPA = DabPwmPrd * (1 - SoftStartDuty); | |
39 | +// EPwm3Regs.CMPB.bit.CMPB = DabPwmPrd - EPwm3Regs.CMPA.bit.CMPA; | |
40 | +// | |
41 | +// //HV Side | |
42 | +// EPwm4Regs.CMPA.bit.CMPA = DabPwmPrd * SoftStartDuty; | |
43 | +// EPwm4Regs.CMPB.bit.CMPB = DabPwmPrd - EPwm4Regs.CMPA.bit.CMPA; | |
44 | +// EPwm5Regs.CMPA.bit.CMPA = DabPwmPrd * (1 - SoftStartDuty); | |
45 | +// EPwm5Regs.CMPB.bit.CMPB = DabPwmPrd - EPwm5Regs.CMPA.bit.CMPA; | |
46 | +// | |
47 | +// //Phase Shift | |
48 | +// EPwm2Regs.TBPHS.bit.TBPHS = 0; //Set Phase Shift = 0 | |
49 | +// EPwm3Regs.TBPHS.bit.TBPHS = 0; //Set Phase Shift = 0 | |
50 | +// EPwm4Regs.TBPHS.bit.TBPHS = TdabPhCnt; //Set Phase Shift = DAB Phase Shift Count | |
51 | +// EPwm5Regs.TBPHS.bit.TBPHS = TdabPhCnt; //Set Phase Shift = DAB Phase Shift Count | |
52 | + | |
53 | +} |
+++ ArcCTRL-23-NEXTSQ-CPU1/V2H_2837xD_FLASH_lnk_cpu1.cmd
... | ... | @@ -0,0 +1,192 @@ |
1 | +MEMORY | |
2 | +{ | |
3 | +PAGE 0 : /* Program Memory */ | |
4 | + /* Memory (RAM/FLASH) blocks can be moved to PAGE1 for data allocation */ | |
5 | + /* BEGIN is used for the "boot to Flash" bootloader mode */ | |
6 | + | |
7 | + BEGIN : origin = 0x080000, length = 0x000002 | |
8 | + | |
9 | + RAMLS012 : origin = 0x008000, length = 0x001800 | |
10 | +// RAMLS1 : origin = 0x008800, length = 0x000800 | |
11 | +// RAMLS2 : origin = 0x009000, length = 0x000800 | |
12 | + | |
13 | + RAMGS14 : origin = 0x01A000, length = 0x001000 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */ | |
14 | + RAMGS15 : origin = 0x01B000, length = 0x000FF8 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */ | |
15 | + | |
16 | +// RAMGS15_RSVD : origin = 0x01BFF8, length = 0x000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */ | |
17 | + | |
18 | + RESET : origin = 0x3FFFC0, length = 0x000002 | |
19 | + | |
20 | + /* Flash sectors */ | |
21 | + FLASHA : origin = 0x080002, length = 0x001FFE /* on-chip Flash */ | |
22 | + FLASHB : origin = 0x082000, length = 0x002000 /* on-chip Flash */ | |
23 | + FLASHC : origin = 0x084000, length = 0x002000 /* on-chip Flash */ | |
24 | + FLASHD : origin = 0x086000, length = 0x002000 /* on-chip Flash */ | |
25 | + FLASHE : origin = 0x088000, length = 0x008000 /* on-chip Flash */ | |
26 | + FLASHF : origin = 0x090000, length = 0x008000 /* on-chip Flash */ | |
27 | + FLASHG : origin = 0x098000, length = 0x008000 /* on-chip Flash */ | |
28 | + FLASHH : origin = 0x0A0000, length = 0x008000 /* on-chip Flash */ | |
29 | + FLASHI : origin = 0x0A8000, length = 0x008000 /* on-chip Flash */ | |
30 | + FLASHJ : origin = 0x0B0000, length = 0x008000 /* on-chip Flash */ | |
31 | + FLASHK : origin = 0x0B8000, length = 0x002000 /* on-chip Flash */ | |
32 | + FLASHL : origin = 0x0BA000, length = 0x002000 /* on-chip Flash */ | |
33 | + FLASHM : origin = 0x0BC000, length = 0x002000 /* on-chip Flash */ | |
34 | + | |
35 | +// FLASHN_RSVD : origin = 0x0BFFF0, length = 0x000010 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */ | |
36 | + | |
37 | +PAGE 1 : /* Data Memory */ | |
38 | + /* Memory (RAM/FLASH) blocks can be moved to PAGE0 for program allocation */ | |
39 | + | |
40 | + BOOT_RSVD : origin = 0x000002, length = 0x000121 /* Part of M0, BOOT rom will use this for stack */ | |
41 | + | |
42 | + | |
43 | + RAMM0 : origin = 0x000123, length = 0x0002DD | |
44 | + RAMM1 : origin = 0x000400, length = 0x0003F8 /* on-chip RAM block M1 */ | |
45 | +// RAMM1_RSVD : origin = 0x0007F8, length = 0x000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */ | |
46 | + | |
47 | + RAMD0 : origin = 0x00B000, length = 0x000800 | |
48 | + RAMD1 : origin = 0x00B800, length = 0x000800 | |
49 | + | |
50 | + RAMLS3 : origin = 0x009800, length = 0x000800 | |
51 | + RAMLS4 : origin = 0x00A000, length = 0x000800 | |
52 | + RAMLS5 : origin = 0x00A800, length = 0x000800 | |
53 | + | |
54 | + RAMGS0 : origin = 0x00C000, length = 0x001000 | |
55 | + RAMGS1 : origin = 0x00D000, length = 0x001000 | |
56 | + RAMGS2 : origin = 0x00E000, length = 0x001000 | |
57 | + RAMGS345 : origin = 0x00F000, length = 0x003000 | |
58 | +// RAMGS4 : origin = 0x010000, length = 0x001000 | |
59 | +// RAMGS5 : origin = 0x011000, length = 0x001000 | |
60 | + RAMGS6 : origin = 0x012000, length = 0x001000 | |
61 | + | |
62 | + //CPU2 | |
63 | + RAMGS7 : origin = 0x013000, length = 0x001000 | |
64 | + RAMGS8 : origin = 0x014000, length = 0x001000 | |
65 | + RAMGS9 : origin = 0x015000, length = 0x001000 | |
66 | + RAMGS10 : origin = 0x016000, length = 0x001000 | |
67 | + RAMGS11 : origin = 0x017000, length = 0x001000 | |
68 | + RAMGS12 : origin = 0x018000, length = 0x001000 | |
69 | + RAMGS13 : origin = 0x019000, length = 0x001000 | |
70 | + | |
71 | + CPU2TOCPU1RAM : origin = 0x03F800, length = 0x000400 | |
72 | + CPU1TOCPU2RAM : origin = 0x03FC00, length = 0x000400 | |
73 | + | |
74 | + FLASHN : origin = 0x0BE000, length = 0x001FF0 /* on-chip Flash */ | |
75 | + | |
76 | + | |
77 | +} | |
78 | + | |
79 | +SECTIONS | |
80 | +{ | |
81 | + /* Allocate program areas: */ | |
82 | + .cinit : > FLASHB PAGE = 0, ALIGN(8) | |
83 | + .pinit : > FLASHB, PAGE = 0, ALIGN(8) | |
84 | + .text : >> FLASHB | FLASHC | FLASHD | FLASHE PAGE = 0, ALIGN(8) | |
85 | + codestart : > BEGIN PAGE = 0, ALIGN(8) | |
86 | + | |
87 | + /* Allocate uninitalized data sections: */ | |
88 | + .stack : > RAMM1 PAGE = 1 | |
89 | + .ebss : >> RAMLS3 | RAMLS4 | RAMLS5 , PAGE = 1 | |
90 | + .esysmem : > RAMLS5, PAGE = 1 | |
91 | + .cio : > RAMLS5, PAGE = 1 | |
92 | + | |
93 | + /* Initalized sections go in Flash */ | |
94 | + .econst : >> FLASHF PAGE = 0, ALIGN(8) | |
95 | + .switch : > FLASHB PAGE = 0, ALIGN(8) | |
96 | + .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */ | |
97 | + | |
98 | + | |
99 | + .TI.ramfunc : {} LOAD = FLASHD, | |
100 | + RUN = RAMLS012, | |
101 | + LOAD_START(_RamfuncsLoadStart), | |
102 | + LOAD_SIZE(_RamfuncsLoadSize), | |
103 | + LOAD_END(_RamfuncsLoadEnd), | |
104 | + RUN_START(_RamfuncsRunStart), | |
105 | + RUN_SIZE(_RamfuncsRunSize), | |
106 | + RUN_END(_RamfuncsRunEnd), | |
107 | + PAGE = 0, ALIGN(8) | |
108 | + | |
109 | + FPUmathTables : {} LOAD = FLASHN, | |
110 | + RUN = RAMD0, | |
111 | + RUN_START(_FPUmathTablesRunStart), | |
112 | + LOAD_START(_FPUmathTablesLoadStart), | |
113 | + LOAD_SIZE(_FPUmathTablesLoadSize), | |
114 | + PAGE = 1, ALIGN(8) | |
115 | + | |
116 | + | |
117 | + | |
118 | + | |
119 | + MSGRAM_CPU1_TO_CPU2 : > CPU1TOCPU2RAM, PAGE = 1 | |
120 | + MSGRAM_CPU2_TO_CPU1 : > CPU2TOCPU1RAM, PAGE = 1 | |
121 | + | |
122 | +// DMARAM1 : > RAMGS5, PAGE = 1 | |
123 | +// DMARAM2 : > RAMGS5, PAGE = 1 | |
124 | +// DMARAM3 : > RAMGS5, PAGE = 1 | |
125 | +// DMARAM4 : > RAMGS5, PAGE = 1 | |
126 | + | |
127 | + //-------------------------------------------------------------// | |
128 | + //only Cpu1 can access | |
129 | + .CpuInfo : > RAMLS5, PAGE = 1 | |
130 | + .TimeSharing : > RAMLS5, PAGE = 1 | |
131 | + //-------------------------------------------------------------// | |
132 | + | |
133 | + //CPU1 Access Only Memory | |
134 | + .DigitalFilter : > RAMLS3, PAGE = 1 | |
135 | + .Relay : > RAMLS3, PAGE = 1 | |
136 | + .OffsetProcess : > RAMLS3, PAGE = 1 | |
137 | + .Pll : > RAMLS3, PAGE = 1 | |
138 | + .RunStopSeq : > RAMLS3, PAGE = 1 | |
139 | + .FaultProcess : > RAMLS3, PAGE = 1 | |
140 | + .IinvCtrl : > RAMLS4, PAGE = 1 | |
141 | + .IinvHarResCtrl : > RAMLS4, PAGE = 1 | |
142 | + .VdcCtrl : > RAMLS4, PAGE = 1 | |
143 | + .IbatCtrl : > RAMLS4, PAGE = 1 | |
144 | + .VbatCtrl : > RAMLS4, PAGE = 1 | |
145 | + .VdabCtrl : > RAMLS4, PAGE = 1 | |
146 | + .VboostCtrl : > RAMLS4, PAGE = 1 | |
147 | + .IdabCtrl : > RAMLS4, PAGE = 1 | |
148 | + .SoftStart : > RAMLS4, PAGE = 1 | |
149 | + | |
150 | + //Temp | |
151 | + .Trace : > RAMGS345, PAGE = 1 | |
152 | + | |
153 | + //CPU1 RW, CPU2 R Memory | |
154 | + .AdcLib : > RAMGS6, PAGE = 1 | |
155 | + .SystemVar : > RAMGS6, PAGE = 1 | |
156 | + .Fault : > RAMGS6, PAGE = 1 | |
157 | + .Scale : > RAMGS6, PAGE = 1 | |
158 | + .Status : > RAMGS6, PAGE = 1 | |
159 | + .IntTemp : > RAMGS6, PAGE = 1 | |
160 | + .ModbusData : > RAMGS6, PAGE = 1 | |
161 | + | |
162 | + //CPU2 RW, CPU1 R Memory | |
163 | + .RmsAvg : > RAMGS13, PAGE = 1 | |
164 | + .TempData : > RAMGS13, PAGE = 1 | |
165 | + .CanLib : > RAMGS13, PAGE = 1 | |
166 | + .CanCHAData : > RAMGS13, PAGE = 1 | |
167 | + .Modbus : > RAMGS13, PAGE = 1 | |
168 | + | |
169 | + | |
170 | +//-------------------------------------------------------------// | |
171 | + /* The following section definitions are required when using the IPC API Drivers */ | |
172 | + GROUP : > CPU1TOCPU2RAM, PAGE = 1 | |
173 | + { | |
174 | + PUTBUFFER | |
175 | + PUTWRITEIDX | |
176 | + GETREADIDX | |
177 | + } | |
178 | + | |
179 | + GROUP : > CPU2TOCPU1RAM, PAGE = 1 | |
180 | + { | |
181 | + GETBUFFER : TYPE = DSECT | |
182 | + GETWRITEIDX : TYPE = DSECT | |
183 | + PUTREADIDX : TYPE = DSECT | |
184 | + } | |
185 | + | |
186 | +} | |
187 | + | |
188 | +/* | |
189 | +//=========================================================================== | |
190 | +// End of file. | |
191 | +//=========================================================================== | |
192 | +*/ |
+++ ArcCTRL-23-NEXTSQ-CPU1/targetConfigs/TMS320F28377D.ccxml
... | ... | @@ -0,0 +1,22 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | +<configurations XML_version="1.2" id="configurations_0"> | |
3 | + <configuration XML_version="1.2" id="configuration_0"> | |
4 | + <instance XML_version="1.2" desc="Spectrum Digital XDS560V2 STM USB Emulator" href="connections/SD560V2USB_Connection.xml" id="Spectrum Digital XDS560V2 STM USB Emulator" xml="SD560V2USB_Connection.xml" xmlpath="connections"/> | |
5 | + <connection XML_version="1.2" id="Spectrum Digital XDS560V2 STM USB Emulator"> | |
6 | + <instance XML_version="1.2" href="drivers/tixds560icepick_c.xml" id="drivers" xml="tixds560icepick_c.xml" xmlpath="drivers"/> | |
7 | + <instance XML_version="1.2" href="drivers/tixds560c28x.xml" id="drivers" xml="tixds560c28x.xml" xmlpath="drivers"/> | |
8 | + <instance XML_version="1.2" href="drivers/tixds560cla1.xml" id="drivers" xml="tixds560cla1.xml" xmlpath="drivers"/> | |
9 | + <instance XML_version="1.2" href="drivers/tixds560cs_child.xml" id="drivers" xml="tixds560cs_child.xml" xmlpath="drivers"/> | |
10 | + <platform XML_version="1.2" id="platform_0"> | |
11 | + <instance XML_version="1.2" desc="TMS320F28377D" href="devices/tms320f28377d.xml" id="TMS320F28377D" xml="tms320f28377d.xml" xmlpath="devices"/> | |
12 | + <device HW_revision="1" XML_version="1.2" description="" id="TMS320F28377D" partnum="TMS320F28377D"> | |
13 | + <router HW_revision="1.0" XML_version="1.2" description="ICEPick_C router" id="IcePick_C_0" isa="ICEPICK_C"> | |
14 | + <subpath id="Subpath_1"> | |
15 | + <property Type="numericfield" Value="0x11" desc="Port Number_0" id="Port Number"/> | |
16 | + </subpath> | |
17 | + </router> | |
18 | + </device> | |
19 | + </platform> | |
20 | + </connection> | |
21 | + </configuration> | |
22 | +</configurations> |
+++ ArcCTRL-23-NEXTSQ-CPU1/targetConfigs/readme.txt
... | ... | @@ -0,0 +1,9 @@ |
1 | +The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based | |
2 | +on the device and connection settings specified in your project on the Properties > General page. | |
3 | + | |
4 | +Please note that in automatic target-configuration management, changes to the project's device and/or | |
5 | +connection settings will either modify an existing or generate a new target-configuration file. Thus, | |
6 | +if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, | |
7 | +you may create your own target-configuration file for this project and manage it manually. You can | |
8 | +always switch back to automatic target-configuration management by checking the "Manage the project's | |
9 | +target-configuration automatically" checkbox on the project's Properties > General page.(파일 끝에 줄바꿈 문자 없음) |
+++ ArcCTRL-23-NEXTSQ-CPU2/.ccsproject
... | ... | @@ -0,0 +1,7 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<?ccsproject version="1.0"?> | |
3 | +<projectOptions> | |
4 | + <deviceFamily value="C2000"/> | |
5 | + <connection value="common/targetdb/connections/SD560V2USB_Connection.xml"/> | |
6 | + <isTargetManual value="false"/> | |
7 | +</projectOptions> |
+++ ArcCTRL-23-NEXTSQ-CPU2/.cproject
... | ... | @@ -0,0 +1,204 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | +<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> | |
3 | + <storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings"> | |
4 | + <cconfiguration id="com.ti.ccstudio.buildDefinitions.C2000.Debug.40640217"> | |
5 | + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.C2000.Debug.40640217" moduleId="org.eclipse.cdt.core.settings" name="Debug"> | |
6 | + <externalSettings/> | |
7 | + <extensions> | |
8 | + <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> | |
9 | + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
10 | + <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
11 | + <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
12 | + <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
13 | + </extensions> | |
14 | + </storageModule> | |
15 | + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> | |
16 | + <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.C2000.Debug.40640217" name="Debug" parent="com.ti.ccstudio.buildDefinitions.C2000.Debug" postbuildStep="copy /Y "${PROJECT_BUILD_DIR}/${BuildArtifactFileName}" "${PROJECT_LOC}/../EZDSP/${BuildArtifactFileName}""> | |
17 | + <folderInfo id="com.ti.ccstudio.buildDefinitions.C2000.Debug.40640217." name="/" resourcePath=""> | |
18 | + <toolChain id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.DebugToolchain.1143441677" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerDebug.2064713584"> | |
19 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1839937161" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> | |
20 | + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=TMS320C28XX.TMS320F28377D"/> | |
21 | + <listOptionValue builtIn="false" value="DEVICE_CORE_ID=C28xx_CPU2"/> | |
22 | + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> | |
23 | + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=COFF"/> | |
24 | + <listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=F2837xD_Headers_nonBIOS_cpu2.cmd"/> | |
25 | + <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> | |
26 | + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> | |
27 | + <listOptionValue builtIn="false" value="PRODUCTS="/> | |
28 | + <listOptionValue builtIn="false" value="PRODUCT_MACRO_IMPORTS={}"/> | |
29 | + <listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> | |
30 | + </option> | |
31 | + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1540557857" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="22.6.0.LTS" valueType="string"/> | |
32 | + <targetPlatform id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.targetPlatformDebug.211691324" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.targetPlatformDebug"/> | |
33 | + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.builderDebug.1444356423" name="GNU Make.Debug" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.builderDebug"/> | |
34 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.compilerDebug.727677918" name="C2000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.compilerDebug"> | |
35 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.LARGE_MEMORY_MODEL.59899879" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.LARGE_MEMORY_MODEL" value="true" valueType="boolean"/> | |
36 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.UNIFIED_MEMORY.1507876956" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.UNIFIED_MEMORY" value="true" valueType="boolean"/> | |
37 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION.1608968040" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION.28" valueType="enumerated"/> | |
38 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT.428377321" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT.fpu32" valueType="enumerated"/> | |
39 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT.1697901468" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT.cla1" valueType="enumerated"/> | |
40 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT.1715588768" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT.vcu2" valueType="enumerated"/> | |
41 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT.177671082" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT.tmu0" valueType="enumerated"/> | |
42 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL.1121849515" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL.3" valueType="enumerated"/> | |
43 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_FOR_SPEED.1585490801" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_FOR_SPEED.5" valueType="enumerated"/> | |
44 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FP_MODE.1103677717" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FP_MODE" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FP_MODE.relaxed" valueType="enumerated"/> | |
45 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH.1508630086" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH" valueType="includePath"> | |
46 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/> | |
47 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/driverlib/f2837xd/driverlib"/> | |
48 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/f2837xd/headers/include"/> | |
49 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/f2837xd/common/include"/> | |
50 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/device"/> | |
51 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../TI_Lib/FPU/include/fpu32"/> | |
52 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../Common_Resource/EasyDSP_Resource"/> | |
53 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../Common_Resource/CodeLibrary"/> | |
54 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/../Common_Resource/CommonLibrary"/> | |
55 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/Main_Resource/include"/> | |
56 | + <listOptionValue builtIn="false" value="${PROJECT_LOC}/Main_Resource"/> | |
57 | + </option> | |
58 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ADVICE__PERFORMANCE.1727457851" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ADVICE__PERFORMANCE" value="--advice:performance=all" valueType="string"/> | |
59 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEFINE.1890249299" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEFINE" valueType="definedSymbols"> | |
60 | + <listOptionValue builtIn="false" value="CPU2"/> | |
61 | + <listOptionValue builtIn="false" value="_FLASH"/> | |
62 | + <listOptionValue builtIn="false" value="__cplusplus"/> | |
63 | + </option> | |
64 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEBUGGING_MODEL.887706077" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/> | |
65 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SYMDEBUG__DWARF_VERSION.1273774800" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SYMDEBUG__DWARF_VERSION" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SYMDEBUG__DWARF_VERSION.3" valueType="enumerated"/> | |
66 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.RTTI.767512877" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.RTTI" value="true" valueType="boolean"/> | |
67 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CPP_DEFAULT.244612587" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CPP_DEFAULT" value="true" valueType="boolean"/> | |
68 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WARNING.1925879985" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WARNING" valueType="stringList"> | |
69 | + <listOptionValue builtIn="false" value="225"/> | |
70 | + </option> | |
71 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP.126192845" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP.off" valueType="enumerated"/> | |
72 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DISPLAY_ERROR_NUMBER.1777509326" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> | |
73 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI.1048763158" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI.coffabi" valueType="enumerated"/> | |
74 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS.159780094" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS"/> | |
75 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS.842955348" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS"/> | |
76 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS.1541911441" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS"/> | |
77 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM2_SRCS.1077680376" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM2_SRCS"/> | |
78 | + </tool> | |
79 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerDebug.2064713584" name="C2000 Linker" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerDebug"> | |
80 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.STACK_SIZE.2010028087" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.STACK_SIZE" value="0x200" valueType="string"/> | |
81 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.MAP_FILE.814319255" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.MAP_FILE" value="${ProjName}.map" valueType="string"/> | |
82 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.OUTPUT_FILE.1783949414" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/> | |
83 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.LIBRARY.2078584514" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.LIBRARY" valueType="libs"> | |
84 | + <listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/TI/FPUfastRTS/c28/lib/rts2800_fpu32_fast_supplement.lib}"/> | |
85 | + <listOptionValue builtIn="false" value="libc.a"/> | |
86 | + </option> | |
87 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.SEARCH_PATH.1483081268" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.SEARCH_PATH" valueType="libPaths"> | |
88 | + <listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/TI/FPUfastRTS/c28/lib}"/> | |
89 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/lib"/> | |
90 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/> | |
91 | + </option> | |
92 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DIAG_WRAP.224120188" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DIAG_WRAP.off" valueType="enumerated"/> | |
93 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DISPLAY_ERROR_NUMBER.395356368" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> | |
94 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.XML_LINK_INFO.1124132539" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.XML_LINK_INFO" value="${ProjName}_linkInfo.xml" valueType="string"/> | |
95 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD_SRCS.1849615755" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD_SRCS"/> | |
96 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD2_SRCS.1043900197" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD2_SRCS"/> | |
97 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__GEN_CMDS.21771115" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__GEN_CMDS"/> | |
98 | + </tool> | |
99 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.387915150" name="C2000 Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex"/> | |
100 | + </toolChain> | |
101 | + </folderInfo> | |
102 | + <fileInfo id="com.ti.ccstudio.buildDefinitions.C2000.Debug.40640217.Main_Resource/source/Cpu2Main.cpp" name="Cpu2Main.cpp" rcbsApplicability="disable" resourcePath="Main_Resource/source/Cpu2Main.cpp" toolsToInvoke="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.compilerDebug.727677918.760341923"> | |
103 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.compilerDebug.727677918.760341923" name="C2000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.compilerDebug.727677918"/> | |
104 | + <tool customBuildStep="true" id="org.eclipse.cdt.managedbuilder.ui.rcbs.1833417928.1101490968.105234686.301313997.811193973.1761959306.151812951" name="Resource Custom Build Step"> | |
105 | + <inputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype.416123549.435376715.826754683.821987797.1127862613.1756930646.1295644129" name="Resource Custom Build Step Input Type"> | |
106 | + <additionalInput kind="additionalinputdependency" paths=""/> | |
107 | + </inputType> | |
108 | + <outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.936650266.45390955.1438371312.1975862918.497411262.312186433.1677727701" name="Resource Custom Build Step Output Type"/> | |
109 | + </tool> | |
110 | + </fileInfo> | |
111 | + <sourceEntries> | |
112 | + <entry excluding="TI_Lib/driverlib/f2837xd/driverlib/ccs" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> | |
113 | + </sourceEntries> | |
114 | + </configuration> | |
115 | + </storageModule> | |
116 | + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> | |
117 | + </cconfiguration> | |
118 | + <cconfiguration id="com.ti.ccstudio.buildDefinitions.C2000.Release.1697767616"> | |
119 | + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.C2000.Release.1697767616" moduleId="org.eclipse.cdt.core.settings" name="Release"> | |
120 | + <externalSettings/> | |
121 | + <extensions> | |
122 | + <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> | |
123 | + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
124 | + <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
125 | + <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
126 | + <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
127 | + </extensions> | |
128 | + </storageModule> | |
129 | + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> | |
130 | + <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.C2000.Release.1697767616" name="Release" parent="com.ti.ccstudio.buildDefinitions.C2000.Release"> | |
131 | + <folderInfo id="com.ti.ccstudio.buildDefinitions.C2000.Release.1697767616." name="/" resourcePath=""> | |
132 | + <toolChain id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.ReleaseToolchain.1688958494" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerRelease.1584441070"> | |
133 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.134772882" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> | |
134 | + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=TMS320C28XX.TMS320F28377D"/> | |
135 | + <listOptionValue builtIn="false" value="DEVICE_CORE_ID="/> | |
136 | + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> | |
137 | + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=COFF"/> | |
138 | + <listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=2837x_FLASH_lnk_cpu1.cmd"/> | |
139 | + <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> | |
140 | + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> | |
141 | + <listOptionValue builtIn="false" value="PRODUCTS="/> | |
142 | + <listOptionValue builtIn="false" value="PRODUCT_MACRO_IMPORTS={}"/> | |
143 | + <listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> | |
144 | + </option> | |
145 | + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.373449968" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="22.6.0.LTS" valueType="string"/> | |
146 | + <targetPlatform id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.targetPlatformRelease.1428857151" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.targetPlatformRelease"/> | |
147 | + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.builderRelease.863083292" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.builderRelease"/> | |
148 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.compilerRelease.724051636" name="C2000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.compilerRelease"> | |
149 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.LARGE_MEMORY_MODEL.1543366178" name="Option deprecated, set by default (--large_memory_model, -ml)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.LARGE_MEMORY_MODEL" useByScannerDiscovery="false" value="true" valueType="boolean"/> | |
150 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.UNIFIED_MEMORY.1296248801" name="Unified memory (--unified_memory, -mt)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.UNIFIED_MEMORY" useByScannerDiscovery="false" value="true" valueType="boolean"/> | |
151 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION.1861789692" name="Processor version (--silicon_version, -v)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION.28" valueType="enumerated"/> | |
152 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT.108414427" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT.fpu32" valueType="enumerated"/> | |
153 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT.1961906856" name="Specify CLA support (--cla_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT.cla1" valueType="enumerated"/> | |
154 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT.1024375311" name="Specify VCU support (--vcu_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT.vcu2" valueType="enumerated"/> | |
155 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT.1623167975" name="Specify TMU support (--tmu_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT.tmu0" valueType="enumerated"/> | |
156 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH.2075002669" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH" valueType="includePath"> | |
157 | + <listOptionValue builtIn="false" value="${PROJECT_ROOT}"/> | |
158 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/> | |
159 | + </option> | |
160 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WARNING.1441910157" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WARNING" useByScannerDiscovery="false" valueType="stringList"> | |
161 | + <listOptionValue builtIn="false" value="225"/> | |
162 | + </option> | |
163 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP.599761166" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP.off" valueType="enumerated"/> | |
164 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DISPLAY_ERROR_NUMBER.972069180" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/> | |
165 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI.1037324424" name="Application binary interface [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI.coffabi" valueType="enumerated"/> | |
166 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS.1913479694" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS"/> | |
167 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS.2004682278" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS"/> | |
168 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS.1700702925" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS"/> | |
169 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM2_SRCS.819451097" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM2_SRCS"/> | |
170 | + </tool> | |
171 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerRelease.1584441070" name="C2000 Linker" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerRelease"> | |
172 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.STACK_SIZE.1932410611" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.STACK_SIZE" useByScannerDiscovery="false" value="0x200" valueType="string"/> | |
173 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.MAP_FILE.529438638" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.MAP_FILE" useByScannerDiscovery="false" value="${ProjName}.map" valueType="string"/> | |
174 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.OUTPUT_FILE.330965495" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.OUTPUT_FILE" useByScannerDiscovery="false" value="${ProjName}.out" valueType="string"/> | |
175 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.LIBRARY.868756979" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.LIBRARY" useByScannerDiscovery="false" valueType="libs"> | |
176 | + <listOptionValue builtIn="false" value="libc.a"/> | |
177 | + </option> | |
178 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.SEARCH_PATH.809820495" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.SEARCH_PATH" valueType="libPaths"> | |
179 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/lib"/> | |
180 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/> | |
181 | + </option> | |
182 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DIAG_WRAP.1771130404" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DIAG_WRAP.off" valueType="enumerated"/> | |
183 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DISPLAY_ERROR_NUMBER.461585675" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/> | |
184 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.XML_LINK_INFO.1158846041" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.XML_LINK_INFO" useByScannerDiscovery="false" value="${ProjName}_linkInfo.xml" valueType="string"/> | |
185 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD_SRCS.895659585" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD_SRCS"/> | |
186 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD2_SRCS.647367651" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__CMD2_SRCS"/> | |
187 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__GEN_CMDS.304003745" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__GEN_CMDS"/> | |
188 | + </tool> | |
189 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.1185668989" name="C2000 Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex"/> | |
190 | + </toolChain> | |
191 | + </folderInfo> | |
192 | + </configuration> | |
193 | + </storageModule> | |
194 | + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> | |
195 | + </cconfiguration> | |
196 | + </storageModule> | |
197 | + <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> | |
198 | + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> | |
199 | + <project id="Master4.0-Test-Firmware.com.ti.ccstudio.buildDefinitions.C2000.ProjectType.1729653242" name="C2000" projectType="com.ti.ccstudio.buildDefinitions.C2000.ProjectType"/> | |
200 | + </storageModule> | |
201 | + <storageModule moduleId="scannerConfiguration"/> | |
202 | + <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> | |
203 | + <storageModule moduleId="refreshScope"/> | |
204 | +</cproject>(파일 끝에 줄바꿈 문자 없음) |
+++ ArcCTRL-23-NEXTSQ-CPU2/.gitignore
... | ... | @@ -0,0 +1,1 @@ |
1 | +/Debug/ |
+++ ArcCTRL-23-NEXTSQ-CPU2/.launches/ArcCtrl-23-NEXTSQ-CPU2.launch
... | ... | @@ -0,0 +1,32 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | +<launchConfiguration type="com.ti.ccstudio.debug.launchType.device.debugging"> | |
3 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1" value="<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <PropertyValues> <property id="ConnectOnStartup"> <curValue>1</curValue> </property> <property id="EnableInstalledBreakpoint"> <curValue>1</curValue> </property> <property id="IgnoreSoftLaunchFailures"> <curValue>0</curValue> </property> </PropertyValues> "/> | |
4 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2" value="<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <PropertyValues> <property id="ConnectOnStartup"> <curValue>1</curValue> </property> <property id="EnableInstalledBreakpoint"> <curValue>1</curValue> </property> <property id="IgnoreSoftLaunchFailures"> <curValue>0</curValue> </property> </PropertyValues> "/> | |
5 | + <setAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_HIDE_CONFIG_ELEMENT_TYPES"> | |
6 | + <setEntry value="BOARD"/> | |
7 | + <setEntry value="BYPASSED_CPU"/> | |
8 | + <setEntry value="BYPASSED_ROUTER"/> | |
9 | + <setEntry value="CONNECTION"/> | |
10 | + <setEntry value="DEVICE"/> | |
11 | + <setEntry value="NON_DEBUG_CPU"/> | |
12 | + <setEntry value="NO_DRIVER"/> | |
13 | + <setEntry value="ROUTER"/> | |
14 | + <setEntry value="SUBPATH"/> | |
15 | + <setEntry value="SYSTEM"/> | |
16 | + </setAttribute> | |
17 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1" value="${build_artifact:ArcCtrl-23-NEXTSQ-CPU2}"/> | |
18 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2" value="${build_artifact:ArcCtrl-23-NEXTSQ-CPU2}"/> | |
19 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1" value="ArcCtrl-23-NEXTSQ-CPU2"/> | |
20 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2" value="ArcCtrl-23-NEXTSQ-CPU2"/> | |
21 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:ArcCtrl-23-NEXTSQ-CPU2}"/> | |
22 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1" value="${build_artifact:ArcCtrl-23-NEXTSQ-CPU2}"/> | |
23 | + <stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.TMS320F28377D.ccxml.Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2" value="${build_artifact:ArcCtrl-23-NEXTSQ-CPU2}"/> | |
24 | + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> | |
25 | + <listEntry value="/ArcCtrl-23-NEXTSQ-CPU2"/> | |
26 | + </listAttribute> | |
27 | + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> | |
28 | + <listEntry value="4"/> | |
29 | + </listAttribute> | |
30 | + <stringAttribute key="org.eclipse.debug.core.source_locator_id" value="com.ti.ccstudio.debug.sourceLocator"/> | |
31 | + <stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;cpuSpecificContainer cpuName=&quot;Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU1&quot;&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;project name=&amp;quot;ArcCtrl-23-NEXTSQ-CPU2&amp;quot; referencedProjects=&amp;quot;true&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.project&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;productsSource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.products.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;deviceLibrarySource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.device.library.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;librarySource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.library.source&quot;/&gt;&#13;&#10;&lt;/cpuSpecificContainer&gt;&#13;&#10;" typeId="com.ti.ccstudio.debug.containerType.cpu.specific"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;cpuSpecificContainer cpuName=&quot;Spectrum Digital XDS560V2 STM USB Emulator/C28xx_CPU2&quot;&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;project name=&amp;quot;ArcCtrl-23-NEXTSQ-CPU2&amp;quot; referencedProjects=&amp;quot;true&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.project&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;productsSource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.products.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;deviceLibrarySource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.device.library.source&quot;/&gt;&#13;&#10; &lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;librarySource/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;com.ti.ccstudio.debug.containerType.library.source&quot;/&gt;&#13;&#10;&lt;/cpuSpecificContainer&gt;&#13;&#10;" typeId="com.ti.ccstudio.debug.containerType.cpu.specific"/> </sourceContainers> </sourceLookupDirector> "/> | |
32 | +</launchConfiguration> |
+++ ArcCTRL-23-NEXTSQ-CPU2/.project
... | ... | @@ -0,0 +1,45 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<projectDescription> | |
3 | + <name>ArcCtrl-23-NEXTSQ-CPU2</name> | |
4 | + <comment></comment> | |
5 | + <projects> | |
6 | + </projects> | |
7 | + <buildSpec> | |
8 | + <buildCommand> | |
9 | + <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> | |
10 | + <arguments> | |
11 | + </arguments> | |
12 | + </buildCommand> | |
13 | + <buildCommand> | |
14 | + <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> | |
15 | + <triggers>full,incremental,</triggers> | |
16 | + <arguments> | |
17 | + </arguments> | |
18 | + </buildCommand> | |
19 | + </buildSpec> | |
20 | + <natures> | |
21 | + <nature>com.ti.ccstudio.core.ccsNature</nature> | |
22 | + <nature>org.eclipse.cdt.core.cnature</nature> | |
23 | + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> | |
24 | + <nature>org.eclipse.cdt.core.ccnature</nature> | |
25 | + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> | |
26 | + </natures> | |
27 | + <linkedResources> | |
28 | + <link> | |
29 | + <name>Common_Resource</name> | |
30 | + <type>2</type> | |
31 | + <locationURI>copy_PARENT/Common_Resource</locationURI> | |
32 | + </link> | |
33 | + <link> | |
34 | + <name>TI_Lib</name> | |
35 | + <type>2</type> | |
36 | + <locationURI>copy_PARENT/TI_Lib</locationURI> | |
37 | + </link> | |
38 | + </linkedResources> | |
39 | + <variableList> | |
40 | + <variable> | |
41 | + <name>copy_PARENT</name> | |
42 | + <value>file:/D:/Project.Git/ArcCtrl-23-Firmware</value> | |
43 | + </variable> | |
44 | + </variableList> | |
45 | +</projectDescription> |
+++ ArcCTRL-23-NEXTSQ-CPU2/.settings/org.eclipse.cdt.codan.core.prefs
... | ... | @@ -0,0 +1,3 @@ |
1 | +eclipse.preferences.version=1 | |
2 | +inEditor=false | |
3 | +onBuild=false |
+++ ArcCTRL-23-NEXTSQ-CPU2/.settings/org.eclipse.cdt.debug.core.prefs
... | ... | @@ -0,0 +1,2 @@ |
1 | +eclipse.preferences.version=1 | |
2 | +org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker |
+++ ArcCTRL-23-NEXTSQ-CPU2/.settings/org.eclipse.core.resources.prefs
... | ... | @@ -0,0 +1,90 @@ |
1 | +eclipse.preferences.version=1 | |
2 | +encoding//CodeLibrary/DigitalFilter.cpp=UTF-8 | |
3 | +encoding//CodeLibrary/SOAPPLL.cpp=UTF-8 | |
4 | +encoding//CodeLibrary/SOGIPLL.cpp=UTF-8 | |
5 | +encoding//Debug/CodeLibrary/subdir_rules.mk=UTF-8 | |
6 | +encoding//Debug/CodeLibrary/subdir_vars.mk=UTF-8 | |
7 | +encoding//Debug/Common_Resource/BoardLibrary/subdir_rules.mk=UTF-8 | |
8 | +encoding//Debug/Common_Resource/BoardLibrary/subdir_vars.mk=UTF-8 | |
9 | +encoding//Debug/Common_Resource/CodeLibrary/CRC/subdir_rules.mk=UTF-8 | |
10 | +encoding//Debug/Common_Resource/CodeLibrary/CRC/subdir_vars.mk=UTF-8 | |
11 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/CRC/subdir_rules.mk=UTF-8 | |
12 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/CRC/subdir_vars.mk=UTF-8 | |
13 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/DigitalCtrl/subdir_rules.mk=UTF-8 | |
14 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/DigitalCtrl/subdir_vars.mk=UTF-8 | |
15 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/DigitalFilter/subdir_rules.mk=UTF-8 | |
16 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/DigitalFilter/subdir_vars.mk=UTF-8 | |
17 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/Ntc/subdir_rules.mk=UTF-8 | |
18 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/Ntc/subdir_vars.mk=UTF-8 | |
19 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/PLL/subdir_rules.mk=UTF-8 | |
20 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/PLL/subdir_vars.mk=UTF-8 | |
21 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/TimeSharing/subdir_rules.mk=UTF-8 | |
22 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/TimeSharing/subdir_vars.mk=UTF-8 | |
23 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/Util/subdir_rules.mk=UTF-8 | |
24 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/Util/subdir_vars.mk=UTF-8 | |
25 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/subdir_rules.mk=UTF-8 | |
26 | +encoding//Debug/Common_Resource/CodeLibrary/Debug/subdir_vars.mk=UTF-8 | |
27 | +encoding//Debug/Common_Resource/CodeLibrary/DigitalController/subdir_rules.mk=UTF-8 | |
28 | +encoding//Debug/Common_Resource/CodeLibrary/DigitalController/subdir_vars.mk=UTF-8 | |
29 | +encoding//Debug/Common_Resource/CodeLibrary/DigitalCtrl/subdir_rules.mk=UTF-8 | |
30 | +encoding//Debug/Common_Resource/CodeLibrary/DigitalCtrl/subdir_vars.mk=UTF-8 | |
31 | +encoding//Debug/Common_Resource/CodeLibrary/DigitalFilter/subdir_rules.mk=UTF-8 | |
32 | +encoding//Debug/Common_Resource/CodeLibrary/DigitalFilter/subdir_vars.mk=UTF-8 | |
33 | +encoding//Debug/Common_Resource/CodeLibrary/Ntc/subdir_rules.mk=UTF-8 | |
34 | +encoding//Debug/Common_Resource/CodeLibrary/Ntc/subdir_vars.mk=UTF-8 | |
35 | +encoding//Debug/Common_Resource/CodeLibrary/PLL/subdir_rules.mk=UTF-8 | |
36 | +encoding//Debug/Common_Resource/CodeLibrary/PLL/subdir_vars.mk=UTF-8 | |
37 | +encoding//Debug/Common_Resource/CodeLibrary/TimeSharing/subdir_rules.mk=UTF-8 | |
38 | +encoding//Debug/Common_Resource/CodeLibrary/TimeSharing/subdir_vars.mk=UTF-8 | |
39 | +encoding//Debug/Common_Resource/CodeLibrary/Util/subdir_rules.mk=UTF-8 | |
40 | +encoding//Debug/Common_Resource/CodeLibrary/Util/subdir_vars.mk=UTF-8 | |
41 | +encoding//Debug/Common_Resource/CommonLibrary/Wiznet/subdir_rules.mk=UTF-8 | |
42 | +encoding//Debug/Common_Resource/CommonLibrary/Wiznet/subdir_vars.mk=UTF-8 | |
43 | +encoding//Debug/Common_Resource/CommonLibrary/source/subdir_rules.mk=UTF-8 | |
44 | +encoding//Debug/Common_Resource/CommonLibrary/source/subdir_vars.mk=UTF-8 | |
45 | +encoding//Debug/Common_Resource/CommonLibrary/subdir_rules.mk=UTF-8 | |
46 | +encoding//Debug/Common_Resource/CommonLibrary/subdir_vars.mk=UTF-8 | |
47 | +encoding//Debug/Common_Resource/EasyDSP_Resource/subdir_rules.mk=UTF-8 | |
48 | +encoding//Debug/Common_Resource/EasyDSP_Resource/subdir_vars.mk=UTF-8 | |
49 | +encoding//Debug/Common_Resource/subdir_rules.mk=UTF-8 | |
50 | +encoding//Debug/Common_Resource/subdir_vars.mk=UTF-8 | |
51 | +encoding//Debug/Main_Resource/include/subdir_rules.mk=UTF-8 | |
52 | +encoding//Debug/Main_Resource/include/subdir_vars.mk=UTF-8 | |
53 | +encoding//Debug/Main_Resource/source/subdir_rules.mk=UTF-8 | |
54 | +encoding//Debug/Main_Resource/source/subdir_vars.mk=UTF-8 | |
55 | +encoding//Debug/Main_Resource/subdir_rules.mk=UTF-8 | |
56 | +encoding//Debug/Main_Resource/subdir_vars.mk=UTF-8 | |
57 | +encoding//Debug/TI/common/cmd/subdir_rules.mk=UTF-8 | |
58 | +encoding//Debug/TI/common/cmd/subdir_vars.mk=UTF-8 | |
59 | +encoding//Debug/TI/common/deprecated/driverlib/subdir_rules.mk=UTF-8 | |
60 | +encoding//Debug/TI/common/deprecated/driverlib/subdir_vars.mk=UTF-8 | |
61 | +encoding//Debug/TI/common/deprecated/third_party/fatfs/port/subdir_rules.mk=UTF-8 | |
62 | +encoding//Debug/TI/common/deprecated/third_party/fatfs/port/subdir_vars.mk=UTF-8 | |
63 | +encoding//Debug/TI/common/deprecated/third_party/fatfs/src/subdir_rules.mk=UTF-8 | |
64 | +encoding//Debug/TI/common/deprecated/third_party/fatfs/src/subdir_vars.mk=UTF-8 | |
65 | +encoding//Debug/TI/common/deprecated/utils/subdir_rules.mk=UTF-8 | |
66 | +encoding//Debug/TI/common/deprecated/utils/subdir_vars.mk=UTF-8 | |
67 | +encoding//Debug/TI/common/source/subdir_rules.mk=UTF-8 | |
68 | +encoding//Debug/TI/common/source/subdir_vars.mk=UTF-8 | |
69 | +encoding//Debug/TI/driverlib/subdir_rules.mk=UTF-8 | |
70 | +encoding//Debug/TI/driverlib/subdir_vars.mk=UTF-8 | |
71 | +encoding//Debug/TI/headers/cmd/subdir_rules.mk=UTF-8 | |
72 | +encoding//Debug/TI/headers/cmd/subdir_vars.mk=UTF-8 | |
73 | +encoding//Debug/TI/headers/source/subdir_rules.mk=UTF-8 | |
74 | +encoding//Debug/TI/headers/source/subdir_vars.mk=UTF-8 | |
75 | +encoding//Debug/TI_Lib/FPU/lib/subdir_rules.mk=UTF-8 | |
76 | +encoding//Debug/TI_Lib/FPU/lib/subdir_vars.mk=UTF-8 | |
77 | +encoding//Debug/TI_Lib/FPUfastRTS/c28/lib/subdir_rules.mk=UTF-8 | |
78 | +encoding//Debug/TI_Lib/FPUfastRTS/c28/lib/subdir_vars.mk=UTF-8 | |
79 | +encoding//Debug/TI_Lib/device/subdir_rules.mk=UTF-8 | |
80 | +encoding//Debug/TI_Lib/device/subdir_vars.mk=UTF-8 | |
81 | +encoding//Debug/TI_Lib/driverlib/f2837xd/driverlib/subdir_rules.mk=UTF-8 | |
82 | +encoding//Debug/TI_Lib/driverlib/f2837xd/driverlib/subdir_vars.mk=UTF-8 | |
83 | +encoding//Debug/TI_Lib/f2837xd/headers/source/subdir_rules.mk=UTF-8 | |
84 | +encoding//Debug/TI_Lib/f2837xd/headers/source/subdir_vars.mk=UTF-8 | |
85 | +encoding//Debug/makefile=UTF-8 | |
86 | +encoding//Debug/objects.mk=UTF-8 | |
87 | +encoding//Debug/sources.mk=UTF-8 | |
88 | +encoding//Debug/subdir_rules.mk=UTF-8 | |
89 | +encoding//Debug/subdir_vars.mk=UTF-8 | |
90 | +encoding//Main_Resource/source/Cpu2Main.cpp=UTF-8 |
+++ ArcCTRL-23-NEXTSQ-CPU2/F2837xD_Headers_nonBIOS_cpu2.cmd
... | ... | @@ -0,0 +1,220 @@ |
1 | +MEMORY | |
2 | +{ | |
3 | + PAGE 0: /* Program Memory */ | |
4 | + PAGE 1: /* Data Memory */ | |
5 | + ACCESSPROTECTION : origin = 0x0005F4C0, length = 0x00000040 | |
6 | + ADCA : origin = 0x00007400, length = 0x00000080 | |
7 | + ADCB : origin = 0x00007480, length = 0x00000080 | |
8 | + ADCC : origin = 0x00007500, length = 0x00000080 | |
9 | + ADCD : origin = 0x00007580, length = 0x00000080 | |
10 | + ADCARESULT : origin = 0x00000B00, length = 0x00000018 | |
11 | + ADCBRESULT : origin = 0x00000B20, length = 0x00000018 | |
12 | + ADCCRESULT : origin = 0x00000B40, length = 0x00000018 | |
13 | + ADCDRESULT : origin = 0x00000B60, length = 0x00000018 | |
14 | + CANA : origin = 0x00048000, length = 0x00000200 | |
15 | + CANB : origin = 0x0004A000, length = 0x00000200 | |
16 | + CLA1 : origin = 0x00001400, length = 0x00000080 | |
17 | + CLB1DATAEXCH : origin = 0x00003200, length = 0x00000200 | |
18 | + CLB2DATAEXCH : origin = 0x00003600, length = 0x00000200 | |
19 | + CLB3DATAEXCH : origin = 0x00003A00, length = 0x00000200 | |
20 | + CLB4DATAEXCH : origin = 0x00003E00, length = 0x00000200 | |
21 | + CLB1LOGICCFG : origin = 0x00003000, length = 0x00000052 | |
22 | + CLB2LOGICCFG : origin = 0x00003400, length = 0x00000052 | |
23 | + CLB3LOGICCFG : origin = 0x00003800, length = 0x00000052 | |
24 | + CLB4LOGICCFG : origin = 0x00003C00, length = 0x00000052 | |
25 | + CLB1LOGICCTRL : origin = 0x00003100, length = 0x00000040 | |
26 | + CLB2LOGICCTRL : origin = 0x00003500, length = 0x00000040 | |
27 | + CLB3LOGICCTRL : origin = 0x00003900, length = 0x00000040 | |
28 | + CLB4LOGICCTRL : origin = 0x00003D00, length = 0x00000040 | |
29 | + CLKCFG : origin = 0x0005D200, length = 0x00000032 | |
30 | + CMPSS1 : origin = 0x00005C80, length = 0x00000020 | |
31 | + CMPSS2 : origin = 0x00005CA0, length = 0x00000020 | |
32 | + CMPSS3 : origin = 0x00005CC0, length = 0x00000020 | |
33 | + CMPSS4 : origin = 0x00005CE0, length = 0x00000020 | |
34 | + CMPSS5 : origin = 0x00005D00, length = 0x00000020 | |
35 | + CMPSS6 : origin = 0x00005D20, length = 0x00000020 | |
36 | + CMPSS7 : origin = 0x00005D40, length = 0x00000020 | |
37 | + CMPSS8 : origin = 0x00005D60, length = 0x00000020 | |
38 | + CPUTIMER0 : origin = 0x00000C00, length = 0x00000008 | |
39 | + CPUTIMER1 : origin = 0x00000C08, length = 0x00000008 | |
40 | + CPUTIMER2 : origin = 0x00000C10, length = 0x00000008 | |
41 | + CPUSYS : origin = 0x0005D300, length = 0x00000082 | |
42 | + DACA : origin = 0x00005C00, length = 0x00000008 | |
43 | + DACB : origin = 0x00005C10, length = 0x00000008 | |
44 | + DACC : origin = 0x00005C20, length = 0x00000008 | |
45 | + DCSMCOMMON : origin = 0x0005F070, length = 0x00000008 | |
46 | + DCSMZ1 : origin = 0x0005F000, length = 0x00000024 | |
47 | + DCSMZ2 : origin = 0x0005F040, length = 0x00000024 | |
48 | + DMACLASRCSEL : origin = 0x00007980, length = 0x0000001A | |
49 | + DMA : origin = 0x00001000, length = 0x00000200 | |
50 | + ECAP1 : origin = 0x00005000, length = 0x00000020 | |
51 | + ECAP2 : origin = 0x00005020, length = 0x00000020 | |
52 | + ECAP3 : origin = 0x00005040, length = 0x00000020 | |
53 | + ECAP4 : origin = 0x00005060, length = 0x00000020 | |
54 | + ECAP5 : origin = 0x00005080, length = 0x00000020 | |
55 | + ECAP6 : origin = 0x000050A0, length = 0x00000020 | |
56 | + EMIF1CONFIG : origin = 0x0005F480, length = 0x00000020 | |
57 | + EMIF1 : origin = 0x00047000, length = 0x00000070 | |
58 | + EPWM1 : origin = 0x00004000, length = 0x00000100 | |
59 | + EPWM2 : origin = 0x00004100, length = 0x00000100 | |
60 | + EPWM3 : origin = 0x00004200, length = 0x00000100 | |
61 | + EPWM4 : origin = 0x00004300, length = 0x00000100 | |
62 | + EPWM5 : origin = 0x00004400, length = 0x00000100 | |
63 | + EPWM6 : origin = 0x00004500, length = 0x00000100 | |
64 | + EPWM7 : origin = 0x00004600, length = 0x00000100 | |
65 | + EPWM8 : origin = 0x00004700, length = 0x00000100 | |
66 | + EPWM9 : origin = 0x00004800, length = 0x00000100 | |
67 | + EPWM10 : origin = 0x00004900, length = 0x00000100 | |
68 | + EPWM11 : origin = 0x00004A00, length = 0x00000100 | |
69 | + EPWM12 : origin = 0x00004B00, length = 0x00000100 | |
70 | + EQEP1 : origin = 0x00005100, length = 0x00000022 | |
71 | + EQEP2 : origin = 0x00005140, length = 0x00000022 | |
72 | + EQEP3 : origin = 0x00005180, length = 0x00000022 | |
73 | + FLASH0CTRL : origin = 0x0005F800, length = 0x00000182 | |
74 | + FLASH0ECC : origin = 0x0005FB00, length = 0x00000028 | |
75 | + FLASHPUMPSEMAPHORE : origin = 0x00050024, length = 0x00000002 | |
76 | + GPIODATA : origin = 0x00007F00, length = 0x00000030 | |
77 | + I2CA : origin = 0x00007300, length = 0x00000022 | |
78 | + I2CB : origin = 0x00007340, length = 0x00000022 | |
79 | + IPC : origin = 0x00050000, length = 0x00000024 | |
80 | + MEMORYERROR : origin = 0x0005F500, length = 0x00000040 | |
81 | + MEMCFG : origin = 0x0005F400, length = 0x00000080 | |
82 | + MCBSPA : origin = 0x00006000, length = 0x00000024 | |
83 | + MCBSPB : origin = 0x00006040, length = 0x00000024 | |
84 | + NMIINTRUPT : origin = 0x00007060, length = 0x00000007 | |
85 | + PIECTRL : origin = 0x00000CE0, length = 0x0000001A | |
86 | + PIEVECTTABLE : origin = 0x00000D00, length = 0x00000200 | |
87 | + ROMPREFETCH : origin = 0x0005E608, length = 0x00000002 | |
88 | + SCIA : origin = 0x00007200, length = 0x00000010 | |
89 | + SCIB : origin = 0x00007210, length = 0x00000010 | |
90 | + SCIC : origin = 0x00007220, length = 0x00000010 | |
91 | + SCID : origin = 0x00007230, length = 0x00000010 | |
92 | + SDFM1 : origin = 0x00005E00, length = 0x00000080 | |
93 | + SDFM2 : origin = 0x00005E80, length = 0x00000080 | |
94 | + SPIA : origin = 0x00006100, length = 0x00000010 | |
95 | + SPIB : origin = 0x00006110, length = 0x00000010 | |
96 | + SPIC : origin = 0x00006120, length = 0x00000010 | |
97 | + WD : origin = 0x00007000, length = 0x0000002B | |
98 | + XINT : origin = 0x00007070, length = 0x0000000B | |
99 | + | |
100 | +} | |
101 | + | |
102 | + | |
103 | +SECTIONS | |
104 | +{ | |
105 | +/*** PIE Vect Table and Boot ROM Variables Structures ***/ | |
106 | +UNION run = PIEVECTTABLE | |
107 | +{ | |
108 | + PieVectTableFile | |
109 | + GROUP | |
110 | + { | |
111 | + EmuKeyVar | |
112 | + EmuBModeVar | |
113 | + EmuBootPinsVar | |
114 | + FlashCallbackVar | |
115 | + FlashScalingVar | |
116 | + } | |
117 | +} | |
118 | + | |
119 | + AccessProtectionRegsFile : > ACCESSPROTECTION, type=NOINIT | |
120 | + AdcaRegsFile : > ADCA, type=NOINIT | |
121 | + AdcbRegsFile : > ADCB, type=NOINIT | |
122 | + AdccRegsFile : > ADCC, type=NOINIT | |
123 | + AdcdRegsFile : > ADCD, type=NOINIT | |
124 | + AdcaResultRegsFile : > ADCARESULT, type=NOINIT | |
125 | + AdcbResultRegsFile : > ADCBRESULT, type=NOINIT | |
126 | + AdccResultRegsFile : > ADCCRESULT, type=NOINIT | |
127 | + AdcdResultRegsFile : > ADCDRESULT, type=NOINIT | |
128 | + CanaRegsFile : > CANA, type=NOINIT | |
129 | + CanbRegsFile : > CANB, type=NOINIT | |
130 | + Cla1RegsFile : > CLA1, type=NOINIT | |
131 | + Clb1DataExchRegsFile : > CLB1DATAEXCH, type=NOINIT | |
132 | + Clb2DataExchRegsFile : > CLB2DATAEXCH, type=NOINIT | |
133 | + Clb3DataExchRegsFile : > CLB3DATAEXCH, type=NOINIT | |
134 | + Clb4DataExchRegsFile : > CLB4DATAEXCH, type=NOINIT | |
135 | + Clb1LogicCfgRegsFile : > CLB1LOGICCFG, type=NOINIT | |
136 | + Clb2LogicCfgRegsFile : > CLB2LOGICCFG, type=NOINIT | |
137 | + Clb3LogicCfgRegsFile : > CLB3LOGICCFG, type=NOINIT | |
138 | + Clb4LogicCfgRegsFile : > CLB4LOGICCFG, type=NOINIT | |
139 | + Clb1LogicCtrlRegsFile : > CLB1LOGICCTRL, type=NOINIT | |
140 | + Clb2LogicCtrlRegsFile : > CLB2LOGICCTRL, type=NOINIT | |
141 | + Clb3LogicCtrlRegsFile : > CLB3LOGICCTRL, type=NOINIT | |
142 | + Clb4LogicCtrlRegsFile : > CLB4LOGICCTRL, type=NOINIT | |
143 | + ClkCfgRegsFile : > CLKCFG, type=NOINIT | |
144 | + Cmpss1RegsFile : > CMPSS1, type=NOINIT | |
145 | + Cmpss2RegsFile : > CMPSS2, type=NOINIT | |
146 | + Cmpss3RegsFile : > CMPSS3, type=NOINIT | |
147 | + Cmpss4RegsFile : > CMPSS4, type=NOINIT | |
148 | + Cmpss5RegsFile : > CMPSS5, type=NOINIT | |
149 | + Cmpss6RegsFile : > CMPSS6, type=NOINIT | |
150 | + Cmpss7RegsFile : > CMPSS7, type=NOINIT | |
151 | + Cmpss8RegsFile : > CMPSS8, type=NOINIT | |
152 | + CpuTimer0RegsFile : > CPUTIMER0, type=NOINIT | |
153 | + CpuTimer1RegsFile : > CPUTIMER1, type=NOINIT | |
154 | + CpuTimer2RegsFile : > CPUTIMER2, type=NOINIT | |
155 | + CpuSysRegsFile : > CPUSYS, type=NOINIT | |
156 | + DacaRegsFile : > DACA, type=NOINIT | |
157 | + DacbRegsFile : > DACB, type=NOINIT | |
158 | + DaccRegsFile : > DACC, type=NOINIT | |
159 | + DcsmCommonRegsFile : > DCSMCOMMON, type=NOINIT | |
160 | + DcsmZ1RegsFile : > DCSMZ1, type=NOINIT | |
161 | + DcsmZ2RegsFile : > DCSMZ2, type=NOINIT | |
162 | + DmaClaSrcSelRegsFile : > DMACLASRCSEL, type=NOINIT | |
163 | + DmaRegsFile : > DMA, type=NOINIT | |
164 | + ECap1RegsFile : > ECAP1, type=NOINIT | |
165 | + ECap2RegsFile : > ECAP2, type=NOINIT | |
166 | + ECap3RegsFile : > ECAP3, type=NOINIT | |
167 | + ECap4RegsFile : > ECAP4, type=NOINIT | |
168 | + ECap5RegsFile : > ECAP5, type=NOINIT | |
169 | + ECap6RegsFile : > ECAP6, type=NOINIT | |
170 | + Emif1ConfigRegsFile : > EMIF1CONFIG, type=NOINIT | |
171 | + Emif1RegsFile : > EMIF1, type=NOINIT | |
172 | + EPwm1RegsFile : > EPWM1, type=NOINIT | |
173 | + EPwm2RegsFile : > EPWM2, type=NOINIT | |
174 | + EPwm3RegsFile : > EPWM3, type=NOINIT | |
175 | + EPwm4RegsFile : > EPWM4, type=NOINIT | |
176 | + EPwm5RegsFile : > EPWM5, type=NOINIT | |
177 | + EPwm6RegsFile : > EPWM6, type=NOINIT | |
178 | + EPwm7RegsFile : > EPWM7, type=NOINIT | |
179 | + EPwm8RegsFile : > EPWM8, type=NOINIT | |
180 | + EPwm9RegsFile : > EPWM9, type=NOINIT | |
181 | + EPwm10RegsFile : > EPWM10, type=NOINIT | |
182 | + EPwm11RegsFile : > EPWM11, type=NOINIT | |
183 | + EPwm12RegsFile : > EPWM12, type=NOINIT | |
184 | + EQep1RegsFile : > EQEP1, type=NOINIT | |
185 | + EQep2RegsFile : > EQEP2, type=NOINIT | |
186 | + EQep3RegsFile : > EQEP3, type=NOINIT | |
187 | + Flash0CtrlRegsFile : > FLASH0CTRL, type=NOINIT | |
188 | + Flash0EccRegsFile : > FLASH0ECC, type=NOINIT | |
189 | + FlashPumpSemaphoreRegsFile : > FLASHPUMPSEMAPHORE, type=NOINIT | |
190 | + GpioDataRegsFile : > GPIODATA, type=NOINIT | |
191 | + I2caRegsFile : > I2CA, type=NOINIT | |
192 | + I2cbRegsFile : > I2CB, type=NOINIT | |
193 | + IpcRegsFile : > IPC, type=NOINIT | |
194 | + MemoryErrorRegsFile : > MEMORYERROR, type=NOINIT | |
195 | + MemCfgRegsFile : > MEMCFG, type=NOINIT | |
196 | + McbspaRegsFile : > MCBSPA, type=NOINIT | |
197 | + McbspbRegsFile : > MCBSPB, type=NOINIT | |
198 | + NmiIntruptRegsFile : > NMIINTRUPT, type=NOINIT | |
199 | + PieCtrlRegsFile : > PIECTRL, type=NOINIT | |
200 | + PieVectTableFile : > PIEVECTTABLE, type=NOINIT | |
201 | + RomPrefetchRegsFile : > ROMPREFETCH, type=NOINIT | |
202 | + SciaRegsFile : > SCIA, type=NOINIT | |
203 | + ScibRegsFile : > SCIB, type=NOINIT | |
204 | + ScicRegsFile : > SCIC, type=NOINIT | |
205 | + ScidRegsFile : > SCID, type=NOINIT | |
206 | + Sdfm1RegsFile : > SDFM1, type=NOINIT | |
207 | + Sdfm2RegsFile : > SDFM2, type=NOINIT | |
208 | + SpiaRegsFile : > SPIA, type=NOINIT | |
209 | + SpibRegsFile : > SPIB, type=NOINIT | |
210 | + SpicRegsFile : > SPIC, type=NOINIT | |
211 | + WdRegsFile : > WD, type=NOINIT | |
212 | + XintRegsFile : > XINT, type=NOINIT | |
213 | +} | |
214 | + | |
215 | +/* | |
216 | +//=========================================================================== | |
217 | +// End of file. | |
218 | +//=========================================================================== | |
219 | +*/ | |
220 | + |
+++ ArcCTRL-23-NEXTSQ-CPU2/Main_Resource/include/Cpu2DeviceDefine.h
... | ... | @@ -0,0 +1,33 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : DeviceDefine.h | |
4 | +// Created on : 2019. 06. 09. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef _DEVICE_DEFINE_H_ | |
11 | +#define _DEVICE_DEFINE_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | +//------------------ ADDRESS DEFINE END---------------------------- | |
19 | +#include "easy28x_driverlib_v10.8.h" | |
20 | +#include "CodeLibrary.h" | |
21 | +#include "CommonLib.h" | |
22 | +//--------------------------------------------// | |
23 | + | |
24 | +#include "Cpu2DmaSet.h" | |
25 | + | |
26 | + | |
27 | + | |
28 | + | |
29 | +#ifdef __cplusplus | |
30 | +} | |
31 | +#endif /* extern "C" */ | |
32 | + | |
33 | +#endif /* _DEVICE_DEFINE_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU2/Main_Resource/include/Cpu2DmaSet.h
... | ... | @@ -0,0 +1,50 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-ME-CPU1 | |
3 | +// File Name : Dma_Map.h | |
4 | +// Created on : 2022. 9. 29. | |
5 | +// Description : | |
6 | +// Author : "Kim Jeong-Woo" | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | +#ifndef MAIN_RESOURCE_INCLUDE_DMA_H_ | |
10 | +#define MAIN_RESOURCE_INCLUDE_DMA_H_ | |
11 | + | |
12 | +#ifdef __cplusplus | |
13 | +extern "C" { | |
14 | +#endif | |
15 | + | |
16 | + | |
17 | + | |
18 | + | |
19 | + | |
20 | + | |
21 | +#pragma SET_DATA_SECTION("DMARAM1") | |
22 | + | |
23 | +#pragma SET_DATA_SECTION() | |
24 | + | |
25 | +#pragma SET_DATA_SECTION("DMARAM3") | |
26 | + | |
27 | +#pragma SET_DATA_SECTION() | |
28 | + | |
29 | +#pragma SET_DATA_SECTION("DMARAM2") | |
30 | + | |
31 | +#pragma SET_DATA_SECTION() | |
32 | + | |
33 | +#pragma SET_DATA_SECTION("DMARAM4") | |
34 | + | |
35 | +#pragma SET_DATA_SECTION() | |
36 | + | |
37 | +extern void InitDma(void); | |
38 | +extern void InitDma1(void); | |
39 | +extern void InitDma2(void); | |
40 | +extern void InitDma3(void); | |
41 | +extern void InitDma4(void); | |
42 | + | |
43 | + | |
44 | + | |
45 | + | |
46 | + | |
47 | +#ifdef __cplusplus | |
48 | +} | |
49 | +#endif /* extern "C" */ | |
50 | +#endif /* MAIN_RESOURCE_INCLUDE_DMA_H_ */ |
+++ ArcCTRL-23-NEXTSQ-CPU2/Main_Resource/source/Cpu2DmaSet.cpp
... | ... | @@ -0,0 +1,117 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-ME-CPU1 | |
3 | +// File Name : Dma.cpp | |
4 | +// Created on : 2022. 9. 29. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu2DeviceDefine.h" | |
11 | + | |
12 | +//-------------------------------------------------------------------// | |
13 | +// DMA를 사용하려고 하는 메모리의 영역이 DMA를 지원하는지 확인해야함 // | |
14 | +// EX) Flash 영역에서는 DMA 사용 안됨, LS메모리도 마찬가지 // | |
15 | +// // | |
16 | +//-------------------------------------------------------------------// | |
17 | + | |
18 | + | |
19 | +void DmaVariableInit() | |
20 | +{ | |
21 | +// memset(&Dma1, 0, (sizeof(Dma1) / sizeof(int))); | |
22 | +// memset(&Dma3, 0, (sizeof(Dma3) / sizeof(int))); | |
23 | +// memset(&Ai, 0, (sizeof(Ai) / sizeof(int))); | |
24 | +// memset(&IntAi, 0, (sizeof(IntAi) / sizeof(int))); | |
25 | +} | |
26 | + | |
27 | +void InitDma() | |
28 | +{ | |
29 | + SysCtl_selectSecMaster(0, SYSCTL_SEC_MASTER_DMA); | |
30 | + | |
31 | + DMA_initController(); | |
32 | + | |
33 | + DmaVariableInit(); | |
34 | + | |
35 | + InitDma1(); | |
36 | + InitDma2(); | |
37 | + InitDma3(); | |
38 | + InitDma4(); | |
39 | + | |
40 | +} | |
41 | + | |
42 | +//DMA1, DI, AD_FLT, GATE_FLT | |
43 | +void InitDma1() | |
44 | +{ | |
45 | +// DMA_configAddresses(DMA_CH1_BASE, &Dma1, (const void*)(CS_FPGA + CS_FPGA_READ_OFFSET)); | |
46 | +// DMA_configBurst(DMA_CH1_BASE, 4, 1, 1); | |
47 | +// DMA_configTransfer(DMA_CH1_BASE, 1, 1, 1); | |
48 | +// DMA_configWrap(DMA_CH1_BASE, 0xFFFF, 0, 0xFFFF, 0); | |
49 | +// DMA_configMode(DMA_CH1_BASE, DMA_TRIGGER_XINT1, (DMA_CFG_ONESHOT_ENABLE | DMA_CFG_CONTINUOUS_ENABLE)); | |
50 | +//// DMA_setPriorityMode(1); | |
51 | +// DMA_setInterruptMode(DMA_CH1_BASE, DMA_INT_AT_END); | |
52 | +// DMA_enableTrigger(DMA_CH1_BASE); | |
53 | +// DMA_enableInterrupt(DMA_CH1_BASE); | |
54 | +// DMA_startChannel(DMA_CH1_BASE); | |
55 | +// | |
56 | +// Interrupt_register(INT_DMA_CH1, &Dma1_Isr); | |
57 | +// Interrupt_enable(INT_DMA_CH1); | |
58 | +} | |
59 | + | |
60 | + | |
61 | +// DMA2 = External ADC | |
62 | +void InitDma2() | |
63 | +{ | |
64 | +// DMA_configAddresses(DMA_CH2_BASE, &Ai, (const void*)(CS_FPGA + CS_FPGA_ADC_READ_OFFSET)); | |
65 | +// DMA_configBurst(DMA_CH2_BASE, 6, 0, 1); | |
66 | +// DMA_configTransfer(DMA_CH2_BASE, 6, 1, 1); | |
67 | +// DMA_configWrap(DMA_CH2_BASE, 0xFFFF, 0, 0xFFFF, 0); | |
68 | +// DMA_configMode(DMA_CH2_BASE, DMA_TRIGGER_XINT2, (DMA_CFG_ONESHOT_ENABLE | DMA_CFG_CONTINUOUS_ENABLE | DMA_CFG_SIZE_16BIT)); | |
69 | +// DMA_setInterruptMode(DMA_CH2_BASE, DMA_INT_AT_END); | |
70 | +// DMA_enableTrigger(DMA_CH2_BASE); | |
71 | +// DMA_enableInterrupt(DMA_CH2_BASE); | |
72 | +// DMA_startChannel(DMA_CH2_BASE); | |
73 | +// | |
74 | +// Interrupt_register(INT_DMA_CH2, &Dma2_Isr); | |
75 | +// Interrupt_enable(INT_DMA_CH2); | |
76 | +} | |
77 | + | |
78 | +// DMA3 PWM, DO, RSV, DAC, WD..... | |
79 | +void InitDma3() | |
80 | +{ | |
81 | +// DMA_configAddresses(DMA_CH3_BASE, (const void*)(CS_FPGA + CS_FPGA_WRITE_OFFSET), &Dma3); | |
82 | +// DMA_configBurst(DMA_CH3_BASE, 23, 1, 1); | |
83 | +// DMA_configTransfer(DMA_CH3_BASE, 2, 1, 1); | |
84 | +// DMA_configWrap(DMA_CH3_BASE, 0xFFFF, 0, 0xFFFF, 0); | |
85 | +// DMA_configMode(DMA_CH3_BASE, DMA_TRIGGER_SOFTWARE, (DMA_CFG_ONESHOT_ENABLE | DMA_CFG_CONTINUOUS_ENABLE | DMA_CFG_SIZE_16BIT)); | |
86 | +// DMA_setInterruptMode(DMA_CH3_BASE, DMA_INT_AT_END); | |
87 | +// DMA_enableTrigger(DMA_CH3_BASE); | |
88 | +// DMA_enableInterrupt(DMA_CH3_BASE); | |
89 | +// DMA_startChannel(DMA_CH3_BASE); | |
90 | +// | |
91 | +// Interrupt_register(INT_DMA_CH3, &Dma3_Isr); | |
92 | +// Interrupt_enable(INT_DMA_CH3); | |
93 | +} | |
94 | + | |
95 | + | |
96 | +//DMA3 = Internal ADC Read | |
97 | +// ADCA Interrupt 1번이 체널이 제일 많아 오래걸리므로 ADCA1번 기준으로 설정 | |
98 | + | |
99 | + | |
100 | +void InitDma4() | |
101 | +{ | |
102 | +// DMA_configAddresses(DMA_CH4_BASE, &AdcData, (const void*)ADCARESULT_BASE); | |
103 | +// DMA_configBurst(DMA_CH4_BASE, 8, 1, 1); | |
104 | +// DMA_configTransfer(DMA_CH4_BASE, 4, 0x19, 1); | |
105 | +// DMA_configWrap(DMA_CH4_BASE, 0xFFFF, 0, 0xFFFF, 0); | |
106 | +// DMA_configMode(DMA_CH4_BASE, DMA_TRIGGER_ADCA1, (DMA_CFG_ONESHOT_ENABLE | DMA_CFG_CONTINUOUS_ENABLE | DMA_CFG_SIZE_16BIT)); | |
107 | +// DMA_setInterruptMode(DMA_CH4_BASE, DMA_INT_AT_END); | |
108 | +// DMA_enableTrigger(DMA_CH4_BASE); | |
109 | +// DMA_enableInterrupt(DMA_CH4_BASE); | |
110 | +// DMA_startChannel(DMA_CH4_BASE); | |
111 | +// | |
112 | +// Interrupt_register(INT_DMA_CH4, &NtcRead); | |
113 | +// Interrupt_enable(INT_DMA_CH4); | |
114 | +} | |
115 | + | |
116 | + | |
117 | + |
+++ ArcCTRL-23-NEXTSQ-CPU2/Main_Resource/source/Cpu2Main.cpp
... | ... | @@ -0,0 +1,135 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : CPU1_Main.cpp | |
4 | +// Created on : 2022. 9. 22. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu2DeviceDefine.h" | |
11 | + | |
12 | + | |
13 | + | |
14 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
15 | +interrupt void Cpu2EIpc1Isr(void); | |
16 | +#pragma SET_CODE_SECTION() | |
17 | + | |
18 | +int main(void) | |
19 | +{ | |
20 | + | |
21 | + CpuInfo(); | |
22 | + | |
23 | + Device_init(); | |
24 | + Interrupt_initModule(); | |
25 | + Interrupt_initVectorTable(); | |
26 | + | |
27 | + easyDSP_Boot_Sync(); | |
28 | + | |
29 | + DEVICE_DELAY_US(1000L); | |
30 | +// Interrupt_enable(INT_EPWM1); | |
31 | +// Interrupt_register(INT_EPWM1, &Cpu2Epwm1Isr); | |
32 | + | |
33 | + IPC_clearFlagLtoR(IPC_CPU2_L_CPU1_R, IPC_FLAG_ALL); | |
34 | + Interrupt_register(INT_IPC_0, &Cpu2EIpc1Isr); | |
35 | + Interrupt_enable(INT_IPC_0); | |
36 | + | |
37 | +// Interrupt_enable(INT_CANA0); | |
38 | +// Interrupt_register(INT_CANA0, &CanBeRxIsr); | |
39 | +// Interrupt_enable(INT_CANB0); | |
40 | +// Interrupt_register(INT_CANB0, &CanMeRxIsr); | |
41 | + InitTimeSharing(20.0e3); | |
42 | + | |
43 | + GPIO_writePin(45, 1); | |
44 | +// InitDma(); | |
45 | + InitCan(); | |
46 | + | |
47 | +// InitModbusSci(); | |
48 | + | |
49 | + InitNtcTable(); | |
50 | + | |
51 | +// easyDSP_SCI_Init(); | |
52 | + Interrupt_enableMaster(); | |
53 | + | |
54 | + | |
55 | + EINT; | |
56 | + ERTM; | |
57 | + | |
58 | + for (;;) | |
59 | + { | |
60 | + | |
61 | + if (OS_Time.T500us.Flag == 1) | |
62 | + { | |
63 | + RoutineT500us(); | |
64 | + OS_Time.T500us.Flag = 0; | |
65 | + } | |
66 | + else if (OS_Time.T1ms.Flag == 1) | |
67 | + { | |
68 | + RoutineT1ms(); // 1ms routine | |
69 | + OS_Time.T1ms.Flag = 0; | |
70 | + } | |
71 | + else if (OS_Time.T2ms.Flag == 1) | |
72 | + { | |
73 | + RoutineT2ms(); // 2ms routine | |
74 | + OS_Time.T2ms.Flag = 0; | |
75 | + } | |
76 | + else if (OS_Time.T10ms.Flag == 1) | |
77 | + { | |
78 | + RoutineT10ms(); | |
79 | + OS_Time.T10ms.Flag = 0; | |
80 | + | |
81 | + | |
82 | + } | |
83 | + else if (OS_Time.T100ms.Flag == 1) | |
84 | + { | |
85 | +// GPIO_togglePin(45); | |
86 | + RoutineT100ms(); | |
87 | + OS_Time.T100ms.Flag = 0; | |
88 | + | |
89 | + | |
90 | + } | |
91 | + else if (OS_Time.T500ms.Flag == 1) | |
92 | + { | |
93 | + RoutineT500ms(); | |
94 | + OS_Time.T500ms.Flag = 0; | |
95 | + | |
96 | + } | |
97 | + else if (OS_Time.T1s.Flag == 1) | |
98 | + { | |
99 | + RoutineT1s(); | |
100 | + OS_Time.T1s.Flag = 0; | |
101 | + } | |
102 | + | |
103 | + } | |
104 | + | |
105 | +// return 0; | |
106 | +} | |
107 | + | |
108 | +unsigned int Cpu2Epwm1IsrCnt = 0; | |
109 | + | |
110 | +interrupt void Cpu2EIpc1Isr(void) | |
111 | +{ | |
112 | + Cpu2Epwm1IsrCnt++; | |
113 | + | |
114 | + OS_Time.Sharing(); | |
115 | + RoutineTsamp(); | |
116 | + | |
117 | + ModbusALLCheckBuffer(); | |
118 | + | |
119 | + | |
120 | +// EPWM_clearEventTriggerInterruptFlag(EPWM1_BASE); | |
121 | +// Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3); | |
122 | + | |
123 | + IPC_ackFlagRtoL(IPC_CPU2_L_CPU1_R, IPC_FLAG0); | |
124 | + Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1); | |
125 | + | |
126 | + | |
127 | +} | |
128 | + | |
129 | + | |
130 | + | |
131 | + | |
132 | + | |
133 | + | |
134 | + | |
135 | + |
+++ ArcCTRL-23-NEXTSQ-CPU2/Main_Resource/source/RoutineT100ms.cpp
... | ... | @@ -0,0 +1,24 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : RoutineT100ms.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu2DeviceDefine.h" | |
11 | + | |
12 | + | |
13 | +void RoutineT100ms() | |
14 | +{ | |
15 | + | |
16 | + | |
17 | + ModbusARxDataUpdate(); | |
18 | + ModbusATxDataUpdate(); | |
19 | + | |
20 | + NtcRead(); | |
21 | + | |
22 | + | |
23 | +} | |
24 | + |
+++ ArcCTRL-23-NEXTSQ-CPU2/Main_Resource/source/RoutineT10ms.cpp
... | ... | @@ -0,0 +1,19 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : RoutineT10ms.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | + | |
12 | +#include "Cpu2DeviceDefine.h" | |
13 | + | |
14 | + | |
15 | + | |
16 | +void RoutineT10ms() | |
17 | +{ | |
18 | + | |
19 | +} |
+++ ArcCTRL-23-NEXTSQ-CPU2/Main_Resource/source/RoutineT1ms.cpp
... | ... | @@ -0,0 +1,19 @@ |
1 | + | |
2 | +//-------------------------------------------------------// | |
3 | +// Project Code : V2H6K01-23-ENEMAN | |
4 | +// File Name : RoutineT1ms.cpp | |
5 | +// Created on : 2023. 8. 8. | |
6 | +// Description : | |
7 | +// Author : KimJeongWoo | |
8 | +// Last modified Date : | |
9 | +//-------------------------------------------------------// | |
10 | + | |
11 | + | |
12 | +#include "Cpu2DeviceDefine.h" | |
13 | + | |
14 | + | |
15 | + | |
16 | +void RoutineT1ms() | |
17 | +{ | |
18 | + | |
19 | +} |
+++ ArcCTRL-23-NEXTSQ-CPU2/Main_Resource/source/RoutineT2ms.cpp
... | ... | @@ -0,0 +1,21 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : RoutineT2ms.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | + | |
12 | + | |
13 | +#include "Cpu2DeviceDefine.h" | |
14 | + | |
15 | + | |
16 | + | |
17 | +void RoutineT2ms() | |
18 | +{ | |
19 | + | |
20 | +} | |
21 | + |
+++ ArcCTRL-23-NEXTSQ-CPU2/Main_Resource/source/RoutineT500ms.cpp
... | ... | @@ -0,0 +1,29 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : RoutineT500ms.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu2DeviceDefine.h" | |
11 | + | |
12 | + | |
13 | + | |
14 | + | |
15 | +void RoutineT500ms() | |
16 | +{ | |
17 | + RmsAvgCal(); | |
18 | + | |
19 | +} | |
20 | + | |
21 | + | |
22 | +void RoutineT1s() | |
23 | +{ | |
24 | + | |
25 | + | |
26 | + | |
27 | +} | |
28 | + | |
29 | + |
+++ ArcCTRL-23-NEXTSQ-CPU2/Main_Resource/source/RoutineT500us.cpp
... | ... | @@ -0,0 +1,17 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : RoutineT500us.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | +#include "Cpu2DeviceDefine.h" | |
10 | + | |
11 | + | |
12 | + | |
13 | +void RoutineT500us() | |
14 | +{ | |
15 | + ModbusALLResponse(); | |
16 | +} | |
17 | + |
+++ ArcCTRL-23-NEXTSQ-CPU2/Main_Resource/source/RoutineTsamp.cpp
... | ... | @@ -0,0 +1,23 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : RoutineTsamp.cpp | |
4 | +// Created on : 2023. 8. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Cpu2DeviceDefine.h" | |
11 | + | |
12 | + | |
13 | + | |
14 | +void RoutineTsamp() | |
15 | +{ | |
16 | + | |
17 | + RmsAvgSum(); | |
18 | + | |
19 | + | |
20 | + | |
21 | + | |
22 | +} | |
23 | + |
+++ ArcCTRL-23-NEXTSQ-CPU2/V2H_2837xD_FLASH_lnk_cpu2.cmd
... | ... | @@ -0,0 +1,167 @@ |
1 | + | |
2 | +MEMORY | |
3 | +{ | |
4 | +PAGE 0 : | |
5 | + /* BEGIN is used for the "boot to SARAM" bootloader mode */ | |
6 | + | |
7 | + BEGIN : origin = 0x080000, length = 0x000002 | |
8 | + | |
9 | + RAMLS012 : origin = 0x008000, length = 0x001800 | |
10 | +// RAMLS1 : origin = 0x008800, length = 0x000800 | |
11 | +// RAMLS2 : origin = 0x009000, length = 0x000800 | |
12 | + | |
13 | + | |
14 | + RAMGS14 : origin = 0x01A000, length = 0x001000 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */ | |
15 | + RAMGS15 : origin = 0x01B000, length = 0x000FF8 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */ | |
16 | + | |
17 | +// RAMGS15_RSVD : origin = 0x01BFF8, length = 0x000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */ | |
18 | + | |
19 | + RESET : origin = 0x3FFFC0, length = 0x000002 | |
20 | + | |
21 | + /* Flash sectors */ | |
22 | + FLASHA : origin = 0x080002, length = 0x001FFE /* on-chip Flash */ | |
23 | + FLASHB : origin = 0x082000, length = 0x002000 /* on-chip Flash */ | |
24 | + FLASHC : origin = 0x084000, length = 0x002000 /* on-chip Flash */ | |
25 | + FLASHD : origin = 0x086000, length = 0x002000 /* on-chip Flash */ | |
26 | + FLASHE : origin = 0x088000, length = 0x008000 /* on-chip Flash */ | |
27 | + FLASHF : origin = 0x090000, length = 0x008000 /* on-chip Flash */ | |
28 | + FLASHG : origin = 0x098000, length = 0x008000 /* on-chip Flash */ | |
29 | + FLASHH : origin = 0x0A0000, length = 0x008000 /* on-chip Flash */ | |
30 | + FLASHI : origin = 0x0A8000, length = 0x008000 /* on-chip Flash */ | |
31 | + FLASHJ : origin = 0x0B0000, length = 0x008000 /* on-chip Flash */ | |
32 | + FLASHK : origin = 0x0B8000, length = 0x002000 /* on-chip Flash */ | |
33 | + FLASHL : origin = 0x0BA000, length = 0x002000 /* on-chip Flash */ | |
34 | + FLASHM : origin = 0x0BC000, length = 0x002000 /* on-chip Flash */ | |
35 | + | |
36 | + | |
37 | +// FLASHN_RSVD : origin = 0x0BFFF0, length = 0x000010 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */ | |
38 | + | |
39 | +PAGE 1 : | |
40 | + | |
41 | + BOOT_RSVD : origin = 0x000002, length = 0x0000A0 /* Part of M0, BOOT rom will use this for stack */ | |
42 | + RAMM0 : origin = 0x0000A2, length = 0x00035E | |
43 | + RAMM1 : origin = 0x000400, length = 0x0003F8 /* on-chip RAM block M1 */ | |
44 | +// RAMM1_RSVD : origin = 0x0007F8, length = 0x000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */ | |
45 | + RAMD0 : origin = 0x00B000, length = 0x000800 | |
46 | + RAMD1 : origin = 0x00B800, length = 0x000800 | |
47 | + | |
48 | + RAMLS3 : origin = 0x009800, length = 0x000800 | |
49 | + RAMLS4 : origin = 0x00A000, length = 0x000800 | |
50 | + RAMLS5 : origin = 0x00A800, length = 0x000800 | |
51 | + | |
52 | + //CPU1 | |
53 | + RAMGS0 : origin = 0x00C000, length = 0x001000 | |
54 | + RAMGS1 : origin = 0x00D000, length = 0x001000 | |
55 | + RAMGS2 : origin = 0x00E000, length = 0x001000 | |
56 | + RAMGS3 : origin = 0x00F000, length = 0x001000 | |
57 | + RAMGS4 : origin = 0x010000, length = 0x001000 | |
58 | + RAMGS5 : origin = 0x011000, length = 0x001000 | |
59 | + RAMGS6 : origin = 0x012000, length = 0x001000 | |
60 | + //CPU2 | |
61 | + RAMGS7 : origin = 0x013000, length = 0x001000 | |
62 | + RAMGS8 : origin = 0x014000, length = 0x001000 | |
63 | + RAMGS9 : origin = 0x015000, length = 0x001000 | |
64 | + RAMGS10 : origin = 0x016000, length = 0x001000 | |
65 | + RAMGS11 : origin = 0x017000, length = 0x001000 | |
66 | + RAMGS12 : origin = 0x018000, length = 0x001000 | |
67 | + RAMGS13 : origin = 0x019000, length = 0x001000 | |
68 | + | |
69 | + CPU2TOCPU1RAM : origin = 0x03F800, length = 0x000400 | |
70 | + CPU1TOCPU2RAM : origin = 0x03FC00, length = 0x000400 | |
71 | + | |
72 | + FLASHN : origin = 0x0BE000, length = 0x001FF0 /* on-chip Flash */ //for FpuTable | |
73 | +} | |
74 | + | |
75 | +SECTIONS | |
76 | +{ | |
77 | + /* Allocate program areas: */ | |
78 | + .cinit : > FLASHB PAGE = 0, ALIGN(8) | |
79 | + .pinit : > FLASHB, PAGE = 0, ALIGN(8) | |
80 | + .text : >> FLASHB | FLASHC | FLASHD | FLASHE PAGE = 0, ALIGN(8) | |
81 | + codestart : > BEGIN PAGE = 0, ALIGN(8) | |
82 | + | |
83 | + /* Allocate uninitalized data sections: */ | |
84 | + .stack : > RAMM1 PAGE = 1 | |
85 | + .ebss : >> RAMLS3 | RAMLS4 | RAMLS5, PAGE = 1 | |
86 | + .esysmem : > RAMLS5, PAGE = 1 | |
87 | + .cio : > RAMLS5, PAGE = 1 | |
88 | + | |
89 | + /* Initalized sections go in Flash */ | |
90 | + .econst : >> FLASHF PAGE = 0, ALIGN(8) | |
91 | + .switch : > FLASHB PAGE = 0, ALIGN(8) | |
92 | + .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */ | |
93 | + | |
94 | + | |
95 | + .TI.ramfunc : {} LOAD = FLASHD, | |
96 | + RUN = RAMLS012, | |
97 | + LOAD_START(_RamfuncsLoadStart), | |
98 | + LOAD_SIZE(_RamfuncsLoadSize), | |
99 | + LOAD_END(_RamfuncsLoadEnd), | |
100 | + RUN_START(_RamfuncsRunStart), | |
101 | + RUN_SIZE(_RamfuncsRunSize), | |
102 | + RUN_END(_RamfuncsRunEnd), | |
103 | + PAGE = 0, ALIGN(8) | |
104 | + | |
105 | + FPUmathTables : {} LOAD = FLASHN, | |
106 | + RUN = RAMD0, | |
107 | + RUN_START(_FPUmathTablesRunStart), | |
108 | + LOAD_START(_FPUmathTablesLoadStart), | |
109 | + LOAD_SIZE(_FPUmathTablesLoadSize), | |
110 | + PAGE = 1, ALIGN(8) | |
111 | + | |
112 | + | |
113 | + MSGRAM_CPU1_TO_CPU2 : > CPU1TOCPU2RAM, PAGE = 1 | |
114 | + MSGRAM_CPU2_TO_CPU1 : > CPU2TOCPU1RAM, PAGE = 1 | |
115 | + | |
116 | + | |
117 | + | |
118 | + DMARAM1 : > RAMGS10, PAGE = 1 | |
119 | + DMARAM2 : > RAMGS10, PAGE = 1 | |
120 | + DMARAM3 : > RAMGS10, PAGE = 1 | |
121 | + DMARAM4 : > RAMGS10, PAGE = 1 | |
122 | + | |
123 | + | |
124 | + //only Cpu2 can access | |
125 | + .CpuInfo : > RAMLS5, PAGE = 1 | |
126 | + .TimeSharing : > RAMLS5, PAGE = 1 | |
127 | + //-------------------------------------------------------------// | |
128 | + | |
129 | + //CPU1 RW, CPU2 R Memory | |
130 | + .AdcLib : > RAMGS6, PAGE = 1 | |
131 | + .SystemVar : > RAMGS6, PAGE = 1 | |
132 | + .Fault : > RAMGS6, PAGE = 1 | |
133 | + .Scale : > RAMGS6, PAGE = 1 | |
134 | + .Status : > RAMGS6, PAGE = 1 | |
135 | + .IntTemp : > RAMGS6, PAGE = 1 | |
136 | + .ModbusData : > RAMGS6, PAGE = 1 | |
137 | + | |
138 | + //CPU2 RW, CPU1 R Memory | |
139 | + .RmsAvg : > RAMGS13, PAGE = 1 | |
140 | + .TempData : > RAMGS13, PAGE = 1 | |
141 | + .CanLib : > RAMGS13, PAGE = 1 | |
142 | + .CanMeData : > RAMGS13, PAGE = 1 | |
143 | + .CanBeData : > RAMGS13, PAGE = 1 | |
144 | + .Modbus : > RAMGS13, PAGE = 1 | |
145 | + | |
146 | +//-------------------------------------------------------------// | |
147 | + /* The following section definitions are required when using the IPC API Drivers */ | |
148 | + GROUP : > CPU2TOCPU1RAM, PAGE = 1 | |
149 | + { | |
150 | + PUTBUFFER | |
151 | + PUTWRITEIDX | |
152 | + GETREADIDX | |
153 | + } | |
154 | + | |
155 | + GROUP : > CPU1TOCPU2RAM, PAGE = 1 | |
156 | + { | |
157 | + GETBUFFER : TYPE = DSECT | |
158 | + GETWRITEIDX : TYPE = DSECT | |
159 | + PUTREADIDX : TYPE = DSECT | |
160 | + } | |
161 | +} | |
162 | + | |
163 | +/* | |
164 | +//=========================================================================== | |
165 | +// End of file. | |
166 | +//=========================================================================== | |
167 | +*/ |
+++ ArcCTRL-23-NEXTSQ-CPU2/targetConfigs/TMS320F28377D.ccxml
... | ... | @@ -0,0 +1,22 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | +<configurations XML_version="1.2" id="configurations_0"> | |
3 | + <configuration XML_version="1.2" id="configuration_0"> | |
4 | + <instance XML_version="1.2" desc="Spectrum Digital XDS560V2 STM USB Emulator" href="connections/SD560V2USB_Connection.xml" id="Spectrum Digital XDS560V2 STM USB Emulator" xml="SD560V2USB_Connection.xml" xmlpath="connections"/> | |
5 | + <connection XML_version="1.2" id="Spectrum Digital XDS560V2 STM USB Emulator"> | |
6 | + <instance XML_version="1.2" href="drivers/tixds560icepick_c.xml" id="drivers" xml="tixds560icepick_c.xml" xmlpath="drivers"/> | |
7 | + <instance XML_version="1.2" href="drivers/tixds560c28x.xml" id="drivers" xml="tixds560c28x.xml" xmlpath="drivers"/> | |
8 | + <instance XML_version="1.2" href="drivers/tixds560cla1.xml" id="drivers" xml="tixds560cla1.xml" xmlpath="drivers"/> | |
9 | + <instance XML_version="1.2" href="drivers/tixds560cs_child.xml" id="drivers" xml="tixds560cs_child.xml" xmlpath="drivers"/> | |
10 | + <platform XML_version="1.2" id="platform_0"> | |
11 | + <instance XML_version="1.2" desc="TMS320F28377D" href="devices/tms320f28377d.xml" id="TMS320F28377D" xml="tms320f28377d.xml" xmlpath="devices"/> | |
12 | + <device HW_revision="1" XML_version="1.2" description="" id="TMS320F28377D" partnum="TMS320F28377D"> | |
13 | + <router HW_revision="1.0" XML_version="1.2" description="ICEPick_C router" id="IcePick_C_0" isa="ICEPICK_C"> | |
14 | + <subpath id="Subpath_1"> | |
15 | + <property Type="numericfield" Value="0x11" desc="Port Number_0" id="Port Number"/> | |
16 | + </subpath> | |
17 | + </router> | |
18 | + </device> | |
19 | + </platform> | |
20 | + </connection> | |
21 | + </configuration> | |
22 | +</configurations> |
+++ ArcCTRL-23-NEXTSQ-CPU2/targetConfigs/readme.txt
... | ... | @@ -0,0 +1,9 @@ |
1 | +The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based | |
2 | +on the device and connection settings specified in your project on the Properties > General page. | |
3 | + | |
4 | +Please note that in automatic target-configuration management, changes to the project's device and/or | |
5 | +connection settings will either modify an existing or generate a new target-configuration file. Thus, | |
6 | +if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, | |
7 | +you may create your own target-configuration file for this project and manage it manually. You can | |
8 | +always switch back to automatic target-configuration management by checking the "Manage the project's | |
9 | +target-configuration automatically" checkbox on the project's Properties > General page.(파일 끝에 줄바꿈 문자 없음) |
+++ Common_Resource/CodeLibrary/.ccsproject
... | ... | @@ -0,0 +1,13 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<?ccsproject version="1.0"?> | |
3 | +<projectOptions> | |
4 | + <ccsVersion value="12.3.0"/> | |
5 | + <deviceVariant value="TMS320C28XX.TMS320F28377D"/> | |
6 | + <deviceFamily value="C2000"/> | |
7 | + <deviceEndianness value="little"/> | |
8 | + <codegenToolVersion value="22.6.0.LTS"/> | |
9 | + <isElfFormat value="false"/> | |
10 | + <createSlaveProjects value=""/> | |
11 | + <templateProperties value="id=com.ti.common.project.core.emptyProjectTemplate"/> | |
12 | + <filesToOpen value=""/> | |
13 | +</projectOptions> |
+++ Common_Resource/CodeLibrary/.cproject
... | ... | @@ -0,0 +1,135 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | +<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> | |
3 | + <storageModule moduleId="org.eclipse.cdt.core.settings"> | |
4 | + <cconfiguration id="com.ti.ccstudio.buildDefinitions.C2000.Debug.481227736"> | |
5 | + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.C2000.Debug.481227736" moduleId="org.eclipse.cdt.core.settings" name="Debug"> | |
6 | + <externalSettings/> | |
7 | + <extensions> | |
8 | + <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> | |
9 | + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
10 | + <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
11 | + <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
12 | + <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
13 | + </extensions> | |
14 | + </storageModule> | |
15 | + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> | |
16 | + <configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.C2000.Debug.481227736" name="Debug" parent="com.ti.ccstudio.buildDefinitions.C2000.Debug"> | |
17 | + <folderInfo id="com.ti.ccstudio.buildDefinitions.C2000.Debug.481227736." name="/" resourcePath=""> | |
18 | + <toolChain id="com.ti.ccstudio.buildDefinitions.C2000_22.6.libraryDebugToolchain.1779907368" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.libraryDebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.librarianDebug.1326696948"> | |
19 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1614823557" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> | |
20 | + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=TMS320C28XX.TMS320F28377D"/> | |
21 | + <listOptionValue builtIn="false" value="DEVICE_CORE_ID="/> | |
22 | + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> | |
23 | + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=COFF"/> | |
24 | + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> | |
25 | + <listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/> | |
26 | + <listOptionValue builtIn="false" value="PRODUCTS="/> | |
27 | + <listOptionValue builtIn="false" value="PRODUCT_MACRO_IMPORTS={}"/> | |
28 | + </option> | |
29 | + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.686002378" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="22.6.0.LTS" valueType="string"/> | |
30 | + <targetPlatform id="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.targetPlatformDebug.471694634" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.targetPlatformDebug"/> | |
31 | + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.builderDebug.2017909000" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.builderDebug"/> | |
32 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.compilerDebug.1253913672" name="C2000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.compilerDebug"> | |
33 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.LARGE_MEMORY_MODEL.1531057239" name="Option deprecated, set by default (--large_memory_model, -ml)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.LARGE_MEMORY_MODEL" useByScannerDiscovery="false" value="true" valueType="boolean"/> | |
34 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.UNIFIED_MEMORY.1774406" name="Unified memory (--unified_memory, -mt)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.UNIFIED_MEMORY" useByScannerDiscovery="false" value="true" valueType="boolean"/> | |
35 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION.2119820736" name="Processor version (--silicon_version, -v)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION.28" valueType="enumerated"/> | |
36 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT.1563940131" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT.fpu32" valueType="enumerated"/> | |
37 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT.1979756594" name="Specify CLA support (--cla_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT.cla1" valueType="enumerated"/> | |
38 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT.425723612" name="Specify VCU support (--vcu_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT.vcu2" valueType="enumerated"/> | |
39 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT.860048800" name="Specify TMU support (--tmu_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT.tmu0" valueType="enumerated"/> | |
40 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEBUGGING_MODEL.1512174653" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEBUGGING_MODEL" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/> | |
41 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WARNING.1684664076" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WARNING" useByScannerDiscovery="false" valueType="stringList"> | |
42 | + <listOptionValue builtIn="false" value="225"/> | |
43 | + </option> | |
44 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DISPLAY_ERROR_NUMBER.457628334" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/> | |
45 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP.1253757588" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP.off" valueType="enumerated"/> | |
46 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH.476657087" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH" valueType="includePath"> | |
47 | + <listOptionValue builtIn="false" value="${PROJECT_ROOT}"/> | |
48 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/> | |
49 | + </option> | |
50 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI.1778942514" name="Application binary interface [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI.coffabi" valueType="enumerated"/> | |
51 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FP_MODE.379086044" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FP_MODE" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FP_MODE.relaxed" valueType="enumerated"/> | |
52 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_FOR_SPEED.292776831" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/> | |
53 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL.1581382537" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL.3" valueType="enumerated"/> | |
54 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS.696547452" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS"/> | |
55 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS.1964787623" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS"/> | |
56 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS.276108219" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS"/> | |
57 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM2_SRCS.1744222075" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM2_SRCS"/> | |
58 | + </tool> | |
59 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.librarianDebug.1326696948" name="C2000 Archiver" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.librarianDebug"> | |
60 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.archiverID.OUTPUT_FILE.1053358065" name="Output file" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.archiverID.OUTPUT_FILE" useByScannerDiscovery="false" value="${ProjName}.lib" valueType="string"/> | |
61 | + </tool> | |
62 | + </toolChain> | |
63 | + </folderInfo> | |
64 | + </configuration> | |
65 | + </storageModule> | |
66 | + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> | |
67 | + </cconfiguration> | |
68 | + <cconfiguration id="com.ti.ccstudio.buildDefinitions.C2000.Release.451006761"> | |
69 | + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.C2000.Release.451006761" moduleId="org.eclipse.cdt.core.settings" name="Release"> | |
70 | + <externalSettings/> | |
71 | + <extensions> | |
72 | + <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> | |
73 | + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
74 | + <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
75 | + <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
76 | + <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | |
77 | + </extensions> | |
78 | + </storageModule> | |
79 | + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> | |
80 | + <configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.C2000.Release.451006761" name="Release" parent="com.ti.ccstudio.buildDefinitions.C2000.Release"> | |
81 | + <folderInfo id="com.ti.ccstudio.buildDefinitions.C2000.Release.451006761." name="/" resourcePath=""> | |
82 | + <toolChain id="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.ReleaseToolchain.1438455741" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.librarianRelease.72530162"> | |
83 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.172522227" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> | |
84 | + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=TMS320C28XX.TMS320F28377D"/> | |
85 | + <listOptionValue builtIn="false" value="DEVICE_CORE_ID="/> | |
86 | + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> | |
87 | + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=COFF"/> | |
88 | + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> | |
89 | + <listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/> | |
90 | + <listOptionValue builtIn="false" value="PRODUCTS="/> | |
91 | + <listOptionValue builtIn="false" value="PRODUCT_MACRO_IMPORTS={}"/> | |
92 | + </option> | |
93 | + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.152891223" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="22.6.0.LTS" valueType="string"/> | |
94 | + <targetPlatform id="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.targetPlatformRelease.1596951938" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.targetPlatformRelease"/> | |
95 | + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.builderRelease.1010902584" name="GNU Make.Release" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.builderRelease"/> | |
96 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.compilerRelease.143520485" name="C2000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.compilerRelease"> | |
97 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.LARGE_MEMORY_MODEL.1087349893" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.LARGE_MEMORY_MODEL" useByScannerDiscovery="false" value="true" valueType="boolean"/> | |
98 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.UNIFIED_MEMORY.2022034764" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.UNIFIED_MEMORY" useByScannerDiscovery="false" value="true" valueType="boolean"/> | |
99 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION.1671667032" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.SILICON_VERSION.28" valueType="enumerated"/> | |
100 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT.2066784967" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.FLOAT_SUPPORT.fpu32" valueType="enumerated"/> | |
101 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT.1008330494" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.CLA_SUPPORT.cla1" valueType="enumerated"/> | |
102 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT.1039609819" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.VCU_SUPPORT.vcu2" valueType="enumerated"/> | |
103 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT.580705894" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.TMU_SUPPORT.tmu0" valueType="enumerated"/> | |
104 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WARNING.1202823400" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WARNING" useByScannerDiscovery="false" valueType="stringList"> | |
105 | + <listOptionValue builtIn="false" value="225"/> | |
106 | + </option> | |
107 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DISPLAY_ERROR_NUMBER.724969209" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/> | |
108 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP.1940115282" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_WRAP.off" valueType="enumerated"/> | |
109 | + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH.1191072888" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH" valueType="includePath"> | |
110 | + <listOptionValue builtIn="false" value="${PROJECT_ROOT}"/> | |
111 | + <listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/> | |
112 | + </option> | |
113 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI.626937096" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ABI.coffabi" valueType="enumerated"/> | |
114 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS.1639113755" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS"/> | |
115 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS.1286139843" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS"/> | |
116 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS.1026494801" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS"/> | |
117 | + <inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM2_SRCS.973322631" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM2_SRCS"/> | |
118 | + </tool> | |
119 | + <tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.librarianRelease.72530162" name="C2000 Archiver" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.library.librarianRelease"> | |
120 | + <option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.archiverID.OUTPUT_FILE.1800176911" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.archiverID.OUTPUT_FILE" useByScannerDiscovery="false" value="${ProjName}.lib" valueType="string"/> | |
121 | + </tool> | |
122 | + </toolChain> | |
123 | + </folderInfo> | |
124 | + </configuration> | |
125 | + </storageModule> | |
126 | + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> | |
127 | + </cconfiguration> | |
128 | + </storageModule> | |
129 | + <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> | |
130 | + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> | |
131 | + <project id="CodeLibrary.com.ti.ccstudio.buildDefinitions.C2000.ProjectType.57556923" name="C2000" projectType="com.ti.ccstudio.buildDefinitions.C2000.ProjectType"/> | |
132 | + </storageModule> | |
133 | + <storageModule moduleId="scannerConfiguration"/> | |
134 | + <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> | |
135 | +</cproject>(파일 끝에 줄바꿈 문자 없음) |
+++ Common_Resource/CodeLibrary/.gitignore
... | ... | @@ -0,0 +1,1 @@ |
1 | +/Debug/ |
+++ Common_Resource/CodeLibrary/.project
... | ... | @@ -0,0 +1,27 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<projectDescription> | |
3 | + <name>CodeLibrary</name> | |
4 | + <comment></comment> | |
5 | + <projects> | |
6 | + </projects> | |
7 | + <buildSpec> | |
8 | + <buildCommand> | |
9 | + <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> | |
10 | + <arguments> | |
11 | + </arguments> | |
12 | + </buildCommand> | |
13 | + <buildCommand> | |
14 | + <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> | |
15 | + <triggers>full,incremental,</triggers> | |
16 | + <arguments> | |
17 | + </arguments> | |
18 | + </buildCommand> | |
19 | + </buildSpec> | |
20 | + <natures> | |
21 | + <nature>com.ti.ccstudio.core.ccsNature</nature> | |
22 | + <nature>org.eclipse.cdt.core.cnature</nature> | |
23 | + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> | |
24 | + <nature>org.eclipse.cdt.core.ccnature</nature> | |
25 | + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> | |
26 | + </natures> | |
27 | +</projectDescription> |
+++ Common_Resource/CodeLibrary/.settings/org.eclipse.cdt.codan.core.prefs
... | ... | @@ -0,0 +1,3 @@ |
1 | +eclipse.preferences.version=1 | |
2 | +inEditor=false | |
3 | +onBuild=false |
+++ Common_Resource/CodeLibrary/.settings/org.eclipse.cdt.debug.core.prefs
... | ... | @@ -0,0 +1,2 @@ |
1 | +eclipse.preferences.version=1 | |
2 | +org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker |
+++ Common_Resource/CodeLibrary/.settings/org.eclipse.core.resources.prefs
... | ... | @@ -0,0 +1,18 @@ |
1 | +eclipse.preferences.version=1 | |
2 | +encoding//Debug/CRC/subdir_rules.mk=UTF-8 | |
3 | +encoding//Debug/CRC/subdir_vars.mk=UTF-8 | |
4 | +encoding//Debug/DigitalCtrl/subdir_rules.mk=UTF-8 | |
5 | +encoding//Debug/DigitalCtrl/subdir_vars.mk=UTF-8 | |
6 | +encoding//Debug/DigitalFilter/subdir_rules.mk=UTF-8 | |
7 | +encoding//Debug/DigitalFilter/subdir_vars.mk=UTF-8 | |
8 | +encoding//Debug/Ntc/subdir_rules.mk=UTF-8 | |
9 | +encoding//Debug/Ntc/subdir_vars.mk=UTF-8 | |
10 | +encoding//Debug/PLL/subdir_rules.mk=UTF-8 | |
11 | +encoding//Debug/PLL/subdir_vars.mk=UTF-8 | |
12 | +encoding//Debug/TimeSharing/subdir_rules.mk=UTF-8 | |
13 | +encoding//Debug/TimeSharing/subdir_vars.mk=UTF-8 | |
14 | +encoding//Debug/Util/subdir_rules.mk=UTF-8 | |
15 | +encoding//Debug/Util/subdir_vars.mk=UTF-8 | |
16 | +encoding//Debug/makefile=UTF-8 | |
17 | +encoding//Debug/objects.mk=UTF-8 | |
18 | +encoding//Debug/sources.mk=UTF-8 |
+++ Common_Resource/CodeLibrary/CRC/CRC16.cpp
... | ... | @@ -0,0 +1,65 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : CRC16.cpp | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include <CodeLibMath.h> | |
11 | +#include <CRC/CRC16.h> | |
12 | + | |
13 | + | |
14 | + | |
15 | +static const Uint8 CrcHi[256] = | |
16 | + { 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, | |
17 | + 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, | |
18 | + 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, | |
19 | + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, | |
20 | + 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, | |
21 | + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, | |
22 | + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, | |
23 | + 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, | |
24 | + 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, | |
25 | + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, | |
26 | + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, | |
27 | + 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, | |
28 | + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, | |
29 | + 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, | |
30 | + 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, | |
31 | + 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 }; | |
32 | + | |
33 | +static const Uint8 CrcLo[256] = | |
34 | + { 0x00, 0xC0, 0xC1, 0x01, 0xC3, 0x03, 0x02, 0xC2, 0xC6, 0x06, 0x07, 0xC7, 0x05, 0xC5, 0xC4, 0x04, | |
35 | + 0xCC, 0x0C, 0x0D, 0xCD, 0x0F, 0xCF, 0xCE, 0x0E, 0x0A, 0xCA, 0xCB, 0x0B, 0xC9, 0x09, 0x08, 0xC8, | |
36 | + 0xD8, 0x18, 0x19, 0xD9, 0x1B, 0xDB, 0xDA, 0x1A, 0x1E, 0xDE, 0xDF, 0x1F, 0xDD, 0x1D, 0x1C, 0xDC, | |
37 | + 0x14, 0xD4, 0xD5, 0x15, 0xD7, 0x17, 0x16, 0xD6, 0xD2, 0x12, 0x13, 0xD3, 0x11, 0xD1, 0xD0, 0x10, | |
38 | + 0xF0, 0x30, 0x31, 0xF1, 0x33, 0xF3, 0xF2, 0x32, 0x36, 0xF6, 0xF7, 0x37, 0xF5, 0x35, 0x34, 0xF4, | |
39 | + 0x3C, 0xFC, 0xFD, 0x3D, 0xFF, 0x3F, 0x3E, 0xFE, 0xFA, 0x3A, 0x3B, 0xFB, 0x39, 0xF9, 0xF8, 0x38, | |
40 | + 0x28, 0xE8, 0xE9, 0x29, 0xEB, 0x2B, 0x2A, 0xEA, 0xEE, 0x2E, 0x2F, 0xEF, 0x2D, 0xED, 0xEC, 0x2C, | |
41 | + 0xE4, 0x24, 0x25, 0xE5, 0x27, 0xE7, 0xE6, 0x26, 0x22, 0xE2, 0xE3, 0x23, 0xE1, 0x21, 0x20, 0xE0, | |
42 | + 0xA0, 0x60, 0x61, 0xA1, 0x63, 0xA3, 0xA2, 0x62, 0x66, 0xA6, 0xA7, 0x67, 0xA5, 0x65, 0x64, 0xA4, | |
43 | + 0x6C, 0xAC, 0xAD, 0x6D, 0xAF, 0x6F, 0x6E, 0xAE, 0xAA, 0x6A, 0x6B, 0xAB, 0x69, 0xA9, 0xA8, 0x68, | |
44 | + 0x78, 0xB8, 0xB9, 0x79, 0xBB, 0x7B, 0x7A, 0xBA, 0xBE, 0x7E, 0x7F, 0xBF, 0x7D, 0xBD, 0xBC, 0x7C, | |
45 | + 0xB4, 0x74, 0x75, 0xB5, 0x77, 0xB7, 0xB6, 0x76, 0x72, 0xB2, 0xB3, 0x73, 0xB1, 0x71, 0x70, 0xB0, | |
46 | + 0x50, 0x90, 0x91, 0x51, 0x93, 0x53, 0x52, 0x92, 0x96, 0x56, 0x57, 0x97, 0x55, 0x95, 0x94, 0x54, | |
47 | + 0x9C, 0x5C, 0x5D, 0x9D, 0x5F, 0x9F, 0x9E, 0x5E, 0x5A, 0x9A, 0x9B, 0x5B, 0x99, 0x59, 0x58, 0x98, | |
48 | + 0x88, 0x48, 0x49, 0x89, 0x4B, 0x8B, 0x8A, 0x4A, 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, 0x4D, 0x4C, 0x8C, | |
49 | + 0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42, 0x43, 0x83, 0x41, 0x81, 0x80, 0x40 }; | |
50 | + | |
51 | +Uint16 CRC16(Uint8 * pucFrame, Uint16 usLen) | |
52 | +{ | |
53 | + Uint16 ucCrcHi = 0xFF; | |
54 | + Uint16 ucCrcLo = 0xFF; | |
55 | + int Index; | |
56 | + | |
57 | + while (usLen--) | |
58 | + { | |
59 | + Index = ucCrcLo ^ *(pucFrame++); | |
60 | + ucCrcLo = (Uint16) (ucCrcHi ^ CrcHi[Index]); | |
61 | + ucCrcHi = CrcLo[Index]; | |
62 | + } | |
63 | + return ((Uint16) ucCrcHi << 8 | ucCrcLo); | |
64 | +} | |
65 | + |
+++ Common_Resource/CodeLibrary/CRC/CRC16.h
... | ... | @@ -0,0 +1,27 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : CRC16.h | |
4 | +// Created on : 2019. 06. 09. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | +#ifndef CRC_CRC16_H_ | |
10 | +#define CRC_CRC16_H_ | |
11 | + | |
12 | +#ifdef __cplusplus | |
13 | +extern "C" { | |
14 | +#endif | |
15 | + | |
16 | + | |
17 | + | |
18 | + | |
19 | +extern Uint16 CRC16(Uint8 * pucFrame, Uint16 usLen); | |
20 | + | |
21 | + | |
22 | + | |
23 | + | |
24 | +#ifdef __cplusplus | |
25 | +} | |
26 | +#endif /* extern "C" */ | |
27 | +#endif /* _CRC16_H_ */ |
+++ Common_Resource/CodeLibrary/CodeLibMath.h
... | ... | @@ -0,0 +1,55 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : CodeLibMath.h | |
4 | +// Created on : 2022. 11. 5. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef COMMON_RESOURCE_CODELIBRARY_CODELIBMATH_H_ | |
11 | +#define COMMON_RESOURCE_CODELIBRARY_CODELIBMATH_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | +typedef int int16; | |
19 | +typedef long int32; | |
20 | +typedef long long int64; | |
21 | +typedef unsigned char Uint8; | |
22 | +typedef unsigned int Uint16; | |
23 | +typedef unsigned long Uint32; | |
24 | +typedef unsigned long long Uint64; | |
25 | +typedef float float32; | |
26 | +typedef long double float64; | |
27 | + | |
28 | +#include <stdint.h> | |
29 | +typedef uint16_t uint8_t; | |
30 | +typedef int16_t int8_t; | |
31 | + | |
32 | + | |
33 | +#define PI 3.14159265358979323846 | |
34 | +#define INV_PI 0.31830988618379067153 | |
35 | + | |
36 | +#define SQRT2 1.41421356237309504880 | |
37 | +#define SQRT3 1.73205080756887729352 | |
38 | +#define INV_SQRT2 0.70710678118654752440 | |
39 | +#define INV_SQRT3 0.57735026918962576450 | |
40 | + | |
41 | +#define INV3 0.33333333333333333333 | |
42 | + | |
43 | +#define BOUND_PI(x) ((x) + (((x) > PI) ? (-2. * PI) : ((x) < (-PI)) ? (2. * PI) : 0.)) | |
44 | +#define LIMITER(value,Upper,Lower) ((value) > (Upper) ? (Upper) : (value) < (Lower) ? (Lower) : (value)) | |
45 | + | |
46 | +#include "math.h" | |
47 | +#include "Util/Util.h" | |
48 | + | |
49 | + | |
50 | + | |
51 | +#ifdef __cplusplus | |
52 | +} | |
53 | +#endif /* extern "C" */ | |
54 | + | |
55 | +#endif /* COMMON_RESOURCE_CODELIBRARY_CODELIBMATH_H_ */ |
+++ Common_Resource/CodeLibrary/CodeLibrary.h
... | ... | @@ -0,0 +1,48 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary Header | |
3 | +// File Name : CodeLibrary.h | |
4 | +// Created on : 2022. 11. 04. | |
5 | +// Description : 코드 라이브러리 헤더 | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef CODELIBRARY_H_ | |
11 | +#define CODELIBRARY_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +#include "CodeLibMath.h" | |
18 | + | |
19 | +//---------------PLL-------------------// | |
20 | +#include "PLL/SoapPll3ph.h" | |
21 | +#include "PLL/SogiPll3ph.h" | |
22 | +#include "PLL/SogiFll1ph.h" | |
23 | + | |
24 | +//---------------Digital Controller-------// | |
25 | +#include "DigitalCtrl/PiCtrl.h" | |
26 | +#include "DigitalCtrl/HarRes.h" | |
27 | +//---------------UTIL-------------------// | |
28 | +#include "Util/Ramp.h" | |
29 | +#include "Util/Util.h" | |
30 | +//---------------CRC---------------------// | |
31 | +#include "CRC/CRC16.h" | |
32 | + | |
33 | +//---------------Digital Filter----------// | |
34 | +#include "DigitalFilter/Lpf.h" | |
35 | +#include "DigitalFilter/Notch.h" | |
36 | + | |
37 | +//--------Time Sharing ------------------// | |
38 | +#include "TimeSharing/TimeSharing.h" | |
39 | + | |
40 | + | |
41 | +//---------------------NTC---------------// | |
42 | +#include "Ntc/Ntc.h" | |
43 | + | |
44 | +#ifdef __cplusplus | |
45 | +} | |
46 | +#endif /* extern "C" */ | |
47 | + | |
48 | +#endif /* CODELIBRARY_H_ */ |
+++ Common_Resource/CodeLibrary/DigitalCtrl/HarRes.cpp
... | ... | @@ -0,0 +1,180 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : HarRes.cpp | |
4 | +// Created on : 2022. 11. 5. | |
5 | +// Description : 고조파 제어기 | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include <CodeLibMath.h> | |
11 | +#include <DigitalCtrl/HarRes.h> | |
12 | + | |
13 | + | |
14 | + | |
15 | +float sLeadCompensator::Run(float in) | |
16 | +{ | |
17 | + out = k1 * in; | |
18 | + out += k2 * inPrev; | |
19 | + out += k3 * outPrev; | |
20 | + | |
21 | + // update compensator-variables | |
22 | + inPrev = in; | |
23 | + outPrev = out; | |
24 | + | |
25 | + return out; | |
26 | +} | |
27 | + | |
28 | +void sIinvHarRes::LeadCompUpdateGain() | |
29 | +{ | |
30 | + // gains for lead compensator in R controller | |
31 | + // d-axis gains | |
32 | + | |
33 | + LeadCompd.WTcomp = Wr * Tsamp; | |
34 | + ThetaRes = 1.5 * LeadCompd.WTcomp; // 1.5Tsamp digital delay is considered | |
35 | + ThetaRes = BOUND_PI(ThetaRes); | |
36 | + LeadCompd.SinComp = sin(ThetaRes); | |
37 | + LeadCompd.CosComp = 1. / cos(ThetaRes); | |
38 | + | |
39 | + LeadCompd.ZT = LeadCompd.WTcomp * LeadCompd.CosComp * (1. - LeadCompd.SinComp) * 0.5; | |
40 | + LeadCompd.PT = LeadCompd.WTcomp * LeadCompd.CosComp * (1. + LeadCompd.SinComp) * 0.5; | |
41 | + LeadCompd.Kc = sqrt(LeadCompd.PT / LeadCompd.ZT); | |
42 | + | |
43 | + LeadCompd.k1 = (1. + LeadCompd.ZT) * LeadCompd.Kc / (1. + LeadCompd.PT); | |
44 | + LeadCompd.k2 = (LeadCompd.ZT - 1.) * LeadCompd.Kc / (1. + LeadCompd.PT); | |
45 | + LeadCompd.k3 = (1. - LeadCompd.PT) / (1. + LeadCompd.PT); | |
46 | + | |
47 | + // q-axis gains | |
48 | + LeadCompq.k1 = LeadCompd.k1; | |
49 | + LeadCompq.k2 = LeadCompd.k2; | |
50 | + LeadCompq.k3 = LeadCompd.k3; | |
51 | +} | |
52 | + | |
53 | +void sIinvHarRes::Reset() | |
54 | +{ | |
55 | + Idr1 = 0.; | |
56 | + Idr2 = 0.; | |
57 | + Vdr1 = 0.; | |
58 | + Vdr2 = 0.; | |
59 | + | |
60 | + Iqr1 = 0.; | |
61 | + Iqr2 = 0.; | |
62 | + Vqr1 = 0.; | |
63 | + Vqr2 = 0.; | |
64 | + | |
65 | + VdssRef = 0.; | |
66 | + VqssRef = 0.; | |
67 | + VdssLead = 0.; | |
68 | + VqssLead = 0.; | |
69 | + | |
70 | + LeadCompd.inPrev = 0.; | |
71 | + LeadCompd.outPrev = 0.; | |
72 | + LeadCompd.out = 0.; | |
73 | + LeadCompq.inPrev = 0.; | |
74 | + LeadCompq.outPrev = 0.; | |
75 | + LeadCompq.out = 0.; | |
76 | +} | |
77 | + | |
78 | +void sIinvHarRes::Init(float mRc, float mOrder, float mWcc, float mWeRate, float mTsamp) | |
79 | +{ | |
80 | + Idr1 = 0.; | |
81 | + Idr2 = 0.; | |
82 | + Vdr1 = 0.; | |
83 | + Vdr2 = 0.; | |
84 | + | |
85 | + Iqr1 = 0.; | |
86 | + Iqr2 = 0.; | |
87 | + Vqr1 = 0.; | |
88 | + Vqr2 = 0.; | |
89 | + | |
90 | + VdssRef = 0.; | |
91 | + VqssRef = 0.; | |
92 | + VdssLead = 0.; | |
93 | + VqssLead = 0.; | |
94 | + | |
95 | + LeadCompd.inPrev = 0.; | |
96 | + LeadCompd.outPrev = 0.; | |
97 | + LeadCompd.out = 0.; | |
98 | + LeadCompq.inPrev = 0.; | |
99 | + LeadCompq.outPrev = 0.; | |
100 | + LeadCompq.out = 0.; | |
101 | + | |
102 | + Tsamp = mTsamp; | |
103 | + Wcc = mWcc; | |
104 | + Rc = mRc; | |
105 | + Kr = Rc * Wcc; | |
106 | + order = mOrder; | |
107 | + WeRate = mWeRate; | |
108 | + Wr = order * WeRate; | |
109 | + delay = 1.5; | |
110 | + | |
111 | + // gains of R controller | |
112 | + Cr1 = tan( Wr * Tsamp * 0.5); | |
113 | + Cr2 = 1. - Cr1 * Cr1; | |
114 | + Cr3 = 1. + Cr1 * Cr1; | |
115 | + Kr1 = Cr1 / Wr / Cr3; | |
116 | + Kr2 = 2. * Cr2 / Cr3; | |
117 | + | |
118 | + LeadCompUpdateGain(); | |
119 | + | |
120 | +} // initilize gains of resonant controller | |
121 | + | |
122 | +void sIinvHarRes::UpdateGain(float mWe_hat) | |
123 | +{ | |
124 | + | |
125 | + Kr = Rc * Wcc; | |
126 | + // frequency updates | |
127 | + Wr = order * mWe_hat; | |
128 | + | |
129 | + // gains of R controller | |
130 | + Cr1 = tan(Wr * Tsamp * 0.5); | |
131 | + Cr2 = 1. - Cr1 * Cr1; | |
132 | + Cr3 = 1. + Cr1 * Cr1; | |
133 | + // More simplified gain settings for R controller itself | |
134 | + Kr1 = Cr1 / Wr / Cr3; | |
135 | + Kr2 = 2. * Cr2 / Cr3; | |
136 | + | |
137 | + LeadCompUpdateGain(); | |
138 | +} | |
139 | + | |
140 | +void sIinvHarRes::Run(float mIds, float mIqs) | |
141 | +{ | |
142 | + | |
143 | + // error currents in the synchronous d-q reference frame | |
144 | + Idr = -Kr * mIds; | |
145 | + Iqr = -Kr * mIqs; | |
146 | + | |
147 | + // d-axis harmonic voltage references | |
148 | + VdssRef = Kr1 * (Idr - Idr2); | |
149 | + VdssRef += Kr2 * Vdr1; | |
150 | + VdssRef -= Vdr2; | |
151 | + | |
152 | + // q-axis harmonic voltage references | |
153 | + VqssRef = Kr1 * (Iqr - Iqr2); | |
154 | + VqssRef += Kr2 * Vqr1; | |
155 | + VqssRef -= Vqr2; | |
156 | + | |
157 | + // update state variables for next sampling period | |
158 | + // d-axis | |
159 | + Idr2 = Idr1; | |
160 | + Idr1 = Idr; | |
161 | + Vdr2 = Vdr1; | |
162 | + Vdr1 = VdssRef; | |
163 | + | |
164 | + // q-axis | |
165 | + Iqr2 = Iqr1; | |
166 | + Iqr1 = Iqr; | |
167 | + Vqr2 = Vqr1; | |
168 | + Vqr1 = VqssRef; | |
169 | + | |
170 | + // lead compensator for digital delay in R controller | |
171 | + VdssLead = LeadCompd.Run(VdssRef); | |
172 | + VqssLead = LeadCompq.Run(VqssRef); | |
173 | + | |
174 | + // limiter for voltage references of resonant controller | |
175 | + VdssLead = LIMITER(VdssLead, 20, -20); | |
176 | + VqssLead = LIMITER(VqssLead, 20, -20); | |
177 | + | |
178 | +} | |
179 | + | |
180 | + |
+++ Common_Resource/CodeLibrary/DigitalCtrl/HarRes.h
... | ... | @@ -0,0 +1,66 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : HarRes.h | |
4 | +// Created on : 2022. 11. 5. | |
5 | +// Description : 고조파 제어기 | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef DIGITALCTRL_HARRES_H_ | |
11 | +#define DIGITALCTRL_HARRES_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | +//Resonant Control(SNU) | |
19 | +struct sLeadCompensator | |
20 | +{ | |
21 | + float WTcomp, SinComp, CosComp, ZT, PT, Kc; | |
22 | + float k1, k2, k3; | |
23 | + float inPrev, outPrev; | |
24 | + float out; | |
25 | + | |
26 | + float Run(float in); | |
27 | +}; | |
28 | + | |
29 | +struct sIinvHarRes | |
30 | +{ | |
31 | + float Rc; | |
32 | + float Wcc, Kr; | |
33 | + float Cr1, Cr2, Cr3, Wr; | |
34 | + float WeRate; | |
35 | + float Kr1, Kr2; | |
36 | + float Idr, Idr1, Idr2, Iqr, Iqr1, Iqr2; | |
37 | + float Vdr1, Vdr2, Vqr1, Vqr2; | |
38 | + float VdssRef, VqssRef; | |
39 | + float VdssLead; | |
40 | + float VqssLead; | |
41 | + float delay, order; | |
42 | + | |
43 | + float Tsamp; | |
44 | + float ThetaRes; | |
45 | + | |
46 | + | |
47 | + void Init(float mRc, float mOrder, float mWcc, float mWeRate, float mTsamp); | |
48 | + void UpdateGain(float mWe_hat); | |
49 | + void Run(float mIds, float mIqs); | |
50 | + void Reset(); | |
51 | + | |
52 | + struct sLeadCompensator LeadCompd; | |
53 | + struct sLeadCompensator LeadCompq; | |
54 | + void LeadCompUpdateGain(); | |
55 | + | |
56 | +}; | |
57 | + | |
58 | + | |
59 | + | |
60 | + | |
61 | + | |
62 | +#ifdef __cplusplus | |
63 | +} | |
64 | +#endif /* extern "C" */ | |
65 | + | |
66 | +#endif /* COMMON_RESOURCE_CODELIBRARY_HARRES_HARRES_H_ */ |
+++ Common_Resource/CodeLibrary/DigitalCtrl/PiCtrl.cpp
... | ... | @@ -0,0 +1,42 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : PI_Ctrl.cpp | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : PI 제어기 | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include <CodeLibMath.h> | |
11 | +#include <DigitalCtrl/PiCtrl.h> | |
12 | + | |
13 | + | |
14 | + | |
15 | +void sPiCtrl::Reset() | |
16 | +{ | |
17 | + Err = 0; | |
18 | + fb = 0; | |
19 | + Integ = 0; | |
20 | + out = 0; | |
21 | +} | |
22 | + | |
23 | +float sPiCtrl::Run() | |
24 | +{ | |
25 | + Integ += Ki * (Err - Ka * (fb - out)); | |
26 | +// Integ = LIMITER(Integ, PImax, PImin); | |
27 | + fb = Integ + Kp * Err + ff; // PI | |
28 | + out = LIMITER(fb, PiMax, PiMin); | |
29 | + | |
30 | + return out; | |
31 | +} | |
32 | + | |
33 | +void sPiCtrl::Init(float mKp, float mKi, float mKa, float mWc, float mTprd, float mPI_Max, float mPI_Min) | |
34 | +{ | |
35 | + Kp = mKp; | |
36 | + Ki = mKi; | |
37 | + Ka = mKa; | |
38 | + Wc = mWc; | |
39 | + Tprd = mTprd; | |
40 | + PiMax = mPI_Max; | |
41 | + PiMin = mPI_Min; | |
42 | +} |
+++ Common_Resource/CodeLibrary/DigitalCtrl/PiCtrl.h
... | ... | @@ -0,0 +1,53 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : PiCtrl.h | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : PI 제어기 | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef DIGITALCTRL_PICTRL_H_ | |
11 | +#define DIGITALCTRL_PICTRL_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | +#define PI_MODE 0 | |
19 | +#define IP_MODE 1 | |
20 | + | |
21 | + | |
22 | +struct sPiCtrl | |
23 | +{ | |
24 | + float Kp; // 비례 게인 | |
25 | + float Ki; // 적분 게인 | |
26 | + float Ka; // 안티-와인드업 게인 | |
27 | + float Wc; // 제어기 대역폭 | |
28 | + float ff; // 피드포워드 항 | |
29 | + float PiMax; // 제어기 리미트 최대치 | |
30 | + float PiMin; // 제어기 리미트 최소치 | |
31 | + float Err; // 에러값 | |
32 | + float Integ; // 적분항 | |
33 | + float fb; // 피드백항 | |
34 | + float out; // 제어 출력값 | |
35 | + float Tprd; // 제어 주기 | |
36 | + float ref; // 지령치 | |
37 | + float Val; // 현재값 | |
38 | + | |
39 | + | |
40 | + void Reset(void); // 제어기 리셋 | |
41 | + void Init(float mKp, float mKi, float mKa, float mWc, float mTprd, float mPI_Max, float mPI_Min); // 제어기 초기화 | |
42 | + float Run(); | |
43 | +}; | |
44 | + | |
45 | +//초기화 및 게인 업데이트는 각 상황마다 상이하므로 별도로 입력해 줄 것 | |
46 | + | |
47 | + | |
48 | + | |
49 | + | |
50 | +#ifdef __cplusplus | |
51 | +} | |
52 | +#endif /* extern "C" */ | |
53 | +#endif /* _PI_CTRL_H_ */ |
+++ Common_Resource/CodeLibrary/DigitalFilter/Lpf.cpp
... | ... | @@ -0,0 +1,112 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : Lpf.cpp | |
4 | +// Created on : 2022. 11. 5. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "CodeLibMath.h" | |
11 | +#include "DigitalFilter/Lpf.h" | |
12 | + | |
13 | + | |
14 | + | |
15 | +void sLpf1st::CoeffUpdate() | |
16 | +{ | |
17 | + Fcut = *pFcut; | |
18 | + Wc = 2. * PI * Fcut; | |
19 | + a1 = (2. - Wc * Tfsamp) / (2. + Wc * Tfsamp); | |
20 | + b0 = (Wc * Tfsamp) / (2. + Wc * Tfsamp); | |
21 | +} | |
22 | + | |
23 | +void sLpf1st::Init(float *Fcutoff, float SamplingTime, float *InData) | |
24 | +{ | |
25 | + pInData = (float *) InData; | |
26 | + Tfsamp = SamplingTime; | |
27 | + | |
28 | + Wc = 0.; | |
29 | + a1 = 0.; | |
30 | + b0 = 0.; | |
31 | + | |
32 | + in = 0.; | |
33 | + old = 0.; | |
34 | + out = 0.; | |
35 | + | |
36 | + pFcut = (float *) Fcutoff; | |
37 | + | |
38 | + CoeffUpdate(); | |
39 | +} | |
40 | + | |
41 | +float sLpf1st::Run(void) | |
42 | +{ | |
43 | + in = *pInData; | |
44 | + out = a1 * out + b0 * (in + old); | |
45 | + old = in; | |
46 | + | |
47 | + return out; | |
48 | +} | |
49 | + | |
50 | + | |
51 | +void sLpf2nd::CoeffUpdate() | |
52 | +{ | |
53 | + Fcut = (float)*pFcut; | |
54 | + Wc = 2. * PI * Fcut; | |
55 | + zeta = 1. / (2.*(float)*pQf); | |
56 | + | |
57 | + d0 = Wc * Wc * Ts * Ts; // W^2 * Ts^2 | |
58 | + d1 = 4. * zeta * Wc * Ts; // 4 * zeta * omega *Tfsamp | |
59 | + | |
60 | + a0 = (d0 + d1 + 4.); | |
61 | + a1 = (2. * d0 - 8.) / a0; | |
62 | + a2 = (d0 - d1 + 4.) / a0; | |
63 | + b0 = d0 / a0; | |
64 | + b1 = 2. * b0; | |
65 | + b2 = b0; | |
66 | + | |
67 | +} | |
68 | + | |
69 | +void sLpf2nd::Init(float* Fcutoff, float* Qf, float SamplingTime, float* InData) | |
70 | +{ | |
71 | + pInData = (float*)InData; | |
72 | + Ts = SamplingTime; | |
73 | + pQf = (float*)Qf; | |
74 | + zeta = 0.5 * (*pQf); | |
75 | + pFcut = (float*)Fcutoff; | |
76 | + | |
77 | + Wc = 0.; | |
78 | + a0 = 0.; | |
79 | + a1 = 0.; | |
80 | + b0 = 0.; | |
81 | + b1 = 0.; | |
82 | + b2 = 0.; | |
83 | + | |
84 | + in = 0.; // x[n] | |
85 | + in1 = 0.; // x[n-1] | |
86 | + in2 = 0.; // x[n-2] | |
87 | + | |
88 | + out = 0.; // y[n] | |
89 | + out1 = 0.; // y[n-1] | |
90 | + out2 = 0.; // y[n-2] | |
91 | + | |
92 | + CoeffUpdate(); | |
93 | +} | |
94 | + | |
95 | +float sLpf2nd::Run(void) | |
96 | +{ | |
97 | + in = *pInData; | |
98 | + out = (b0 * in + b1 * in1 + b2 * in2) - (a1 * out1 + a2 * out2); | |
99 | + | |
100 | + in2 = in1; | |
101 | + in1 = in; | |
102 | + | |
103 | + out2 = out1; | |
104 | + out1 = out; | |
105 | + | |
106 | + | |
107 | + return out; | |
108 | +} | |
109 | + | |
110 | + | |
111 | + | |
112 | + |
+++ Common_Resource/CodeLibrary/DigitalFilter/Lpf.h
... | ... | @@ -0,0 +1,58 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : Lpf.h | |
4 | +// Created on : 2022. 11. 5. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef DIGITALFILTER_LPF_H_ | |
11 | +#define DIGITALFILTER_LPF_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +struct sLpf1st | |
18 | +{ | |
19 | + float *pInData; | |
20 | + float *pFcut; | |
21 | + | |
22 | + float in, old; | |
23 | + float out; | |
24 | + float a1, b0; | |
25 | + float Fcut, Wc; | |
26 | + | |
27 | + float Tfsamp; | |
28 | + | |
29 | + void Init(float *Fcutoff, float SamplingTime, float *InData); | |
30 | + void CoeffUpdate(void); | |
31 | + float Run(void); | |
32 | +}; | |
33 | + | |
34 | +struct sLpf2nd | |
35 | +{ | |
36 | + float *pInData; | |
37 | + float *pFcut; | |
38 | + float *pQf; // Q Factor | |
39 | + | |
40 | + float in, in1, in2; | |
41 | + float out, out1, out2; | |
42 | + float a0, a1, a2, b0, b1, b2; | |
43 | + float d0, d1, d2, d3; | |
44 | + float Fcut, Wc; | |
45 | + float zeta; | |
46 | + | |
47 | + float Ts; | |
48 | + | |
49 | + void Init(float *Fcutoff, float *Qf, float Tsampling, float *InData); | |
50 | + void CoeffUpdate(void); | |
51 | + float Run(void); | |
52 | +}; | |
53 | + | |
54 | +#ifdef __cplusplus | |
55 | +} | |
56 | +#endif /* extern "C" */ | |
57 | + | |
58 | +#endif /* COMMON_RESOURCE_CODELIBRARY_DIGITALFILTER_LPF_H_ */ |
+++ Common_Resource/CodeLibrary/DigitalFilter/Notch.cpp
... | ... | @@ -0,0 +1,84 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : Notch.cpp | |
4 | +// Created on : 2022. 12. 20. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "DigitalFilter/Notch.h" | |
11 | +#include "CodeLibMath.h" | |
12 | + | |
13 | + | |
14 | +void sNotch::CoeffUpdate() | |
15 | +{ | |
16 | + // Fcut = Fcutoff; | |
17 | + //LPF1st_Fcut = mCut_Off_Freq; | |
18 | + | |
19 | + Fcut = (float)*pFcut; | |
20 | + Wc = 2. * PI * Fcut; | |
21 | + //K = 2. / Ts; // Tustin | |
22 | + k = Wc / tan((Wc * Ts) / 2.); // PreaWarp | |
23 | + | |
24 | + //임시 | |
25 | + c = 10; //대역폭 | |
26 | + d = 0.001; //감쇠율 | |
27 | + | |
28 | + zeta1 = 1 / c; | |
29 | + zeta2 = d / c; | |
30 | + | |
31 | + | |
32 | + | |
33 | + d0 = 2. * k * Wc; | |
34 | + d1 = k * k + Wc * Wc; | |
35 | + d2 = ( -2. * k * k) + (2 * Wc * Wc); | |
36 | + | |
37 | + a0 = (d0 * zeta1 + d1); | |
38 | + a1 = d2 / a0; | |
39 | + a2 = ( -1. * d0 * zeta1 + d1) / a0; | |
40 | + b0 = (d0 * zeta2 + d1) / a0; | |
41 | + b1 = d2 / a0; | |
42 | + b2 = ( -1. * d0 * zeta2 + d1) / a0; | |
43 | + | |
44 | +} | |
45 | + | |
46 | +void sNotch::Init(float* Fcutoff, float SamplingTime, float* InData) | |
47 | +{ | |
48 | + pInData = (float*)InData; | |
49 | + Ts = SamplingTime; | |
50 | + | |
51 | + pFcut = (float*)Fcutoff; | |
52 | + | |
53 | + Wc = 0.; | |
54 | + a0 = 0.; | |
55 | + a1 = 0.; | |
56 | + b0 = 0.; | |
57 | + b1 = 0.; | |
58 | + b2 = 0.; | |
59 | + | |
60 | + in = 0.; // x[n] | |
61 | + in1 = 0.; // x[n-1] | |
62 | + in2 = 0.; // x[n-2] | |
63 | + | |
64 | + out = 0.; // y[n] | |
65 | + out1 = 0.; // y[n-1] | |
66 | + out2 = 0.; // y[n-2] | |
67 | + | |
68 | + CoeffUpdate(); | |
69 | +} | |
70 | + | |
71 | +float sNotch::Run(void) | |
72 | +{ | |
73 | + in = *pInData; | |
74 | + out = (b0 * in + b1 * in1 + b2 * in2) - (a1 * out1 + a2 * out2); | |
75 | + | |
76 | + in2 = in1; | |
77 | + in1 = in; | |
78 | + | |
79 | + out2 = out1; | |
80 | + out1 = out; | |
81 | + | |
82 | + | |
83 | + return out; | |
84 | +} |
+++ Common_Resource/CodeLibrary/DigitalFilter/Notch.h
... | ... | @@ -0,0 +1,51 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : Notch.h | |
4 | +// Created on : 2022. 12. 20. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef DIGITALFILTER_NOTCH_H_ | |
11 | +#define DIGITALFILTER_NOTCH_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | + | |
19 | +struct sNotch | |
20 | +{ | |
21 | + float* pInData; //데이터 포인터 | |
22 | + float* pFcut; //차단 주파수 포인터 | |
23 | + | |
24 | + float in, in1, in2; | |
25 | + float out, out1, out2; | |
26 | + float a0, a1, a2, b0, b1, b2; | |
27 | + float d0, d1, d2; //연산량 감소용 임시 변수 | |
28 | + float Fcut, Wc; | |
29 | + float zeta1; | |
30 | + float zeta2; | |
31 | + float d; // notch 감쇄율 | |
32 | + float c; // notch 대역폭.. // 나중에 수식 확인해 볼것 | |
33 | + float k; | |
34 | + | |
35 | + float Ts; //필터 입력 데이터의 샘플링 타임 | |
36 | + | |
37 | + void Init(float* Fcutoff, float Tsampling, float* InData); | |
38 | + void CoeffUpdate(void); | |
39 | + float Run(void); | |
40 | +}; | |
41 | + | |
42 | + | |
43 | + | |
44 | + | |
45 | + | |
46 | + | |
47 | +#ifdef __cplusplus | |
48 | +} | |
49 | +#endif /* extern "C" */ | |
50 | + | |
51 | +#endif /* COMMON_RESOURCE_CODELIBRARY_DIGITALFILTER_NOTCH_H_ */ |
+++ Common_Resource/CodeLibrary/Ntc/Ntc.cpp
... | ... | @@ -0,0 +1,55 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : Ntc.cpp | |
4 | +// Created on : 2022. 11. 5. | |
5 | +// Description : 테이블 방식의 NTC 온도계산 프로그램 | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#include "CodeLibMath.h" | |
12 | +#include "Ntc.h" | |
13 | + | |
14 | + | |
15 | +void NtcTableReadTemp(float *NtcTemp, int *AdcData, struct sNTCTABLE *NtcTable) | |
16 | +{ | |
17 | + | |
18 | + if (*NtcTemp <= 0) | |
19 | + { | |
20 | + if (*AdcData <= NtcTable->Table[0]) *NtcTemp = 0; | |
21 | + else *NtcTemp = 1; | |
22 | + } | |
23 | + else if (*NtcTemp >= NtcTable->Size) | |
24 | + { | |
25 | + if (*AdcData > NtcTable->Table[NtcTable->Size]) *NtcTemp = NtcTable->Size - 1; | |
26 | + else *NtcTemp = NtcTable->Size; | |
27 | + } | |
28 | + else | |
29 | + { | |
30 | + if (*AdcData < NtcTable->Table[(Uint16) *NtcTemp - 1]) *NtcTemp = *NtcTemp - 1; | |
31 | + else if (*AdcData >= NtcTable->Table[(Uint16) *NtcTemp]) *NtcTemp = *NtcTemp + 1; | |
32 | + } | |
33 | +} | |
34 | + | |
35 | +//--------------------------Table 생성코드---------------------------------// | |
36 | +//todo Beta 값 기반인데 나중에 Stain-Heart Heart 방정식으로 변경하면 좋을 듯? | |
37 | +// | |
38 | + | |
39 | +void NtcTableGen(struct sNTCTABLE *Ntc) | |
40 | +{ | |
41 | + int i = 0.; | |
42 | + float Rntc = 0.; | |
43 | + float Vntc = 0.; | |
44 | + | |
45 | + for ( i = 0; i < Ntc->Size; i++) | |
46 | + { | |
47 | + Rntc = (Ntc->R25 * expf(Ntc->Beta * (1. / (273.15 + (float)i) - 1. / 298.15))); | |
48 | + Vntc = (Ntc->Vset * (Ntc->Rset / (Rntc + Ntc->Rset))); | |
49 | + | |
50 | + //ADC 12bit, 3Vref | |
51 | + Ntc->Table[i] = 4095. * (Vntc / 3.); | |
52 | + } | |
53 | +} | |
54 | + | |
55 | +//----------------------------------------------------------------------------------------------------// |
+++ Common_Resource/CodeLibrary/Ntc/Ntc.h
... | ... | @@ -0,0 +1,42 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : Ntc.h | |
4 | +// Created on : 2022. 11. 5. | |
5 | +// Description : 테이블 방식의 NTC 온도계산 프로그램 | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef NTC_NTC_H_ | |
11 | +#define NTC_NTC_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | +struct sNTCTABLE | |
19 | +{ | |
20 | + float R25; | |
21 | + float Rset; | |
22 | + float Vset; | |
23 | + float Beta; | |
24 | + | |
25 | + unsigned int Size; | |
26 | + unsigned int TempStep; | |
27 | + | |
28 | + unsigned int Table[200]; | |
29 | +}; | |
30 | + | |
31 | + | |
32 | +extern void NtcTableGen(struct sNTCTABLE *Ntc); | |
33 | +extern void NtcTableReadTemp(float *NtcTemp, int *AdcVal, struct sNTCTABLE *Ntc); | |
34 | + | |
35 | + | |
36 | + | |
37 | + | |
38 | +#ifdef __cplusplus | |
39 | +} | |
40 | +#endif /* extern "C" */ | |
41 | + | |
42 | +#endif /* COMMON_RESOURCE_CODELIBRARY_NTC_NTC_H_ */ |
+++ Common_Resource/CodeLibrary/PLL/SoapPll3ph.cpp
... | ... | @@ -0,0 +1,90 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : SoapPll3ph.cpp | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include <PLL/SoapPll3ph.h> | |
11 | +#include "CodeLibMath.h" | |
12 | + | |
13 | + | |
14 | +//Synchronous Observer-Aided Preprocessing PLL | |
15 | + | |
16 | +void sSoapPll::Init(float mTsamp, float mVsRatePeak, float mFreqRate) | |
17 | +{ | |
18 | + | |
19 | + Tprd = mTsamp; | |
20 | + Zeta = 1; | |
21 | + Wc = 2. * 5. * PI; | |
22 | + | |
23 | + Kp = 2. * Zeta * Wc; | |
24 | + Ki = Wc * Wc; | |
25 | + | |
26 | + k = 1.5; | |
27 | + rho = 1.; | |
28 | + c1 = 0.5 * (1. + rho) * k; | |
29 | + c2 = 0.5 * rho * k * k; | |
30 | + | |
31 | + Reset(mVsRatePeak, mFreqRate); | |
32 | + | |
33 | +} | |
34 | + | |
35 | +void sSoapPll::Reset(float mVsRatePeak, float mFreqRate) | |
36 | +{ | |
37 | + Integral = 0.; | |
38 | + Wehat = 2. * PI * mFreqRate; | |
39 | + Weff = 2. * PI * mFreqRate; | |
40 | + Thetahat = 0.; | |
41 | + | |
42 | + Thetd = 0.; | |
43 | + | |
44 | + VdePos = 0.; | |
45 | + VqePos = mVsRatePeak; //140.*INV_SQRT3*SQRT2; | |
46 | + Vdehat = 0.; | |
47 | + Vqehat = mVsRatePeak; //0.; | |
48 | +} | |
49 | + | |
50 | +float sSoapPll::Run(float mVde, float mVqe, float mFreqRate, float mTsamp) | |
51 | +{ | |
52 | + float coefficient = 0.; | |
53 | + float out = 0.; | |
54 | + | |
55 | + coefficient = Wehat * mTsamp; | |
56 | + | |
57 | + // Synchronous Observer-Aided Preprocessing (SOAP) | |
58 | + ErrVde = mVde - Vdehat; | |
59 | + VqePos -= c2 * coefficient * ErrVde; | |
60 | + Vdehat += 2. * coefficient * (c1 * ErrVde + mVqe - VqePos); | |
61 | + | |
62 | + ErrVqe = mVqe - Vqehat; | |
63 | + VdePos += c2 * coefficient * ErrVqe; | |
64 | + Vqehat += 2. * coefficient * (c1 * ErrVqe - mVde + VdePos); | |
65 | + | |
66 | + //PLL | |
67 | + Thetd = atan2(-VdePos, VqePos); | |
68 | + Integral += Ki * mTsamp * Thetd; | |
69 | + Wehat = Weff + Integral; | |
70 | + FreqOut = Wehat * 0.5 * INV_PI; | |
71 | + | |
72 | + Thetahat += mTsamp * (Kp * Thetd + Wehat); | |
73 | + Thetahat = BOUND_PI(Thetahat); | |
74 | + | |
75 | + out = Thetahat; | |
76 | + | |
77 | + return out; | |
78 | +} | |
79 | + | |
80 | +void sSoapPll::Preparing(float mVde, float mVqe, float mTheta, float mWeRate) | |
81 | +{ | |
82 | + Wehat = mWeRate; | |
83 | + Thetahat = mTheta; | |
84 | + | |
85 | + VqePos = Vqehat = mVqe; | |
86 | + VdePos = Vdehat = mVde; | |
87 | + | |
88 | + Integral = 0; | |
89 | + | |
90 | +} |
+++ Common_Resource/CodeLibrary/PLL/SoapPll3ph.h
... | ... | @@ -0,0 +1,59 @@ |
1 | + | |
2 | +//-------------------------------------------------------// | |
3 | +// Project Code : CodeLibrary | |
4 | +// File Name : SogiPll3ph.h | |
5 | +// Created on : 2019. 06. 07. | |
6 | +// Description : | |
7 | +// Author : KimJeongWoo | |
8 | +// Last modified Date : | |
9 | +//-------------------------------------------------------// | |
10 | + | |
11 | + | |
12 | +#ifndef PLL_SOAPPLL3PH_H_ | |
13 | +#define PLL_SOAPPLL3PH_H_ | |
14 | + | |
15 | + | |
16 | +#ifdef __cplusplus | |
17 | +extern "C" { | |
18 | +#endif | |
19 | + | |
20 | +//Synchronous Observer-Aided Preprocessing PLL | |
21 | +struct sSoapPll | |
22 | +{ | |
23 | + float Tprd; | |
24 | + | |
25 | + float Kp; | |
26 | + float Ki; | |
27 | + float Wc; | |
28 | + float Zeta; | |
29 | + | |
30 | + float k; | |
31 | + float rho; | |
32 | + float c1; | |
33 | + float c2; | |
34 | + | |
35 | + float ErrVde; | |
36 | + float ErrVqe; | |
37 | + float VdePos; | |
38 | + float VqePos; | |
39 | + float Vdehat; | |
40 | + float Vqehat; | |
41 | + | |
42 | + float Thetd; | |
43 | + float Integral; | |
44 | + float Wehat; | |
45 | + float Weff; | |
46 | + float Thetahat; | |
47 | + float FreqOut; | |
48 | + | |
49 | + void Init(float mTsamp, float mVsRatePeak, float mFreqRate); | |
50 | + void Reset(float mEqe_rate, float mFreqRate); | |
51 | + float Run(float mVde, float mVqe, float mFreqRate, float mTsamp); | |
52 | + void Preparing(float mVde, float mVqe, float mTheta, float mWeRate); | |
53 | +}; | |
54 | + | |
55 | + | |
56 | +#ifdef __cplusplus | |
57 | +} | |
58 | +#endif // extern "C" // | |
59 | +#endif // MAIN_RESOURCE_INCLUDE_SOAPPLL_H_ // |
+++ Common_Resource/CodeLibrary/PLL/SogiFll1ph.cpp
... | ... | @@ -0,0 +1,182 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : SogiFll1ph.cpp | |
4 | +// Created on : 2023. 7. 13. | |
5 | +// Description : | |
6 | +// Author : "Kim JeongWoo" | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include <PLL/SogiFll1ph.h> | |
11 | +#include "CodeLibMath.h" | |
12 | + | |
13 | + | |
14 | +void sSogiFll1ph::Init(float mFreqRate, float mTsamp, float mVacPeakMax, float *Vac, float *Iac) | |
15 | +{ | |
16 | + pVac = (float *) Vac; | |
17 | + pIac = (float *) Iac; | |
18 | + | |
19 | + | |
20 | + Vs_U[0] = 0.0; | |
21 | + Vs_U[1] = 0.0; | |
22 | + Vs_U[2] = 0.0; | |
23 | + | |
24 | + Is_U[0] = 0.0; | |
25 | + Is_U[1] = 0.0; | |
26 | + Is_U[2] = 0.0; | |
27 | + | |
28 | + Vs_Osg_U[0] = 0.0; | |
29 | + Vs_Osg_U[1] = 0.0; | |
30 | + Vs_Osg_U[2] = 0.0; | |
31 | + | |
32 | + Vs_Osg_Qu[0] = 0.0; | |
33 | + Vs_Osg_Qu[1] = 0.0; | |
34 | + Vs_Osg_Qu[2] = 0.0; | |
35 | + | |
36 | + Vs_u_Q[0] = 0.0; | |
37 | + Vs_u_Q[1] = 0.0; | |
38 | + | |
39 | + Vs_u_D[0] = 0.0; | |
40 | + Vs_u_D[1] = 0.0; | |
41 | + | |
42 | + Is_Osg_U[0] = 0.0; | |
43 | + Is_Osg_U[1] = 0.0; | |
44 | + Is_Osg_U[2] = 0.0; | |
45 | + | |
46 | + Is_Osg_Qu[0] = 0.0; | |
47 | + Is_Osg_Qu[1] = 0.0; | |
48 | + Is_Osg_Qu[2] = 0.0; | |
49 | + | |
50 | + Is_u_Q[0] = 0.0; | |
51 | + Is_u_Q[1] = 0.0; | |
52 | + | |
53 | + Is_u_D[0] = 0.0; | |
54 | + Is_u_D[1] = 0.0; | |
55 | + | |
56 | + Vs_ylf[0] = 0.0; | |
57 | + Vs_ylf[1] = 0.0; | |
58 | + | |
59 | + Is_ylf[0] = 0.0; | |
60 | + Is_ylf[1] = 0.0; | |
61 | + | |
62 | + FreqOut = 0.0; | |
63 | + FreqRate = mFreqRate; | |
64 | + | |
65 | + Theta = 0.0; | |
66 | + SinTheta = 0.0; | |
67 | + CosTheta = 0.0; | |
68 | + | |
69 | + Tsamp = mTsamp; | |
70 | + VacPeakMax = mVacPeakMax; | |
71 | + | |
72 | + x3[0] = 0; | |
73 | + x3[1] = 0; | |
74 | + | |
75 | + ef2 = 0; | |
76 | + | |
77 | + WeRate = 2 * PI * FreqRate; | |
78 | + WeHat = 2 * PI * FreqRate; | |
79 | + | |
80 | + SettlingTime = 0.03; //3ms | |
81 | + DampingRatio = 0.7; | |
82 | + ErrBand = 0.01; | |
83 | + Wn = ((log((1 / sqrt(1 - DampingRatio * DampingRatio)) / ErrBand)) / SettlingTime) / DampingRatio; | |
84 | + | |
85 | + Ti = 2 * (DampingRatio / Wn); | |
86 | + Kp = Wn * Wn * Ti; | |
87 | + Ki = Kp / Ti; | |
88 | + | |
89 | + | |
90 | + LpfCoefUpdate(); | |
91 | + CoefUpdate(WeRate); | |
92 | +} | |
93 | + | |
94 | +void sSogiFll1ph::LpfCoefUpdate() | |
95 | +{ | |
96 | + // loop filter coefficients for 20kHz | |
97 | + Lpf.b0 = ((2.0) * Kp + Ki * Tsamp) * 0.5 / VacPeakMax; | |
98 | + Lpf.b1 = -((2.0) * Kp - Ki * Tsamp) * 0.5 / VacPeakMax; | |
99 | + Lpf.a1 = 1.0; | |
100 | +} | |
101 | + | |
102 | +void sSogiFll1ph::CoefUpdate(float mWe) | |
103 | +{ | |
104 | + float temp; | |
105 | + | |
106 | + Osg.k = (float)(1.2); | |
107 | + | |
108 | + Osg.x = (float)(2.0 * Osg.k * mWe * Tsamp); | |
109 | + Osg.y = (float)(mWe * Tsamp * mWe * Tsamp); | |
110 | + | |
111 | + temp = (float)1.0 / (Osg.x + Osg.y + 4.0); | |
112 | + | |
113 | + Osg.b0 = ((float)Osg.x * temp); | |
114 | + Osg.b2 = ((float)(-1.0) * Osg.b0); | |
115 | + Osg.a1 = ((float)(2.0 * (4.0 - Osg.y)) * temp); | |
116 | + Osg.a2 = ((float)(Osg.x - Osg.y - 4) * temp); | |
117 | + | |
118 | + Osg.qb0 = ((float)(Osg.k * Osg.y) * temp); | |
119 | + Osg.qb1 = (Osg.qb0 * (float)(2.0)); | |
120 | + Osg.qb2 = Osg.qb0; | |
121 | +} | |
122 | + | |
123 | +void sSogiFll1ph::Run(void) | |
124 | +{ | |
125 | + Vs_U[0] = *pVac; | |
126 | + | |
127 | + Vs_Osg_U[0] = (Osg.b0 * (Vs_U[0] - Vs_U[2])) + (Osg.a1 * Vs_Osg_U[1]) + (Osg.a2 * Vs_Osg_U[2]); | |
128 | + Vs_Osg_U[2] = Vs_Osg_U[1]; | |
129 | + Vs_Osg_U[1] = Vs_Osg_U[0]; | |
130 | + | |
131 | + Vs_Osg_Qu[0] = ((Osg.qb0 * Vs_U[0]) + (Osg.qb1 * Vs_U[1]) + (Osg.qb2 * Vs_U[2]) + (Osg.a1 * Vs_Osg_Qu[1]) + (Osg.a2 * Vs_Osg_Qu[2])); | |
132 | + Vs_Osg_Qu[2] = Vs_Osg_Qu[1]; | |
133 | + Vs_Osg_Qu[1] = Vs_Osg_Qu[0]; | |
134 | + | |
135 | + Vs_U[2] = Vs_U[1]; | |
136 | + Vs_U[1] = Vs_U[0]; | |
137 | + | |
138 | + Vs_u_D[0] = (CosTheta * Vs_Osg_U[0]) + (SinTheta * Vs_Osg_Qu[0]); | |
139 | + Vs_u_Q[0] = (CosTheta * Vs_Osg_Qu[0]) - (SinTheta * Vs_Osg_U[0]); | |
140 | + | |
141 | + // | |
142 | + Is_U[0] = *pIac; | |
143 | + | |
144 | + Is_Osg_U[0] = (Osg.b0 * (Is_U[0] - Is_U[2])) + (Osg.a1 * Is_Osg_U[1]) + (Osg.a2 * Is_Osg_U[2]); | |
145 | + Is_Osg_U[2] = Is_Osg_U[1]; | |
146 | + Is_Osg_U[1] = Is_Osg_U[0]; | |
147 | + | |
148 | + Is_Osg_Qu[0] = ((Osg.qb0 * Is_U[0]) + (Osg.qb1 * Is_U[1]) + (Osg.qb2 * Is_U[2]) + (Osg.a1 * Is_Osg_Qu[1]) + (Osg.a2 * Is_Osg_Qu[2])); | |
149 | + Is_Osg_Qu[2] = Is_Osg_Qu[1]; | |
150 | + Is_Osg_Qu[1] = Is_Osg_Qu[0]; | |
151 | + | |
152 | + Is_U[2] = Is_U[1]; | |
153 | + Is_U[1] = Is_U[0]; | |
154 | + | |
155 | + Is_u_D[0] = (CosTheta * Is_Osg_U[0]) + (SinTheta * Is_Osg_Qu[0]); | |
156 | + Is_u_Q[0] = (CosTheta * Is_Osg_Qu[0]) - (SinTheta * Is_Osg_U[0]); | |
157 | + | |
158 | + Vs_ylf[0] = Vs_ylf[1] + (Lpf.b0 * Vs_u_D[0]) + (Lpf.b1 * Vs_u_D[1]); | |
159 | + Vs_ylf[1] = Vs_ylf[0]; | |
160 | + Vs_u_D[1] = Vs_u_D[0]; | |
161 | + | |
162 | + FreqOut = (FreqRate - Vs_ylf[0]); | |
163 | + WeHat = ((FreqOut) * (float(2.0 * PI))); | |
164 | + | |
165 | + Theta = Theta + WeHat * Tsamp; | |
166 | + Theta = BOUND_PI(Theta); | |
167 | + | |
168 | + SinTheta = (float)sin(Theta); | |
169 | + CosTheta = (float)cos(Theta); | |
170 | + | |
171 | + ef2 = ((Vs_U[0] - Vs_Osg_U[0]) * Vs_Osg_Qu[0]) * 0.7 * Tsamp * -1.0; | |
172 | + | |
173 | + x3[0] = x3[1] + ef2; | |
174 | + x3[1] = x3[0]; | |
175 | + | |
176 | + WeHat = WeRate + x3[0]; | |
177 | + FreqRate = WeHat / (2.0 * PI); | |
178 | + | |
179 | + CoefUpdate(WeHat); | |
180 | + | |
181 | +} | |
182 | + |
+++ Common_Resource/CodeLibrary/PLL/SogiFll1ph.h
... | ... | @@ -0,0 +1,102 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : SogiFll1ph.h | |
4 | +// Created on : 2023. 7. 13. | |
5 | +// Description : | |
6 | +// Author : "Kim JeongWoo" | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef PLL_SOGIFLL1PH_H_ | |
11 | +#define PLL_SOGIFLL1PH_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | + | |
19 | + | |
20 | +//*********** Structure Definition ********// | |
21 | +struct sOsgCoef | |
22 | +{ | |
23 | + float k; | |
24 | + float x; | |
25 | + float y; | |
26 | + float b0; | |
27 | + float b2; | |
28 | + float a1; | |
29 | + float a2; | |
30 | + float qb0; | |
31 | + float qb1; | |
32 | + float qb2; | |
33 | +}; | |
34 | + | |
35 | +//PI제어기를 필터형태로 구현한 것 | |
36 | +struct sOsgLpfCoef | |
37 | +{ | |
38 | + float b1; | |
39 | + float b0; | |
40 | + float a1; | |
41 | +}; | |
42 | + | |
43 | +struct sSogiFll1ph | |
44 | +{ | |
45 | + float *pVac; | |
46 | + float *pIac; | |
47 | + | |
48 | + float Vs_U[3]; // Ac Input | |
49 | + float Vs_Osg_U[3]; | |
50 | + float Vs_Osg_Qu[3]; | |
51 | + float Vs_u_Q[2]; | |
52 | + float Vs_u_D[2]; | |
53 | + | |
54 | + float Is_U[3]; // Ac Input | |
55 | + float Is_Osg_U[3]; | |
56 | + float Is_Osg_Qu[3]; | |
57 | + float Is_u_Q[2]; | |
58 | + float Is_u_D[2]; | |
59 | + | |
60 | + float Vs_ylf[2]; | |
61 | + float Is_ylf[2]; | |
62 | + | |
63 | + float FreqOut; // output frequency of PLL | |
64 | + float FreqRate; //nominal frequency | |
65 | + float Theta; | |
66 | + float CosTheta; | |
67 | + float SinTheta; | |
68 | + float Tsamp; | |
69 | + | |
70 | + float x3[2]; | |
71 | + float ef2; | |
72 | + | |
73 | + float WeHat; | |
74 | + float WeRate; | |
75 | + | |
76 | + float SettlingTime; // ms | |
77 | + float DampingRatio; | |
78 | + float ErrBand; | |
79 | + float Wn; | |
80 | + | |
81 | + float Ti; | |
82 | + float Kp; | |
83 | + float Ki; | |
84 | + | |
85 | + float VacPeakMax; | |
86 | + | |
87 | + sOsgCoef Osg; | |
88 | + sOsgLpfCoef Lpf; | |
89 | + | |
90 | + void Init(float mFreqRate, float mTsamp, float mVacPeakMax, float *pVac, float *pIac); | |
91 | + void Run(void); | |
92 | + void CoefUpdate(float mWe); | |
93 | + void LpfCoefUpdate(); | |
94 | + | |
95 | +}; | |
96 | + | |
97 | + | |
98 | +#ifdef __cplusplus | |
99 | +} | |
100 | +#endif /* extern "C" */ | |
101 | + | |
102 | +#endif /* COMMON_RESOURCE_CODELIBRARY_PLL_SOGIFLL1PH_H_ */ |
+++ Common_Resource/CodeLibrary/PLL/SogiPll3ph.cpp
... | ... | @@ -0,0 +1,184 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : SogiPll3ph.cpp | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include <PLL/SogiPll3ph.h> | |
11 | +#include "CodeLibMath.h" | |
12 | + | |
13 | + | |
14 | +//Second Order Generalized Integrators PLL | |
15 | +void sSogiPll::Reset(float mFreqRate, float mTsamp) | |
16 | +{ | |
17 | + | |
18 | + k = 0.5; | |
19 | + Wehat = 2. * PI * mFreqRate; | |
20 | + | |
21 | + d0 = Wehat * Wehat * mTsamp * mTsamp; | |
22 | + d1 = 2 * k * Wehat * mTsamp; | |
23 | + | |
24 | + //동상 계수 | |
25 | + D_a0 = (d0 + d1 + 4.); | |
26 | + D_a1 = (2. * d0 - 8.) / D_a0; | |
27 | + D_a2 = (d0 - d1 + 4.) / D_a0; | |
28 | + D_b0 = (d1) / D_a0; | |
29 | + D_b1 = 0; | |
30 | + D_b2 = -D_b0; | |
31 | + | |
32 | + //90도 지연 계수 | |
33 | + Q_a0 = D_a0; | |
34 | + Q_a1 = D_a1; | |
35 | + Q_a2 = D_a2; | |
36 | + Q_b0 = (k * d0) / Q_a0; | |
37 | + Q_b1 = (2. * Q_b0); | |
38 | + Q_b2 = Q_b0; | |
39 | + | |
40 | + | |
41 | + | |
42 | + //d축 전압 | |
43 | + Eds[0] = 0.; //x[n] | |
44 | + Eds[1] = 0.; //x[n-1] | |
45 | + Eds[2] = 0.; //x[n-2] | |
46 | + | |
47 | + EdsIn[0] = 0.; //y[n] | |
48 | + EdsIn[1] = 0.; //y[n-1] | |
49 | + EdsIn[2] = 0.; //y[n-2] | |
50 | + | |
51 | + EdsLag[0] = 0.; //y[n] | |
52 | + EdsLag[1] = 0.; //y[n-1] | |
53 | + EdsLag[2] = 0.; //y[n-2] | |
54 | + | |
55 | + | |
56 | + //q축 전압 | |
57 | + Eqs[0] = 0.; | |
58 | + Eqs[1] = 0.; | |
59 | + Eqs[2] = 0.; | |
60 | + | |
61 | + EqsIn[0] = 0.; | |
62 | + EqsIn[1] = 0.; | |
63 | + EqsIn[2] = 0.; | |
64 | + | |
65 | + EqsLag[0] = 0.; //y[n] | |
66 | + EqsLag[1] = 0.; //y[n-1] | |
67 | + EqsLag[2] = 0.; //y[n-2] | |
68 | + | |
69 | + EdsPos = 0.; | |
70 | + EqsPos = 0.; | |
71 | + EdsNeg = 0.; | |
72 | + EqsNeg = 0.; | |
73 | + | |
74 | + EdePos = 0.; | |
75 | + EqePos = 0.; | |
76 | + | |
77 | + //SRF-PLL. 위상 동기화 제어기 | |
78 | + Err = 0.; | |
79 | + Integ = 0.; | |
80 | + | |
81 | + Fb = 0.; | |
82 | + | |
83 | + Thetahat = 0.; | |
84 | +} | |
85 | + | |
86 | +void sSogiPll::Init(float mVsRatePeak, float mFreqRate, float mTsamp) | |
87 | +{ | |
88 | + //Ksogi가 작으면 필터링 성능이 증가하지만, 과도 상태가 증가함. Ksogi 값이 너무 작을 경우 과도상태가 매우 길어져서 제어기가 제대로 동작하지 못함. | |
89 | + //강한 필터링에 과도 상태를 빠르게 하기 위해서는 SOGI-FLL로 구성하면 되지만, 주파수 추정할 때 Gain 튜닝에도 불구하고 리플이 존재함. | |
90 | + k = 0.5; | |
91 | + Wehat = 2. * PI * mFreqRate; | |
92 | + | |
93 | + Zeta = 1.; | |
94 | + Wc = 2. * PI * 5.; | |
95 | + | |
96 | + //PI제어기 | |
97 | + Kp = 2. * Zeta * Wc / mVsRatePeak; | |
98 | + Ki = Wc * Wc / mVsRatePeak; | |
99 | +} | |
100 | + | |
101 | +float sSogiPll::Run(float mEds, float mEqs, float mFreqRate, float mTsamp) | |
102 | +{ | |
103 | + d0 = Wehat * Wehat * mTsamp * mTsamp; | |
104 | + d1 = 2 * k * Wehat * mTsamp; | |
105 | + | |
106 | + //동상 계수 | |
107 | + D_a0 = (d0 + d1 + 4.); | |
108 | + D_a1 = (2. * d0 - 8.) / D_a0; | |
109 | + D_a2 = (d0 - d1 + 4.) / D_a0; | |
110 | + D_b0 = (d1) / D_a0; | |
111 | + D_b1 = 0; | |
112 | + D_b2 = -D_b0; | |
113 | + | |
114 | + //90도 지연 계수 | |
115 | + Q_a0 = D_a0; | |
116 | + Q_a1 = D_a1; | |
117 | + Q_a2 = D_a2; | |
118 | + Q_b0 = (k * d0) / Q_a0; | |
119 | + Q_b1 = (2. * Q_b0); | |
120 | + Q_b2 = Q_b0; | |
121 | + | |
122 | + | |
123 | + Eds[0] = mEds; | |
124 | + Eqs[0] = mEqs; | |
125 | + | |
126 | + | |
127 | + //동상 전압 | |
128 | + EdsIn[0] = (D_b0 * Eds[0] + D_b1 * Eds[1] + D_b2 * Eds[2]) | |
129 | + - (D_a1 * EdsIn[1] + D_a2 * EdsIn[2]); | |
130 | + | |
131 | + EqsIn[0] = (D_b0 * Eqs[0] + D_b1 * Eqs[1] + D_b2 * Eqs[2]) | |
132 | + - (D_a1 * EqsIn[1] + D_a2 * EqsIn[2]); | |
133 | + | |
134 | + //90도 지연 전압 | |
135 | + EdsLag[0] = (Q_b0 * Eds[0] + Q_b1 * Eds[1] + Q_b2 * Eds[2]) | |
136 | + - (Q_a1 * EdsLag[1] + Q_a2 * EdsLag[2]); | |
137 | + | |
138 | + EqsLag[0] = (Q_b0 * Eqs[0] + Q_b1 * Eqs[1] + Q_b2 * Eqs[2]) | |
139 | + - (Q_a1 * EqsLag[1] + Q_a2 * EqsLag[2]); | |
140 | + | |
141 | + | |
142 | + //d축 전압 | |
143 | + Eds[2] = Eds[1]; | |
144 | + Eds[1] = Eds[0]; | |
145 | + EdsIn[2] = EdsIn[1]; | |
146 | + EdsIn[1] = EdsIn[0]; | |
147 | + EdsLag[2] = EdsLag[1]; | |
148 | + EdsLag[1] = EdsLag[0]; | |
149 | + | |
150 | + //q축 전압 | |
151 | + Eqs[2] = Eqs[1]; | |
152 | + Eqs[1] = Eqs[0]; | |
153 | + EqsIn[2] = EqsIn[1]; | |
154 | + EqsIn[1] = EqsIn[0]; | |
155 | + EqsLag[2] = EqsLag[1]; | |
156 | + EqsLag[1] = EqsLag[0]; | |
157 | + | |
158 | + //정상분 dq 전압 | |
159 | + EdsPos = 0.5 * EdsIn[0] - 0.5 * EqsLag[0]; | |
160 | + EqsPos = 0.5 * EdsLag[0] + 0.5 * EqsIn[0]; | |
161 | + | |
162 | + //역상분 dq 전압 | |
163 | + EdsNeg = 0.5 * EdsIn[0] + 0.5 * EqsLag[0]; | |
164 | + EqsNeg = -0.5 * EdsLag[0] + 0.5 * EqsIn[0]; | |
165 | + | |
166 | + //정상분 동기 좌표계 전압 | |
167 | + //a = Theta_hat* Thetahat; | |
168 | + EdePos = cos(Thetahat) * EdsPos + sin(Thetahat) * EqsPos; | |
169 | + EqePos = -sin(Thetahat) * EdsPos + cos(Thetahat) * EqsPos; | |
170 | + | |
171 | + //SRF-PLL. 위상 동기화 제어기 | |
172 | + Err = 0 - EdePos; | |
173 | + Integ = Integ + Ki * Err * mTsamp; | |
174 | + | |
175 | + Wehat = Integ + 2. * PI * mFreqRate; | |
176 | + Fb = Err * Kp + Wehat; | |
177 | + | |
178 | + FreqOut = Wehat * 0.5 * INV_PI; | |
179 | + | |
180 | + Thetahat = Thetahat + Fb * mTsamp; | |
181 | + Thetahat = Thetahat + ((Thetahat > PI) ? -2. * PI : (Thetahat < -PI) ? 2. * PI : 0.); | |
182 | + | |
183 | + return Thetahat; | |
184 | +} |
+++ Common_Resource/CodeLibrary/PLL/SogiPll3ph.h
... | ... | @@ -0,0 +1,79 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : SogiPll3ph.h | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef PLL_SOGIPLL3PH_H_ | |
11 | +#define PLL_SOGIPLL3PH_H_ | |
12 | +#ifdef __cplusplus | |
13 | +extern "C" { | |
14 | +#endif | |
15 | + | |
16 | +//Second Order Generalized Integrators PLL | |
17 | +//Inph : 동상 | |
18 | +//Lagph : 지상 | |
19 | +struct sSogiPll | |
20 | +{ | |
21 | + | |
22 | + float Eds[3]; | |
23 | + float EdsIn[3]; //Eds 동상 | |
24 | + float EdsLag[3]; //Eds 90도 지상 | |
25 | + | |
26 | + float Eqs[3]; | |
27 | + float EqsIn[3]; //Eqs 동상 | |
28 | + float EqsLag[3]; //Eqs 90도 지상 | |
29 | + | |
30 | + float EdsPos, EdePos; //Pos 정상분 | |
31 | + float EqsPos, EqePos; | |
32 | + | |
33 | + float EdsNeg, EdeNeg; //Neg 역상분 | |
34 | + float EqsNeg, EqeNeg; | |
35 | + | |
36 | + float k; //k 비례게인 | |
37 | + | |
38 | + float Kp; | |
39 | + float Ki; | |
40 | + float Wc; | |
41 | + float Zeta; | |
42 | + float Integ; | |
43 | + float Err; | |
44 | + float Fb; | |
45 | + | |
46 | + float Q_a0; //Q-Axis | |
47 | + float Q_a1; | |
48 | + float Q_a2; | |
49 | + float Q_b0; | |
50 | + float Q_b1; | |
51 | + float Q_b2; | |
52 | + | |
53 | + float D_a0; | |
54 | + float D_a1; | |
55 | + float D_a2; | |
56 | + float D_b0; | |
57 | + float D_b1; | |
58 | + float D_b2; | |
59 | + | |
60 | + float d0; //연산량 줄이기용 | |
61 | + float d1; | |
62 | + float d2; | |
63 | + | |
64 | + float Wehat; | |
65 | + float Thetahat; | |
66 | + | |
67 | + float FreqOut; | |
68 | + | |
69 | + void Reset(float mFreq_rate, float mTsamp); | |
70 | + void Init(float mEqe_rate, float mFreq_rate, float mTsamp); | |
71 | + float Run(float mEds, float mEqs, float mFreq_rate, float mTsamp); | |
72 | + | |
73 | +}; | |
74 | + | |
75 | + | |
76 | +#ifdef __cplusplus | |
77 | +} | |
78 | +#endif // extern "C" // | |
79 | +#endif // MAIN_RESOURCE_INCLUDE_SOGIPLL_H_ // |
+++ Common_Resource/CodeLibrary/README.md
... | ... | @@ -0,0 +1,1 @@ |
1 | +# CodeLibrary |
+++ Common_Resource/CodeLibrary/TimeSharing/TimeSharing.cpp
... | ... | @@ -0,0 +1,161 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : TimeSharing.cpp | |
4 | +// Created on : 2019. 06. 07 | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "TimeSharing.h" | |
11 | + | |
12 | + | |
13 | +float Tsamp = 0; | |
14 | +float T250us = 0; | |
15 | +float T500us = 0; | |
16 | +float T1ms = 0; | |
17 | +float T2ms = 0; | |
18 | +float T10ms = 0; | |
19 | +float T100ms = 0; | |
20 | +float T500ms = 0; | |
21 | +float T1s = 0; | |
22 | + | |
23 | +float INV_Tsamp = 0; | |
24 | +float INV_T250us = 0; | |
25 | +float INV_T500us = 0; | |
26 | +float INV_T1ms = 0; | |
27 | +float INV_T2ms = 0; | |
28 | +float INV_T10ms = 0; | |
29 | +float INV_T100ms = 0; | |
30 | +float INV_T500ms = 0; | |
31 | +float INV_T1s = 0; | |
32 | + | |
33 | + | |
34 | +float INV_RMS_T100ms = 0; | |
35 | +float INV_RMS_T500ms = 0; | |
36 | + | |
37 | +struct sTiME_SHARING OS_Time; | |
38 | + | |
39 | + | |
40 | +void InitTimeSharing(float BaseFreq) | |
41 | +{ | |
42 | + OS_Time.Init(BaseFreq); | |
43 | + | |
44 | + Tsamp = OS_Time.Tsamp.Prd; | |
45 | + T250us = OS_Time.T250us.Prd; | |
46 | + T500us = OS_Time.T500us.Prd; | |
47 | + T1ms = OS_Time.T1ms.Prd; | |
48 | + T2ms = OS_Time.T2ms.Prd; | |
49 | + T10ms = OS_Time.T10ms.Prd; | |
50 | + T100ms = OS_Time.T100ms.Prd; | |
51 | + T500ms = OS_Time.T500ms.Prd; | |
52 | + | |
53 | + INV_Tsamp = OS_Time.Tsamp.Inverse; | |
54 | + INV_T250us = OS_Time.T250us.Inverse; | |
55 | + INV_T500us = OS_Time.T500us.Inverse; | |
56 | + INV_T1ms = OS_Time.T1ms.Inverse; | |
57 | + INV_T2ms = OS_Time.T2ms.Inverse; | |
58 | + INV_T10ms = OS_Time.T10ms.Inverse; | |
59 | + INV_T100ms = OS_Time.T100ms.Inverse; | |
60 | + INV_T500ms = OS_Time.T500ms.Inverse; | |
61 | + | |
62 | + INV_RMS_T500ms = 1 / (T500ms / Tsamp); | |
63 | + INV_RMS_T100ms = 1 / (T100ms / Tsamp); | |
64 | + | |
65 | +} | |
66 | + | |
67 | + | |
68 | + | |
69 | +void sTiME_SHARING :: Init(float BaseFreq) | |
70 | +{ | |
71 | + BaseTime = (1 / BaseFreq); | |
72 | + | |
73 | + Tsamp.Prd = BaseTime; | |
74 | + T250us.Prd = 250e-6; | |
75 | + T500us.Prd = 500e-6; | |
76 | + T1ms.Prd = 1e-3; | |
77 | + T2ms.Prd = 2e-3; | |
78 | + T10ms.Prd = 10e-3; | |
79 | + T100ms.Prd = 100e-3; | |
80 | + T500ms.Prd = 500e-3; | |
81 | + T1s.Prd = 1.; | |
82 | + | |
83 | + Tsamp.Inverse = 1. / Tsamp.Prd; | |
84 | + T250us.Inverse = 1. / T250us.Prd; | |
85 | + T500us.Inverse = 1. / T500us.Prd; | |
86 | + T1ms.Inverse = 1. / T1ms.Prd; | |
87 | + T2ms.Inverse = 1. / T2ms.Prd; | |
88 | + T10ms.Inverse = 1. / T10ms.Prd; | |
89 | + T100ms.Inverse = 1. / T100ms.Prd; | |
90 | + T500ms.Inverse = 1. / T500ms.Prd; | |
91 | + T1s.Inverse = 1. / T1s.Prd; | |
92 | + | |
93 | + T250us.Flag = 0; | |
94 | + T500us.Flag = 0; | |
95 | + T1ms.Flag = 0; | |
96 | + T2ms.Flag = 0; | |
97 | + T10ms.Flag = 0; | |
98 | + T100ms.Flag = 0; | |
99 | + T500ms.Flag = 0; | |
100 | + T1s.Flag = 0; | |
101 | + | |
102 | + T250us.Tick = T250us.SetTick = (int) (T250us.Prd * Tsamp.Inverse + 0.5 ); | |
103 | + T500us.Tick = T500us.SetTick = (int) (T500us.Prd * Tsamp.Inverse + 0.5 ); | |
104 | + T1ms.Tick = T1ms.SetTick = (int) (T1ms.Prd * Tsamp.Inverse + 0.5 ); | |
105 | + T2ms.Tick = T2ms.SetTick = (int) (T2ms.Prd * Tsamp.Inverse + 0.5 ); | |
106 | + T10ms.Tick = T10ms.SetTick = (int) (T10ms.Prd * Tsamp.Inverse + 0.5 ); | |
107 | + T100ms.Tick = T100ms.SetTick = (int) (T100ms.Prd * Tsamp.Inverse + 0.5 ); | |
108 | + T500ms.Tick = T500ms.SetTick = (int) (T500ms.Prd * Tsamp.Inverse + 0.5 ); | |
109 | + T1s.Tick = T1s.SetTick = (int) (T1s.Prd * Tsamp.Inverse + 0.5 ); | |
110 | + | |
111 | + | |
112 | +} | |
113 | + | |
114 | +void sTiME_SHARING::Sharing(void) | |
115 | +{ | |
116 | + if ((T250us.Tick--) <= 0) | |
117 | + { | |
118 | + T250us.Flag = 1; | |
119 | + T250us.Tick = T250us.SetTick - 1; | |
120 | + } | |
121 | + if ((T500us.Tick--) <= 0) | |
122 | + { | |
123 | + T500us.Flag = 1; | |
124 | + T500us.Tick = T500us.SetTick - 1; | |
125 | + } | |
126 | + if ((T1ms.Tick--) <= 0) | |
127 | + { | |
128 | + T1ms.Flag = 1; | |
129 | + T1ms.Tick = T1ms.SetTick - 1; | |
130 | + } | |
131 | + if ((T2ms.Tick--) <= 0) | |
132 | + { | |
133 | + T2ms.Flag = 1; | |
134 | + T2ms.Tick = T2ms.SetTick - 1; | |
135 | + } | |
136 | + if ((T10ms.Tick--) <= 0) | |
137 | + { | |
138 | + T10ms.Flag = 1; | |
139 | + T10ms.Tick = T10ms.SetTick - 1; | |
140 | + } | |
141 | + if ((T100ms.Tick--) <= 0) | |
142 | + { | |
143 | + T100ms.Flag = 1; | |
144 | + T100ms.Tick = T100ms.SetTick - 1; | |
145 | + } | |
146 | + if ((T500ms.Tick--) <= 0) | |
147 | + { | |
148 | + T500ms.Flag = 1; | |
149 | + T500ms.Tick = T500ms.SetTick - 1; | |
150 | + } | |
151 | + if ((T1s.Tick--) <= 0) | |
152 | + { | |
153 | + T1s.Flag = 1; | |
154 | + T1s.Tick = T1s.SetTick - 1; | |
155 | + } | |
156 | +} | |
157 | + | |
158 | + | |
159 | + | |
160 | + | |
161 | + |
+++ Common_Resource/CodeLibrary/TimeSharing/TimeSharing.h
... | ... | @@ -0,0 +1,112 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : TimeSharing.h | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | +#ifndef TIMESHARING_TIMESHARING_H_ | |
10 | +#define TIMESHARING_TIMESHARING_H_ | |
11 | + | |
12 | +#ifdef __cplusplus | |
13 | +extern "C" { | |
14 | +#endif | |
15 | + | |
16 | + | |
17 | + | |
18 | +struct sTiME_SHARING_SUB | |
19 | +{ | |
20 | + float Prd; | |
21 | + float Inverse; | |
22 | + long int SetTick; | |
23 | + long int Tick; | |
24 | + int Flag; | |
25 | +}; | |
26 | + | |
27 | + | |
28 | + | |
29 | +struct sTiME_SHARING | |
30 | +{ | |
31 | + float BaseTime; | |
32 | + | |
33 | + volatile struct sTiME_SHARING_SUB Tsamp; | |
34 | + volatile struct sTiME_SHARING_SUB T250us; | |
35 | + volatile struct sTiME_SHARING_SUB T500us; | |
36 | + volatile struct sTiME_SHARING_SUB T1ms; | |
37 | + volatile struct sTiME_SHARING_SUB T2ms; | |
38 | + volatile struct sTiME_SHARING_SUB T10ms; | |
39 | + volatile struct sTiME_SHARING_SUB T100ms; | |
40 | + volatile struct sTiME_SHARING_SUB T500ms; | |
41 | + volatile struct sTiME_SHARING_SUB T1s; | |
42 | + | |
43 | + void Init(float BaseFreq); | |
44 | + void Sharing(void); | |
45 | + | |
46 | +}; | |
47 | + | |
48 | + | |
49 | + | |
50 | +//-------------------------------------------------------------// | |
51 | +// 듀얼코어 사용시 CPU간 상호 참조하거나 GS메모리에 위치하여 원하지 않는 동작을 | |
52 | +// 방지하기 위하여 각 CPU에서만 사용가능한 LS메모리에 위치하여 동작 시킬 것 | |
53 | +//-------------------------------------------------------------// | |
54 | + | |
55 | + | |
56 | + | |
57 | + | |
58 | +#pragma SET_DATA_SECTION(".TimeSharing") | |
59 | + | |
60 | +extern struct sTiME_SHARING OS_Time; | |
61 | + | |
62 | +extern float Tsamp; | |
63 | +extern float T250us; | |
64 | +extern float T500us; | |
65 | +extern float T1ms; | |
66 | +extern float T2ms; | |
67 | +extern float T10ms; | |
68 | +extern float T100ms; | |
69 | +extern float T500ms; | |
70 | +extern float T1s; | |
71 | + | |
72 | +extern float INV_Tsamp; | |
73 | +extern float INV_T250us; | |
74 | +extern float INV_T500us; | |
75 | +extern float INV_T1ms; | |
76 | +extern float INV_T2ms; | |
77 | +extern float INV_T10ms; | |
78 | +extern float INV_T100ms; | |
79 | +extern float INV_T500ms; | |
80 | +extern float INV_T1s; | |
81 | + | |
82 | +extern float INV_RMS_T100ms; | |
83 | +extern float INV_RMS_T500ms; | |
84 | + | |
85 | +#pragma SET_DATA_SECTION() | |
86 | + | |
87 | + | |
88 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
89 | +extern void RoutineTsamp(void); | |
90 | +extern void RoutineT250us(void); | |
91 | +extern void RoutineT500us(void); | |
92 | +extern void RoutineT1ms(void); | |
93 | +extern void RoutineT2ms(void); | |
94 | +extern void RoutineT10ms(void); | |
95 | +extern void RoutineT100ms(void); | |
96 | +extern void RoutineT500ms(void); | |
97 | +extern void RoutineT1s(void); | |
98 | +#pragma SET_CODE_SECTION() | |
99 | + | |
100 | +extern void InitTimeSharing(float BaseFreq); | |
101 | + | |
102 | + | |
103 | + | |
104 | + | |
105 | + | |
106 | + | |
107 | + | |
108 | +#ifdef __cplusplus | |
109 | +} | |
110 | +#endif /* extern "C" */ | |
111 | + | |
112 | +#endif /* _TIMESHARING_H_ */ |
+++ Common_Resource/CodeLibrary/Util/Ramp.cpp
... | ... | @@ -0,0 +1,79 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : Ramp.cpp | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "Ramp.h" | |
11 | + | |
12 | +void sRampGen::Init(float *InData, float *InDelt, float Tprd) | |
13 | +{ | |
14 | + | |
15 | + pInData = (float *) InData; | |
16 | + pInDelt = (float *) InDelt; | |
17 | + | |
18 | + TprdCnt = 1 / Tprd; | |
19 | + Reset(); | |
20 | + UpdateSlope(); | |
21 | + | |
22 | +} | |
23 | + | |
24 | +float sRampGen::Run(void) | |
25 | +{ | |
26 | + in = (float) *pInData; | |
27 | + | |
28 | + if (fabs(in - out) < DelMag) out = in; | |
29 | + else if (in > (out - DelMag)) out += DelMag; | |
30 | + else if (in < (out + DelMag)) out -= DelMag; | |
31 | + else out = in; | |
32 | + | |
33 | + return out; | |
34 | +} | |
35 | + | |
36 | +float sRampGen::RunStepDown(void) | |
37 | +{ | |
38 | + in = (float) *pInData; | |
39 | + | |
40 | + if (fabs(in - out) < DelMag) out = in; | |
41 | + else if (in < (out + DelMag)) out -= DelMag; | |
42 | + else out = in; | |
43 | + | |
44 | + return out; | |
45 | +} | |
46 | + | |
47 | + | |
48 | +float sRampGen::RunStepUp(void) | |
49 | +{ | |
50 | + in = (float) *pInData; | |
51 | + | |
52 | + if (fabs(in - out) < DelMag) out = in; | |
53 | + else if (in > (out - DelMag)) out += DelMag; | |
54 | + else out = in; | |
55 | + | |
56 | + return out; | |
57 | +} | |
58 | + | |
59 | +void sRampGen::Reset(void) | |
60 | +{ | |
61 | + in = 0; | |
62 | + out = 0; | |
63 | +} | |
64 | + | |
65 | +void sRampGen::UpdateSlope(void) | |
66 | +{ | |
67 | + Delt = (float) *pInDelt; | |
68 | + DelMag = Delt / TprdCnt; | |
69 | +} | |
70 | + | |
71 | + | |
72 | + | |
73 | + | |
74 | + | |
75 | + | |
76 | + | |
77 | + | |
78 | + | |
79 | + |
+++ Common_Resource/CodeLibrary/Util/Ramp.h
... | ... | @@ -0,0 +1,40 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : CodeLibrary | |
3 | +// File Name : Ramp.h | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#ifndef UTIL_RAMP_H_ | |
12 | +#define UTIL_RAMP_H_ | |
13 | + | |
14 | + | |
15 | +struct sRampGen | |
16 | +{ | |
17 | + float *pInData; | |
18 | + float *pInDelt; | |
19 | + float Delt; | |
20 | + float in; | |
21 | + float out; | |
22 | + float DelMag; | |
23 | + | |
24 | + float TprdCnt; | |
25 | + | |
26 | + void Init(float *InData, float *InDelt, float Tprd); | |
27 | + float Run(void); //UpDwon | |
28 | + float RunStepDown(void); //RampUp - StepDown | |
29 | + float RunStepUp(void); //StepUp - RampDwon | |
30 | + void Reset(void); | |
31 | + void UpdateSlope(void); | |
32 | + | |
33 | +}; | |
34 | + | |
35 | + | |
36 | + | |
37 | + | |
38 | + | |
39 | + | |
40 | +#endif /* MAIN_RESOURCE_INCLUDE_RAMP_H_ */ |
+++ Common_Resource/CodeLibrary/Util/Util.cpp
... | ... | @@ -0,0 +1,162 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : Util.cpp | |
4 | +// Created on : 2022. 11. 5. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "CodeLibMath.h" | |
11 | +#include "Util.h" | |
12 | + | |
13 | +#define BUILD_MONTH_IS_JAN (__DATE__[0] == 'J' && __DATE__[1] == 'a' && __DATE__[2] == 'n') | |
14 | +#define BUILD_MONTH_IS_FEB (__DATE__[0] == 'F') | |
15 | +#define BUILD_MONTH_IS_MAR (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'r') | |
16 | +#define BUILD_MONTH_IS_APR (__DATE__[0] == 'A' && __DATE__[1] == 'p') | |
17 | +#define BUILD_MONTH_IS_MAY (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'y') | |
18 | +#define BUILD_MONTH_IS_JUN (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'n') | |
19 | +#define BUILD_MONTH_IS_JUL (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'l') | |
20 | +#define BUILD_MONTH_IS_AUG (__DATE__[0] == 'A' && __DATE__[1] == 'u') | |
21 | +#define BUILD_MONTH_IS_SEP (__DATE__[0] == 'S') | |
22 | +#define BUILD_MONTH_IS_OCT (__DATE__[0] == 'O') | |
23 | +#define BUILD_MONTH_IS_NOV (__DATE__[0] == 'N') | |
24 | +#define BUILD_MONTH_IS_DEC (__DATE__[0] == 'D') | |
25 | + | |
26 | +#define BUILD_DATE_CH0 (__DATE__[ 4] - '0') | |
27 | +#define BUILD_DATE_CH1 (__DATE__[ 5] - '0') | |
28 | + | |
29 | +#define BUILD_YEAR_CH0 (__DATE__[ 7] - '0') | |
30 | +#define BUILD_YEAR_CH1 (__DATE__[ 8] - '0') | |
31 | +#define BUILD_YEAR_CH2 (__DATE__[ 9] - '0') | |
32 | +#define BUILD_YEAR_CH3 (__DATE__[10] - '0') | |
33 | + | |
34 | +#define BUILD_HOUR (((__TIME__[0] - '0') * 10 + __TIME__[1] - '0')) | |
35 | +#define BUILD_MIN (((__TIME__[3] - '0') * 10 + __TIME__[4] - '0')) | |
36 | +#define BUILD_SEC (((__TIME__[6] - '0') * 10 + __TIME__[7] - '0')) | |
37 | + | |
38 | + | |
39 | +struct sCompileTime | |
40 | +{ | |
41 | + Uint32 Date; | |
42 | + Uint32 Time; | |
43 | +}; | |
44 | + | |
45 | +volatile struct sCompileTime Compiletime; | |
46 | + | |
47 | +void getCompileTime() | |
48 | +{ | |
49 | + | |
50 | + unsigned long TempYear = 0; | |
51 | + unsigned long TempMonth = 0; | |
52 | + unsigned long TempDate = 0; | |
53 | + unsigned long TempHour = 0; | |
54 | + unsigned long TempMin = 0; | |
55 | + unsigned long TempSec = 0; | |
56 | + unsigned long TempCal = 0; | |
57 | + | |
58 | + TempYear = (Uint32) (BUILD_YEAR_CH0 * 1000 + BUILD_YEAR_CH1 * 100 + BUILD_YEAR_CH2 * 10 + BUILD_YEAR_CH3) * 10000; | |
59 | + | |
60 | + //�� ���� --> ���ڷ� ��ȯ easy���� ���ڿ��� ���� �����Ƿ�... | |
61 | + if (BUILD_MONTH_IS_JAN) TempMonth = (Uint32) (1 * 100); | |
62 | + else if (BUILD_MONTH_IS_FEB) TempMonth = (Uint32) (2 * 100); | |
63 | + else if (BUILD_MONTH_IS_MAR) TempMonth = (Uint32) (3 * 100); | |
64 | + else if (BUILD_MONTH_IS_APR) TempMonth = (Uint32) (4 * 100); | |
65 | + else if (BUILD_MONTH_IS_MAY) TempMonth = (Uint32) (5 * 100); | |
66 | + else if (BUILD_MONTH_IS_JUN) TempMonth = (Uint32) (6 * 100); | |
67 | + else if (BUILD_MONTH_IS_JUL) TempMonth = (Uint32) (7 * 100); | |
68 | + else if (BUILD_MONTH_IS_AUG) TempMonth = (Uint32) (8 * 100); | |
69 | + else if (BUILD_MONTH_IS_SEP) TempMonth = (Uint32) (9 * 100); | |
70 | + else if (BUILD_MONTH_IS_OCT) TempMonth = (Uint32) (10 * 100); | |
71 | + else if (BUILD_MONTH_IS_NOV) TempMonth = (Uint32) (11 * 100); | |
72 | + else if (BUILD_MONTH_IS_DEC) TempMonth = (Uint32) (12 * 100); | |
73 | + | |
74 | + TempCal = BUILD_DATE_CH0; | |
75 | + if (( BUILD_DATE_CH0 < 0) || ( BUILD_DATE_CH0 > 9)) TempCal = 0; | |
76 | + | |
77 | + TempDate = (Uint32) ((TempCal * 10) + BUILD_DATE_CH1); | |
78 | + | |
79 | + TempHour = (Uint32) BUILD_HOUR * 10000; //Unit32 ij���� ���� ���� 16bit ������ ����ؼ� ���ڸ� �߸� | |
80 | + TempMin = (Uint32) BUILD_MIN * 100; | |
81 | + TempSec = (Uint32) BUILD_SEC; | |
82 | + | |
83 | + Compiletime.Date = (TempYear + TempMonth + TempDate); | |
84 | + Compiletime.Time = (TempHour + TempMin + TempSec); | |
85 | + | |
86 | +} | |
87 | + | |
88 | + | |
89 | +//BCD �ڵ带 Decimal ���·� ���� ex) 0x45 -> 45�� | |
90 | +Uint16 BcdToDec(unsigned int x) | |
91 | +{ | |
92 | + return (x - 6 * (x >> 4)); | |
93 | +} | |
94 | + | |
95 | +int compare(const void *a, const void *b) | |
96 | +{ | |
97 | + return *(int *) a - *(int *) b; //ũ�� ���, ������ ���� ���� | |
98 | +} | |
99 | + | |
100 | +float fMax2(float in1, float in2) | |
101 | +{ | |
102 | + float max; | |
103 | + | |
104 | + if (in1 > in2) max = in1; | |
105 | + else max = in2; | |
106 | + | |
107 | + return max; | |
108 | +} // return maximum value of two | |
109 | + | |
110 | +float fMin2(float in1, float in2) | |
111 | +{ | |
112 | + float min; | |
113 | + | |
114 | + if (in1 < in2) min = in1; | |
115 | + else min = in2; | |
116 | + | |
117 | + return min; | |
118 | +} // return minimum value of two | |
119 | + | |
120 | +float fMax3(float in1, float in2, float in3) | |
121 | +{ | |
122 | + float max; | |
123 | + | |
124 | + if (in1 > in2) max = in1; | |
125 | + else max = in2; | |
126 | + if (in3 > max) max = in3; | |
127 | + | |
128 | + return max; | |
129 | +} // return maximum value of two | |
130 | + | |
131 | +float fMid3(float in1, float in2, float in3) | |
132 | +{ | |
133 | + float mid; | |
134 | + | |
135 | + if (in1 < in2) | |
136 | + { | |
137 | + if (in2 < in3) mid = in2; | |
138 | + else if (in1 < in3) mid = in3; | |
139 | + else mid = in1; | |
140 | + } | |
141 | + else if (in1 > in2) | |
142 | + { | |
143 | + if (in1 < in3) mid = in1; | |
144 | + else if (in2 < in3) mid = in3; | |
145 | + else mid = in2; | |
146 | + } | |
147 | + | |
148 | + | |
149 | + return mid; | |
150 | +} | |
151 | + | |
152 | +float fMin3(float in1, float in2, float in3) | |
153 | +{ | |
154 | + float min; | |
155 | + | |
156 | + if (in1 < in2) min = in1; | |
157 | + else min = in2; | |
158 | + if (in3 < min) min = in3; | |
159 | + | |
160 | + return min; | |
161 | +} // return minimum value of two | |
162 | + |
+++ Common_Resource/CodeLibrary/Util/Util.h
... | ... | @@ -0,0 +1,35 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : Util.h | |
4 | +// Created on : 2022. 11. 5. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef UTIL_UTIL_H_ | |
11 | +#define UTIL_UTIL_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | +extern void getCompileTime(void); | |
19 | +extern Uint16 BcdToDec(Uint16 x); | |
20 | +extern int compare(const void *a, const void *b); | |
21 | + | |
22 | +extern float fMax2(float in1, float in2); | |
23 | +extern float fMin2(float in1, float in2); | |
24 | +extern float fMax3(float in1, float in2, float in3); | |
25 | +extern float fMin3(float in1, float in2, float in3); | |
26 | +extern float fMid3(float in1, float in2, float in3); | |
27 | + | |
28 | + | |
29 | + | |
30 | + | |
31 | +#ifdef __cplusplus | |
32 | +} | |
33 | +#endif /* extern "C" */ | |
34 | + | |
35 | +#endif /* COMMON_RESOURCE_CODELIBRARY_UTIL_UTIL_H_ */ |
+++ Common_Resource/CommonLibrary/CommonLib.h
... | ... | @@ -0,0 +1,68 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-ME-CPU1 | |
3 | +// File Name : Peripherals.h | |
4 | +// Created on : 2022. 10. 19. | |
5 | +// Description : | |
6 | +// Author : Kim-JeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef MAIN_RESOURCE_LIB_PERIPHERALS_H_ | |
11 | +#define MAIN_RESOURCE_LIB_PERIPHERALS_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +//--------------------------Ti Lib------------// | |
18 | +#include "F2837xD_device.h" | |
19 | +#include "driverlib.h" | |
20 | +#include "device.h" | |
21 | +#include "inc/hw_ipc.h" | |
22 | +#include "math.h" | |
23 | +#include "string.h" | |
24 | + | |
25 | +#include "fpu_vector.h" | |
26 | + | |
27 | +#include "F2837xD_EPwm_defines.h" | |
28 | +//#include "F2837xD_I2c_defines.h" | |
29 | +//--------------------------------------------// | |
30 | + | |
31 | +//------------ Board Lib----------------------// | |
32 | +#include "include/CpuInfo.h" | |
33 | +#include "include/AdcLib.h" | |
34 | +#include "include/DigitalIO.h" | |
35 | +#include "include/CanLib.h" | |
36 | +#include "include/EPwmLib.h" | |
37 | +#include "include/TimerLib.h" | |
38 | +#include "include/NtcLib.h" | |
39 | + | |
40 | +#include "include/Status.h" | |
41 | +#include "include/SystemVar.h" | |
42 | +#include "include/SensingScale.h" | |
43 | +#include "include/FaultDefine.h" | |
44 | +#include "include/RmsAvgCal.h" | |
45 | + | |
46 | +#include <include/Trace.h> | |
47 | + | |
48 | +#include "include/F28377D_TempSensor.h" | |
49 | +#include "include/ModBus.h" | |
50 | + | |
51 | +//Can 통신 관련 | |
52 | +#include "include/CanCHAdeMODataMap.h" | |
53 | +#include "include/CanCHAdeMO.h" | |
54 | + | |
55 | +//Eeprom | |
56 | +#include "include/Eeprom.h" | |
57 | +#include "include/SpiEepromLib.h" | |
58 | + | |
59 | +#include "include/RTC_SPI.h" | |
60 | + | |
61 | +#include "include/RTC.h" | |
62 | + | |
63 | + | |
64 | +#ifdef __cplusplus | |
65 | +} | |
66 | +#endif /* extern "C" */ | |
67 | + | |
68 | +#endif /* MAIN_RESOURCE_LIB_PERIPHERALS_H_ */ |
+++ Common_Resource/CommonLibrary/include/AdcLib.h
... | ... | @@ -0,0 +1,98 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-ME-CPU1 | |
3 | +// File Name : Adc_Driver.h | |
4 | +// Created on : 2022. 10. 16. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef MAIN_RESOURCE_ADC_SETTING_ADC_DRIVER_H_ | |
11 | +#define MAIN_RESOURCE_ADC_SETTING_ADC_DRIVER_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +#include <CommonLib.h> | |
18 | + | |
19 | + | |
20 | +#define ADCA_FORCE_SOC_SET ( ADC_FORCE_SOC0 \ | |
21 | + | ADC_FORCE_SOC1 \ | |
22 | + | ADC_FORCE_SOC2 \ | |
23 | + | ADC_FORCE_SOC3 \ | |
24 | + | ADC_FORCE_SOC4 \ | |
25 | + | ADC_FORCE_SOC5 \ | |
26 | + | ADC_FORCE_SOC6 \ | |
27 | + | ADC_FORCE_SOC7 \ | |
28 | + | ADC_FORCE_SOC8 ) | |
29 | + | |
30 | +#define ADCB_FORCE_SOC_SET ( ADC_FORCE_SOC0 \ | |
31 | + | ADC_FORCE_SOC1 \ | |
32 | + | ADC_FORCE_SOC2 \ | |
33 | + | ADC_FORCE_SOC3 \ | |
34 | + | ADC_FORCE_SOC4 \ | |
35 | + | ADC_FORCE_SOC5 ) | |
36 | + | |
37 | +#define ADCC_FORCE_SOC_SET ( ADC_FORCE_SOC2 \ | |
38 | + | ADC_FORCE_SOC3 \ | |
39 | + | ADC_FORCE_SOC4 \ | |
40 | + | ADC_FORCE_SOC5 ) | |
41 | + | |
42 | +#define ADCD_FORCE_SOC_SET ( ADC_FORCE_SOC0 \ | |
43 | + | ADC_FORCE_SOC1 \ | |
44 | + | ADC_FORCE_SOC2 \ | |
45 | + | ADC_FORCE_SOC3 \ | |
46 | + | ADC_FORCE_SOC4 \ | |
47 | + | ADC_FORCE_SOC5 ) | |
48 | + | |
49 | +extern void InitAdc(); | |
50 | + | |
51 | +extern void ConfigAdc(); | |
52 | +extern void SetupAdcSoc(); | |
53 | + | |
54 | +extern void AdcForceSoc(); | |
55 | +extern void AdcIntEocState(); | |
56 | + | |
57 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
58 | +extern void AdcIntInterruptClear(); | |
59 | +#pragma SET_CODE_SECTION() | |
60 | + | |
61 | + | |
62 | + | |
63 | +struct sAdc | |
64 | +{ | |
65 | + int RawData[32]; | |
66 | + int Data[32]; | |
67 | + float Offset[32]; | |
68 | + float OffsetDefault[32]; | |
69 | + float OffsetSum[32]; | |
70 | + float OffsetDelt[32]; | |
71 | + | |
72 | + float InversBit; | |
73 | + | |
74 | + int Cmd_Reset; | |
75 | +}; | |
76 | + | |
77 | + | |
78 | +#pragma SET_DATA_SECTION(".AdcLib") | |
79 | + | |
80 | +extern struct sAdc Adc; | |
81 | + | |
82 | +extern unsigned int CntWaitAdcEoc; | |
83 | +extern unsigned int SetWaitAdcEoc; | |
84 | + | |
85 | +extern int Flag_ErrEoc; | |
86 | + | |
87 | +#pragma SET_DATA_SECTION() | |
88 | + | |
89 | + | |
90 | + | |
91 | + | |
92 | + | |
93 | + | |
94 | +#ifdef __cplusplus | |
95 | +} | |
96 | +#endif /* extern "C" */ | |
97 | + | |
98 | +#endif /* MAIN_RESOURCE_ADC_SETTING_ADC_DRIVER_H_ */ |
+++ Common_Resource/CommonLibrary/include/CanCHAdeMO.h
... | ... | @@ -0,0 +1,63 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : CanCHAdeMO.h | |
4 | +// Created on : 2023. 11. 15. | |
5 | +// Description : | |
6 | +// Author : KwonJeongMin | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_CANCHADEMO_H_ | |
11 | +#define COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_CANCHADEMO_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +#define CanCHAdeMOTxMbox CanaTxMbox | |
18 | +#define CanCHAdeMORxMbox CanaRxMbox | |
19 | + | |
20 | +#define CANCHADEMO CANA_BASE | |
21 | + | |
22 | +#define CANCHADEMO_SLV_ID_OFFSET 0x100 | |
23 | + | |
24 | + | |
25 | +#pragma SET_DATA_SECTION(".CanCHAData") | |
26 | + | |
27 | +extern union uCanCHAdeMO CanCHAdeMO; | |
28 | +extern struct sCanCHAdeMO CanCHAdeMORx; | |
29 | +extern unsigned int CanCHAdeMORxStatus; | |
30 | +extern unsigned int CanCHAdeMORxIsrCnt; | |
31 | +extern unsigned int CanCHAdeMORxIsrErrCnt; | |
32 | + | |
33 | +extern unsigned int CanCHAdeMOTxSeqTable[]; | |
34 | +extern unsigned int CanCHAdeMOTxSeqTableSize; | |
35 | +extern unsigned int CanCHAdeMOTxSeqTableCnt; | |
36 | + | |
37 | +extern unsigned int CANCHADEMO_RxID_OFFSET; | |
38 | +extern unsigned int CANCHADEMO_TxID_OFFSET; | |
39 | + | |
40 | +#pragma SET_DATA_SECTION() | |
41 | + | |
42 | +extern void InitCanCHAdeMO(); | |
43 | + | |
44 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
45 | + | |
46 | +extern void CanCHAdeMORxUpdate(); | |
47 | +extern void CanCHAdeMORun_500us(); | |
48 | +extern void CanCHAdeMORun(); | |
49 | +extern void CanCHAdeMOTxUpdate(); | |
50 | +extern void CanCHAdeMOTxMasToSlv(); | |
51 | +extern void CanCHAdeMOTxSlvToMas(); | |
52 | + | |
53 | +extern void CanCHAdeMOMasTxRun(); | |
54 | +extern void CanCHAdeMOSlvTxRun(); | |
55 | + | |
56 | +extern interrupt void CanCHAdeMORxIsr(void); | |
57 | +#pragma SET_CODE_SECTION() | |
58 | + | |
59 | +#ifdef __cplusplus | |
60 | +} | |
61 | +#endif /* extern "C" */ | |
62 | + | |
63 | +#endif /* COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_CANCHADEMO_H_ */ |
+++ Common_Resource/CommonLibrary/include/CanCHAdeMODataMap.h
... | ... | @@ -0,0 +1,186 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : CanCHAdeMODataMap.h | |
4 | +// Created on : 2023. 11. 15. | |
5 | +// Description : | |
6 | +// Author : KwonJeongMin | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_CANCHADEMODATAMAP_H_ | |
11 | +#define COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_CANCHADEMODATAMAP_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +#include "CommonLib.h" | |
18 | + | |
19 | +struct sCanCHAdeMOIDx00 | |
20 | +{ | |
21 | + float IbatRef; | |
22 | + union uSTATUS Status; | |
23 | + uint16_t :16; | |
24 | +}; | |
25 | + | |
26 | +struct sCanCHAdeMOIDx01 | |
27 | +{ | |
28 | + uint16_t HeartBeat :16; | |
29 | + uint16_t Mode :16; | |
30 | + uint32_t :32; | |
31 | +}; | |
32 | + | |
33 | +struct sCanCHAdeMOIDx02 | |
34 | +{ | |
35 | +// union uFAULT_HW FaultHW; | |
36 | + union uFAULT_SW1 FaultSW1; | |
37 | +}; | |
38 | + | |
39 | +struct sCanCHAdeMOIDx03 | |
40 | +{ | |
41 | + union uFAULT_SW2 FaultSW2; | |
42 | + union uFAULT_SW3 FaultSW3; | |
43 | +}; | |
44 | + | |
45 | +struct sCanCHAdeMOIDx04 | |
46 | +{ | |
47 | + float Temp_AcSwHeatSink1; | |
48 | + float Temp_AcSwHeatSink2; | |
49 | +}; | |
50 | + | |
51 | +struct sCanCHAdeMOIDx05 | |
52 | +{ | |
53 | + float Temp_DcSwHeatSink1; | |
54 | + float Temp_DcSwHeatSink2; | |
55 | +}; | |
56 | + | |
57 | +struct sCanCHAdeMOIDx06 | |
58 | +{ | |
59 | + float Temp_Spare1; | |
60 | + float Temp_Spare2; | |
61 | +}; | |
62 | + | |
63 | +struct sCanCHAdeMOIDx07 | |
64 | +{ | |
65 | + float Ibat; | |
66 | + float Vbat; | |
67 | +}; | |
68 | + | |
69 | +struct sCanCHAdeMOIDx08 | |
70 | +{ | |
71 | + float Pbat; | |
72 | + float Vdc; | |
73 | +}; | |
74 | + | |
75 | +struct sCanCHAdeMOIDx09 | |
76 | +{ | |
77 | + float Vqe; | |
78 | + float Iqe; | |
79 | +}; | |
80 | + | |
81 | +struct sCanCHAdeMOIDx0A | |
82 | +{ | |
83 | + float Pinv; | |
84 | + uint32_t :32; | |
85 | +}; | |
86 | + | |
87 | +union uCanCHAdeMOIDx00 | |
88 | +{ | |
89 | + uint64_t all; | |
90 | + struct sCanCHAdeMOIDx00 bit; | |
91 | +}; | |
92 | + | |
93 | +union uCanCHAdeMOIDx01 | |
94 | +{ | |
95 | + uint64_t all; | |
96 | + struct sCanCHAdeMOIDx01 bit; | |
97 | +}; | |
98 | + | |
99 | +union uCanCHAdeMOIDx02 | |
100 | +{ | |
101 | + uint64_t all; | |
102 | + struct sCanCHAdeMOIDx02 bit; | |
103 | +}; | |
104 | + | |
105 | +union uCanCHAdeMOIDx03 | |
106 | +{ | |
107 | + uint64_t all; | |
108 | + struct sCanCHAdeMOIDx03 bit; | |
109 | +}; | |
110 | + | |
111 | +union uCanCHAdeMOIDx04 | |
112 | +{ | |
113 | + uint64_t all; | |
114 | + struct sCanCHAdeMOIDx04 bit; | |
115 | +}; | |
116 | + | |
117 | +union uCanCHAdeMOIDx05 | |
118 | +{ | |
119 | + uint64_t all; | |
120 | + struct sCanCHAdeMOIDx05 bit; | |
121 | +}; | |
122 | + | |
123 | +union uCanCHAdeMOIDx06 | |
124 | +{ | |
125 | + uint64_t all; | |
126 | + struct sCanCHAdeMOIDx06 bit; | |
127 | +}; | |
128 | + | |
129 | +union uCanCHAdeMOIDx07 | |
130 | +{ | |
131 | + uint64_t all; | |
132 | + struct sCanCHAdeMOIDx07 bit; | |
133 | +}; | |
134 | + | |
135 | +union uCanCHAdeMOIDx08 | |
136 | +{ | |
137 | + uint64_t all; | |
138 | + struct sCanCHAdeMOIDx08 bit; | |
139 | +}; | |
140 | + | |
141 | +union uCanCHAdeMOIDx09 | |
142 | +{ | |
143 | + uint64_t all; | |
144 | + struct sCanCHAdeMOIDx09 bit; | |
145 | +}; | |
146 | + | |
147 | +union uCanCHAdeMOIDx0A | |
148 | +{ | |
149 | + uint64_t all; | |
150 | + struct sCanCHAdeMOIDx0A bit; | |
151 | +}; | |
152 | + | |
153 | +//ID0xx = Master, ID1xx = Slave | |
154 | +struct sCanCHAdeMODataSet | |
155 | +{ | |
156 | + union uCanCHAdeMOIDx00 IDx00; | |
157 | + union uCanCHAdeMOIDx01 IDx01; | |
158 | + union uCanCHAdeMOIDx02 IDx02; | |
159 | + union uCanCHAdeMOIDx03 IDx03; | |
160 | + union uCanCHAdeMOIDx04 IDx04; | |
161 | + union uCanCHAdeMOIDx05 IDx05; | |
162 | + union uCanCHAdeMOIDx06 IDx06; | |
163 | + union uCanCHAdeMOIDx07 IDx07; | |
164 | + union uCanCHAdeMOIDx08 IDx08; | |
165 | + union uCanCHAdeMOIDx09 IDx09; | |
166 | + union uCanCHAdeMOIDx0A IDx0A; | |
167 | +}; | |
168 | + | |
169 | +union uCanCHAdeMO | |
170 | +{ | |
171 | + struct sCanCHAdeMODataSet Data; | |
172 | + uint64_t DataArr[0x0A + 1]; | |
173 | +}; | |
174 | + | |
175 | +struct sCanCHAdeMO | |
176 | +{ | |
177 | + union uCanCHAdeMO Mas; | |
178 | + union uCanCHAdeMO Slv; | |
179 | +}; | |
180 | + | |
181 | + | |
182 | +#ifdef __cplusplus | |
183 | +} | |
184 | +#endif /* extern "C" */ | |
185 | + | |
186 | +#endif /* COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_CANCHADEMODATAMAP_H_ */ |
+++ Common_Resource/CommonLibrary/include/CanLib.h
... | ... | @@ -0,0 +1,116 @@ |
1 | +/* | |
2 | + * Can_Driver.h | |
3 | + * | |
4 | + * Created on: 2021. 8. 3. | |
5 | + * Author: Kim-JeongWoo | |
6 | + */ | |
7 | + | |
8 | +#ifndef MAIN_RESOURCE_CAN_DRIVER_H_ | |
9 | +#define MAIN_RESOURCE_CAN_DRIVER_H_ | |
10 | + | |
11 | + | |
12 | +#ifdef __cplusplus | |
13 | +extern "C" { | |
14 | +#endif | |
15 | + | |
16 | + | |
17 | +struct sCanData32bit | |
18 | +{ | |
19 | + uint32_t Low; | |
20 | + uint32_t High; | |
21 | +}; | |
22 | + | |
23 | +struct sCanData16bit | |
24 | +{ | |
25 | + uint16_t Word[4]; | |
26 | +}; | |
27 | + | |
28 | + | |
29 | +struct sCanData8bit | |
30 | +{ | |
31 | + uint64_t Byte0 :8; | |
32 | + uint64_t Byte1 :8; | |
33 | + uint64_t Byte2 :8; | |
34 | + uint64_t Byte3 :8; | |
35 | + uint64_t Byte4 :8; | |
36 | + uint64_t Byte5 :8; | |
37 | + uint64_t Byte6 :8; | |
38 | + uint64_t Byte7 :8; | |
39 | +}; | |
40 | + | |
41 | + | |
42 | + | |
43 | +union uCANDATA_TYPE | |
44 | +{ | |
45 | + uint64_t all; | |
46 | + struct sCanData16bit U16; | |
47 | + struct sCanData32bit U32; | |
48 | + struct sCanData8bit U8; | |
49 | +}; | |
50 | + | |
51 | +struct sCANRXDATA | |
52 | +{ | |
53 | + unsigned int Id; | |
54 | + CAN_MsgFrameType *frameType; | |
55 | + uint16_t Data[8]; | |
56 | +}; | |
57 | + | |
58 | +struct sCanMsg | |
59 | +{ | |
60 | + union uCANDATA_TYPE Data; //Data | |
61 | + uint32_t Id; //Id ext 모드일 경우 최대 29bit | |
62 | + CAN_MsgFrameType *frameType; //Std or Ext | |
63 | + uint16_t Lenth; //Lenth | |
64 | + uint16_t Cnt; //Lenth | |
65 | +}; | |
66 | + | |
67 | + | |
68 | + | |
69 | + | |
70 | +#define CANCHADEMO_RX_MBOX_START 1 | |
71 | +#define CANCHADEMO_RX_MBOX_END 31 | |
72 | + | |
73 | +//#define CANME_RX_MBOX_START 1 | |
74 | +//#define CANME_RX_MBOX_END 31 | |
75 | + | |
76 | + | |
77 | +#pragma SET_DATA_SECTION(".CanLib") | |
78 | + | |
79 | +extern unsigned int TerminalResSet; | |
80 | +extern sCanMsg CanaRxMbox[32]; | |
81 | +extern sCanMsg CanaTxMbox; | |
82 | +//extern sCanMsg CanaTxMbox2; | |
83 | + | |
84 | +//extern sCanMsg CanbRxMbox[32]; | |
85 | +//extern sCanMsg CanbTxMbox; | |
86 | + | |
87 | +extern int FlagCanReset; | |
88 | + | |
89 | +#pragma SET_DATA_SECTION() | |
90 | + | |
91 | + | |
92 | + | |
93 | + | |
94 | + | |
95 | +extern void CanErrorReset(); | |
96 | +extern void InitCan(); | |
97 | + | |
98 | + | |
99 | + | |
100 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
101 | + | |
102 | +extern void CanTxMsg(uint32_t base, uint32_t objID, sCanMsg *Msg); | |
103 | +extern bool CanRxMsg(uint32_t base, uint32_t objID, sCanMsg *Msg); | |
104 | + | |
105 | +#pragma SET_CODE_SECTION() | |
106 | + | |
107 | + | |
108 | + | |
109 | + | |
110 | + | |
111 | + | |
112 | +#ifdef __cplusplus | |
113 | +} | |
114 | +#endif /* extern "C" */ | |
115 | + | |
116 | +#endif /* MAIN_RESOURCE_CAN_DRIVER_H_ */ |
+++ Common_Resource/CommonLibrary/include/CpuInfo.h
... | ... | @@ -0,0 +1,25 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : CpuInfo.h | |
4 | +// Created on : 2023. 3. 6. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef COMMON_RESOURCE_COMMONLIBRARY_SOURCE_CPUINFO_H_ | |
11 | +#define COMMON_RESOURCE_COMMONLIBRARY_SOURCE_CPUINFO_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | +extern void CpuInfo(); | |
19 | + | |
20 | + | |
21 | +#ifdef __cplusplus | |
22 | +} | |
23 | +#endif /* extern "C" */ | |
24 | + | |
25 | +#endif /* COMMON_RESOURCE_COMMONLIBRARY_SOURCE_CPUINFO_H_ */ |
+++ Common_Resource/CommonLibrary/include/DigitalIO.h
... | ... | @@ -0,0 +1,143 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : DigitalIO.h | |
4 | +// Created on : 2022. 10. 30. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef MAIN_RESOURCE_INCLUDE_DIGITALIO_H_ | |
11 | +#define MAIN_RESOURCE_INCLUDE_DIGITALIO_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +#define NORMAL_OPEN 0 | |
18 | +#define NORMAL_CLOSE 1 | |
19 | + | |
20 | + | |
21 | + | |
22 | +extern void InitDigitalIOSet(void); | |
23 | +extern void DigitalInput(void); | |
24 | +extern void DigitalOutput(void); | |
25 | + | |
26 | +void InitDigitalInput(void); | |
27 | +void InitDigitalOutput(void); | |
28 | + | |
29 | + | |
30 | +extern void ReadDioExor(void); | |
31 | +extern void WriteDioExor(void); | |
32 | +extern void ResetDioExor(void); | |
33 | + | |
34 | +extern int FlagWrDioExor; | |
35 | +extern int FlagRstDioExor; | |
36 | + | |
37 | +extern long int BufferDoutExorAll; | |
38 | + | |
39 | +union uDinRawData | |
40 | +{ | |
41 | + Uint32 all; | |
42 | +}; | |
43 | + | |
44 | + | |
45 | + | |
46 | +struct sDinList | |
47 | +{ | |
48 | + Uint16 Button :1; //0 | |
49 | + Uint16 Door_chk :1; //1 | |
50 | + | |
51 | + Uint16 rsd1 :6; //2~7 | |
52 | + | |
53 | + Uint16 rsd2 :8; //8~15 | |
54 | + | |
55 | + Uint16 FT_CH1_UV :1; //0 | |
56 | + Uint16 FT_CH1_VIS :1; //1 | |
57 | + Uint16 FT_CH1_IR :1; //2 | |
58 | + Uint16 FT_CH2_UV :1; //3 | |
59 | + | |
60 | + Uint16 FT_CH2_VIS :1; //4 | |
61 | + Uint16 FT_CH2_IR :1; //5 | |
62 | + Uint16 FT_CH3_UV :1; //6 | |
63 | + Uint16 FT_CH3_VIS :1; //7 | |
64 | + | |
65 | + Uint16 FT_CH3_IR :1; //8 | |
66 | + Uint16 FT_CH4_UV :1; //9 | |
67 | + Uint16 FT_CH4_VIS :1; //10 | |
68 | + Uint16 FT_CH4_IR :1; //11 | |
69 | + | |
70 | + Uint16 rsd3 :4; //12 | |
71 | + | |
72 | +}; | |
73 | + | |
74 | + | |
75 | + | |
76 | +union uDinData | |
77 | +{ | |
78 | + Uint32 all; | |
79 | + struct sDinList bit; | |
80 | +}; | |
81 | + | |
82 | +union uDinExor | |
83 | +{ | |
84 | + Uint32 all; | |
85 | + struct sDinList bit; | |
86 | +}; | |
87 | + | |
88 | +struct sDin | |
89 | +{ | |
90 | + union uDinRawData DataRaw; | |
91 | + union uDinData Data; | |
92 | + union uDinExor Exor; | |
93 | +}; | |
94 | + | |
95 | +struct sDoutList | |
96 | +{ | |
97 | + Uint16 Ch00 :1; // 0x0001 (Red) | |
98 | + Uint16 Ch01 :1; // 0x0002 | |
99 | + Uint16 Ch02 :1; // 0x0004 (Green) | |
100 | + Uint16 Ch03 :1; // 0x0008 (Yellow) | |
101 | + | |
102 | + Uint16 Ch04 :1; // 0x0010 | |
103 | + Uint16 Ch05 :1; // 0x0020 | |
104 | + Uint16 Ch06 :1; // 0x0040 | |
105 | + Uint16 Ch07 :1; // 0x0080 | |
106 | + | |
107 | + Uint16 Ch08 :1; // 0x0100 //충전건 Lock | |
108 | + Uint16 Ch09 :1; // 0x0200 | |
109 | + Uint16 Ch20 :1; // 0x0400 | |
110 | + Uint16 Ch21 :1; // 0x0800 //충전건 Unlock | |
111 | + | |
112 | + Uint16 Ch22 :1; // 0x1000 | |
113 | + Uint16 Ch23 :1; // 0x2000 | |
114 | + Uint16 Ch24 :1; // 0x4000 | |
115 | + Uint16 Ch25 :1; // 0x8000 | |
116 | +}; | |
117 | + | |
118 | +union uDOUT_DATA | |
119 | +{ | |
120 | + Uint16 all; | |
121 | + struct sDoutList bit; | |
122 | +}; | |
123 | + | |
124 | +union uDOUT_EXOR | |
125 | +{ | |
126 | + Uint16 all; | |
127 | + struct sDoutList bit; | |
128 | +}; | |
129 | + | |
130 | +struct sDOUT | |
131 | +{ | |
132 | + union uDOUT_DATA Data; | |
133 | + union uDOUT_EXOR Exor; | |
134 | +}; | |
135 | + | |
136 | +extern struct sDin Din; | |
137 | +extern struct sDOUT Dout; | |
138 | + | |
139 | +#ifdef __cplusplus | |
140 | +} | |
141 | +#endif /* extern "C" */ | |
142 | + | |
143 | +#endif /* MAIN_RESOURCE_INCLUDE_DIGITALIO_H_ */ |
+++ Common_Resource/CommonLibrary/include/EPwmLib.h
... | ... | @@ -0,0 +1,90 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : EPwm.h | |
4 | +// Created on : 2019. 06. 09. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#ifndef _EPWM_H_ | |
12 | +#define _EPWM_H_ | |
13 | + | |
14 | +#ifdef __cplusplus | |
15 | +extern "C" { | |
16 | +#endif | |
17 | + | |
18 | +#define PWM1_INT_ENABLE 1 | |
19 | +#define PWM2_INT_ENABLE 1 | |
20 | +#define PWM3_INT_ENABLE 1 | |
21 | +#define PWM4_INT_ENABLE 1 | |
22 | +#define PWM5_INT_ENABLE 1 | |
23 | +#define PWM6_INT_ENABLE 1 | |
24 | + | |
25 | +extern void InitEPwm1Gpio(void); | |
26 | +extern void InitEPwm2Gpio(void); | |
27 | +extern void InitEPwm3Gpio(void); | |
28 | +extern void InitEPwm4Gpio(void); | |
29 | +extern void InitEPwm5Gpio(void); | |
30 | +extern void InitEPwm6Gpio(void); | |
31 | +extern void InitEPwm7Gpio(void); | |
32 | +extern void InitEPwm8Gpio(void); | |
33 | +extern void InitEPwm9Gpio(void); | |
34 | +extern void InitEPwm10Gpio(void); | |
35 | +extern void InitEPwm11Gpio(void); | |
36 | +extern void InitEPwm12Gpio(void); | |
37 | + | |
38 | +extern void InitEPwm(void); | |
39 | + | |
40 | +extern void InitEPwm1(float PwmFreq, float Deadtime, unsigned int CTR_Mode, unsigned int Tbphs); | |
41 | +extern void InitEPwm2(float PwmFreq, float Deadtime, unsigned int CTR_Mode, unsigned int Tbphs); | |
42 | +extern void InitEPwm3(float PwmFreq, float Deadtime, unsigned int CTR_Mode, unsigned int Tbphs); | |
43 | +extern void InitEPwm4(float PwmFreq, float Deadtime, unsigned int CTR_Mode, unsigned int Tbphs); | |
44 | +extern void InitEPwm5(float PwmFreq, float Deadtime, unsigned int CTR_Mode, unsigned int Tbphs); | |
45 | +extern void InitEPwm6(float PwmFreq, float Deadtime, unsigned int CTR_Mode, unsigned int Tbphs); | |
46 | +extern void InitEPwm7(float PwmFreq, float Deadtime, unsigned int CTR_Mode, unsigned int Tbphs); | |
47 | +extern void InitEPwm8(float PwmFreq, float Deadtime, unsigned int CTR_Mode, unsigned int Tbphs); | |
48 | +extern void InitEPwm9(float PwmFreq, float Deadtime, unsigned int CTR_Mode, unsigned int Tbphs); | |
49 | + | |
50 | +extern unsigned int PwmPrdCal(float PwmFreq, float Tbclk, unsigned int CtrDiv); | |
51 | +extern unsigned int PwmDeadtimeCal(float PwmDeadtime, float Tbclk); | |
52 | + | |
53 | + | |
54 | +extern float Tpwm; | |
55 | + | |
56 | +extern float InvPwmFreq; | |
57 | +extern unsigned int InvPwmPrd; | |
58 | + | |
59 | +extern float BoostPwmFreq; | |
60 | +extern unsigned int BoostPwmPrd; | |
61 | + | |
62 | +extern unsigned int DabPwmPrd; | |
63 | + | |
64 | +extern float Deadtime; | |
65 | + | |
66 | + | |
67 | + | |
68 | + | |
69 | +extern void InitGateEnbGpio(void); | |
70 | +extern void GatePulseGenerate(void); | |
71 | + | |
72 | +////////////Temp/////////////////////////// | |
73 | +#define GPIO_GATE_ENB GpioDataRegs.GPCDAT.bit.GPIO95 | |
74 | + | |
75 | + | |
76 | +extern void GateOutEnable(void); | |
77 | +extern void GateOutDisable(void); | |
78 | +extern void PwmCntUpDate(void); | |
79 | + | |
80 | +extern void PwmTestCode(void); | |
81 | + | |
82 | + | |
83 | +extern interrupt void Cpu1Epwm1Isr(void); | |
84 | +extern interrupt void Cpu2Epwm1Isr(void); | |
85 | + | |
86 | +#ifdef __cplusplus | |
87 | +} | |
88 | +#endif /* extern "C" */ | |
89 | + | |
90 | +#endif /* _EPWM_H_ */ |
+++ Common_Resource/CommonLibrary/include/Eeprom.h
... | ... | @@ -0,0 +1,62 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : Eeprom.h | |
4 | +// Created on : 2023. 10. 31. | |
5 | +// Description : EEPROM Library (SPI-Type) | |
6 | +// Author : "Kim JeongWoo" | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#ifndef COMMON_RESOURCE_COMMONLIBRARY_SOURCE_EEPROM_H_ | |
12 | +#define COMMON_RESOURCE_COMMONLIBRARY_SOURCE_EEPROM_H_ | |
13 | + | |
14 | + | |
15 | +#ifdef __cplusplus | |
16 | +extern "C" { | |
17 | +#endif | |
18 | + | |
19 | +//EEPROM 저장영역 설정 | |
20 | +#define pEepromAdcScale 0x0000 | |
21 | +#define pEepromAdcOffset 0x0100 | |
22 | +#define pEepromExor 0x1000 | |
23 | +#define pEepromChk 0x3000 | |
24 | + | |
25 | +#define EEPROM_MAX_SIZE 0xFFFF /4 | |
26 | + | |
27 | +extern void EepromWriteAdcScale(); | |
28 | +extern void EepromReadAdcScale(); | |
29 | + | |
30 | +extern void EepromWriteAdcOffset(); | |
31 | +extern void EepromReadAdcOffset(); | |
32 | + | |
33 | +extern void EepromReadDioExor(); | |
34 | +extern void EepromWriteDioExor(); | |
35 | + | |
36 | +extern void EepromCmds(); | |
37 | +extern void EepromChk(); | |
38 | + | |
39 | +//for test | |
40 | +extern void EepromChkCodeClr(); | |
41 | +extern void EepromChkCodeWr(); | |
42 | + | |
43 | + | |
44 | +extern unsigned int FlagWrAdcScale; | |
45 | +extern unsigned int FlagRdAdcScale; | |
46 | +extern unsigned int FlagWrAdcOffset; | |
47 | +extern unsigned int FlagRdAdcOffset; | |
48 | + | |
49 | +extern float Testpcs1; | |
50 | +extern float Testpcs2; | |
51 | +extern float Testpcs3; | |
52 | + | |
53 | + | |
54 | + | |
55 | +#ifdef __cplusplus | |
56 | +} | |
57 | +#endif /* extern "C" */ | |
58 | + | |
59 | + | |
60 | + | |
61 | + | |
62 | +#endif /* COMMON_RESOURCE_COMMONLIBRARY_SOURCE_EEPROM_H_ */ |
+++ Common_Resource/CommonLibrary/include/EepromLib.h
... | ... | @@ -0,0 +1,44 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-ENEMAN-CPU1 | |
3 | +// File Name : EepromLib.h | |
4 | +// Created on : 2023. 07. 12. | |
5 | +// Description : | |
6 | +// Author : KWONJEONGMIN | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_EEPROMLIB_H_ | |
11 | +#define COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_EEPROMLIB_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +#include <CommonLib.h> | |
18 | + | |
19 | +#define ERASE 0x0380 //ERASE | |
20 | +#define ERAL 0x0240 //ERASE ALL | |
21 | +#define EWDS 0x0200 //ERASE/WRITE DISABLE | |
22 | +#define EWEN 0x0260 //ERASE/WRITE ENABLE | |
23 | +#define READ 0x0300 //READ | |
24 | +#define WRITE 0x0280 //WRITE | |
25 | +#define WRAL 0x0220 //WRITE ALL | |
26 | + | |
27 | +//extern void InitSpi(); | |
28 | +extern void InitSpiGpio(); | |
29 | + | |
30 | +extern void ew_disable(); | |
31 | +extern void ew_enable(); | |
32 | +extern bool is_ew_enabled(); | |
33 | +extern void erase_all(); | |
34 | +extern void write_all(); | |
35 | +extern void write(); | |
36 | +extern void erase(); | |
37 | +extern word read(); | |
38 | + | |
39 | + | |
40 | +#ifdef __cplusplus | |
41 | +} | |
42 | +#endif /* extern "C" */ | |
43 | + | |
44 | +#endif /* COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_EEPROMLIB_H_ */ |
+++ Common_Resource/CommonLibrary/include/F28377D_TempSensor.h
... | ... | @@ -0,0 +1,34 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU2 | |
3 | +// File Name : F28377D_TempSensor.h | |
4 | +// Created on : 2022. 12. 16. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_F28377D_TEMPSENSOR_H_ | |
11 | +#define COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_F28377D_TEMPSENSOR_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | +extern void InitDspTempSensor(void); | |
19 | + | |
20 | +extern int16 GetTemperatureC(int16 sensorSample); | |
21 | +extern int16 GetTemperatureK(int16 sensorSample); | |
22 | + | |
23 | +#pragma SET_DATA_SECTION(".IntTemp") | |
24 | +extern float32 tempSensor_tempSlope; | |
25 | +extern float32 tempSensor_tempOffset; | |
26 | +extern float32 tempSensor_scaleFactor; | |
27 | +#pragma SET_DATA_SECTION() | |
28 | + | |
29 | + | |
30 | +#ifdef __cplusplus | |
31 | +} | |
32 | +#endif /* extern "C" */ | |
33 | + | |
34 | +#endif /* COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_F28377D_TEMPSENSOR_H_ */ |
+++ Common_Resource/CommonLibrary/include/FaultDefine.h
... | ... | @@ -0,0 +1,157 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : FaultDefine.h | |
4 | +// Created on : 2022. 10. 30. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef MAIN_RESOURCE_INCLUDE_FAULTDEFINE_H_ | |
11 | +#define MAIN_RESOURCE_INCLUDE_FAULTDEFINE_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +struct sFAULT_SW_LIST1 | |
18 | +{ | |
19 | + Uint32 CH1_UV_OV :1; // 0x00000001 | |
20 | + Uint32 CH1_VIS_OV :1; // 0x00000002 | |
21 | + Uint32 CH1_IR_OV :1; // 0x00000004 | |
22 | + | |
23 | + Uint32 CH2_UV_OV :1; // 0x00000008 | |
24 | + Uint32 CH2_VIS_OV :1; // 0x00000010 | |
25 | + Uint32 CH2_IR_OV :1; // 0x00000020 | |
26 | + | |
27 | + Uint32 CH3_UV_OV :1; // 0x00000040 | |
28 | + Uint32 CH3_VIS_OV :1; // 0x00000080 | |
29 | + Uint32 CH3_IR_OV :1; // 0x00000100 | |
30 | + | |
31 | + Uint32 CH4_UV_OV :1; // 0x00000200 | |
32 | + Uint32 CH4_VIS_OV :1; // 0x00000400 | |
33 | + Uint32 CH4_IR_OV :1; // 0x00000800 | |
34 | + | |
35 | + Uint32 Reseved0 :20; // 0x08000000 ~ 0x80000000 | |
36 | + | |
37 | +}; | |
38 | + | |
39 | +union uFAULT_SW1 | |
40 | +{ | |
41 | + Uint32 all; | |
42 | + struct sFAULT_SW_LIST1 bit; | |
43 | +}; | |
44 | + | |
45 | +struct sFAULT_SW_LIST2 | |
46 | +{ | |
47 | + | |
48 | + //contactType Fault | |
49 | + Uint32 Switch_EmergencyStop :1; // 0x00000001 | |
50 | +// Uint32 Switch_Paddlelock :1; // 0x00000002 Paddle lock switch or Limit �switch | |
51 | +// Uint32 FuseAcAphase :1; // 0x00000004 | |
52 | +// Uint32 FuseAcBphase :1; // 0x00000008 | |
53 | +// Uint32 FuseAcCphase :1; // 0x00000010 | |
54 | +// Uint32 FuseDc :1; // 0x00000020 | |
55 | +// | |
56 | +// Uint32 SpdCtrl :1; // 0x00000040 | |
57 | +// Uint32 SpdPower :1; // 0x00000080 | |
58 | +// | |
59 | +// Uint32 FanBeOutStackFrontTop :1; // 0x00000100 | |
60 | +// Uint32 FanBeOutStackFrontBot :1; // 0x00000200 | |
61 | +// Uint32 FanMcStackFront :1; // 0x00000400 | |
62 | +// Uint32 FanMcStackRear :1; // 0x00000800 | |
63 | +// Uint32 FanCpRearLeft :1; // 0x00001000 | |
64 | +// Uint32 FanCpRearRight :1; // 0x00002000 | |
65 | +// Uint32 FanRackLeft :1; // 0x00004000 | |
66 | +// Uint32 FanRackRight :1; // 0x00008000 | |
67 | +// Uint32 FanBeStackFront :1; // 0x00010000 | |
68 | +// Uint32 FanBeStackRear :1; // 0x00020000 | |
69 | +// | |
70 | +// Uint32 OT_ThsBeStackLeft :1; // 0x00040000 //Thermal Switch | |
71 | +// Uint32 OT_ThsBeStackRight :1; // 0x00080000 //Thermal Switch | |
72 | +// | |
73 | +// Uint16 Cmc :1; // 0x00100000 //Cmc | |
74 | +// Uint16 Mmc :1; // 0x00200000 //Mmc | |
75 | +// Uint16 Mccb_Open :1; // 0x00400000 // MCCB | |
76 | +// | |
77 | +// Uint16 OT_Ntc_Dcl :1; // 0x00800000 // | |
78 | +// Uint16 OT_Ntc_Acl :1; // 0x01000000 // | |
79 | +// Uint16 OT_Ntc_Tr :1; // 0x02000000 // | |
80 | +// | |
81 | +// Uint16 OT_Ntc_SicConvA :1; // 0x04000000 // | |
82 | +// Uint16 OT_Ntc_SicConvB :1; // 0x08000000 // | |
83 | +// Uint16 OT_Ntc_SicConvC :1; // 0x10000000 // | |
84 | +// | |
85 | +// Uint16 OT_Ntc_SicInvA :1; // 0x20000000 // | |
86 | +// Uint16 OT_Ntc_SicInvB :1; // 0x40000000 // | |
87 | +// Uint16 OT_Ntc_SicInvC :1; // 0x80000000 // | |
88 | + | |
89 | +}; | |
90 | + | |
91 | +union uFAULT_SW2 | |
92 | +{ | |
93 | + Uint32 all; | |
94 | + struct sFAULT_SW_LIST2 bit; | |
95 | +}; | |
96 | + | |
97 | +struct sFAULT_SW_LIST3 // | |
98 | +{ | |
99 | + Uint32 Comm_RTU :1; // 0x00000001 | |
100 | + Uint32 Comm_Can :1; // 0x00000002 | |
101 | +// Uint32 Offset_Iabc :1; // 0x00000001 | |
102 | +// Uint32 Offset_IL :1; // 0x00000002 | |
103 | +// Uint32 Offset_Ibe :1; // 0x00000004 | |
104 | +// | |
105 | +// Uint32 Err_Nvram :1; // 0x00000008 | |
106 | +// Uint32 Comm_CanMe :1; // 0x00000010 | |
107 | +// Uint32 Comm_CanBe :1; // 0x00000020 | |
108 | +// | |
109 | +// Uint32 Err_Parallel :1; | |
110 | + | |
111 | + Uint32 :30; | |
112 | +}; | |
113 | + | |
114 | +union uFAULT_SW3 | |
115 | +{ | |
116 | + Uint32 all; | |
117 | + struct sFAULT_SW_LIST3 bit; | |
118 | +}; | |
119 | + | |
120 | +struct sFault | |
121 | +{ | |
122 | + union uFAULT_SW1 Sw1; //32bit | |
123 | + union uFAULT_SW2 Sw2; //32bit | |
124 | + union uFAULT_SW3 Sw3; //32bit | |
125 | +}; | |
126 | + | |
127 | +struct sFaultSet | |
128 | +{ | |
129 | + float Ratio; | |
130 | + float SetLevel; | |
131 | + float SetTime; | |
132 | + int SetCnt; | |
133 | + int ChkCnt; // Check Count | |
134 | + int SetStableCnt; | |
135 | + int StableCnt; | |
136 | +}; | |
137 | + | |
138 | +#pragma SET_DATA_SECTION(".Fault") | |
139 | + | |
140 | +extern struct sFault Fault; | |
141 | + | |
142 | +extern struct sFaultSet FT_UV_OV; | |
143 | +extern struct sFaultSet FT_VIS_OV; | |
144 | +extern struct sFaultSet FT_IR_OV; | |
145 | + | |
146 | +extern struct sFaultSet OtNtc5; | |
147 | +extern struct sFaultSet OtNtc6; | |
148 | + | |
149 | +extern struct sMesureList FaultLatch; | |
150 | + | |
151 | +#pragma SET_DATA_SECTION() | |
152 | + | |
153 | +#ifdef __cplusplus | |
154 | +} | |
155 | +#endif /* extern "C" */ | |
156 | + | |
157 | +#endif /* MAIN_RESOURCE_INCLUDE_FAULTDEFINE_H_ */ |
+++ Common_Resource/CommonLibrary/include/ModBus.h
... | ... | @@ -0,0 +1,84 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : ModBus.h | |
4 | +// Created on : 2019. 06. 09. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#ifndef _MODBUS_SCI_H__ | |
12 | +#define _MODBUS_SCI_H__ | |
13 | + | |
14 | +#ifdef __cplusplus | |
15 | +extern "C" { | |
16 | +#endif | |
17 | + | |
18 | +extern void InitModbusSci(); | |
19 | +void InitModbusPtr(); | |
20 | + | |
21 | +extern void InitSci(); | |
22 | + | |
23 | +#define MODBUSA_ENB 1 | |
24 | +#define MODBUSB_ENB 0 | |
25 | + | |
26 | + | |
27 | +//-----------------------Modbus A -----------------------------// | |
28 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
29 | +extern void ModbusACheckBuffer(); | |
30 | +extern void ModbusAResponse(); | |
31 | +void ModbusA3rdResponse(); | |
32 | +void ModbusA4thResponse(); | |
33 | +void ModbusA6thResponse(); | |
34 | +void ModbusA16thResponse(); | |
35 | +void ModbusABadResponse(); | |
36 | +int ModbusASerialRange(int address); | |
37 | +int ModbusACRC16(int dataLength,int check); | |
38 | + | |
39 | +extern void ModbusARxDataUpdate(void); | |
40 | +extern void ModbusATxDataUpdate(void); | |
41 | +#pragma SET_CODE_SECTION() | |
42 | + | |
43 | + | |
44 | +#define MODBUSAPTRMAX 1010 | |
45 | + | |
46 | +#pragma SET_DATA_SECTION(".Modbus") | |
47 | +extern volatile void *ModbusAPtr[MODBUSAPTRMAX]; | |
48 | +void InitModbusAPtr(void); | |
49 | +#pragma SET_DATA_SECTION() | |
50 | + | |
51 | +//-----------------------Modbus B -----------------------------// | |
52 | + | |
53 | +#if(MODBUSB_ENB) | |
54 | + | |
55 | +extern void ModbusBCheckBuffer(); | |
56 | +extern void ModbusBResponse(); | |
57 | +void ModbusB3rdResponse(); | |
58 | +void ModbusB4thResponse(); | |
59 | +void ModbusB6thResponse(); | |
60 | +void ModbusB16thResponse(); | |
61 | +void ModbusBBadResponse(); | |
62 | +int ModbusBSerialRange(int address); | |
63 | +int ModbusBCRC16(int dataLength,int check); | |
64 | + | |
65 | +void InitModbusBPtr(void); | |
66 | +#define MODBUSBPTRMAX 300 | |
67 | +extern volatile void *ModbusBPtr[MODBUSBPTRMAX]; | |
68 | +extern void ModbusBRxDataUpdate(void); | |
69 | +extern void ModbusBTxDataUpdate(void); | |
70 | + | |
71 | +#endif | |
72 | + | |
73 | +extern void ModbusALLCheckBuffer(void); | |
74 | +extern void ModbusALLResponse(void); | |
75 | +extern void ModbusALLDataUpdate(void); | |
76 | + | |
77 | +//#include "CRC16.h" | |
78 | + | |
79 | + | |
80 | +#ifdef __cplusplus | |
81 | +} | |
82 | +#endif /* extern "C" */ | |
83 | + | |
84 | +#endif // of _Modbus_SCI_H__ |
+++ Common_Resource/CommonLibrary/include/NtcLib.h
... | ... | @@ -0,0 +1,53 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-ME-CPU1 | |
3 | +// File Name : Ntc.h | |
4 | +// Created on : 2022. 10. 17. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef MAIN_RESOURCE_NTC_H_ | |
11 | +#define MAIN_RESOURCE_NTC_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +#include "CodeLibrary.h" | |
18 | + | |
19 | +struct sTEMP_LIST | |
20 | +{ | |
21 | + //Internal ADC | |
22 | + float DcSwHeatSink1; | |
23 | + float DcSwHeatSink2; | |
24 | + float AcSwHeatSink1; //나중에 변수명 정확하게 기입 할 것 | |
25 | + float AcSwHeatSink2; | |
26 | + float Spare1; | |
27 | + float Spare2; | |
28 | + | |
29 | + //I.C 온도 | |
30 | + float MCU; | |
31 | + float RTC; | |
32 | +}; | |
33 | + | |
34 | + | |
35 | +#pragma SET_DATA_SECTION(".TempData") | |
36 | + | |
37 | +extern sTEMP_LIST Temp; | |
38 | +#pragma SET_DATA_SECTION() | |
39 | + | |
40 | + | |
41 | + | |
42 | +extern void InitNtcTable(void); | |
43 | +extern void NtcRead(void); | |
44 | + | |
45 | + | |
46 | + | |
47 | + | |
48 | + | |
49 | +#ifdef __cplusplus | |
50 | +} | |
51 | +#endif /* extern "C" */ | |
52 | + | |
53 | +#endif /* MAIN_RESOURCE_NTC_H_ */ |
+++ Common_Resource/CommonLibrary/include/RTC.h
... | ... | @@ -0,0 +1,414 @@ |
1 | +/* | |
2 | + * RTC.h | |
3 | + * | |
4 | + * Created on: 2024. 2. 20. | |
5 | + * Author: user | |
6 | + */ | |
7 | + | |
8 | +/* | |
9 | +* RTC.h | |
10 | +* | |
11 | +* Created on: 2017. 1. 25. | |
12 | +* Author: kdkor | |
13 | +*/ | |
14 | + | |
15 | + | |
16 | +#ifndef MAIN_RESOURCE_INCLUDE_RTC_H_ | |
17 | +#define MAIN_RESOURCE_INCLUDE_RTC_H_ | |
18 | + | |
19 | +#ifdef __cplusplus | |
20 | +extern "C" { | |
21 | +#endif | |
22 | + | |
23 | +extern unsigned int Spid_Rx(unsigned int Read_addr); | |
24 | +extern void Spid_Tx(unsigned int Tx_Data); | |
25 | + | |
26 | +//RTC DEVICE MODEL | |
27 | +// DS3234 SPI 4-Wire RTC | |
28 | +#define M48T35Y 0 | |
29 | +#define DS3234 1 | |
30 | +#define DS1390 0 | |
31 | + | |
32 | + | |
33 | +#if(DS3234) | |
34 | + | |
35 | + | |
36 | +// Read, Write Mode | |
37 | +#define RTC_RD 0x0000 | |
38 | +#define RTC_WR 0x8000 | |
39 | + | |
40 | +// ADDR Preset | |
41 | +#define RTC_SEC 0x0000 | |
42 | +#define RTC_MIN 0x0100 | |
43 | +#define RTC_HOUR 0x0200 | |
44 | +#define RTC_DAY 0x0300 | |
45 | +#define RTC_DATE 0x0400 | |
46 | +#define RTC_MONTH 0x0500 | |
47 | +#define RTC_YEAR 0x0600 | |
48 | + | |
49 | +#define RTC_ALARM1_SEC 0x0700 | |
50 | +#define RTC_ALARM1_MIN 0x0800 | |
51 | +#define RTC_ALARM1_HOUR 0x0900 | |
52 | +#define RTC_ALARM1_DAY_DATE 0x0A00 | |
53 | + | |
54 | +#define RTC_ALARM2_MIN 0x0B00 | |
55 | +#define RTC_ALARM2_HOUR 0x0C00 | |
56 | +#define RTC_ALARM2_DATE 0x0D00 | |
57 | + | |
58 | +#define RTC_CTRL 0x0E00 | |
59 | +#define RTC_CTRL_STATUS 0x0F00 | |
60 | + | |
61 | +#define RTC_XTAL_AGING_OFFSET 0x1000 | |
62 | + | |
63 | +#define RTC_TEMP_MSB 0x1100 | |
64 | +#define RTC_TEMP_LSB 0x1200 | |
65 | + | |
66 | +struct sDS3234_SEC_BIT | |
67 | +{ | |
68 | + Uint16 Unit :4; // 0:3 Seconds 일의 자리 | |
69 | + Uint16 Tens :3; // 4:6 Seconds 10의 자리 | |
70 | + Uint16 rsvd1 :9; // 7:15 rsvd | |
71 | +}; | |
72 | +// | |
73 | +union sDS3234_SEC | |
74 | +{ | |
75 | + Uint16 all; | |
76 | + struct sDS3234_SEC_BIT bit; | |
77 | +}; | |
78 | + | |
79 | +struct sDS3234_MIN_BIT | |
80 | +{ | |
81 | + Uint16 Unit :4; // 0:3 Minutes 일의 자리 | |
82 | + Uint16 Tens :3; // 4:6 Minutes 10의 자리 | |
83 | + Uint16 rsvd1 :9; // 7:15 rsvd | |
84 | +}; | |
85 | + | |
86 | +union sDS3234_MIN | |
87 | +{ | |
88 | + Uint16 all; | |
89 | + struct sDS3234_MIN_BIT bit; | |
90 | +}; | |
91 | + | |
92 | +struct sDS3234_HOUR_BIT | |
93 | +{ | |
94 | + Uint16 Unit :4; // 0:3 Hour 일의 자리 | |
95 | + Uint16 Tens :2; // 4:5 Hour 10의 자리 | |
96 | + Uint16 Mode_24_12 :1; // 6 12/24 Mode | |
97 | + Uint16 rsvd1 :9; // 7:15 rsvd | |
98 | +}; | |
99 | +// | |
100 | +union sDS3234_HOUR | |
101 | +{ | |
102 | + Uint16 all; | |
103 | + struct sDS3234_HOUR_BIT bit; | |
104 | +}; | |
105 | + | |
106 | + | |
107 | +struct sDS3234_DAY_BIT | |
108 | +{ | |
109 | + Uint16 Day :3; // 0:2 Day (요일) 1~7 | |
110 | + Uint16 rsvd4 :13; // 3:15 rsvd | |
111 | + | |
112 | +}; | |
113 | +// | |
114 | +union sDS3234_DAY | |
115 | +{ | |
116 | + Uint16 all; | |
117 | + struct sDS3234_DAY_BIT bit; | |
118 | +}; | |
119 | + | |
120 | +struct sDS3234_DATE_BIT | |
121 | +{ | |
122 | + Uint16 Unit :4; // 0:3 1 Date (날짜) | |
123 | + Uint16 Tens :2; // 4:5 10 Date (날짜) | |
124 | + Uint16 rsvd5 :10; // 6:15 rsvd | |
125 | +}; | |
126 | +// | |
127 | +union sDS3234_DATE | |
128 | +{ | |
129 | + Uint16 all; | |
130 | + struct sDS3234_DATE_BIT bit; | |
131 | +}; | |
132 | + | |
133 | + | |
134 | +struct sDS3234_MONTH_BIT | |
135 | +{ | |
136 | + Uint16 Unit :4; // 0:3 Month | |
137 | + Uint16 Tens :1; // 4 Month 10의 자리 | |
138 | + Uint16 rsvd6 :2; // 5:6 rsvd | |
139 | + Uint16 Century :1; // 7 Century | |
140 | + Uint16 rsvd7 :8; // 8:15 rsvd | |
141 | +}; | |
142 | +// | |
143 | +union sDS3234_MONTH | |
144 | +{ | |
145 | + Uint16 all; | |
146 | + struct sDS3234_MONTH_BIT bit; | |
147 | +}; | |
148 | + | |
149 | +struct sDS3234_YEAR_BIT | |
150 | +{ | |
151 | + Uint16 Unit :4; // 0:3 Year | |
152 | + Uint16 Tens :4; // 4:7 Year 10의 자리 | |
153 | + Uint16 rsvd8 :8; // 8:15 rsvd | |
154 | +}; | |
155 | + | |
156 | +union sDS3234_YEAR | |
157 | +{ | |
158 | + Uint16 all; | |
159 | + struct sDS3234_YEAR_BIT bit; | |
160 | +}; | |
161 | + | |
162 | + | |
163 | +struct sDS3234_TEMP_BIT | |
164 | +{ | |
165 | + Uint16 LSB :8; // 4:7 Month 10의 자리 | |
166 | + Uint16 MSB :8; // 0:3 Month | |
167 | +}; | |
168 | + | |
169 | +union sDS3234_TEMP | |
170 | +{ | |
171 | + Uint16 all; | |
172 | + struct sDS3234_TEMP_BIT bit; | |
173 | +}; | |
174 | + | |
175 | +struct sDS3234_REGS | |
176 | +{ | |
177 | + volatile union sDS3234_SEC SecDAT; | |
178 | + volatile int16 Sec; | |
179 | + | |
180 | + volatile union sDS3234_MIN MinDAT; | |
181 | + volatile int16 Min; | |
182 | + | |
183 | + volatile union sDS3234_HOUR HourDAT; | |
184 | + volatile int16 Hour; | |
185 | + | |
186 | + volatile union sDS3234_DAY DayDAT; | |
187 | + volatile int16 Day; | |
188 | + | |
189 | + volatile union sDS3234_DATE DateDAT; | |
190 | + volatile int16 Date; | |
191 | + | |
192 | + volatile union sDS3234_MONTH MonthDAT; | |
193 | + volatile int16 Month; | |
194 | + | |
195 | + volatile union sDS3234_YEAR YearDAT; | |
196 | + volatile int16 Year; | |
197 | + | |
198 | + volatile union sDS3234_TEMP TempDAT; | |
199 | + volatile float Temp; | |
200 | +}; | |
201 | + | |
202 | +struct sRTC_DATA_BUF | |
203 | +{ | |
204 | + int Sec; | |
205 | + int Min; | |
206 | + int Hour; | |
207 | + int Date; | |
208 | + int Day; | |
209 | + int Month; | |
210 | + int Year; | |
211 | + int Temp; | |
212 | +}; | |
213 | + | |
214 | +extern struct sDS3234_REGS RTCRegs; | |
215 | +extern struct sDS3234_REGS RTCWrBuf; | |
216 | + | |
217 | +#endif | |
218 | + | |
219 | + | |
220 | +#if(DS1390) | |
221 | + | |
222 | +// Read, Write Mode | |
223 | +#define RTC_RD 0x00 | |
224 | +#define RTC_WR 0x80 | |
225 | + | |
226 | +// ADDR Preset | |
227 | +#define RTC_HUNDREDTHS_SEC 0x00 | |
228 | +#define RTC_SEC 0x01 | |
229 | +#define RTC_MIN 0x02 | |
230 | +#define RTC_HOUR 0x03 | |
231 | +#define RTC_DAY 0x04 | |
232 | +#define RTC_DATE 0x05 | |
233 | +#define RTC_MONTH 0x06 | |
234 | +#define RTC_YEAR 0x07 | |
235 | + | |
236 | +#define RTC_ALARM1_HUNDREDTHS_SEC 0x08 | |
237 | +#define RTC_ALARM1_SEC 0x09 | |
238 | +#define RTC_ALARM1_MIN 0x0A | |
239 | +#define RTC_ALARM1_HOUR 0x0B | |
240 | +#define RTC_ALARM1_DAY_DATE 0x0C | |
241 | + | |
242 | +#define RTC_CTRL 0x0D | |
243 | +#define RTC_CTRL_STATUS 0x0E | |
244 | + | |
245 | +struct sDS1390_HUNDREDTH_SEC_BIT | |
246 | +{ | |
247 | + Uint16 Hundredths :4; // 0:3 Seconds 일의 자리 | |
248 | + Uint16 Tenths :4; // 4:7 Seconds 10의 자리 | |
249 | + Uint16 rsvd1 :8; // 8:15 rsvd | |
250 | +}; | |
251 | + | |
252 | +union sDS1390_HUNDREDTH_SEC | |
253 | +{ | |
254 | + Uint16 all; | |
255 | + struct sDS1390_HUNDREDTH_SEC_BIT bit; | |
256 | +}; | |
257 | + | |
258 | +struct sDS1390_SEC_BIT | |
259 | +{ | |
260 | + Uint16 Unit :4; // 0:3 Seconds 일의 자리 | |
261 | + Uint16 Tens :3; // 4:7 Seconds 10의 자리 | |
262 | + Uint16 rsvd1 :9; // 8:15 rsvd | |
263 | +}; | |
264 | +// | |
265 | +union sDS1390_SEC | |
266 | +{ | |
267 | + Uint16 all; | |
268 | + struct sDS1390_SEC_BIT bit; | |
269 | +}; | |
270 | + | |
271 | +struct sDS1390_MIN_BIT | |
272 | +{ | |
273 | + Uint16 Unit :4; // 0:3 Minutes 일의 자리 | |
274 | + Uint16 Tens :3; // 4:6 Minutes 10의 자리 | |
275 | + Uint16 rsvd1 :9; // 7:15 rsvd | |
276 | +}; | |
277 | + | |
278 | +union sDS1390_MIN | |
279 | +{ | |
280 | + Uint16 all; | |
281 | + struct sDS1390_MIN_BIT bit; | |
282 | +}; | |
283 | + | |
284 | +struct sDS1390_HOUR_BIT | |
285 | +{ | |
286 | + Uint16 Unit :4; // 0:3 Hour 일의 자리 | |
287 | + Uint16 Tens :2; // 4:5 Hour 10의 자리 | |
288 | + Uint16 Mode_24_12 :1; // 6 12/24 Mode | |
289 | + Uint16 rsvd1 :9; // 7:15 rsvd | |
290 | +}; | |
291 | +// | |
292 | +union sDS1390_HOUR | |
293 | +{ | |
294 | + Uint16 all; | |
295 | + struct sDS1390_HOUR_BIT bit; | |
296 | +}; | |
297 | + | |
298 | + | |
299 | +struct sDS1390_DAY_BIT | |
300 | +{ | |
301 | + Uint16 Day :3; // 0:2 Day (요일) | |
302 | + Uint16 rsvd4 :13; // 3:15 rsvd | |
303 | + | |
304 | +}; | |
305 | +// | |
306 | +union sDS1390_DAY | |
307 | +{ | |
308 | + Uint16 all; | |
309 | + struct sDS1390_DAY_BIT bit; | |
310 | +}; | |
311 | + | |
312 | +struct sDS1390_DATE_BIT | |
313 | +{ | |
314 | + Uint16 Unit :4; // 0:3 Date (날짜) | |
315 | + Uint16 Tens :2; // 4:5 Date (날짜) | |
316 | + Uint16 rsvd5 :10; // 6:15 rsvd | |
317 | +}; | |
318 | +// | |
319 | +union sDS1390_DATE | |
320 | +{ | |
321 | + Uint16 all; | |
322 | + struct sDS1390_DATE_BIT bit; | |
323 | +}; | |
324 | + | |
325 | + | |
326 | +struct sDS1390_MONTH_BIT | |
327 | +{ | |
328 | + Uint16 Unit :4; // 0:3 Month | |
329 | + Uint16 Tens :1; // 4 Month 10의 자리 | |
330 | + Uint16 rsvd6 :2; // 5:6 rsvd | |
331 | + Uint16 Century :1; // 7 Century | |
332 | + Uint16 rsvd7 :8; // 8:15 rsvd | |
333 | +}; | |
334 | +// | |
335 | +union sDS1390_MONTH | |
336 | +{ | |
337 | + Uint16 all; | |
338 | + struct sDS1390_MONTH_BIT bit; | |
339 | +}; | |
340 | + | |
341 | +struct sDS1390_YEAR_BIT | |
342 | +{ | |
343 | + Uint16 Unit :4; // 0:3 Month | |
344 | + Uint16 Tens :4; // 4:7 Month 10의 자리 | |
345 | + Uint16 rsvd8 :8; // 8:15 rsvd | |
346 | +}; | |
347 | + | |
348 | +union sDS1390_YEAR | |
349 | +{ | |
350 | + Uint16 all; | |
351 | + struct sDS1390_YEAR_BIT bit; | |
352 | +}; | |
353 | + | |
354 | + | |
355 | +struct sDS1390_REGS | |
356 | +{ | |
357 | + volatile union sDS1390_SEC SecDAT; | |
358 | + volatile int16 Sec; | |
359 | + | |
360 | + volatile union sDS1390_MIN MinDAT; | |
361 | + volatile int16 Min; | |
362 | + | |
363 | + volatile union sDS1390_HOUR HourDAT; | |
364 | + volatile int16 Hour; | |
365 | + | |
366 | + volatile union sDS1390_DAY DayDAT; | |
367 | + volatile int16 Day; | |
368 | + | |
369 | + volatile union sDS1390_DATE DateDAT; | |
370 | + volatile int16 Date; | |
371 | + | |
372 | + volatile union sDS1390_MONTH MonthDAT; | |
373 | + volatile int16 Month; | |
374 | + | |
375 | + volatile union sDS1390_YEAR YearDAT; | |
376 | + volatile int16 Year; | |
377 | +}; | |
378 | + | |
379 | + | |
380 | + | |
381 | +struct sRTC_DATA_BUF | |
382 | +{ | |
383 | + int Sec; | |
384 | + int Min; | |
385 | + int Hour; | |
386 | + int Date; | |
387 | + int Day; | |
388 | + int Month; | |
389 | + int Year; | |
390 | +}; | |
391 | + | |
392 | + | |
393 | +extern struct sDS1390_REGS RTCRegs; | |
394 | +extern struct sDS1390_REGS RTCWrBuf; | |
395 | + | |
396 | +#endif | |
397 | + | |
398 | +extern void InitRTC(void); | |
399 | +extern void RtcRunning(void); | |
400 | +extern void RtcRun(void); | |
401 | +extern void RtcReadTime(void); | |
402 | +extern void RtcWriteTime(void); | |
403 | + | |
404 | +extern unsigned int Flag_Wr_RTC; | |
405 | + | |
406 | +extern unsigned long RTCDate; | |
407 | +extern unsigned long RTCTime; | |
408 | + | |
409 | +#ifdef __cplusplus | |
410 | +} | |
411 | +#endif /* extern "C" */ | |
412 | + | |
413 | +#endif | |
414 | + |
+++ Common_Resource/CommonLibrary/include/RTC_SPI.h
... | ... | @@ -0,0 +1,52 @@ |
1 | +/*************************************************************** | |
2 | + RTC_SPI.h | |
3 | + copyright (c) 2017 by Sang-Yong Kim | |
4 | + All Rights Reserved. | |
5 | +****************************************************************/ | |
6 | +#ifndef _RTC_SPI_H__ | |
7 | +#define _RTC_SPI_H__ | |
8 | + | |
9 | +// Read, Write Mode | |
10 | +#define RTC_RD 0x00 | |
11 | +#define RTC_WR 0x80 | |
12 | + | |
13 | +// ADDR Preset | |
14 | +#define RTC_SEC 0x00 | |
15 | +#define RTC_MIN 0x01 | |
16 | +#define RTC_HOUR 0x02 | |
17 | +#define RTC_DAY 0x03 | |
18 | +#define RTC_DATE 0x04 | |
19 | +#define RTC_MONTH 0x05 | |
20 | +#define RTC_YEAR 0x06 | |
21 | + | |
22 | +#define RTC_ALARM1_SEC 0x07 | |
23 | +#define RTC_ALARM1_MIN 0x08 | |
24 | +#define RTC_ALARM1_HOUR 0x09 | |
25 | +#define RTC_ALARM1_DAY_DATE 0x0A | |
26 | + | |
27 | +#define RTC_ALARM2_MIN 0x0B | |
28 | +#define RTC_ALARM2_HOUR 0x0C | |
29 | +#define RTC_ALARM2_DATE 0x0D | |
30 | + | |
31 | +#define RTC_CTRL 0x0E | |
32 | +#define RTC_CTRL_STATUS 0x0F | |
33 | + | |
34 | +#define RTC_XTAL_AGING_OFFSET 0x10 | |
35 | + | |
36 | +#define RTC_TEMP_MSB 0x11 | |
37 | +#define RTC_TEMP_LSB 0x12 | |
38 | + | |
39 | +extern int Time_sec, Time_min, Time_hour; | |
40 | +extern int Day_date, Day_month, Day_year; | |
41 | +extern int Write_sec,Write_min,Write_hour; | |
42 | +extern int Write_date,Write_month,Write_year; | |
43 | +extern int Time_1224, Time_AMPM; | |
44 | +extern int State_RTC_Write_complete; | |
45 | + | |
46 | +void SPI_RTC_Read_Sequence(); | |
47 | +void SPI_RTC_Write_Sequence(); | |
48 | + | |
49 | +extern void InitSpi_RTC(); | |
50 | + | |
51 | + | |
52 | +#endif // of _RTC_SPI_H__ |
+++ Common_Resource/CommonLibrary/include/RmsAvgCal.h
... | ... | @@ -0,0 +1,120 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : RmsAvgCal.h | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | +#ifndef RMSAVGCAL_H_ | |
10 | +#define RMSAVGCAL_H_ | |
11 | + | |
12 | + | |
13 | +extern void RmsAvgSum(void); | |
14 | +extern void RmsAvgCal(void); | |
15 | + | |
16 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
17 | +extern float RMS(float *Sum, float InversTime); | |
18 | +extern float AVG(float *Sum, float InversTime); | |
19 | +#pragma SET_CODE_SECTION() | |
20 | + | |
21 | + | |
22 | +#pragma SET_DATA_SECTION(".RmsAvg") | |
23 | + | |
24 | +extern float VbatSum; | |
25 | +extern float VbatAvg; | |
26 | + | |
27 | +extern float IbatSum; | |
28 | +extern float IbatAvg; | |
29 | + | |
30 | +extern float VboostSum; | |
31 | +extern float VboostAvg; | |
32 | + | |
33 | +extern float VdabSum; | |
34 | +extern float VdabAvg; | |
35 | + | |
36 | +extern float VdcHSum; | |
37 | +extern float VdcHAvg; | |
38 | + | |
39 | +extern float VdcLSum; | |
40 | +extern float VdcLAvg; | |
41 | + | |
42 | +extern float VdcSum; | |
43 | +extern float VdcAvg; | |
44 | + | |
45 | +extern float VunInvRms; | |
46 | +extern float VunInvRmsSum; | |
47 | + | |
48 | +extern float VnwInvRms; | |
49 | +extern float VnwInvRmsSum; | |
50 | + | |
51 | +extern float VacInvRms; | |
52 | +extern float VacInvRmsSum; | |
53 | + | |
54 | +extern float VunGridRms; | |
55 | +extern float VunGridRmsSum; | |
56 | + | |
57 | +extern float VnwGridRms; | |
58 | +extern float VnwGridRmsSum; | |
59 | + | |
60 | +extern float VacGridRms; | |
61 | +extern float VacGridRmsSum; | |
62 | + | |
63 | +extern float IacInvRms; | |
64 | +extern float IacInvRmsSum; | |
65 | + | |
66 | +extern float IuInvRms; | |
67 | +extern float IuInvRmsSum; | |
68 | + | |
69 | +extern float IwInvRms; | |
70 | +extern float IwInvRmsSum; | |
71 | + | |
72 | +extern float InInvRms; | |
73 | +extern float InInvRmsSum; | |
74 | + | |
75 | +extern float IacGridRms; | |
76 | +extern float IacGridRmsSum; | |
77 | + | |
78 | +extern float IuGridRms; | |
79 | +extern float IuGridRmsSum; | |
80 | + | |
81 | +extern float IwGridRms; | |
82 | +extern float IwGridRmsSum; | |
83 | + | |
84 | +extern float InGridRms; | |
85 | +extern float InGridRmsSum; | |
86 | + | |
87 | +extern float IzctRms; | |
88 | +extern float IzctRmsSum; | |
89 | + | |
90 | +extern float PinvReactive; | |
91 | +extern float PinvReactiveSum; | |
92 | +extern float PinvReactiveAvg; | |
93 | + | |
94 | +extern float PinvActive; | |
95 | +extern float PinvActiveSum; | |
96 | +extern float PinvActiveAvg; | |
97 | + | |
98 | +extern float PinvApparentAvg; | |
99 | + | |
100 | +extern float Pbat; | |
101 | +extern float PbatAvg; | |
102 | +extern float PbatSum; | |
103 | + | |
104 | +extern float IdeSum; | |
105 | +extern float IdeAvg; | |
106 | + | |
107 | +extern float IqeSum; | |
108 | +extern float IqeAvg; | |
109 | + | |
110 | +extern float VdeSum; | |
111 | +extern float VdeAvg; | |
112 | + | |
113 | +extern float VqeSum; | |
114 | +extern float VqeAvg; | |
115 | + | |
116 | +extern float PfAvg; | |
117 | + | |
118 | +#pragma SET_DATA_SECTION() | |
119 | + | |
120 | +#endif /* RMSAVGCAL_H_ */ |
+++ Common_Resource/CommonLibrary/include/SensingScale.h
... | ... | @@ -0,0 +1,171 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : SensingScale.h | |
4 | +// Created on : 2022. 11. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef COMMON_RESOURCE_COMMONLIBRARY_SENSINGSCALE_H_ | |
11 | +#define COMMON_RESOURCE_COMMONLIBRARY_SENSINGSCALE_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +#define ADC_OFFSET1V5 (4095./2.) | |
18 | +#define ZCT_OFFSET (1442.133333) | |
19 | + | |
20 | +#define ADC_MAX_VOLT (3.) | |
21 | +#define INV_ADC_12BIT (0.000244200244200244000) //0x0FFF 역수 | |
22 | +#define VOLT_PER_ADCBIT (ADC_MAX_VOLT * INV_ADC_12BIT) | |
23 | + | |
24 | +#define LAH50_P_GAIN (2000.) //LAH 50-P 50A CT turn ratio 1:2000 | |
25 | +#define LAH100_P_GAIN (2000.) //LAH 100-P 100A CT turn ratio 1:2000 | |
26 | + | |
27 | +#define AMC3330_GAIN (2.) //AMC3330 Fixed Gain 2. | |
28 | +#define INV_AMC3330_GAIN (1./2.) //AMC3330 Fixed Gain 2. | |
29 | + | |
30 | +#define PT_INA821_RG (12.4) //12.4kOhm | |
31 | +#define PT_INA821_GAIN (1. + (49.4 / PT_INA821_RG)) //INA821 Datasheet 참조 | |
32 | +#define INV_PT_INA821_GAIN (1. / PT_INA821_GAIN) | |
33 | + | |
34 | +#define PT_OPAMP_GAIN (3./20.) | |
35 | +#define CT_OPAMP_GAIN (3./20.) | |
36 | + | |
37 | +//------------------------입력전압 PT ---------------------------------------------------------------------------------------// | |
38 | +#define DC_PT_PRI_RD (992000.) //분압저항 | |
39 | +#define DC_PT_PRI_RM (1300.) //측정저항 | |
40 | +#define DC_PT_PRI_R_RATIO (DC_PT_PRI_RM / (DC_PT_PRI_RD + DC_PT_PRI_RM)) // 저항비 | |
41 | +#define INV_DC_PT_PRI_R_RATIO (1. / DC_PT_PRI_R_RATIO) | |
42 | + | |
43 | +#define DC_PT_GAIN (PT_OPAMP_GAIN * PT_INA821_GAIN * AMC3330_GAIN * DC_PT_PRI_R_RATIO) | |
44 | +#define INV_DC_PT_GAIN ((1. / DC_PT_GAIN) * VOLT_PER_ADCBIT) //Vbat / Vboost / Vdab gain | |
45 | +//-------------------------------------------------------------------------------------------------------------------------// | |
46 | + | |
47 | +//------------------------DCLINK 상/하 PT ----------------------------------------------------------------------------------// | |
48 | +#define DCLINK_PT_PRI_RD (992000.) //분압저항 | |
49 | +#define DCLINK_PT_PRI_RM (2700.) //측정저항 | |
50 | +#define DCLINK_PT_PRI_R_RATIO (DCLINK_PT_PRI_RM / (DCLINK_PT_PRI_RD + DCLINK_PT_PRI_RM)) // 저항비 | |
51 | +#define INV_DCLINK_PT_PRI_R_RATIO (1. / DCLINK_PT_PRI_R_RATIO) | |
52 | + | |
53 | +#define DCLINK_PT_GAIN (PT_OPAMP_GAIN * PT_INA821_GAIN * AMC3330_GAIN * DCLINK_PT_PRI_R_RATIO) | |
54 | +#define INV_DCLINK_PT_GAIN (1. / DCLINK_PT_GAIN) * VOLT_PER_ADCBIT //Vdc link HIGH / LOW | |
55 | +//-------------------------------------------------------------------------------------------------------------------------// | |
56 | + | |
57 | +//----------------------------------AC전압----------------------------------------------------------------------------------// | |
58 | +#define AC_PT_PRI_RD (992000.) //분압저항 | |
59 | +#define AC_PT_PRI_RM (3400.) //측정저항 | |
60 | +#define AC_PT_PRI_R_RATIO (AC_PT_PRI_RM / (AC_PT_PRI_RD + AC_PT_PRI_RM)) // 저항비 | |
61 | +#define INV_AC_PT_PRI_R_RATIO (1. / AC_PT_PRI_R_RATIO) | |
62 | + | |
63 | +#define AC_PT_GAIN (PT_OPAMP_GAIN * PT_INA821_GAIN * AMC3330_GAIN * AC_PT_PRI_R_RATIO) | |
64 | +#define INV_AC_PT_GAIN (1. / AC_PT_GAIN) * VOLT_PER_ADCBIT //Vgrid U / Vgrid W / Vgrid | |
65 | +//-------------------------------------------------------------------------------------------------------------------------// | |
66 | + | |
67 | + | |
68 | +//----------------------------------AC전류----------------------------------------------------------------------------------// | |
69 | +#define AC_CT_RATIO LAH100_P_GAIN | |
70 | +#define AC_CT_RM (280.) | |
71 | +#define AC_CT_GAIN ((CT_OPAMP_GAIN * AC_CT_RM) / AC_CT_RATIO) | |
72 | +#define INV_AC_CT_GAIN (1. / AC_CT_GAIN) * VOLT_PER_ADCBIT //IuGridExt / IwGridExt / IuGrid / IwGrid | |
73 | +//-------------------------------------------------------------------------------------------------------------------------// | |
74 | + | |
75 | +//----------------------------------DC전류----------------------------------------------------------------------------------// | |
76 | +#define DC_CT_RATIO LAH50_P_GAIN | |
77 | +#define DC_CT_RM (280.) | |
78 | +#define DC_CT_GAIN ((CT_OPAMP_GAIN * DC_CT_RM) / DC_CT_RATIO) | |
79 | +#define INV_DC_CT_GAIN (1. / DC_CT_GAIN) * VOLT_PER_ADCBIT //Ibat | |
80 | +//-------------------------------------------------------------------------------------------------------------------------// | |
81 | + | |
82 | + | |
83 | + | |
84 | +//----------------------------------ADC전압---------------------------------------------------------------------------------// | |
85 | +#define INV_VADC_GAIN VOLT_PER_ADCBIT | |
86 | + | |
87 | + | |
88 | +//----------------------------------Zct 전류--------------------------------------------------------------------------------// | |
89 | + | |
90 | +#define ZCT_CT_GAIN (4.) | |
91 | +#define ZCT_OPAMP_GAIN (8.45/20.) | |
92 | +#define ZCT_GAIN (ZCT_CT_GAIN * ZCT_OPAMP_GAIN) | |
93 | +#define INV_AC_ZCT_GAIN (1. / ZCT_GAIN) * VOLT_PER_ADCBIT //임시 | |
94 | + | |
95 | +struct sMesureList | |
96 | +{ | |
97 | + | |
98 | + float ADC_CH1_UV; //Adc1 배터리 입력전압 | |
99 | + float ADC_CH1_VIS; //Adc2 배터리 입력전류 | |
100 | + float ADC_CH1_IR; //Adc3 부스트 입력전압(배터리 릴레이 후단 전압) | |
101 | + float ADC_CH2_UV; //Adc4 Dab 입력전압(부스트 출력전압) | |
102 | + float ADC_CH2_VIS; //Adc5 GFD | |
103 | + float ADC_CH2_IR; //Adc6 DC-Link 상단전압 | |
104 | + float ADC_CH3_UV; //Adc7 DC-Link 하단전압 | |
105 | + float ADC_CH3_VIS; //Adc8 계통 U-N전압(단상 삼선식) | |
106 | + float ADC_CH3_IR; //Adc9 계통 N-W전압 | |
107 | + float ADC_CH4_UV; //Adc10 인버터 전류 U | |
108 | + float ADC_CH4_VIS; //Adc11 인버터 전류 W | |
109 | + float ADC_CH4_IR; //Adc12 ZCT 전류 | |
110 | + | |
111 | +}; | |
112 | + | |
113 | +//------------------------------------------------------------------------// | |
114 | +extern float CH1_UV, CH1_VIS, CH1_IR; | |
115 | +extern float CH2_UV, CH2_VIS, CH2_IR; | |
116 | +extern float CH3_UV, CH3_VIS, CH3_IR; | |
117 | +extern float CH4_UV, CH4_VIS, CH4_IR; | |
118 | + | |
119 | +extern float DAC_1, DAC_2, DAC_3; | |
120 | + | |
121 | +extern void InitScale(void); | |
122 | + | |
123 | +#pragma SET_CODE_SECTION(".TI.ramfunc") | |
124 | +extern void AdcResult(void); | |
125 | +#pragma SET_CODE_SECTION() | |
126 | + | |
127 | +extern void ScaleDefaultCal(void); | |
128 | +extern void ScaleUpdate(void); | |
129 | +extern void ReadScaleDelt(void); | |
130 | +extern void WriteScaleDelt(void); | |
131 | +extern void ResetScaleDelt(void); | |
132 | + | |
133 | +extern void OffsetDefaultCal(void); | |
134 | +extern void OffsetUpdate(void); | |
135 | +extern void ReadOffsetDelt(void); | |
136 | +extern void WriteOffsetDelt(void); | |
137 | +extern void ResetOffsetDelt(void); | |
138 | + | |
139 | + | |
140 | +extern int Flag_Wr_ScaleDelt; | |
141 | +extern int Flag_Rst_ScaleDelt; | |
142 | + | |
143 | + | |
144 | + | |
145 | +#pragma SET_DATA_SECTION(".Scale") | |
146 | + | |
147 | +extern struct sMesureList Scale; | |
148 | +extern struct sMesureList ScaleDefault; | |
149 | +extern struct sMesureList ScaleDelt; | |
150 | + | |
151 | +// | |
152 | +//extern struct sMesureList Offset; | |
153 | +//extern struct sMesureList OffsetDefault; | |
154 | +//extern struct sMesureList OffsetSum; | |
155 | +//extern struct sMesureList OffsetDelt; | |
156 | + | |
157 | + | |
158 | +#pragma SET_DATA_SECTION() | |
159 | + | |
160 | + | |
161 | + | |
162 | + | |
163 | + | |
164 | + | |
165 | + | |
166 | + | |
167 | +#ifdef __cplusplus | |
168 | +} | |
169 | +#endif /* extern "C" */ | |
170 | + | |
171 | +#endif /* COMMON_RESOURCE_COMMONLIBRARY_SENSINGSCALE_H_ */ |
+++ Common_Resource/CommonLibrary/include/SpiEepromLib.h
... | ... | @@ -0,0 +1,43 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : EepromLib.h | |
4 | +// Created on : 2023. 10. 31. | |
5 | +// Description : EEPROM Library for CAT25512VI-GT3 | |
6 | +// Author : "Kim JeongWoo" | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_SPIEEPROMLIB_H_ | |
11 | +#define COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_SPIEEPROMLIB_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | + | |
19 | +extern void InitSpi(); | |
20 | +extern uint16_t ReadEepromStatusReg(void); | |
21 | + | |
22 | +extern void ReadEeprom(uint16_t address, uint16_t *data, uint16_t length); | |
23 | +extern void WriteEepromArray(uint16_t address, uint16_t *data, uint16_t length); | |
24 | +extern void WriteEepromFloat(uint16_t Addr, float *Val); | |
25 | +extern void WriteEepromInt(uint16_t Addr, void *Val); | |
26 | + | |
27 | +extern float ReadEepromFloat(uint16_t address, float *Val); | |
28 | +extern int ReadEepromInt(uint16_t address, void *Val); | |
29 | + | |
30 | +void WriteEeprom(uint16_t address, uint16_t * data, uint16_t length); | |
31 | + | |
32 | +extern int FlagReadEeprom; | |
33 | +extern int FlagWriteEeprom; | |
34 | + | |
35 | +extern unsigned int EepromAddr; | |
36 | +extern unsigned int EepromNumofBytes; | |
37 | + | |
38 | + | |
39 | + | |
40 | +#ifdef __cplusplus | |
41 | +} | |
42 | +#endif /* extern "C" */ | |
43 | +#endif /* COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_SPIEEPROMLIB_H_ */ |
+++ Common_Resource/CommonLibrary/include/Status.h
... | ... | @@ -0,0 +1,56 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : Status.h | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#ifndef _STATUS_H_ | |
12 | +#define _STATUS_H_ | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +struct sSTATUS_LIST | |
18 | +{ | |
19 | +// Uint16 Standby :1; // 0x0001 | |
20 | + Uint16 Ready :1; // 0x0004 | |
21 | + Uint16 InvRun :1; | |
22 | + Uint16 BeRun :1; | |
23 | + Uint16 SystemFault :1; // 0x0800 | |
24 | + | |
25 | + Uint16 ParallelMode :1; // 0x0800 | |
26 | + Uint16 Master :1; | |
27 | + Uint16 InvBuilup :1; | |
28 | + Uint16 CmdSlvRun :1; | |
29 | + Uint16 CmdSlvReset :1; | |
30 | + Uint16 VbeParaMode :1; | |
31 | + | |
32 | + Uint16 Reserved :6; | |
33 | +}; | |
34 | + | |
35 | + | |
36 | +union uSTATUS | |
37 | +{ | |
38 | + Uint16 all; | |
39 | + struct sSTATUS_LIST bit; | |
40 | +}; | |
41 | + | |
42 | +#pragma SET_DATA_SECTION(".Status") | |
43 | +extern union uSTATUS Status; | |
44 | +extern unsigned int FlagCanBeMasSlvChange; | |
45 | +extern unsigned int FlagParaInvBuilup; //병렬운전시 Mas,Slv Inv 빌드업 확인 변수 | |
46 | +extern int RemoteMode; | |
47 | +extern int SetRemoteMode; | |
48 | + | |
49 | + | |
50 | +#pragma SET_DATA_SECTION() | |
51 | + | |
52 | + | |
53 | +#ifdef __cplusplus | |
54 | +} | |
55 | +#endif /* extern "C" */ | |
56 | +#endif /* _STATUS_H_ */ |
+++ Common_Resource/CommonLibrary/include/SystemVar.h
... | ... | @@ -0,0 +1,197 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : SystemVar.h | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#ifndef _SYSTEMVAR_H_ | |
12 | +#define _SYSTEMVAR_H_ | |
13 | + | |
14 | +#ifdef __cplusplus | |
15 | +extern "C" { | |
16 | +#endif | |
17 | + | |
18 | +#define delay_us(us) DEVICE_DELAY_US(us) | |
19 | +#define delay_ms(ms) DEVICE_DELAY_US(ms*1000) | |
20 | + | |
21 | + | |
22 | +#pragma SET_DATA_SECTION(".SystemVar") | |
23 | + | |
24 | +extern float SystemClock; | |
25 | + | |
26 | + | |
27 | + | |
28 | +//------------------------------------------------------------------------// | |
29 | + | |
30 | +//extern float VdcRate; | |
31 | +//extern float VdcMax; | |
32 | +//extern float VdcMin; | |
33 | +// | |
34 | +//extern float VdabMax; | |
35 | +//extern float VdabMin; | |
36 | +//extern float VdabRate; | |
37 | +// | |
38 | +//extern float VboostRate; | |
39 | +//extern float VboostMin; | |
40 | +//extern float VboostMax; | |
41 | +// | |
42 | +//extern float VbatRate; | |
43 | +//extern float VbatMin; | |
44 | +//extern float VbatMax; | |
45 | + | |
46 | +//extern float INV_Wh_T500ms; | |
47 | +extern int SET_FT_UV_Level; | |
48 | +extern int SET_FT_VIS_Level; | |
49 | +extern int SET_FT_IR_Level; | |
50 | + | |
51 | + | |
52 | +extern int SystemFault; | |
53 | +extern int EmergencyStop; | |
54 | + | |
55 | +extern int CmdFaultReset; | |
56 | + | |
57 | +extern float CH1_UV_Flt; | |
58 | +extern float CH1_VIS_Flt; | |
59 | +extern float CH1_IR_Flt; | |
60 | + | |
61 | +extern float CH2_UV_Flt; | |
62 | +extern float CH2_VIS_Flt; | |
63 | +extern float CH2_IR_Flt; | |
64 | + | |
65 | +extern float CH3_UV_Flt; | |
66 | +extern float CH3_VIS_Flt; | |
67 | +extern float CH3_IR_Flt; | |
68 | + | |
69 | +extern float CH4_UV_Flt; | |
70 | +extern float CH4_VIS_Flt; | |
71 | +extern float CH4_IR_Flt; | |
72 | + | |
73 | +extern int SystemReady; | |
74 | +// | |
75 | +//extern int FlagInvGating; | |
76 | +//extern int FlagInvGatingInput; | |
77 | +// | |
78 | +//extern int FlagBoostGating; | |
79 | +//extern int FlagBoostGatingInput; | |
80 | +// | |
81 | +//extern int FlagDabGating; | |
82 | +//extern int FlagDabGatingInput; | |
83 | +// | |
84 | +//extern float Tboost; | |
85 | +// | |
86 | +//extern float TdabPh; | |
87 | +//extern float TdabA; | |
88 | +//extern float TdabB; | |
89 | +//extern float TdabC; | |
90 | +//extern float TdabD; | |
91 | +// | |
92 | +//extern float TinvA; | |
93 | +//extern float TinvB; | |
94 | +// | |
95 | +//extern unsigned int TboostCnt; | |
96 | +// | |
97 | +//extern int TdabPhCnt; | |
98 | +//extern unsigned int TdabACnt; | |
99 | +//extern unsigned int TdabBCnt; | |
100 | +//extern unsigned int TdabCCnt; | |
101 | +//extern unsigned int TdabDCnt; | |
102 | +// | |
103 | +//extern unsigned int TinvACnt; | |
104 | +//extern unsigned int TinvBCnt; | |
105 | + | |
106 | + | |
107 | + | |
108 | +extern int FaultReset; | |
109 | + | |
110 | +enum eSystemMode | |
111 | +{ | |
112 | + Normal = 0, | |
113 | + Test_Mode = 1 | |
114 | + | |
115 | +}; | |
116 | +extern enum eSystemMode ModeSystem; | |
117 | + | |
118 | +enum eTestSelect | |
119 | +{ | |
120 | + NonSelect = 0, | |
121 | + BoardTest = 1, | |
122 | + StackTest = 2, | |
123 | + ControllerTest = 3 | |
124 | +}; | |
125 | + | |
126 | +extern enum eTestSelect TestSelect; | |
127 | + | |
128 | +enum eSystemState | |
129 | +{ | |
130 | + StateInitial = 0, | |
131 | + StateOffset = 1, | |
132 | + StateReady = 2, | |
133 | + StateRun = 3, | |
134 | + StateFault = 4 | |
135 | +}; | |
136 | +extern enum eSystemState SystemState; | |
137 | + | |
138 | +enum eINV_OP_MODE | |
139 | +{ | |
140 | + OpMode_GridTie = 0, | |
141 | + OpMode_StandAlone = 1 | |
142 | +}; | |
143 | + | |
144 | +extern enum eINV_OP_MODE InvOpMode; | |
145 | + | |
146 | + | |
147 | + | |
148 | +extern void InitSystemParameter(); | |
149 | +extern void SystemParameterUpdate(); | |
150 | + | |
151 | + | |
152 | + | |
153 | +extern struct sRampGen MagVqeRamp; | |
154 | +extern float MagVqeRefSet; | |
155 | +extern float MagSinRef; | |
156 | +extern float DelMagVqe; | |
157 | + | |
158 | +extern void FreqSinGen(); | |
159 | + | |
160 | +extern float ThetaTest; | |
161 | +extern float FreqSineTest; | |
162 | +extern float SinThetaTest; | |
163 | +extern float CosThetaTest; | |
164 | +extern float SinSquareTest; | |
165 | +extern float CosSquareTest; | |
166 | + | |
167 | + | |
168 | +//TEST | |
169 | + | |
170 | +extern float VdcRefSet; | |
171 | +extern float PkwRefSet; | |
172 | + | |
173 | + | |
174 | +//firmware Ver | |
175 | +extern float FwVer; | |
176 | + | |
177 | + | |
178 | +#pragma SET_DATA_SECTION() | |
179 | + | |
180 | +#pragma SET_DATA_SECTION(".Trace") | |
181 | +extern unsigned long int pTrace1; | |
182 | +extern unsigned long int pTrace2; | |
183 | + | |
184 | +extern unsigned int FlagTrace; | |
185 | + | |
186 | +extern float TraceData1[2000]; | |
187 | +extern float TraceData2[2000]; | |
188 | +extern unsigned int TraceCount; | |
189 | + | |
190 | +#pragma SET_DATA_SECTION() | |
191 | + | |
192 | + | |
193 | +#ifdef __cplusplus | |
194 | +} | |
195 | +#endif /* extern "C" */ | |
196 | + | |
197 | +#endif /* _SYSTEMVAR_H_ */ |
+++ Common_Resource/CommonLibrary/include/TimerLib.h
... | ... | @@ -0,0 +1,25 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-ME-CPU1 | |
3 | +// File Name : TimerLib.h | |
4 | +// Created on : 2022. 10. 19. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef MAIN_RESOURCE_BOARDLIB_TIMERLIB_H_ | |
11 | +#define MAIN_RESOURCE_BOARDLIB_TIMERLIB_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | + | |
18 | +extern void configCPUTimer(uint32_t, float freq, float period); | |
19 | + | |
20 | + | |
21 | +#ifdef __cplusplus | |
22 | +} | |
23 | +#endif /* extern "C" */ | |
24 | + | |
25 | +#endif /* MAIN_RESOURCE_BOARDLIB_TIMERLIB_H_ */ |
+++ Common_Resource/CommonLibrary/include/Trace.h
... | ... | @@ -0,0 +1,37 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : Ringbuffer.h | |
4 | +// Created on : 2022. 12. 10. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#ifndef COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_TRACE_H_ | |
11 | +#define COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_TRACE_H_ | |
12 | + | |
13 | +#ifdef __cplusplus | |
14 | +extern "C" { | |
15 | +#endif | |
16 | + | |
17 | +//todo 임시 테스트 구조체 | |
18 | + | |
19 | +struct sRingBuf | |
20 | +{ | |
21 | + float BufLow[512]; | |
22 | + unsigned int WrPtr; | |
23 | + unsigned int RdPtr; | |
24 | + unsigned int Size; | |
25 | +}; | |
26 | + | |
27 | +extern struct sRingBuf RingBuf; | |
28 | +extern void InitRingBuf(); | |
29 | +extern void WrRingBuf(); | |
30 | +extern void SortRingBuf(); | |
31 | + | |
32 | + | |
33 | +#ifdef __cplusplus | |
34 | +} | |
35 | +#endif /* extern "C" */ | |
36 | + | |
37 | +#endif /* COMMON_RESOURCE_COMMONLIBRARY_INCLUDE_TRACE_H_ */ |
+++ Common_Resource/CommonLibrary/source/AdcLib.cpp
... | ... | @@ -0,0 +1,160 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-ME-CPU1 | |
3 | +// File Name : Adc_Driver.cpp | |
4 | +// Created on : 2022. 10. 16. | |
5 | +// Description : Internal ADC Function | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include <CommonLib.h> | |
11 | + | |
12 | + | |
13 | +struct sAdc Adc = {0,}; | |
14 | + | |
15 | + | |
16 | +unsigned int StateAdcEOC = 0; | |
17 | +unsigned int CntWaitAdcEoc = 0; | |
18 | +unsigned int SetWaitAdcEoc = 2000; //clock | |
19 | + | |
20 | +int Flag_ErrEoc = 0; | |
21 | + | |
22 | +ADC_Trigger AdcTriggerMode = ADC_TRIGGER_EPWM1_SOCA; | |
23 | + | |
24 | +// - Acquisition window = (ACQPS + 1)∙(System Clock (SYSCLK) cycle time | |
25 | +// - The selected acquisition window duration must be at least as long as one ADCCLK cycle. | |
26 | +// - The datasheet will specify a minimum acquisition window duration (in nanoseconds). The user is | |
27 | +// responsible for selecting an acquisition window duration that meets this requirement. | |
28 | + | |
29 | +unsigned int acqps = 50; | |
30 | + | |
31 | +void InitAdc() | |
32 | +{ | |
33 | + memset(&Adc, 0, (sizeof(Adc) / sizeof(int))); | |
34 | + | |
35 | + ConfigAdc(); | |
36 | + SetupAdcSoc(); | |
37 | +} | |
38 | + | |
39 | +void AdcForceSoc() | |
40 | +{ | |
41 | + ADC_forceMultipleSOC(ADCA_BASE, ADCA_FORCE_SOC_SET); | |
42 | + ADC_forceMultipleSOC(ADCB_BASE, ADCB_FORCE_SOC_SET); | |
43 | + ADC_forceMultipleSOC(ADCC_BASE, ADCC_FORCE_SOC_SET); | |
44 | + ADC_forceMultipleSOC(ADCD_BASE, ADCD_FORCE_SOC_SET); | |
45 | +} | |
46 | + | |
47 | +void ConfigAdc(void) | |
48 | +{ | |
49 | + // Set ADCDLK divider to /2 | |
50 | + ADC_setPrescaler(ADCA_BASE, ADC_CLK_DIV_2_0); | |
51 | + ADC_setPrescaler(ADCB_BASE, ADC_CLK_DIV_2_0); | |
52 | + ADC_setPrescaler(ADCC_BASE, ADC_CLK_DIV_2_0); | |
53 | + ADC_setPrescaler(ADCD_BASE, ADC_CLK_DIV_2_0); | |
54 | + | |
55 | + ADC_setMode(ADCA_BASE, ADC_RESOLUTION_12BIT, ADC_MODE_SINGLE_ENDED); | |
56 | + ADC_setMode(ADCB_BASE, ADC_RESOLUTION_12BIT, ADC_MODE_SINGLE_ENDED); | |
57 | + ADC_setMode(ADCC_BASE, ADC_RESOLUTION_12BIT, ADC_MODE_SINGLE_ENDED); | |
58 | + ADC_setMode(ADCD_BASE, ADC_RESOLUTION_12BIT, ADC_MODE_SINGLE_ENDED); | |
59 | + | |
60 | + ADC_setInterruptPulseMode(ADCA_BASE, ADC_PULSE_END_OF_CONV); | |
61 | + ADC_setInterruptPulseMode(ADCB_BASE, ADC_PULSE_END_OF_CONV); | |
62 | + ADC_setInterruptPulseMode(ADCC_BASE, ADC_PULSE_END_OF_CONV); | |
63 | + ADC_setInterruptPulseMode(ADCD_BASE, ADC_PULSE_END_OF_CONV); | |
64 | + | |
65 | + ADC_enableConverter(ADCA_BASE); | |
66 | + ADC_enableConverter(ADCB_BASE); | |
67 | + ADC_enableConverter(ADCC_BASE); | |
68 | + ADC_enableConverter(ADCD_BASE); | |
69 | + | |
70 | + DEVICE_DELAY_US(1000); | |
71 | + | |
72 | +} | |
73 | + | |
74 | + | |
75 | +int FactoryOffset[24]; | |
76 | +int FactoryScale[24]; | |
77 | + | |
78 | +void SetupAdcSoc(void) | |
79 | +{ | |
80 | + //ADCA | |
81 | + ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER0, AdcTriggerMode, ADC_CH_ADCIN0, acqps); | |
82 | + ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER1, AdcTriggerMode, ADC_CH_ADCIN1, acqps); | |
83 | + ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER2, AdcTriggerMode, ADC_CH_ADCIN2, acqps); | |
84 | + ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER3, AdcTriggerMode, ADC_CH_ADCIN3, acqps); | |
85 | + ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER4, AdcTriggerMode, ADC_CH_ADCIN4, acqps); | |
86 | + ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER5, AdcTriggerMode, ADC_CH_ADCIN5, acqps); | |
87 | + ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER6, AdcTriggerMode, ADC_CH_ADCIN14, acqps); | |
88 | + ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER7, AdcTriggerMode, ADC_CH_ADCIN15, acqps); | |
89 | + ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER8, AdcTriggerMode, ADC_CH_ADCIN13, acqps); //for MCU Temperature | |
90 | + | |
91 | + ADC_setInterruptSource(ADCA_BASE, ADC_INT_NUMBER1, ADC_SOC_NUMBER8); | |
92 | + ADC_enableInterrupt(ADCA_BASE, ADC_INT_NUMBER1); | |
93 | + ADC_clearInterruptStatus(ADCA_BASE, ADC_INT_NUMBER1); | |
94 | + | |
95 | + //ADCB | |
96 | + ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER0, AdcTriggerMode, ADC_CH_ADCIN0, acqps); | |
97 | + ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER1, AdcTriggerMode, ADC_CH_ADCIN1, acqps); | |
98 | + ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER2, AdcTriggerMode, ADC_CH_ADCIN2, acqps); | |
99 | + ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER3, AdcTriggerMode, ADC_CH_ADCIN3, acqps); | |
100 | + ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER4, AdcTriggerMode, ADC_CH_ADCIN4, acqps); | |
101 | + ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER5, AdcTriggerMode, ADC_CH_ADCIN5, acqps); | |
102 | + | |
103 | +// ADC_setInterruptSource(ADCB_BASE, ADC_INT_NUMBER1, ADC_SOC_NUMBER5); | |
104 | +// ADC_enableInterrupt(ADCB_BASE, ADC_INT_NUMBER1); | |
105 | + ADC_clearInterruptStatus(ADCB_BASE, ADC_INT_NUMBER1); | |
106 | + | |
107 | + //ADCC | |
108 | + ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER2, AdcTriggerMode, ADC_CH_ADCIN2, acqps); | |
109 | + ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER3, AdcTriggerMode, ADC_CH_ADCIN3, acqps); | |
110 | + ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER4, AdcTriggerMode, ADC_CH_ADCIN4, acqps); | |
111 | + ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER5, AdcTriggerMode, ADC_CH_ADCIN5, acqps); | |
112 | + | |
113 | +// ADC_setInterruptSource(ADCC_BASE, ADC_INT_NUMBER1, ADC_SOC_NUMBER3); | |
114 | +// ADC_enableInterrupt(ADCC_BASE, ADC_INT_NUMBER1); | |
115 | + ADC_clearInterruptStatus(ADCC_BASE, ADC_INT_NUMBER1); | |
116 | + | |
117 | + | |
118 | + //ADCD | |
119 | + ADC_setupSOC(ADCD_BASE, ADC_SOC_NUMBER0, AdcTriggerMode, ADC_CH_ADCIN0, acqps); | |
120 | + ADC_setupSOC(ADCD_BASE, ADC_SOC_NUMBER1, AdcTriggerMode, ADC_CH_ADCIN1, acqps); | |
121 | + ADC_setupSOC(ADCD_BASE, ADC_SOC_NUMBER2, AdcTriggerMode, ADC_CH_ADCIN2, acqps); | |
122 | + ADC_setupSOC(ADCD_BASE, ADC_SOC_NUMBER3, AdcTriggerMode, ADC_CH_ADCIN3, acqps); | |
123 | + ADC_setupSOC(ADCD_BASE, ADC_SOC_NUMBER4, AdcTriggerMode, ADC_CH_ADCIN4, acqps); | |
124 | + ADC_setupSOC(ADCD_BASE, ADC_SOC_NUMBER5, AdcTriggerMode, ADC_CH_ADCIN5, acqps); | |
125 | + | |
126 | +// ADC_setInterruptSource(ADCD_BASE, ADC_INT_NUMBER1, ADC_SOC_NUMBER5); | |
127 | +// ADC_enableInterrupt(ADCD_BASE, ADC_INT_NUMBER1); | |
128 | + ADC_clearInterruptStatus(ADCD_BASE, ADC_INT_NUMBER1); | |
129 | +} | |
130 | + | |
131 | +void AdcIntInterruptClear() | |
132 | +{ | |
133 | + ADC_clearInterruptStatus(ADCA_BASE, ADC_INT_NUMBER1); | |
134 | + ADC_clearInterruptStatus(ADCB_BASE, ADC_INT_NUMBER1); | |
135 | + ADC_clearInterruptStatus(ADCC_BASE, ADC_INT_NUMBER1); | |
136 | + ADC_clearInterruptStatus(ADCD_BASE, ADC_INT_NUMBER1); | |
137 | +} | |
138 | + | |
139 | +void AdcIntEocState() | |
140 | +{ | |
141 | + //제일 오래걸리는 체널만 체크 | |
142 | + while (ADC_getInterruptStatus(ADCA_BASE, ADC_INT_NUMBER1) != 0x01) | |
143 | + { | |
144 | + if (CntWaitAdcEoc++ > SetWaitAdcEoc) | |
145 | + { | |
146 | + //Internal Adc Read Error | |
147 | + CntWaitAdcEoc = 0; | |
148 | + Flag_ErrEoc = 1; | |
149 | + break; | |
150 | + } | |
151 | + else | |
152 | + { | |
153 | + Flag_ErrEoc = 0; | |
154 | + } | |
155 | + } | |
156 | + AdcIntInterruptClear(); | |
157 | +} | |
158 | + | |
159 | + | |
160 | + |
+++ Common_Resource/CommonLibrary/source/CanCHAdeMO.cpp
... | ... | @@ -0,0 +1,107 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : CanCHAdeMO.cpp | |
4 | +// Created on : 2023. 11. 15. | |
5 | +// Description : | |
6 | +// Author : KwonJeongMin | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "CommonLib.h" | |
11 | + | |
12 | +union uCanCHAdeMO CanCHAdeMO; | |
13 | +struct sCanCHAdeMO CanCHAdeMORx; //CanBeRx.Mas = Master to Slave Data, CanBeRx.Slv = Slave to Master Data | |
14 | + | |
15 | +unsigned int CanCHAdeMORxStatus = 0; | |
16 | +unsigned int CanCHAdeMORxIsrCnt = 0; | |
17 | +unsigned int CanCHAdeMORxIsrErrCnt = 0; | |
18 | + | |
19 | +unsigned int CANCHADEMO_RxID_OFFSET = 0x0000; | |
20 | +unsigned int CANCHADEMO_TxID_OFFSET = 0x0000; | |
21 | + | |
22 | +void InitCanCHAdeMO() | |
23 | +{ | |
24 | + | |
25 | +} | |
26 | + | |
27 | +interrupt void CanCHAdeMORxIsr(void) | |
28 | +{ | |
29 | + CanCHAdeMORxStatus = CAN_getInterruptCause(CANCHADEMO); | |
30 | + //수신용 메일박스 사용 숫자에 따라 변경할 것 | |
31 | + if((CanCHAdeMORxStatus >= CANCHADEMO_RX_MBOX_START) && (CanCHAdeMORxStatus <= CANCHADEMO_RX_MBOX_END)) | |
32 | + { | |
33 | + CanRxMsg(CANCHADEMO, CanCHAdeMORxStatus, &CanCHAdeMORxMbox[CanCHAdeMORxStatus]); | |
34 | + if (Status.bit.Master != 1) CanCHAdeMORx.Mas.DataArr[CanCHAdeMORxMbox[CanCHAdeMORxStatus].Id - CANCHADEMO_RxID_OFFSET] = CanCHAdeMORxMbox[CanCHAdeMORxStatus].Data.all; | |
35 | + else CanCHAdeMORx.Slv.DataArr[CanCHAdeMORxMbox[CanCHAdeMORxStatus].Id - CANCHADEMO_RxID_OFFSET] = CanCHAdeMORxMbox[CanCHAdeMORxStatus].Data.all; | |
36 | + } | |
37 | + else | |
38 | + { | |
39 | + //0x8000 이면 에러.. | |
40 | + //나머지는 미사용 메일박스 | |
41 | + CanCHAdeMORxIsrErrCnt++; | |
42 | + } | |
43 | + | |
44 | + CanCHAdeMORxIsrCnt++; | |
45 | + | |
46 | + CAN_clearInterruptStatus(CANCHADEMO, CanCHAdeMORxStatus); | |
47 | + CAN_clearGlobalInterruptStatus(CANCHADEMO, CAN_GLOBAL_INT_CANINT0); | |
48 | + Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9); | |
49 | + | |
50 | +} | |
51 | + | |
52 | +void CanCHAdeMORun_500us() | |
53 | +{ | |
54 | +// CanCHAdeMO.Data.IDx00.bit.IbatRef = IbatRef; | |
55 | +// CanCHAdeMO.Data.IDx00.bit.Status.all = Status.all; | |
56 | +// | |
57 | +// CanCHAdeMOTxMbox.Lenth = 8; | |
58 | +// CanCHAdeMOTxMbox.Id = CANCHADEMO_TxID_OFFSET; | |
59 | +// CanCHAdeMOTxMbox.Data.all = CanCHAdeMO.Data.IDx00.all; | |
60 | +// | |
61 | +// CanTxMsg(CANCHADEMO, 32, &CanCHAdeMOTxMbox); | |
62 | + | |
63 | +} | |
64 | + | |
65 | +unsigned int CanCHAdeMOTable[] = {0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,0x0008,0x0009,0x000A}; | |
66 | +unsigned int CanCHAdeMOTxSeqTableSize = 0; | |
67 | +unsigned int CanCHAdeMOTxSeqTableCnt = 0; | |
68 | + | |
69 | +void CanCHAdeMORun() | |
70 | +{ | |
71 | + CanCHAdeMOTxUpdate(); | |
72 | + | |
73 | + //배열 크기 계산 | |
74 | + CanCHAdeMOTxSeqTableSize = sizeof(CanCHAdeMOTable); | |
75 | + | |
76 | + if (CanCHAdeMOTxSeqTableCnt >= CanCHAdeMOTxSeqTableSize) CanCHAdeMOTxSeqTableCnt = 0; | |
77 | + | |
78 | + CanCHAdeMOTxMbox.Id = CanCHAdeMOTxSeqTable[CanCHAdeMOTxSeqTableCnt++]+CANCHADEMO_TxID_OFFSET; | |
79 | + CanCHAdeMOTxMbox.Data.all = CanCHAdeMO.DataArr[CanCHAdeMOTxMbox.Id - CANCHADEMO_TxID_OFFSET]; | |
80 | + | |
81 | + CanTxMsg(CANCHADEMO, 32, &CanCHAdeMOTxMbox); | |
82 | + | |
83 | +} | |
84 | + | |
85 | +void CanCHAdeMOTxUpdate() | |
86 | +{ | |
87 | + CanCHAdeMO.Data.IDx01.bit.HeartBeat ^= 1; | |
88 | + CanCHAdeMO.Data.IDx01.bit.Mode = Status.bit.Master; | |
89 | +// CanCHAdeMO.Data.IDx02.bit.FaultHW.all = Fault.Hw.all; | |
90 | + CanCHAdeMO.Data.IDx02.bit.FaultSW1.all = Fault.Sw1.all; | |
91 | + CanCHAdeMO.Data.IDx03.bit.FaultSW2.all = Fault.Sw2.all; | |
92 | + CanCHAdeMO.Data.IDx03.bit.FaultSW3.all = Fault.Sw3.all; | |
93 | + CanCHAdeMO.Data.IDx04.bit.Temp_AcSwHeatSink1 = Temp.AcSwHeatSink1; | |
94 | + CanCHAdeMO.Data.IDx04.bit.Temp_AcSwHeatSink2 = Temp.AcSwHeatSink2; | |
95 | + CanCHAdeMO.Data.IDx05.bit.Temp_DcSwHeatSink1 = Temp.DcSwHeatSink1; | |
96 | + CanCHAdeMO.Data.IDx05.bit.Temp_DcSwHeatSink2 = Temp.DcSwHeatSink2; | |
97 | + CanCHAdeMO.Data.IDx06.bit.Temp_Spare1 = Temp.Spare1; | |
98 | + CanCHAdeMO.Data.IDx06.bit.Temp_Spare2 = Temp.Spare2; | |
99 | + CanCHAdeMO.Data.IDx07.bit.Ibat = IbatAvg; | |
100 | + CanCHAdeMO.Data.IDx07.bit.Vbat = VbatAvg; | |
101 | + CanCHAdeMO.Data.IDx08.bit.Pbat = PbatAvg; | |
102 | + CanCHAdeMO.Data.IDx08.bit.Vdc = VdcAvg; | |
103 | + CanCHAdeMO.Data.IDx09.bit.Iqe = IqeAvg; | |
104 | + CanCHAdeMO.Data.IDx09.bit.Vqe = VqeAvg; | |
105 | + CanCHAdeMO.Data.IDx0A.bit.Pinv = PinvActiveAvg; | |
106 | + | |
107 | +} |
+++ Common_Resource/CommonLibrary/source/CanLib.cpp
... | ... | @@ -0,0 +1,209 @@ |
1 | +/* | |
2 | + * Can_Driver.c | |
3 | + * | |
4 | + * Created on: 2021. 8. 3. | |
5 | + * Author: KimJeongWoo | |
6 | + */ | |
7 | + | |
8 | +#include <CommonLib.h> | |
9 | + | |
10 | +sCanMsg CanaTxMbox1; | |
11 | +sCanMsg CanaTxMbox2; | |
12 | +sCanMsg CanbTxMbox; | |
13 | + | |
14 | +sCanMsg CanaRxMbox[32]; | |
15 | +sCanMsg CanbRxMbox[32]; | |
16 | + | |
17 | +unsigned int TerminalResSet = 0xff; | |
18 | + | |
19 | + | |
20 | + | |
21 | + | |
22 | +void InitCan() | |
23 | +{ | |
24 | +// InitCanGpio(); | |
25 | + CAN_initModule(CANA_BASE); | |
26 | + CAN_initModule(CANB_BASE); | |
27 | + | |
28 | + CAN_setBitRate(CANA_BASE, DEVICE_SYSCLK_FREQ, 500000, 16); | |
29 | + CAN_setBitRate(CANB_BASE, DEVICE_SYSCLK_FREQ, 500000, 16); | |
30 | + | |
31 | + CAN_enableGlobalInterrupt(CANA_BASE, CAN_GLOBAL_INT_CANINT0); | |
32 | + CAN_enableGlobalInterrupt(CANB_BASE, CAN_GLOBAL_INT_CANINT0); | |
33 | + | |
34 | + CAN_enableInterrupt(CANA_BASE, CAN_INT_IE0); | |
35 | + CAN_enableInterrupt(CANB_BASE, CAN_INT_IE0); | |
36 | + | |
37 | + | |
38 | + //송신용 | |
39 | +// CAN_setupMessageObject(CANA_BASE, 32, 0x000 + CanBe_TxId_Offset, CAN_MSG_FRAME_STD, CAN_MSG_OBJ_TYPE_TX, 0x7FF, CAN_MSG_OBJ_USE_ID_FILTER, 8); | |
40 | +// CAN_setupMessageObject(CANA_BASE, 31, 0x01F + CanBe_TxId_Offset, CAN_MSG_FRAME_STD, CAN_MSG_OBJ_TYPE_TX, 0x7F0, CAN_MSG_OBJ_USE_ID_FILTER, 8); | |
41 | + //수신용 | |
42 | +// CAN_setupMessageObject(CANA_BASE, 1, 0x000 + CanBe_RxId_Offset, CAN_MSG_FRAME_STD, CAN_MSG_OBJ_TYPE_RX, 0x7FF, (CAN_MSG_OBJ_RX_INT_ENABLE | CAN_MSG_OBJ_USE_ID_FILTER), 0); | |
43 | +// CAN_setupMessageObject(CANA_BASE, 2, 0x01F + CanBe_RxId_Offset, CAN_MSG_FRAME_STD, CAN_MSG_OBJ_TYPE_RX, 0x7F0, (CAN_MSG_OBJ_RX_INT_ENABLE | CAN_MSG_OBJ_USE_ID_FILTER), 0); | |
44 | + | |
45 | + CAN_startModule(CANA_BASE); | |
46 | + CAN_startModule(CANB_BASE); | |
47 | +} | |
48 | + | |
49 | +int FlagCanReset = 0; | |
50 | + | |
51 | +/* | |
52 | + bp_16 LEC:3; // 2:0 Last Error Code | |
53 | + bp_16 TxOk:1; // 3 Transmission status | |
54 | + bp_16 RxOk:1; // 4 Reception status | |
55 | + bp_16 EPass:1; // 5 Error Passive State | |
56 | + bp_16 EWarn:1; // 6 Warning State | |
57 | + bp_16 BOff:1; // 7 Bus-Off State | |
58 | + bp_16 PER:1; // 8 Parity Error Detected | |
59 | + */ | |
60 | + | |
61 | +void CanErrorReset() | |
62 | +{ | |
63 | + if ((CanaRegs.CAN_ES.bit.BOff == 1) || (CanaRegs.CAN_ES.bit.PER == 1)) | |
64 | + { | |
65 | + CAN_startModule(CANA_BASE); | |
66 | + } | |
67 | + if ((CanbRegs.CAN_ES.bit.BOff == 1) || (CanbRegs.CAN_ES.bit.PER == 1)) | |
68 | + { | |
69 | + CAN_startModule(CANB_BASE); | |
70 | + } | |
71 | + | |
72 | + if (FlagCanReset == 1) | |
73 | + { | |
74 | + InitCan(); | |
75 | + FlagCanReset = 0; | |
76 | + } | |
77 | +} | |
78 | + | |
79 | + | |
80 | +//todo 일단은 std만.. 나중에 고칠 것 | |
81 | + | |
82 | +//ID 변경가능, DLC 변경 가능, Std 모드 | |
83 | +void CanTxMsg(uint32_t base, uint32_t objID, sCanMsg *Msg) | |
84 | +{ | |
85 | + uint32_t msgCtrl = 0U; | |
86 | + uint32_t arbReg = 0U; | |
87 | + | |
88 | + HWREG_BP(base + CAN_O_IF1CMD) = ((uint32_t) CAN_IF1CMD_CONTROL | (objID & CAN_IF1CMD_MSG_NUM_M)); | |
89 | + | |
90 | + while ((HWREGH(base + CAN_O_IF1CMD) & CAN_IF1CMD_BUSY) == CAN_IF1CMD_BUSY); | |
91 | + | |
92 | + msgCtrl = HWREGH(base + CAN_O_IF1MCTL); | |
93 | + arbReg = HWREGH(base + CAN_O_IF1ARB); | |
94 | + | |
95 | + // 데이터 길이 업데이트 | |
96 | + msgCtrl &= ~CAN_IF1MCTL_DLC_M; | |
97 | + msgCtrl |= (Msg->Lenth & CAN_IF1MCTL_DLC_M); | |
98 | + HWREG_BP(base + CAN_O_IF1MCTL) = msgCtrl; | |
99 | + | |
100 | + //ID 업데이트 Id std. | |
101 | + arbReg |= ((Msg->Id << CAN_IF1ARB_STD_ID_S) & CAN_IF1ARB_STD_ID_M) | CAN_IF1ARB_MSGVAL | CAN_IF1ARB_DIR; | |
102 | + HWREG_BP(base + CAN_O_IF1ARB) = arbReg; | |
103 | + | |
104 | + HWREG_BP(base + CAN_O_IF1CMD) = (CAN_IF1CMD_CONTROL | CAN_IF1CMD_DIR | (objID & CAN_IF1CMD_MSG_NUM_M)); | |
105 | + | |
106 | + uint16_t Cnt = 0; | |
107 | + uint16_t idx = 0; | |
108 | + uint32_t dataReg = 0; | |
109 | + | |
110 | + //Data 주소위치 | |
111 | + dataReg = (base + CAN_O_IF1DATA); | |
112 | + | |
113 | + //16bit 처리를 위한 인덱스 카운트 생성, 데이터길이가 홀수일 때 + 1 | |
114 | + Cnt = ((Msg->Lenth * 0.5) + (Msg->Lenth % 2)); | |
115 | + | |
116 | + //MassageRam 영역에 데이터 쓰기 | |
117 | + for (idx = 0U; idx < Cnt; idx++) | |
118 | + { | |
119 | + //HWREGH는16bit, HWREGB는 8bit | |
120 | + HWREGH(dataReg) = Msg->Data.U16.Word[idx]; | |
121 | + dataReg = dataReg + 2; | |
122 | + } | |
123 | + | |
124 | + // Set Data to be transferred from IF | |
125 | + if (Msg->Lenth > 0U) | |
126 | + { | |
127 | + msgCtrl = CAN_IF1CMD_DATA_B | CAN_IF1CMD_DATA_A; | |
128 | + } | |
129 | + else | |
130 | + { | |
131 | + msgCtrl = 0U; | |
132 | + } | |
133 | + | |
134 | + HWREG_BP(base + CAN_O_IF1CMD) = (msgCtrl | (uint32_t) CAN_IF1CMD_DIR | CAN_IF1CMD_ARB | (uint32_t) CAN_IF1CMD_TXRQST | (objID & CAN_IF1CMD_MSG_NUM_M)); | |
135 | +} | |
136 | + | |
137 | + | |
138 | +bool CanRxMsg(uint32_t base, uint32_t objID, sCanMsg *Msg) | |
139 | +{ | |
140 | + bool status; | |
141 | + uint16_t msgCtrl = 0U; | |
142 | + uint32_t idx; | |
143 | + uint32_t dataReg; | |
144 | + | |
145 | + HWREG_BP(base + CAN_O_IF2CMD) = ((uint32_t) CAN_IF2CMD_DATA_A | |
146 | + | (uint32_t) CAN_IF2CMD_DATA_B | |
147 | + | (uint32_t) CAN_IF2CMD_CONTROL | |
148 | + | (objID & CAN_IF2CMD_MSG_NUM_M) | |
149 | + | (uint32_t) CAN_IF2CMD_ARB); | |
150 | + | |
151 | + | |
152 | + while ((HWREGH(base + CAN_O_IF2CMD) & CAN_IF2CMD_BUSY) == CAN_IF2CMD_BUSY); | |
153 | + | |
154 | + msgCtrl = HWREGH(base + CAN_O_IF2MCTL); | |
155 | + | |
156 | + Msg->Lenth = (msgCtrl & CAN_IF2MCTL_DLC_M); | |
157 | + | |
158 | + if ((msgCtrl & CAN_IF2MCTL_NEWDAT) == CAN_IF2MCTL_NEWDAT) | |
159 | + { | |
160 | + uint16_t Cnt; | |
161 | + | |
162 | + Cnt = ((Msg->Lenth * 0.5) + (Msg->Lenth % 2)); | |
163 | + | |
164 | + dataReg = (base + CAN_O_IF2DATA); | |
165 | + | |
166 | + for(idx = 0; idx < Cnt; idx++) | |
167 | + { | |
168 | + Msg->Data.U16.Word[idx] = HWREGH(dataReg); | |
169 | + dataReg = dataReg + 2; | |
170 | + } | |
171 | + | |
172 | + status = true; | |
173 | + | |
174 | + // | |
175 | + // Now clear out the new data flag | |
176 | + // | |
177 | + HWREG_BP(base + CAN_O_IF2CMD) = ((uint32_t) CAN_IF2CMD_TXRQST | (objID & CAN_IF2CMD_MSG_NUM_M)); | |
178 | + | |
179 | + // | |
180 | + // Wait for busy bit to clear | |
181 | + // | |
182 | + while ((HWREGH(base + CAN_O_IF2CMD) & CAN_IF2CMD_BUSY) == CAN_IF2CMD_BUSY); | |
183 | + | |
184 | + } | |
185 | + else | |
186 | + { | |
187 | + status = false; | |
188 | + } | |
189 | + | |
190 | + if (status == true) | |
191 | + { | |
192 | + if ((HWREG_BP(base + CAN_O_IF2ARB) & CAN_IF2ARB_XTD) != 0U) | |
193 | + { | |
194 | + *Msg->frameType = CAN_MSG_FRAME_EXT; | |
195 | + Msg->Id = ((HWREG_BP(base + CAN_O_IF2ARB)) & CAN_IF2ARB_ID_M); | |
196 | + } | |
197 | + else | |
198 | + { | |
199 | + *Msg->frameType = CAN_MSG_FRAME_STD; | |
200 | + Msg->Id = (((HWREG_BP(base + CAN_O_IF2ARB)) & CAN_IF2ARB_STD_ID_M) >> CAN_IF2ARB_STD_ID_S); | |
201 | + } | |
202 | + | |
203 | + Msg->Cnt++; //정상적인 수신일 경우 카운트 | |
204 | + } | |
205 | + | |
206 | + return (status); | |
207 | +} | |
208 | + | |
209 | + |
+++ Common_Resource/CommonLibrary/source/CpuInfo.cpp
... | ... | @@ -0,0 +1,36 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : CpuInfo.cpp | |
4 | +// Created on : 2023. 3. 6. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | + | |
12 | +#include "CommonLib.h" | |
13 | + | |
14 | + | |
15 | +//-------------------------------------------------------// | |
16 | +// CpuNum 및 CpuSiliconRev는 Cpu1 및 Cpu2의 정보가 각각 별도로 | |
17 | +// 존재 해야함으로 Cpu1과 Cpu2가 서로 접근할 수 없는 LS메모리에 위치 | |
18 | +// 할 것 | |
19 | +//-------------------------------------------------------// | |
20 | + | |
21 | +#pragma SET_DATA_SECTION(".CpuInfo") | |
22 | +unsigned int CpuNum; | |
23 | +unsigned int CpuSiliconRev; | |
24 | +#pragma SET_DATA_SECTION(".CpuInfo") | |
25 | + | |
26 | + | |
27 | +void CpuInfo() | |
28 | +{ | |
29 | + // Cpu1에서는 1, Cpu2에서는 2 | |
30 | + CpuNum = HWREGH(0x0007026D) & 0x00FF; | |
31 | + // Cpu2에서는 SiliconRev 정보가 획득 안 됨 참고할 것 | |
32 | + CpuSiliconRev = HWREGH(0x0005D00C); | |
33 | + | |
34 | +} | |
35 | + | |
36 | + |
+++ Common_Resource/CommonLibrary/source/DigitalIO.cpp
... | ... | @@ -0,0 +1,239 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : DigitalIO.cpp | |
4 | +// Created on : 2022. 10. 30. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "CommonLib.h" | |
11 | + | |
12 | + | |
13 | +struct sDin Din; | |
14 | +struct sDOUT Dout; | |
15 | + | |
16 | +int FlagWrDioExor = 0; | |
17 | +int FlagRstDioExor = 0; | |
18 | +long int BufferDoutExorAll = 0; | |
19 | + | |
20 | +void InitDigitalIOSet() | |
21 | +{ | |
22 | + memset(&Din, 0, (sizeof(Din) / sizeof(int))); | |
23 | + memset(&Dout, 0, (sizeof(Dout) / sizeof(int))); | |
24 | + | |
25 | + | |
26 | + ResetDioExor(); | |
27 | +// ReadDioExor(); | |
28 | + | |
29 | + InitDigitalInput(); | |
30 | + InitDigitalOutput(); | |
31 | + | |
32 | + | |
33 | + | |
34 | + DigitalInput(); | |
35 | + DigitalOutput(); | |
36 | + | |
37 | +} | |
38 | + | |
39 | + | |
40 | +void InitDigitalInput() | |
41 | +{ | |
42 | + //Din0 | |
43 | + GPIO_setMasterCore(0, GPIO_CORE_CPU1); | |
44 | + GPIO_setPadConfig(0, GPIO_PIN_TYPE_PULLUP); | |
45 | + GPIO_setPinConfig(GPIO_0_GPIO0); | |
46 | + GPIO_setQualificationMode(0, GPIO_QUAL_ASYNC); | |
47 | + GPIO_setDirectionMode(0, GPIO_DIR_MODE_IN); | |
48 | + | |
49 | + //Din1 | |
50 | + GPIO_setMasterCore(1, GPIO_CORE_CPU1); | |
51 | + GPIO_setPadConfig(1, GPIO_PIN_TYPE_PULLUP); | |
52 | + GPIO_setPinConfig(GPIO_1_GPIO1); | |
53 | + GPIO_setQualificationMode(1, GPIO_QUAL_ASYNC); | |
54 | + GPIO_setDirectionMode(1, GPIO_DIR_MODE_IN); | |
55 | + | |
56 | + //Din16 | |
57 | + GPIO_setMasterCore(16, GPIO_CORE_CPU1); | |
58 | + GPIO_setPadConfig(16, GPIO_PIN_TYPE_PULLUP); | |
59 | + GPIO_setPinConfig(GPIO_16_GPIO16); | |
60 | + GPIO_setQualificationMode(16, GPIO_QUAL_ASYNC); | |
61 | + GPIO_setDirectionMode(16, GPIO_DIR_MODE_IN); | |
62 | + | |
63 | + //Din17 | |
64 | + GPIO_setMasterCore(17, GPIO_CORE_CPU1); | |
65 | + GPIO_setPadConfig(17, GPIO_PIN_TYPE_PULLUP); | |
66 | + GPIO_setPinConfig(GPIO_17_GPIO17); | |
67 | + GPIO_setQualificationMode(17, GPIO_QUAL_ASYNC); | |
68 | + GPIO_setDirectionMode(17, GPIO_DIR_MODE_IN); | |
69 | + | |
70 | + //Din18 | |
71 | + GPIO_setMasterCore(18, GPIO_CORE_CPU1); | |
72 | + GPIO_setPadConfig(18, GPIO_PIN_TYPE_PULLUP); | |
73 | + GPIO_setPinConfig(GPIO_18_GPIO18); | |
74 | + GPIO_setQualificationMode(18, GPIO_QUAL_ASYNC); | |
75 | + GPIO_setDirectionMode(18, GPIO_DIR_MODE_IN); | |
76 | + | |
77 | + //Din19 | |
78 | + GPIO_setMasterCore(19, GPIO_CORE_CPU1); | |
79 | + GPIO_setPadConfig(19, GPIO_PIN_TYPE_PULLUP); | |
80 | + GPIO_setPinConfig(GPIO_19_GPIO19); | |
81 | + GPIO_setQualificationMode(19, GPIO_QUAL_ASYNC); | |
82 | + GPIO_setDirectionMode(19, GPIO_DIR_MODE_IN); | |
83 | + | |
84 | + //Din20 | |
85 | + GPIO_setMasterCore(20, GPIO_CORE_CPU1); | |
86 | + GPIO_setPadConfig(20, GPIO_PIN_TYPE_PULLUP); | |
87 | + GPIO_setPinConfig(GPIO_20_GPIO20); | |
88 | + GPIO_setQualificationMode(20, GPIO_QUAL_ASYNC); | |
89 | + GPIO_setDirectionMode(20, GPIO_DIR_MODE_IN); | |
90 | + | |
91 | + //Din21 | |
92 | + GPIO_setMasterCore(21, GPIO_CORE_CPU1); | |
93 | + GPIO_setPadConfig(21, GPIO_PIN_TYPE_PULLUP); | |
94 | + GPIO_setPinConfig(GPIO_21_GPIO21); | |
95 | + GPIO_setQualificationMode(21, GPIO_QUAL_ASYNC); | |
96 | + GPIO_setDirectionMode(21, GPIO_DIR_MODE_IN); | |
97 | + | |
98 | + //Din22 | |
99 | + GPIO_setMasterCore(22, GPIO_CORE_CPU1); | |
100 | + GPIO_setPadConfig(22, GPIO_PIN_TYPE_PULLUP); | |
101 | + GPIO_setPinConfig(GPIO_22_GPIO22); | |
102 | + GPIO_setQualificationMode(22, GPIO_QUAL_ASYNC); | |
103 | + GPIO_setDirectionMode(22, GPIO_DIR_MODE_IN); | |
104 | + | |
105 | + //Din23 | |
106 | + GPIO_setMasterCore(23, GPIO_CORE_CPU1); | |
107 | + GPIO_setPadConfig(23, GPIO_PIN_TYPE_PULLUP); | |
108 | + GPIO_setPinConfig(GPIO_23_GPIO23); | |
109 | + GPIO_setQualificationMode(23, GPIO_QUAL_ASYNC); | |
110 | + GPIO_setDirectionMode(23, GPIO_DIR_MODE_IN); | |
111 | + | |
112 | + //Din24 | |
113 | + GPIO_setMasterCore(24, GPIO_CORE_CPU1); | |
114 | + GPIO_setPadConfig(24, GPIO_PIN_TYPE_PULLUP); | |
115 | + GPIO_setPinConfig(GPIO_24_GPIO24); | |
116 | + GPIO_setQualificationMode(24, GPIO_QUAL_ASYNC); | |
117 | + GPIO_setDirectionMode(24, GPIO_DIR_MODE_IN); | |
118 | + | |
119 | + //Din25 | |
120 | + GPIO_setMasterCore(25, GPIO_CORE_CPU1); | |
121 | + GPIO_setPadConfig(25, GPIO_PIN_TYPE_PULLUP); | |
122 | + GPIO_setPinConfig(GPIO_25_GPIO25); | |
123 | + GPIO_setQualificationMode(25, GPIO_QUAL_ASYNC); | |
124 | + GPIO_setDirectionMode(25, GPIO_DIR_MODE_IN); | |
125 | + | |
126 | + //Din26 | |
127 | + GPIO_setMasterCore(26, GPIO_CORE_CPU1); | |
128 | + GPIO_setPadConfig(26, GPIO_PIN_TYPE_PULLUP); | |
129 | + GPIO_setPinConfig(GPIO_26_GPIO26); | |
130 | + GPIO_setQualificationMode(26, GPIO_QUAL_ASYNC); | |
131 | + GPIO_setDirectionMode(26, GPIO_DIR_MODE_IN); | |
132 | + | |
133 | + //Din27 | |
134 | + GPIO_setMasterCore(27, GPIO_CORE_CPU1); | |
135 | + GPIO_setPadConfig(27, GPIO_PIN_TYPE_PULLUP); | |
136 | + GPIO_setPinConfig(GPIO_27_GPIO27); | |
137 | + GPIO_setQualificationMode(27, GPIO_QUAL_ASYNC); | |
138 | + GPIO_setDirectionMode(27, GPIO_DIR_MODE_IN); | |
139 | + | |
140 | + | |
141 | + | |
142 | + | |
143 | +} | |
144 | + | |
145 | + | |
146 | +void InitDigitalOutput() | |
147 | +{ | |
148 | + | |
149 | + //Dout0 | |
150 | + GPIO_setMasterCore(32, GPIO_CORE_CPU1); | |
151 | + GPIO_setPadConfig(32, GPIO_PIN_TYPE_PULLUP); | |
152 | + GPIO_setPinConfig(GPIO_32_GPIO32); | |
153 | + GPIO_setDirectionMode(32, GPIO_DIR_MODE_OUT); | |
154 | + GPIO_writePin(32, 0); | |
155 | + | |
156 | + //Dout1 | |
157 | + GPIO_setMasterCore(33, GPIO_CORE_CPU1); | |
158 | + GPIO_setPadConfig(33, GPIO_PIN_TYPE_PULLUP); | |
159 | + GPIO_setPinConfig(GPIO_33_GPIO33); | |
160 | + GPIO_setDirectionMode(33, GPIO_DIR_MODE_OUT); | |
161 | + GPIO_writePin(33, 0); | |
162 | + | |
163 | + //Dout2 | |
164 | + GPIO_setMasterCore(34, GPIO_CORE_CPU1); | |
165 | + GPIO_setPadConfig(34, GPIO_PIN_TYPE_PULLUP); | |
166 | + GPIO_setPinConfig(GPIO_34_GPIO34); | |
167 | + GPIO_setDirectionMode(34, GPIO_DIR_MODE_OUT); | |
168 | + GPIO_writePin(34, 0); | |
169 | + | |
170 | + //Dout3 | |
171 | + GPIO_setMasterCore(35, GPIO_CORE_CPU1); | |
172 | + GPIO_setPadConfig(35, GPIO_PIN_TYPE_PULLUP); | |
173 | + GPIO_setPinConfig(GPIO_35_GPIO35); | |
174 | + GPIO_setDirectionMode(35, GPIO_DIR_MODE_OUT); | |
175 | + GPIO_writePin(35, 0); | |
176 | + | |
177 | + //Dout4 | |
178 | + GPIO_setMasterCore(36, GPIO_CORE_CPU1); | |
179 | + GPIO_setPadConfig(36, GPIO_PIN_TYPE_PULLUP); | |
180 | + GPIO_setPinConfig(GPIO_36_GPIO36); | |
181 | + GPIO_setDirectionMode(36, GPIO_DIR_MODE_OUT); | |
182 | + GPIO_writePin(36, 0); | |
183 | + | |
184 | +} | |
185 | + | |
186 | + | |
187 | +Uint16 TestDin; | |
188 | + | |
189 | +void DigitalInput() | |
190 | +{ | |
191 | + Din.DataRaw.all = HWREG(GPIODATA_BASE + 0x00); //16-bit HWREGH -> 32-bit HWREG | |
192 | + Din.Data.all = Din.DataRaw.all ^ ~Din.Exor.all; | |
193 | +} | |
194 | + | |
195 | + | |
196 | +void DigitalOutput() | |
197 | +{ | |
198 | + HWREGH(GPIODATA_BASE + 0x8) = ~(Dout.Data.all ^ Dout.Exor.all); | |
199 | +} | |
200 | +// | |
201 | +void ReadDioExor(void) | |
202 | +{ | |
203 | +// Din.Exor.all = NV.Din.Exor.all; | |
204 | +// Dout.Exor.all = NV.Dout.Exor.all; | |
205 | +} | |
206 | +// | |
207 | +void WriteDioExor(void) | |
208 | +{ | |
209 | +// NV.Din.Exor.all = Din.Exor.all; | |
210 | +// NV.Dout.Exor.all = Dout.Exor.all; | |
211 | +} | |
212 | + | |
213 | +void ResetDioExor() | |
214 | +{ | |
215 | + // 0, A접점(NO, Normal Open) | |
216 | + // 1, B접점(NC, Normal Close) | |
217 | + Din.Exor.bit.Button = NORMAL_OPEN; | |
218 | + Din.Exor.bit.Door_chk = NORMAL_CLOSE; | |
219 | + | |
220 | + Din.Exor.bit.FT_CH1_IR = NORMAL_OPEN; | |
221 | + Din.Exor.bit.FT_CH1_VIS = NORMAL_OPEN; | |
222 | + Din.Exor.bit.FT_CH1_UV = NORMAL_OPEN; | |
223 | + Din.Exor.bit.FT_CH2_IR = NORMAL_OPEN; | |
224 | + | |
225 | + Din.Exor.bit.FT_CH2_VIS = NORMAL_OPEN; | |
226 | + Din.Exor.bit.FT_CH2_UV = NORMAL_OPEN; | |
227 | + Din.Exor.bit.FT_CH3_IR = NORMAL_OPEN; | |
228 | + Din.Exor.bit.FT_CH3_VIS = NORMAL_OPEN; | |
229 | + | |
230 | + Din.Exor.bit.FT_CH3_UV = NORMAL_OPEN; | |
231 | + Din.Exor.bit.FT_CH4_IR = NORMAL_OPEN; | |
232 | + Din.Exor.bit.FT_CH4_VIS = NORMAL_OPEN; | |
233 | + Din.Exor.bit.FT_CH4_UV = NORMAL_OPEN; | |
234 | + | |
235 | + | |
236 | +} | |
237 | + | |
238 | + | |
239 | + |
+++ Common_Resource/CommonLibrary/source/Eeprom.cpp
... | ... | @@ -0,0 +1,262 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : EepromLib.h | |
4 | +// Created on : 2023. 10. 31. | |
5 | +// Description : EEPROM Library (SPI-Type) | |
6 | +// Author : "Kim JeongWoo" | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "CommonLib.h" | |
11 | + | |
12 | + | |
13 | +//나중에 DMA로 처리 할 것!!!! | |
14 | +//FIFO 적용할 것!!!!!!!! | |
15 | +//지금은 임시!!!!!!!!!! | |
16 | +//코드 컨벤션 및 변수 네이밍 나중에 수정 할 것!!!!!!!! | |
17 | + | |
18 | +uint16_t EepromChkClrBuf[10] = {0,0,0,0,0,0,0,0,0,0}; | |
19 | +uint16_t EepromChkRdBuf[10] = {0,0,0,0,0,0,0,0,0,0}; | |
20 | +uint16_t EepromChkCodeSet[10] = {'N','e','x','t','S','q','u','a','r','e'}; | |
21 | + | |
22 | +unsigned int EepromChkCnt = 0; | |
23 | + | |
24 | +float Testpcs1 = 1024; | |
25 | +float Testpcs2 = 1024; | |
26 | +float Testpcs3 = 1024; | |
27 | + | |
28 | +void EepromChkCodeClr() | |
29 | +{ | |
30 | + WriteEepromArray(pEepromChk + 0, EepromChkClrBuf, 10); | |
31 | +} | |
32 | + | |
33 | +void EepromChkCodeWr() | |
34 | +{ | |
35 | + WriteEepromArray(pEepromChk + 0, EepromChkCodeSet, 10); | |
36 | +} | |
37 | + | |
38 | +unsigned int EepromInitStatus = 0; | |
39 | + | |
40 | + | |
41 | +int FlagTestEeprom = 0; | |
42 | + | |
43 | + | |
44 | +void EepromChk() | |
45 | +{ | |
46 | + int i = 0; | |
47 | + | |
48 | + ReadEeprom(pEepromChk + 0, EepromChkRdBuf, 10); | |
49 | + | |
50 | + for(i = 0; i < 10; i++) | |
51 | + { | |
52 | +// if(EepromChkRdBuf[i] != EepromChkCodeSet[i]) EepromChkCnt++; | |
53 | +// if(EepromChkCnt != 0) Fault.Sw3.bit.Err_Nvram |= 1; | |
54 | + } | |
55 | + | |
56 | + if(EepromChkCnt != 0) | |
57 | + { | |
58 | + //임시 | |
59 | + memset(&ScaleDelt, 0, (sizeof(ScaleDelt) / sizeof(int))); | |
60 | + memset(&Adc.OffsetDelt, 0, (sizeof(Adc.OffsetDelt) / sizeof(int))); | |
61 | + ResetDioExor(); | |
62 | + | |
63 | + WriteEepromArray(pEepromChk + 0, EepromChkCodeSet, 10); | |
64 | + EepromWriteAdcScale(); | |
65 | + EepromWriteAdcOffset(); | |
66 | + EepromWriteDioExor(); | |
67 | + | |
68 | +// EepromChkCnt = 0; | |
69 | + EepromInitStatus = 1; | |
70 | + } | |
71 | +} | |
72 | + | |
73 | + | |
74 | + | |
75 | +void EepromWriteDioExor() | |
76 | +{ | |
77 | + WriteEepromInt(pEepromExor + 0, &Din.Exor.all); | |
78 | + WriteEepromInt(pEepromExor + 1, &Dout.Exor.all); | |
79 | +} | |
80 | +void EepromReadDioExor() | |
81 | +{ | |
82 | + ReadEepromInt(pEepromExor + 0, &Din.Exor.all); | |
83 | + ReadEepromInt(pEepromExor + 1, &Dout.Exor.all); | |
84 | +} | |
85 | + | |
86 | +void EepromWriteAdcScale() | |
87 | +{ | |
88 | + WriteEepromFloat(pEepromAdcScale + 0, &Testpcs1); | |
89 | + WriteEepromFloat(pEepromAdcScale + 1, &Testpcs2); | |
90 | + WriteEepromFloat(pEepromAdcScale + 2, &Testpcs3); | |
91 | +// WriteEepromFloat(pEepromAdcScale + 3, &ScaleDelt.Vdab); | |
92 | +// WriteEepromFloat(pEepromAdcScale + 4, &ScaleDelt.AdcCh05); | |
93 | +// WriteEepromFloat(pEepromAdcScale + 5, &ScaleDelt.VdcH); | |
94 | +// WriteEepromFloat(pEepromAdcScale + 6, &ScaleDelt.VdcL); | |
95 | +// WriteEepromFloat(pEepromAdcScale + 7, &ScaleDelt.VunGrid); | |
96 | +// WriteEepromFloat(pEepromAdcScale + 8, &ScaleDelt.VnwGrid); | |
97 | +// WriteEepromFloat(pEepromAdcScale + 9, &ScaleDelt.IuInv); | |
98 | +// WriteEepromFloat(pEepromAdcScale + 10, &ScaleDelt.IwInv); | |
99 | +// WriteEepromFloat(pEepromAdcScale + 11, &ScaleDelt.Izct); | |
100 | +// WriteEepromFloat(pEepromAdcScale + 12, &ScaleDelt.IuGridExt); | |
101 | +// WriteEepromFloat(pEepromAdcScale + 13, &ScaleDelt.IwGridExt); | |
102 | +// WriteEepromFloat(pEepromAdcScale + 14, &ScaleDelt.VntcBoost); | |
103 | +// WriteEepromFloat(pEepromAdcScale + 15, &ScaleDelt.VntcLvDab); | |
104 | +// WriteEepromFloat(pEepromAdcScale + 16, &ScaleDelt.VntcHvDab); | |
105 | +// WriteEepromFloat(pEepromAdcScale + 17, &ScaleDelt.VntcInv); | |
106 | +// WriteEepromFloat(pEepromAdcScale + 18, &ScaleDelt.Vntc5); | |
107 | +// WriteEepromFloat(pEepromAdcScale + 19, &ScaleDelt.Vntc6); | |
108 | +// WriteEepromFloat(pEepromAdcScale + 20, &ScaleDelt.VunInv); | |
109 | +// WriteEepromFloat(pEepromAdcScale + 21, &ScaleDelt.VnwInv); | |
110 | +// WriteEepromFloat(pEepromAdcScale + 22, &ScaleDelt.IuGrid); | |
111 | +// WriteEepromFloat(pEepromAdcScale + 23, &ScaleDelt.IwGrid); | |
112 | +} | |
113 | + | |
114 | +void EepromReadAdcScale() | |
115 | +{ | |
116 | + ReadEepromFloat(pEepromAdcScale + 0, &Testpcs1); | |
117 | + ReadEepromFloat(pEepromAdcScale + 1, &Testpcs2); | |
118 | + ReadEepromFloat(pEepromAdcScale + 2, &Testpcs3); | |
119 | +// ReadEepromFloat(pEepromAdcScale + 3, &ScaleDelt.Vdab); | |
120 | +// ReadEepromFloat(pEepromAdcScale + 4, &ScaleDelt.AdcCh05); | |
121 | +// ReadEepromFloat(pEepromAdcScale + 5, &ScaleDelt.VdcH); | |
122 | +// ReadEepromFloat(pEepromAdcScale + 6, &ScaleDelt.VdcL); | |
123 | +// ReadEepromFloat(pEepromAdcScale + 7, &ScaleDelt.VunGrid); | |
124 | +// ReadEepromFloat(pEepromAdcScale + 8, &ScaleDelt.VnwGrid); | |
125 | +// ReadEepromFloat(pEepromAdcScale + 9, &ScaleDelt.IuInv); | |
126 | +// ReadEepromFloat(pEepromAdcScale + 10, &ScaleDelt.IwInv); | |
127 | +// ReadEepromFloat(pEepromAdcScale + 11, &ScaleDelt.Izct); | |
128 | +// ReadEepromFloat(pEepromAdcScale + 12, &ScaleDelt.IuGridExt); | |
129 | +// ReadEepromFloat(pEepromAdcScale + 13, &ScaleDelt.IwGridExt); | |
130 | +// ReadEepromFloat(pEepromAdcScale + 14, &ScaleDelt.VntcBoost); | |
131 | +// ReadEepromFloat(pEepromAdcScale + 15, &ScaleDelt.VntcLvDab); | |
132 | +// ReadEepromFloat(pEepromAdcScale + 16, &ScaleDelt.VntcHvDab); | |
133 | +// ReadEepromFloat(pEepromAdcScale + 17, &ScaleDelt.VntcInv); | |
134 | +// ReadEepromFloat(pEepromAdcScale + 18, &ScaleDelt.Vntc5); | |
135 | +// ReadEepromFloat(pEepromAdcScale + 19, &ScaleDelt.Vntc6); | |
136 | +// ReadEepromFloat(pEepromAdcScale + 20, &ScaleDelt.VunInv); | |
137 | +// ReadEepromFloat(pEepromAdcScale + 21, &ScaleDelt.VnwInv); | |
138 | +// ReadEepromFloat(pEepromAdcScale + 22, &ScaleDelt.IuGrid); | |
139 | +// ReadEepromFloat(pEepromAdcScale + 23, &ScaleDelt.IwGrid); | |
140 | +} | |
141 | + | |
142 | +void EepromWriteAdcOffset() | |
143 | +{ | |
144 | + int idx = 0; | |
145 | + | |
146 | + for (idx = 0; idx < 32; idx++) | |
147 | + { | |
148 | + WriteEepromFloat(pEepromAdcOffset + idx, &Adc.OffsetDelt[idx]); | |
149 | + } | |
150 | +} | |
151 | + | |
152 | +void EepromReadAdcOffset() | |
153 | +{ | |
154 | + int idx = 0; | |
155 | + | |
156 | + for (idx = 0; idx < 32; idx++) | |
157 | + { | |
158 | + ReadEepromFloat(pEepromAdcOffset + idx, &Adc.OffsetDelt[idx]); | |
159 | + } | |
160 | +} | |
161 | + | |
162 | +unsigned int FlagRstAdcPara = 0; | |
163 | +unsigned int FlagWrAdcScale = 0; | |
164 | +unsigned int FlagRdAdcScale = 0; | |
165 | +unsigned int FlagWrAdcOffset = 0; | |
166 | +unsigned int FlagRdAdcOffset = 0; | |
167 | + | |
168 | +//unsigned int FlagRstDioExor = 0; | |
169 | +unsigned int FlagRdDioExor = 0; | |
170 | +//unsigned int FlagWrDioExor = 0; | |
171 | + | |
172 | +unsigned int FlagEepromRstAll = 0; | |
173 | +unsigned int FlagEepromWrAll = 0; | |
174 | +unsigned int FlagEepromRdAll = 0; | |
175 | +unsigned int FlagEepromChkClr = 0; | |
176 | + | |
177 | +void EepromCmds() | |
178 | +{ | |
179 | + if(FlagEepromRstAll == 1) | |
180 | + { | |
181 | + FlagRstAdcPara = 1; | |
182 | + FlagRstDioExor = 1; | |
183 | + FlagEepromRstAll = 0; | |
184 | + } | |
185 | + | |
186 | + if(FlagEepromWrAll == 1) | |
187 | + { | |
188 | + FlagWrAdcScale = 1; | |
189 | + FlagWrAdcOffset = 1; | |
190 | + FlagWrDioExor = 1; | |
191 | + FlagEepromWrAll = 0; | |
192 | + } | |
193 | + | |
194 | + if(FlagEepromRdAll == 1) | |
195 | + { | |
196 | + FlagRdAdcScale = 1; | |
197 | + FlagRdAdcOffset = 1; | |
198 | + FlagRdDioExor = 1; | |
199 | + FlagEepromRdAll = 0; | |
200 | + } | |
201 | + | |
202 | + if(FlagRdDioExor == 1 ) | |
203 | + { | |
204 | + EepromReadDioExor(); | |
205 | + FlagRdDioExor = 0; | |
206 | + } | |
207 | + | |
208 | + if(FlagWrDioExor == 1 ) | |
209 | + { | |
210 | + EepromWriteDioExor(); | |
211 | + FlagWrDioExor = 0; | |
212 | + } | |
213 | + | |
214 | + | |
215 | + if(FlagRdAdcScale == 1 ) | |
216 | + { | |
217 | + EepromReadAdcScale(); | |
218 | + FlagRdAdcScale = 0; | |
219 | + } | |
220 | + | |
221 | + if(FlagWrAdcScale == 1 ) | |
222 | + { | |
223 | + EepromWriteAdcScale(); | |
224 | + FlagWrAdcScale = 0; | |
225 | + } | |
226 | + | |
227 | + if(FlagRdAdcOffset == 1 ) | |
228 | + { | |
229 | + EepromReadAdcOffset(); | |
230 | + FlagRdAdcScale = 0; | |
231 | + } | |
232 | + | |
233 | + if(FlagWrAdcOffset == 1 ) | |
234 | + { | |
235 | + EepromWriteAdcOffset(); | |
236 | + FlagWrAdcOffset = 0; | |
237 | + } | |
238 | + | |
239 | + if(FlagRstAdcPara == 1) | |
240 | + { | |
241 | + //임시 | |
242 | + memset(&ScaleDelt, 0, (sizeof(ScaleDelt) / sizeof(int))); | |
243 | + memset(&Adc.OffsetDelt, 0, (sizeof(Adc.OffsetDelt) / sizeof(int))); | |
244 | + FlagRstAdcPara = 0; | |
245 | + } | |
246 | + | |
247 | + if(FlagRstDioExor == 1) | |
248 | + { | |
249 | + ResetDioExor(); | |
250 | + FlagRstDioExor = 0; | |
251 | + } | |
252 | + | |
253 | + if(FlagEepromChkClr == 1) | |
254 | + { | |
255 | + EepromChkCodeClr(); | |
256 | + FlagEepromChkClr = 0; | |
257 | + } | |
258 | + | |
259 | +} | |
260 | + | |
261 | + | |
262 | + |
+++ Common_Resource/CommonLibrary/source/EepromLib.cpp
... | ... | @@ -0,0 +1,137 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-ENEMAN-CPU1 | |
3 | +// File Name : EepromLib.h | |
4 | +// Created on : 2023. 07. 12. | |
5 | +// Description : | |
6 | +// Author : KWONJEONGMIN | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "CommonLib.h" | |
11 | +#include "F2837xD_gpio.h" | |
12 | +// | |
13 | +// Calculate BRR: 7-bit baud rate register value | |
14 | +// SPI CLK freq = 500 kHz | |
15 | +// LSPCLK freq = CPU freq / 4 (by default) | |
16 | +// BRR = (LSPCLK freq / SPI CLK freq) - 1 | |
17 | +// | |
18 | +#define CPUCLK 200000000L // CPU Main Clock | |
19 | +#define SPI_BRR ((200E6 / 4) / 500E3) - 1 // SPI BRR | |
20 | + | |
21 | +//void InitSpi(void) | |
22 | +//{ | |
23 | +// //Initialize SPI-C | |
24 | +// | |
25 | +// // Set reset low before configuration changes | |
26 | +// // Clock polarity (0 == rising, 1 == falling) | |
27 | +// // 16-bit character | |
28 | +// // Enable loop-back | |
29 | +// SpicRegs.SPICCR.bit.SPISWRESET = 0; | |
30 | +// SpicRegs.SPICCR.bit.CLKPOLARITY = 0; | |
31 | +// SpicRegs.SPICCR.bit.SPICHAR = (16-1); | |
32 | +// SpicRegs.SPICCR.bit.SPILBK = 1; | |
33 | +// | |
34 | +// // Enable master (0 == slave, 1 == master) | |
35 | +// // Enable transmission (Talk) | |
36 | +// // Clock phase (0 == normal, 1 == delayed) | |
37 | +// // SPI interrupts are enabled | |
38 | +// SpicRegs.SPICTL.bit.MASTER_SLAVE = 1; | |
39 | +// SpicRegs.SPICTL.bit.TALK = 1; | |
40 | +// SpicRegs.SPICTL.bit.CLK_PHASE = 0; | |
41 | +// SpicRegs.SPICTL.bit.SPIINTENA = 1; | |
42 | +// | |
43 | +// // Set the baud rate | |
44 | +// SpicRegs.SPIBRR.bit.SPI_BIT_RATE = SPI_BRR; | |
45 | +// | |
46 | +// // Set FREE bit | |
47 | +// // Halting on a breakpoint will not halt the SPI | |
48 | +// SpicRegs.SPIPRI.bit.FREE = 1; | |
49 | +// | |
50 | +// // Release the SPI from reset | |
51 | +// SpicRegs.SPICCR.bit.SPISWRESET = 1; | |
52 | +//} | |
53 | + | |
54 | +// | |
55 | +// InitSpiGpio - This function initializes GPIO pins to function as SPI pins. | |
56 | +// Each GPIO pin can be configured as a GPIO pin or up to 3 | |
57 | +// different peripheral functional pins. By default all pins come | |
58 | +// up as GPIO inputs after reset. | |
59 | +// | |
60 | +// Caution: | |
61 | +// For each SPI peripheral | |
62 | +// Only one GPIO pin should be enabled for SPISOMO operation. | |
63 | +// Only one GPIO pin should be enabled for SPISOMI operation. | |
64 | +// Only one GPIO pin should be enabled for SPICLK operation. | |
65 | +// | |
66 | + | |
67 | + | |
68 | +#ifdef CPU1 | |
69 | +void InitSpiGpio(void) | |
70 | +{ | |
71 | + EALLOW; | |
72 | + | |
73 | + // | |
74 | + // Enable internal pull-up for the selected pins | |
75 | + // | |
76 | + // Pull-ups can be enabled or disabled by the user. | |
77 | + // This will enable the pull ups for the specified pins. | |
78 | + // | |
79 | + GpioCtrlRegs.GPDPUD.bit.GPIO100 = 0; // Enable pull-up on GPIO100 (SPISIMOC) | |
80 | + GpioCtrlRegs.GPDPUD.bit.GPIO101 = 0; // Enable pull-up on GPIO101 (SPISOMIC) | |
81 | + GpioCtrlRegs.GPDPUD.bit.GPIO102 = 0; // Enable pull-up on GPIO101 (SPICLKC) | |
82 | + | |
83 | + // | |
84 | + // Set qualification for selected pins to asynch only | |
85 | + // | |
86 | + // This will select asynch (no qualification) for the selected pins. | |
87 | + // | |
88 | + GpioCtrlRegs.GPDQSEL1.bit.GPIO100 = 3; //Asynch input GPIO100 (SPISIMOC) | |
89 | + GpioCtrlRegs.GPDQSEL1.bit.GPIO101 = 3; //Asynch input GPIO101 (SPISOMIC) | |
90 | + GpioCtrlRegs.GPDQSEL1.bit.GPIO102 = 3; //Asynch input GPIO101 (SPICLKC) | |
91 | + | |
92 | + // | |
93 | + //Configure SPI-A pins using GPIO regs | |
94 | + // | |
95 | + // This specifies which of the possible GPIO pins will be SPI functional pins. | |
96 | + // | |
97 | + GpioCtrlRegs.GPDMUX1.bit.GPIO100 = 1; //Configure GPIO100 as SPISIMOC | |
98 | + GpioCtrlRegs.GPDMUX1.bit.GPIO101 = 1; //Configure GPIO101 as SPISOMIC | |
99 | + GpioCtrlRegs.GPDMUX1.bit.GPIO102 = 1; //Configure GPIO102 as SPICLKC | |
100 | + | |
101 | + EDIS; | |
102 | +} | |
103 | +#endif | |
104 | + | |
105 | + | |
106 | +void ew_disable() | |
107 | +{ | |
108 | + | |
109 | +} | |
110 | +void ew_enable() | |
111 | +{ | |
112 | + | |
113 | +} | |
114 | +void is_ew_enabled() | |
115 | +{ | |
116 | + | |
117 | +} | |
118 | +void erase_all() | |
119 | +{ | |
120 | + | |
121 | +} | |
122 | +void write_all() | |
123 | +{ | |
124 | + | |
125 | +} | |
126 | +void write() | |
127 | +{ | |
128 | + | |
129 | +} | |
130 | +void erase() | |
131 | +{ | |
132 | + | |
133 | +} | |
134 | +void read() | |
135 | +{ | |
136 | + | |
137 | +} |
+++ Common_Resource/CommonLibrary/source/EpwmLib.cpp
... | ... | @@ -0,0 +1,1019 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : Epwm.cpp | |
4 | +// Created on : 2019. 06. 07 | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include <CommonLib.h> | |
11 | + | |
12 | + | |
13 | + | |
14 | +void InitEPwm1(float Pwm_Freq, float Pwm_Deadtime, unsigned int CTR_Mode, unsigned int Tbphs) | |
15 | +{ | |
16 | + float Tbclk = 0.; | |
17 | + | |
18 | + | |
19 | + EALLOW; | |
20 | + | |
21 | + //EPwm1Regs.TBPRD = Pwm_prd; // Set timer period | |
22 | + EPwm1Regs.TBPHS.bit.TBPHS = Tbphs; // Phase is 0 | |
23 | + EPwm1Regs.TBCTR = 0x0000; // Clear counter | |
24 | + | |
25 | + // Setup Tbclk | |
26 | + EPwm1Regs.TBCTL.bit.CTRMODE = CTR_Mode; // Count up | |
27 | + EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Disable phase loading | |
28 | + //EPwm4Regs.TBCTL.bit.PHSDIR = TB_DOWN; | |
29 | + | |
30 | + EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; | |
31 | + EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW; | |
32 | + //EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; // Clock ratio to SYSCLKOUT | |
33 | + EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT | |
34 | + EPwm1Regs.TBCTL.bit.CLKDIV = TB_DIV1; // Slow so we can observe on the scope | |
35 | + | |
36 | + EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; | |
37 | + EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; | |
38 | + EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_PRD; // load on CTR=Zero | |
39 | + EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_PRD; // load on CTR=Zero | |
40 | + | |
41 | + | |
42 | + EPwm1Regs.ETSEL.bit.INTSEL = ET_CTR_PRD; | |
43 | + EPwm1Regs.ETSEL.bit.INTEN = PWM1_INT_ENABLE; | |
44 | + EPwm1Regs.ETPS.bit.INTPRD = ET_2ND; | |
45 | + | |
46 | + EPwm1Regs.ETPS.bit.SOCPSSEL = 0; | |
47 | + EPwm1Regs.ETPS.bit.SOCAPRD = ET_2ND; | |
48 | + EPwm1Regs.ETPS.bit.SOCBPRD = ET_2ND; | |
49 | +// EPwm1Regs.ETSOCPS.bit.SOCAPRD2 = 1; | |
50 | + | |
51 | + EPwm1Regs.ETSEL.bit.SOCASEL = ET_CTR_PRD; | |
52 | + EPwm1Regs.ETSEL.bit.SOCAEN = 1; | |
53 | + | |
54 | + EPwm1Regs.ETSEL.bit.SOCBSEL = ET_CTR_ZERO; | |
55 | + EPwm1Regs.ETSEL.bit.SOCBEN = 1; | |
56 | + | |
57 | + // Set actions | |
58 | + EPwm1Regs.AQCTLA.bit.CAU = AQ_CLEAR; // set actions for EPWM1A | |
59 | + EPwm1Regs.AQCTLA.bit.CAD = AQ_SET; | |
60 | + | |
61 | +// EPwm1Regs.AQCTLB.bit.CBU = AQ_CLEAR; // set actions for EPWM1B | |
62 | +// EPwm1Regs.AQCTLB.bit.CBD = AQ_SET; | |
63 | + | |
64 | + // Setup compare | |
65 | + EPwm1Regs.CMPA.bit.CMPA = 0; | |
66 | + EPwm1Regs.CMPB.bit.CMPB = 0; | |
67 | + | |
68 | + EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO; | |
69 | + EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO; | |
70 | + | |
71 | + // Active high complementary PWMs - Setup the deadband | |
72 | + EPwm1Regs.DBCTL.bit.IN_MODE = DBA_ALL; | |
73 | + EPwm1Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | |
74 | + EPwm1Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; | |
75 | + | |
76 | + | |
77 | + //------------------TBPRD 및 Deadtime 자동계산 ---------------------// | |
78 | + unsigned int HSPCLKDIV = 0, CLKDIV = 0, CTRMODE = 0, CTRDIV = 0; | |
79 | + | |
80 | + HSPCLKDIV = EPwm1Regs.TBCTL.bit.HSPCLKDIV; | |
81 | + CLKDIV = EPwm1Regs.TBCTL.bit.CLKDIV; | |
82 | + CTRMODE = EPwm1Regs.TBCTL.bit.CTRMODE; | |
83 | + | |
84 | + if (CTRMODE == 0 || CTRMODE == 1) CTRDIV = 1; // Up or Down count���� 1 Up-Down�� 2 | |
85 | + else if (CTRMODE == 2) CTRDIV = 2; | |
86 | + | |
87 | + Tbclk = (SystemClock / ((HSPCLKDIV + 1) * (CLKDIV + 1))); //Tbclk = SYSCLKOUT / (HSPCLKDIV �� CLKDIV) | |
88 | + | |
89 | + EPwm1Regs.TBPRD = PwmPrdCal(Pwm_Freq, Tbclk, CTRDIV); | |
90 | + EPwm1Regs.DBRED.bit.DBRED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
91 | + EPwm1Regs.DBFED.bit.DBFED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
92 | + | |
93 | + EDIS; | |
94 | + | |
95 | +} | |
96 | + | |
97 | +void InitEPwm2(float Pwm_Freq, float Pwm_Deadtime, unsigned int CTR_Mode, unsigned int Tbphs) | |
98 | +{ | |
99 | + float Tbclk = 0; | |
100 | + | |
101 | + EALLOW; | |
102 | + | |
103 | + //EPwm2Regs.TBPRD = Pwm_prd; // Set timer period | |
104 | + EPwm2Regs.TBPHS.bit.TBPHS = Tbphs; // Phase is 0 | |
105 | + EPwm2Regs.TBCTR = 0x0000; // Clear counter | |
106 | + | |
107 | + // Setup Tbclk | |
108 | + EPwm2Regs.TBCTL.bit.CTRMODE = CTR_Mode; // Count up | |
109 | + EPwm2Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Disable phase loading | |
110 | + EPwm2Regs.TBCTL.bit.PHSDIR = TB_DOWN; | |
111 | + | |
112 | + EPwm2Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; | |
113 | + EPwm2Regs.TBCTL.bit.PRDLD = TB_SHADOW; | |
114 | + //EPwm2Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; // Clock ratio to SYSCLKOUT | |
115 | + EPwm2Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT | |
116 | + EPwm2Regs.TBCTL.bit.CLKDIV = TB_DIV1; // Slow so we can observe on the scope | |
117 | + | |
118 | + EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; | |
119 | + EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; | |
120 | + EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_PRD; // load on CTR=Zero | |
121 | + EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_PRD; // load on CTR=Zero | |
122 | + | |
123 | +// EPwm2Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; | |
124 | +// EPwm2Regs.ETSEL.bit.INTEN = PWM1_INT_ENABLE; | |
125 | +// EPwm2Regs.ETPS.bit.INTPRD = ET_1ST; | |
126 | + | |
127 | + // Set actions | |
128 | + EPwm2Regs.AQCTLA.bit.CAU = AQ_CLEAR; // set actions for EPWM1A | |
129 | + EPwm2Regs.AQCTLA.bit.CAD = AQ_SET; | |
130 | + | |
131 | +// EPwm2Regs.AQCTLB.bit.CBU = AQ_CLEAR; // set actions for EPWM1B | |
132 | +// EPwm2Regs.AQCTLB.bit.CBD = AQ_SET; | |
133 | + | |
134 | + // Setup compare | |
135 | + EPwm2Regs.CMPA.bit.CMPA = 0; | |
136 | + EPwm2Regs.CMPB.bit.CMPB = 0; | |
137 | + | |
138 | + EPwm2Regs.TZCTL.bit.TZA = TZ_FORCE_LO; | |
139 | + EPwm2Regs.TZCTL.bit.TZB = TZ_FORCE_LO; | |
140 | + | |
141 | + // Active high complementary PWMs - Setup the deadband | |
142 | + EPwm2Regs.DBCTL.bit.IN_MODE = DBA_ALL; | |
143 | + EPwm2Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | |
144 | + EPwm2Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; | |
145 | + | |
146 | + //------------------TBPRD 및 Deadtime 자동계산 ---------------------// | |
147 | + unsigned int HSPCLKDIV = 0, CLKDIV = 0, CTRMODE = 0, CTRDIV = 0; | |
148 | + | |
149 | + HSPCLKDIV = EPwm2Regs.TBCTL.bit.HSPCLKDIV; | |
150 | + CLKDIV = EPwm2Regs.TBCTL.bit.CLKDIV; | |
151 | + CTRMODE = EPwm2Regs.TBCTL.bit.CTRMODE; | |
152 | + | |
153 | + if (CTRMODE == 0 || CTRMODE == 1) CTRDIV = 1; // Up or Down count : 1 Up-Down : 2 | |
154 | + else if (CTRMODE == 2) CTRDIV = 2; | |
155 | + | |
156 | + Tbclk = (SystemClock / ((HSPCLKDIV + 1) * (CLKDIV + 1))); //Tbclk = SYSCLKOUT / (HSPCLKDIV �� CLKDIV) | |
157 | + | |
158 | + EPwm2Regs.TBPRD = PwmPrdCal(Pwm_Freq, Tbclk, CTRDIV); | |
159 | + EPwm2Regs.DBRED.bit.DBRED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
160 | + EPwm2Regs.DBFED.bit.DBFED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
161 | + | |
162 | + EDIS; | |
163 | + | |
164 | +} | |
165 | + | |
166 | +void InitEPwm3(float Pwm_Freq, float Pwm_Deadtime, unsigned int CTR_Mode, unsigned int Tbphs) | |
167 | +{ | |
168 | + float Tbclk = 0; | |
169 | + | |
170 | + EALLOW; | |
171 | + | |
172 | + //EPwm3Regs.TBPRD = Pwm_prd; // Set timer period | |
173 | + EPwm3Regs.TBPHS.bit.TBPHS = Tbphs; // Phase is 0 | |
174 | + EPwm3Regs.TBCTR = 0x0000; // Clear counter | |
175 | + | |
176 | + // Setup Tbclk | |
177 | + EPwm3Regs.TBCTL.bit.CTRMODE = CTR_Mode; // Count up | |
178 | + EPwm3Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Disable phase loading | |
179 | + EPwm3Regs.TBCTL.bit.PHSDIR = TB_UP; | |
180 | + | |
181 | + EPwm3Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; | |
182 | + EPwm3Regs.TBCTL.bit.PRDLD = TB_SHADOW; | |
183 | + //EPwm3Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; // Clock ratio to SYSCLKOUT | |
184 | + EPwm3Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT | |
185 | + EPwm3Regs.TBCTL.bit.CLKDIV = TB_DIV1; // Slow so we can observe on the scope | |
186 | + | |
187 | + EPwm3Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; | |
188 | + EPwm3Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; | |
189 | + EPwm3Regs.CMPCTL.bit.LOADAMODE = CC_CTR_PRD; // load on CTR=Zero | |
190 | + EPwm3Regs.CMPCTL.bit.LOADBMODE = CC_CTR_PRD; // load on CTR=Zero | |
191 | + | |
192 | +// EPwm3Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; | |
193 | +// EPwm3Regs.ETSEL.bit.INTEN = PWM1_INT_ENABLE; | |
194 | +// EPwm3Regs.ETPS.bit.INTPRD = ET_1ST; | |
195 | + | |
196 | + // Set actions | |
197 | + EPwm3Regs.AQCTLA.bit.CAU = AQ_SET; // set actions for EPWM1A | |
198 | + EPwm3Regs.AQCTLA.bit.CAD = AQ_CLEAR; | |
199 | + | |
200 | +// EPwm3Regs.AQCTLB.bit.CBU = AQ_CLEAR; // set actions for EPWM1B | |
201 | +// EPwm3Regs.AQCTLB.bit.CBD = AQ_SET; | |
202 | + | |
203 | + // Setup compare | |
204 | + EPwm3Regs.CMPA.bit.CMPA = 0; | |
205 | + EPwm3Regs.CMPB.bit.CMPB = 0; | |
206 | + | |
207 | + EPwm3Regs.TZCTL.bit.TZA = TZ_FORCE_LO; | |
208 | + EPwm3Regs.TZCTL.bit.TZB = TZ_FORCE_LO; | |
209 | + | |
210 | + // Active high complementary PWMs - Setup the deadband | |
211 | + EPwm3Regs.DBCTL.bit.IN_MODE = DBA_ALL; | |
212 | + EPwm3Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | |
213 | + EPwm3Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; | |
214 | + | |
215 | +// EPwm3Regs.DBRED = Inv_Deadtime_prd; | |
216 | +// EPwm3Regs.DBFED = Inv_Deadtime_prd; | |
217 | + | |
218 | + //------------------TBPRD 및 Deadtime 자동계산 ---------------------// | |
219 | + unsigned int HSPCLKDIV = 0, CLKDIV = 0, CTRMODE = 0, CTRDIV = 0; | |
220 | + | |
221 | + HSPCLKDIV = EPwm3Regs.TBCTL.bit.HSPCLKDIV; | |
222 | + CLKDIV = EPwm3Regs.TBCTL.bit.CLKDIV; | |
223 | + CTRMODE = EPwm3Regs.TBCTL.bit.CTRMODE; | |
224 | + | |
225 | + if (CTRMODE == 0 || CTRMODE == 1) CTRDIV = 1; // Up or Down count���� 1 Up-Down�ϴ� 2 | |
226 | + else if (CTRMODE == 2) CTRDIV = 2; | |
227 | + | |
228 | + Tbclk = (SystemClock / ((HSPCLKDIV + 1) * (CLKDIV + 1))); //Tbclk = SYSCLKOUT / (HSPCLKDIV �� CLKDIV) | |
229 | + | |
230 | + EPwm3Regs.TBPRD = PwmPrdCal(Pwm_Freq, Tbclk, CTRDIV); | |
231 | + //EPwm3Regs.TBPHS.bit.TBPHS = PWMPrdCal(Pwm_Freq, Tbclk, CTRDIV) / 2; | |
232 | + EPwm3Regs.DBRED.bit.DBRED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
233 | + EPwm3Regs.DBFED.bit.DBFED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
234 | + | |
235 | + EDIS; | |
236 | + | |
237 | +} | |
238 | + | |
239 | +void InitEPwm4(float Pwm_Freq, float Pwm_Deadtime, unsigned int CTR_Mode, unsigned int Tbphs) | |
240 | +{ | |
241 | + float Tbclk = 0; | |
242 | + | |
243 | + EALLOW; | |
244 | + | |
245 | + //EPwm4Regs.TBPRD = Pwm_prd; // Set timer period | |
246 | + EPwm4Regs.TBPHS.bit.TBPHS = Tbphs; // Phase is 0 | |
247 | + EPwm4Regs.TBCTR = 0x0000; // Clear counter | |
248 | + | |
249 | + // Setup Tbclk | |
250 | + EPwm4Regs.TBCTL.bit.CTRMODE = CTR_Mode; // Count up | |
251 | + EPwm4Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Disable phase loading | |
252 | + //EPwm4Regs.TBCTL.bit.PHSDIR = TB_DOWN; | |
253 | + | |
254 | + EPwm4Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; | |
255 | + EPwm4Regs.TBCTL.bit.PRDLD = TB_SHADOW; | |
256 | + //EPwm4Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; // Clock ratio to SYSCLKOUT | |
257 | + EPwm4Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT | |
258 | + EPwm4Regs.TBCTL.bit.CLKDIV = TB_DIV1; // Slow so we can observe on the scope | |
259 | + | |
260 | + EPwm4Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; | |
261 | + EPwm4Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; | |
262 | + EPwm4Regs.CMPCTL.bit.LOADAMODE = CC_CTR_PRD; // load on CTR=Zero | |
263 | + EPwm4Regs.CMPCTL.bit.LOADBMODE = CC_CTR_PRD; // load on CTR=Zero | |
264 | + | |
265 | +// EPwm4Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; | |
266 | +// EPwm4Regs.ETSEL.bit.INTEN = PWM1_INT_ENABLE; | |
267 | +// EPwm4Regs.ETPS.bit.INTPRD = ET_1ST; | |
268 | + | |
269 | + // Set actions | |
270 | + EPwm4Regs.AQCTLA.bit.CAU = AQ_CLEAR; // set actions for EPWM1A | |
271 | + EPwm4Regs.AQCTLA.bit.CAD = AQ_SET; | |
272 | + | |
273 | +// EPwm4Regs.AQCTLB.bit.CBU = AQ_CLEAR; // set actions for EPWM1B | |
274 | +// EPwm4Regs.AQCTLB.bit.CBD = AQ_SET; | |
275 | + | |
276 | + // Setup compare | |
277 | + EPwm4Regs.CMPA.bit.CMPA = 0; | |
278 | + EPwm4Regs.CMPB.bit.CMPB = 0; | |
279 | + | |
280 | + EPwm4Regs.TZCTL.bit.TZA = TZ_FORCE_LO; | |
281 | + EPwm4Regs.TZCTL.bit.TZB = TZ_FORCE_LO; | |
282 | + | |
283 | + // Active high complementary PWMs - Setup the deadband | |
284 | + EPwm4Regs.DBCTL.bit.IN_MODE = DBA_ALL; | |
285 | + EPwm4Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | |
286 | + EPwm4Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; | |
287 | + | |
288 | +// EPwm4Regs.DBRED = Inv_Deadtime_prd; | |
289 | +// EPwm4Regs.DBFED = Inv_Deadtime_prd; | |
290 | + | |
291 | + //------------------TBPRD 및 Deadtime 자동계산 ---------------------// | |
292 | + unsigned int HSPCLKDIV = 0, CLKDIV = 0, CTRMODE = 0, CTRDIV = 0; | |
293 | + | |
294 | + HSPCLKDIV = EPwm4Regs.TBCTL.bit.HSPCLKDIV; | |
295 | + CLKDIV = EPwm4Regs.TBCTL.bit.CLKDIV; | |
296 | + CTRMODE = EPwm4Regs.TBCTL.bit.CTRMODE; | |
297 | + | |
298 | + if (CTRMODE == 0 || CTRMODE == 1) CTRDIV = 1; // Up or Down count���� 1 Up-Down�ϴ� 2 | |
299 | + else if (CTRMODE == 2) CTRDIV = 2; | |
300 | + | |
301 | + Tbclk = (SystemClock / ((HSPCLKDIV + 1) * (CLKDIV + 1))); //Tbclk = SYSCLKOUT / (HSPCLKDIV �� CLKDIV) | |
302 | + | |
303 | + EPwm4Regs.TBPRD = PwmPrdCal(Pwm_Freq, Tbclk, CTRDIV); | |
304 | + //EPwm4Regs.TBPHS.bit.TBPHS = PWMPrdCal(Pwm_Freq, Tbclk, CTRDIV) / 2; | |
305 | + EPwm4Regs.DBRED.bit.DBRED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
306 | + EPwm4Regs.DBFED.bit.DBFED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
307 | + | |
308 | + EDIS; | |
309 | + | |
310 | +} | |
311 | + | |
312 | +void InitEPwm5(float Pwm_Freq, float Pwm_Deadtime, unsigned int CTR_Mode, unsigned int Tbphs) | |
313 | +{ | |
314 | + float Tbclk = 0; | |
315 | + | |
316 | + EALLOW; | |
317 | + | |
318 | + //EPwm5Regs.TBPRD = Pwm_prd; // Set timer period | |
319 | + EPwm5Regs.TBPHS.bit.TBPHS = Tbphs; // Phase is 0 | |
320 | + EPwm5Regs.TBCTR = 0x0000; // Clear counter | |
321 | + | |
322 | + // Setup Tbclk | |
323 | + EPwm5Regs.TBCTL.bit.CTRMODE = CTR_Mode; // Count up | |
324 | + EPwm5Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Disable phase loading | |
325 | + //EPwm4Regs.TBCTL.bit.PHSDIR = TB_DOWN; | |
326 | + | |
327 | + EPwm5Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; | |
328 | + EPwm5Regs.TBCTL.bit.PRDLD = TB_SHADOW; | |
329 | + //EPwm5Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; // Clock ratio to SYSCLKOUT | |
330 | + EPwm5Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT | |
331 | + EPwm5Regs.TBCTL.bit.CLKDIV = TB_DIV1; // Slow so we can observe on the scope | |
332 | + | |
333 | + EPwm5Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; | |
334 | + EPwm5Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; | |
335 | + EPwm5Regs.CMPCTL.bit.LOADAMODE = CC_CTR_PRD; // load on CTR=Zero | |
336 | + EPwm5Regs.CMPCTL.bit.LOADBMODE = CC_CTR_PRD; // load on CTR=Zero | |
337 | + | |
338 | +// EPwm5Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; | |
339 | +// EPwm5Regs.ETSEL.bit.INTEN = PWM1_INT_ENABLE; | |
340 | +// EPwm5Regs.ETPS.bit.INTPRD = ET_1ST; | |
341 | + | |
342 | + // Set actions | |
343 | + EPwm5Regs.AQCTLA.bit.CAU = AQ_SET; // set actions for EPWM1A | |
344 | + EPwm5Regs.AQCTLA.bit.CAD = AQ_CLEAR; | |
345 | + | |
346 | +// EPwm5Regs.AQCTLB.bit.CBU = AQ_CLEAR; // set actions for EPWM1B | |
347 | +// EPwm5Regs.AQCTLB.bit.CBD = AQ_SET; | |
348 | + | |
349 | + // Setup compare | |
350 | + EPwm5Regs.CMPA.bit.CMPA = 0; | |
351 | + EPwm5Regs.CMPB.bit.CMPB = 0; | |
352 | + | |
353 | + EPwm5Regs.TZCTL.bit.TZA = TZ_FORCE_LO; | |
354 | + EPwm5Regs.TZCTL.bit.TZB = TZ_FORCE_LO; | |
355 | + | |
356 | + // Active high complementary PWMs - Setup the deadband | |
357 | + EPwm5Regs.DBCTL.bit.IN_MODE = DBA_ALL; | |
358 | + EPwm5Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | |
359 | + EPwm5Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; | |
360 | + | |
361 | +// EPwm5Regs.DBRED = Inv_Deadtime_prd; | |
362 | +// EPwm5Regs.DBFED = Inv_Deadtime_prd; | |
363 | + | |
364 | + //------------------TBPRD 및 Deadtime 자동계산 ---------------------// | |
365 | + unsigned int HSPCLKDIV = 0, CLKDIV = 0, CTRMODE = 0, CTRDIV = 0; | |
366 | + | |
367 | + HSPCLKDIV = EPwm5Regs.TBCTL.bit.HSPCLKDIV; | |
368 | + CLKDIV = EPwm5Regs.TBCTL.bit.CLKDIV; | |
369 | + CTRMODE = EPwm5Regs.TBCTL.bit.CTRMODE; | |
370 | + | |
371 | + if (CTRMODE == 0 || CTRMODE == 1) CTRDIV = 1; // Up or Down count���� 1 Up-Down�ϴ� 2 | |
372 | + else if (CTRMODE == 2) CTRDIV = 2; | |
373 | + | |
374 | + Tbclk = (SystemClock / ((HSPCLKDIV + 1) * (CLKDIV + 1))); //Tbclk = SYSCLKOUT / (HSPCLKDIV �� CLKDIV) | |
375 | + | |
376 | + EPwm5Regs.TBPRD = PwmPrdCal(Pwm_Freq, Tbclk, CTRDIV); | |
377 | + //EPwm5Regs.TBPHS.bit.TBPHS = PWMPrdCal(Pwm_Freq, Tbclk, CTRDIV) / 2; | |
378 | + EPwm5Regs.DBRED.bit.DBRED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
379 | + EPwm5Regs.DBFED.bit.DBFED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
380 | + | |
381 | + EDIS; | |
382 | + | |
383 | +} | |
384 | + | |
385 | +void InitEPwm6(float Pwm_Freq, float Pwm_Deadtime, unsigned int CTR_Mode, unsigned int Tbphs) | |
386 | +{ | |
387 | + float Tbclk = 0; | |
388 | + | |
389 | + EALLOW; | |
390 | + | |
391 | + //EPwm6Regs.TBPRD = Pwm_prd; // Set timer period | |
392 | + EPwm6Regs.TBPHS.bit.TBPHS = Tbphs; // Phase is 0 | |
393 | + EPwm6Regs.TBCTR = 0x0000; // Clear counter | |
394 | + | |
395 | + // Setup Tbclk | |
396 | + EPwm6Regs.TBCTL.bit.CTRMODE = CTR_Mode; // Count up | |
397 | + EPwm6Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Disable phase loading | |
398 | + //EPwm4Regs.TBCTL.bit.PHSDIR = TB_DOWN; | |
399 | + | |
400 | + EPwm6Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; | |
401 | + EPwm6Regs.TBCTL.bit.PRDLD = TB_SHADOW; | |
402 | + //EPwm6Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; // Clock ratio to SYSCLKOUT | |
403 | + EPwm6Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT | |
404 | + EPwm6Regs.TBCTL.bit.CLKDIV = TB_DIV1; // Slow so we can observe on the scope | |
405 | + | |
406 | + EPwm6Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; | |
407 | + EPwm6Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; | |
408 | + EPwm6Regs.CMPCTL.bit.LOADAMODE = CC_CTR_PRD; // load on CTR=Zero | |
409 | + EPwm6Regs.CMPCTL.bit.LOADBMODE = CC_CTR_PRD; // load on CTR=Zero | |
410 | + | |
411 | +// EPwm6Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; | |
412 | +// EPwm6Regs.ETSEL.bit.INTEN = PWM1_INT_ENABLE; | |
413 | +// EPwm6Regs.ETPS.bit.INTPRD = ET_1ST; | |
414 | + | |
415 | + // Set actions | |
416 | + EPwm6Regs.AQCTLA.bit.CAU = AQ_CLEAR; // set actions for EPWM1A | |
417 | + EPwm6Regs.AQCTLA.bit.CAD = AQ_SET; | |
418 | + | |
419 | +// EPwm6Regs.AQCTLB.bit.CBU = AQ_CLEAR; // set actions for EPWM1B | |
420 | +// EPwm6Regs.AQCTLB.bit.CBD = AQ_SET; | |
421 | + | |
422 | + // Setup compare | |
423 | + EPwm6Regs.CMPA.bit.CMPA = 0; | |
424 | + EPwm6Regs.CMPB.bit.CMPB = 0; | |
425 | + | |
426 | + EPwm6Regs.TZCTL.bit.TZA = TZ_FORCE_LO; | |
427 | + EPwm6Regs.TZCTL.bit.TZB = TZ_FORCE_LO; | |
428 | + | |
429 | + // Active high complementary PWMs - Setup the deadband | |
430 | + EPwm6Regs.DBCTL.bit.IN_MODE = DBA_ALL; | |
431 | + EPwm6Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | |
432 | + EPwm6Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; | |
433 | + | |
434 | +// EPwm6Regs.DBRED = Inv_Deadtime_prd; | |
435 | +// EPwm6Regs.DBFED = Inv_Deadtime_prd; | |
436 | + | |
437 | + //------------------TBPRD 및 Deadtime 자동계산 ---------------------// | |
438 | + unsigned int HSPCLKDIV = 0, CLKDIV = 0, CTRMODE = 0, CTRDIV = 0; | |
439 | + | |
440 | + HSPCLKDIV = EPwm6Regs.TBCTL.bit.HSPCLKDIV; | |
441 | + CLKDIV = EPwm6Regs.TBCTL.bit.CLKDIV; | |
442 | + CTRMODE = EPwm6Regs.TBCTL.bit.CTRMODE; | |
443 | + | |
444 | + if (CTRMODE == 0 || CTRMODE == 1) CTRDIV = 1; // Up or Down count���� 1 Up-Down�ϴ� 2 | |
445 | + else if (CTRMODE == 2) CTRDIV = 2; | |
446 | + | |
447 | + Tbclk = (SystemClock / ((HSPCLKDIV + 1) * (CLKDIV + 1))); //Tbclk = SYSCLKOUT / (HSPCLKDIV �� CLKDIV) | |
448 | + | |
449 | + EPwm6Regs.TBPRD = PwmPrdCal(Pwm_Freq, Tbclk, CTRDIV); | |
450 | + //EPwm6Regs.TBPHS.bit.TBPHS = PWMPrdCal(Pwm_Freq, Tbclk, CTRDIV) / 2; | |
451 | + EPwm6Regs.DBRED.bit.DBRED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
452 | + EPwm6Regs.DBFED.bit.DBFED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
453 | + | |
454 | + EDIS; | |
455 | + | |
456 | +} | |
457 | + | |
458 | +void InitEPwm7(float Pwm_Freq, float Pwm_Deadtime, unsigned int CTR_Mode, unsigned int Tbphs) | |
459 | +{ | |
460 | + float Tbclk = 0; | |
461 | + | |
462 | + EALLOW; | |
463 | + | |
464 | + //EPwm7Regs.TBPRD = Pwm_prd; // Set timer period | |
465 | + EPwm7Regs.TBPHS.bit.TBPHS = Tbphs; // Phase is 0 | |
466 | + EPwm7Regs.TBCTR = 0x0000; // Clear counter | |
467 | + | |
468 | + // Setup Tbclk | |
469 | + EPwm7Regs.TBCTL.bit.CTRMODE = CTR_Mode; // Count up | |
470 | + EPwm7Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Disable phase loading | |
471 | + //EPwm4Regs.TBCTL.bit.PHSDIR = TB_DOWN; | |
472 | + | |
473 | + EPwm7Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; | |
474 | + EPwm7Regs.TBCTL.bit.PRDLD = TB_SHADOW; | |
475 | + //EPwm7Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; // Clock ratio to SYSCLKOUT | |
476 | + EPwm7Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT | |
477 | + EPwm7Regs.TBCTL.bit.CLKDIV = TB_DIV1; // Slow so we can observe on the scope | |
478 | + | |
479 | + EPwm7Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; | |
480 | + EPwm7Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; | |
481 | + EPwm7Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO_PRD; // load on CTR=Zero | |
482 | + EPwm7Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO_PRD; // load on CTR=Zero | |
483 | + | |
484 | +// EPwm7Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; | |
485 | +// EPwm7Regs.ETSEL.bit.INTEN = PWM1_INT_ENABLE; | |
486 | +// EPwm7Regs.ETPS.bit.INTPRD = ET_1ST; | |
487 | + | |
488 | + // Set actions | |
489 | + EPwm7Regs.AQCTLA.bit.CAU = AQ_CLEAR; // set actions for EPWM1A | |
490 | + EPwm7Regs.AQCTLA.bit.CAD = AQ_SET; | |
491 | + | |
492 | +// EPwm7Regs.AQCTLB.bit.CBU = AQ_CLEAR; // set actions for EPWM1B | |
493 | +// EPwm7Regs.AQCTLB.bit.CBD = AQ_SET; | |
494 | + | |
495 | + // Setup compare | |
496 | + EPwm7Regs.CMPA.bit.CMPA = 0; | |
497 | + EPwm7Regs.CMPB.bit.CMPB = 0; | |
498 | + | |
499 | + EPwm7Regs.TZCTL.bit.TZA = TZ_FORCE_LO; | |
500 | + EPwm7Regs.TZCTL.bit.TZB = TZ_FORCE_LO; | |
501 | + | |
502 | + // Active high complementary PWMs - Setup the deadband | |
503 | + EPwm7Regs.DBCTL.bit.IN_MODE = DBA_ALL; | |
504 | + EPwm7Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | |
505 | + EPwm7Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; | |
506 | + | |
507 | +// EPwm7Regs.DBRED = Inv_Deadtime_prd; | |
508 | +// EPwm7Regs.DBFED = Inv_Deadtime_prd; | |
509 | + | |
510 | + //------------------TBPRD 및 Deadtime 자동계산 ---------------------// | |
511 | + unsigned int HSPCLKDIV = 0, CLKDIV = 0, CTRMODE = 0, CTRDIV = 0; | |
512 | + | |
513 | + HSPCLKDIV = EPwm7Regs.TBCTL.bit.HSPCLKDIV; | |
514 | + CLKDIV = EPwm7Regs.TBCTL.bit.CLKDIV; | |
515 | + CTRMODE = EPwm7Regs.TBCTL.bit.CTRMODE; | |
516 | + | |
517 | + if (CTRMODE == 0 || CTRMODE == 1) CTRDIV = 1; // Up or Down count���� 1 Up-Down�ϴ� 2 | |
518 | + else if (CTRMODE == 2) CTRDIV = 2; | |
519 | + | |
520 | + Tbclk = (SystemClock / ((HSPCLKDIV + 1) * (CLKDIV + 1))); //Tbclk = SYSCLKOUT / (HSPCLKDIV �� CLKDIV) | |
521 | + | |
522 | + EPwm7Regs.TBPRD = PwmPrdCal(Pwm_Freq, Tbclk, CTRDIV); | |
523 | + //EPwm7Regs.TBPHS.bit.TBPHS = PWMPrdCal(Pwm_Freq, Tbclk, CTRDIV) / 2; | |
524 | + EPwm7Regs.DBRED.bit.DBRED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
525 | + EPwm7Regs.DBFED.bit.DBFED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
526 | + | |
527 | + EDIS; | |
528 | + | |
529 | +} | |
530 | + | |
531 | +void InitEPwm8(float Pwm_Freq, float Pwm_Deadtime, unsigned int CTR_Mode, unsigned int Tbphs) | |
532 | +{ | |
533 | + float Tbclk = 0; | |
534 | + | |
535 | + EALLOW; | |
536 | + | |
537 | + //EPwm8Regs.TBPRD = Pwm_prd; // Set timer period | |
538 | + EPwm8Regs.TBPHS.bit.TBPHS = Tbphs; // Phase is 0 | |
539 | + EPwm8Regs.TBCTR = 0x0000; // Clear counter | |
540 | + | |
541 | + // Setup Tbclk | |
542 | + EPwm8Regs.TBCTL.bit.CTRMODE = CTR_Mode; // Count up | |
543 | + EPwm8Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Disable phase loading | |
544 | + //EPwm4Regs.TBCTL.bit.PHSDIR = TB_DOWN; | |
545 | + | |
546 | + EPwm8Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; | |
547 | + EPwm8Regs.TBCTL.bit.PRDLD = TB_SHADOW; | |
548 | + //EPwm8Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; // Clock ratio to SYSCLKOUT | |
549 | + EPwm8Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT | |
550 | + EPwm8Regs.TBCTL.bit.CLKDIV = TB_DIV1; // Slow so we can observe on the scope | |
551 | + | |
552 | + EPwm8Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; | |
553 | + EPwm8Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; | |
554 | + EPwm8Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO_PRD; // load on CTR=Zero | |
555 | + EPwm8Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO_PRD; // load on CTR=Zero | |
556 | + | |
557 | +// EPwm8Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; | |
558 | +// EPwm8Regs.ETSEL.bit.INTEN = PWM1_INT_ENABLE; | |
559 | +// EPwm8Regs.ETPS.bit.INTPRD = ET_1ST; | |
560 | + | |
561 | + // Set actions | |
562 | + EPwm8Regs.AQCTLA.bit.CAU = AQ_CLEAR; // set actions for EPWM1A | |
563 | + EPwm8Regs.AQCTLA.bit.CAD = AQ_SET; | |
564 | + | |
565 | +// EPwm8Regs.AQCTLB.bit.CBU = AQ_CLEAR; // set actions for EPWM1B | |
566 | +// EPwm8Regs.AQCTLB.bit.CBD = AQ_SET; | |
567 | + | |
568 | + // Setup compare | |
569 | + EPwm8Regs.CMPA.bit.CMPA = 0; | |
570 | + EPwm8Regs.CMPB.bit.CMPB = 0; | |
571 | + | |
572 | + EPwm8Regs.TZCTL.bit.TZA = TZ_FORCE_LO; | |
573 | + EPwm8Regs.TZCTL.bit.TZB = TZ_FORCE_LO; | |
574 | + | |
575 | + // Active high complementary PWMs - Setup the deadband | |
576 | + EPwm8Regs.DBCTL.bit.IN_MODE = DBA_ALL; | |
577 | + EPwm8Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | |
578 | + EPwm8Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; | |
579 | + | |
580 | +// EPwm8Regs.DBRED = Inv_Deadtime_prd; | |
581 | +// EPwm8Regs.DBFED = Inv_Deadtime_prd; | |
582 | + | |
583 | + //------------------TBPRD 및 Deadtime 자동계산 ---------------------// | |
584 | + unsigned int HSPCLKDIV = 0, CLKDIV = 0, CTRMODE = 0, CTRDIV = 0; | |
585 | + | |
586 | + HSPCLKDIV = EPwm8Regs.TBCTL.bit.HSPCLKDIV; | |
587 | + CLKDIV = EPwm8Regs.TBCTL.bit.CLKDIV; | |
588 | + CTRMODE = EPwm8Regs.TBCTL.bit.CTRMODE; | |
589 | + | |
590 | + if (CTRMODE == 0 || CTRMODE == 1) CTRDIV = 1; // Up or Down count���� 1 Up-Down�ϴ� 2 | |
591 | + else if (CTRMODE == 2) CTRDIV = 2; | |
592 | + | |
593 | + Tbclk = (SystemClock / ((HSPCLKDIV + 1) * (CLKDIV + 1))); //Tbclk = SYSCLKOUT / (HSPCLKDIV �� CLKDIV) | |
594 | + | |
595 | + EPwm8Regs.TBPRD = PwmPrdCal(Pwm_Freq, Tbclk, CTRDIV); | |
596 | + //EPwm8Regs.TBPHS.bit.TBPHS = PWMPrdCal(Pwm_Freq, Tbclk, CTRDIV) / 2; | |
597 | + EPwm8Regs.DBRED.bit.DBRED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
598 | + EPwm8Regs.DBFED.bit.DBFED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
599 | + | |
600 | + EDIS; | |
601 | +} | |
602 | + | |
603 | +void InitEPwm9(float Pwm_Freq, float Pwm_Deadtime, unsigned int CTR_Mode, unsigned int Tbphs) | |
604 | +{ | |
605 | + float Tbclk = 0; | |
606 | + | |
607 | + EALLOW; | |
608 | + | |
609 | + //EPwm9Regs.TBPRD = Pwm_prd; // Set timer period | |
610 | + EPwm9Regs.TBPHS.bit.TBPHS = Tbphs; // Phase is 0 | |
611 | + EPwm9Regs.TBCTR = 0x0000; // Clear counter | |
612 | + | |
613 | + // Setup Tbclk | |
614 | + EPwm9Regs.TBCTL.bit.CTRMODE = CTR_Mode; // Count up | |
615 | + EPwm9Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Disable phase loading | |
616 | + //EPwm4Regs.TBCTL.bit.PHSDIR = TB_DOWN; | |
617 | + | |
618 | + EPwm9Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; | |
619 | + EPwm9Regs.TBCTL.bit.PRDLD = TB_SHADOW; | |
620 | + //EPwm9Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; // Clock ratio to SYSCLKOUT | |
621 | + EPwm9Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT | |
622 | + EPwm9Regs.TBCTL.bit.CLKDIV = TB_DIV1; // Slow so we can observe on the scope | |
623 | + | |
624 | + EPwm9Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; | |
625 | + EPwm9Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; | |
626 | + EPwm9Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO_PRD; // load on CTR=Zero | |
627 | + EPwm9Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO_PRD; // load on CTR=Zero | |
628 | + | |
629 | +// EPwm9Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; | |
630 | +// EPwm9Regs.ETSEL.bit.INTEN = PWM1_INT_ENABLE; | |
631 | +// EPwm9Regs.ETPS.bit.INTPRD = ET_1ST; | |
632 | + | |
633 | + // Set actions | |
634 | + EPwm9Regs.AQCTLA.bit.CAU = AQ_CLEAR; // set actions for EPWM1A | |
635 | + EPwm9Regs.AQCTLA.bit.CAD = AQ_SET; | |
636 | + | |
637 | +// EPwm9Regs.AQCTLB.bit.CBU = AQ_CLEAR; // set actions for EPWM1B | |
638 | +// EPwm9Regs.AQCTLB.bit.CBD = AQ_SET; | |
639 | + | |
640 | + // Setup compare | |
641 | + EPwm9Regs.CMPA.bit.CMPA = 0; | |
642 | + EPwm9Regs.CMPB.bit.CMPB = 0; | |
643 | + | |
644 | + EPwm9Regs.TZCTL.bit.TZA = TZ_FORCE_LO; | |
645 | + EPwm9Regs.TZCTL.bit.TZB = TZ_FORCE_LO; | |
646 | + | |
647 | + // Active high complementary PWMs - Setup the deadband | |
648 | + EPwm9Regs.DBCTL.bit.IN_MODE = DBA_ALL; | |
649 | + EPwm9Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | |
650 | + EPwm9Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; | |
651 | + | |
652 | +// EPwm9Regs.DBRED = Inv_Deadtime_prd; | |
653 | +// EPwm9Regs.DBFED = Inv_Deadtime_prd; | |
654 | + | |
655 | + //------------------TBPRD 및 Deadtime 자동계산 ---------------------// | |
656 | + unsigned int HSPCLKDIV = 0, CLKDIV = 0, CTRMODE = 0, CTRDIV = 0; | |
657 | + | |
658 | + HSPCLKDIV = EPwm9Regs.TBCTL.bit.HSPCLKDIV; | |
659 | + CLKDIV = EPwm9Regs.TBCTL.bit.CLKDIV; | |
660 | + CTRMODE = EPwm9Regs.TBCTL.bit.CTRMODE; | |
661 | + | |
662 | + if (CTRMODE == 0 || CTRMODE == 1) CTRDIV = 1; // Up or Down count���� 1 Up-Down�ϴ� 2 | |
663 | + else if (CTRMODE == 2) CTRDIV = 2; | |
664 | + | |
665 | + Tbclk = (SystemClock / ((HSPCLKDIV + 1) * (CLKDIV + 1))); //Tbclk = SYSCLKOUT / (HSPCLKDIV �� CLKDIV) | |
666 | + | |
667 | + EPwm9Regs.TBPRD = PwmPrdCal(Pwm_Freq, Tbclk, CTRDIV); | |
668 | + //EPwm9Regs.TBPHS.bit.TBPHS = PWMPrdCal(Pwm_Freq, Tbclk, CTRDIV) / 2; | |
669 | + EPwm9Regs.DBRED.bit.DBRED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
670 | + EPwm9Regs.DBFED.bit.DBFED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
671 | + | |
672 | + EDIS; | |
673 | + | |
674 | +} | |
675 | + | |
676 | +void InitEPwm10(float Pwm_Freq, float Pwm_Deadtime, unsigned int CTR_Mode, unsigned int Tbphs) | |
677 | +{ | |
678 | + float Tbclk = 0; | |
679 | + | |
680 | + EALLOW; | |
681 | + | |
682 | + //EPwm10Regs.TBPRD = Pwm_prd; // Set timer period | |
683 | + EPwm10Regs.TBPHS.bit.TBPHS = Tbphs; // Phase is 0 | |
684 | + EPwm10Regs.TBCTR = 0x0000; // Clear counter | |
685 | + | |
686 | + // Setup Tbclk | |
687 | + EPwm10Regs.TBCTL.bit.CTRMODE = CTR_Mode; // Count up | |
688 | + EPwm10Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Disable phase loading | |
689 | + //EPwm4Regs.TBCTL.bit.PHSDIR = TB_DOWN; | |
690 | + | |
691 | + EPwm10Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; | |
692 | + EPwm10Regs.TBCTL.bit.PRDLD = TB_SHADOW; | |
693 | + //EPwm10Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; // Clock ratio to SYSCLKOUT | |
694 | + EPwm10Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT | |
695 | + EPwm10Regs.TBCTL.bit.CLKDIV = TB_DIV1; // Slow so we can observe on the scope | |
696 | + | |
697 | + EPwm10Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; | |
698 | + EPwm10Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; | |
699 | + EPwm10Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO_PRD; // load on CTR=Zero | |
700 | + EPwm10Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO_PRD; // load on CTR=Zero | |
701 | + | |
702 | +// EPwm10Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; | |
703 | +// EPwm10Regs.ETSEL.bit.INTEN = PWM1_INT_ENABLE; | |
704 | +// EPwm10Regs.ETPS.bit.INTPRD = ET_1ST; | |
705 | + | |
706 | + // Set actions | |
707 | + EPwm10Regs.AQCTLA.bit.CAU = AQ_CLEAR; // set actions for EPWM1A | |
708 | + EPwm10Regs.AQCTLA.bit.CAD = AQ_SET; | |
709 | + | |
710 | +// EPwm10Regs.AQCTLB.bit.CBU = AQ_CLEAR; // set actions for EPWM1B | |
711 | +// EPwm10Regs.AQCTLB.bit.CBD = AQ_SET; | |
712 | + | |
713 | + // Setup compare | |
714 | + EPwm10Regs.CMPA.bit.CMPA = 0; | |
715 | + EPwm10Regs.CMPB.bit.CMPB = 0; | |
716 | + | |
717 | + EPwm10Regs.TZCTL.bit.TZA = TZ_FORCE_LO; | |
718 | + EPwm10Regs.TZCTL.bit.TZB = TZ_FORCE_LO; | |
719 | + | |
720 | + // Active high complementary PWMs - Setup the deadband | |
721 | + EPwm10Regs.DBCTL.bit.IN_MODE = DBA_ALL; | |
722 | + EPwm10Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | |
723 | + EPwm10Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; | |
724 | + | |
725 | +// EPwm10Regs.DBRED = Inv_Deadtime_prd; | |
726 | +// EPwm10Regs.DBFED = Inv_Deadtime_prd; | |
727 | + | |
728 | + //------------------TBPRD 및 Deadtime 자동계산 ---------------------// | |
729 | + unsigned int HSPCLKDIV = 0, CLKDIV = 0, CTRMODE = 0, CTRDIV = 0; | |
730 | + | |
731 | + HSPCLKDIV = EPwm10Regs.TBCTL.bit.HSPCLKDIV; | |
732 | + CLKDIV = EPwm10Regs.TBCTL.bit.CLKDIV; | |
733 | + CTRMODE = EPwm10Regs.TBCTL.bit.CTRMODE; | |
734 | + | |
735 | + if (CTRMODE == 0 || CTRMODE == 1) CTRDIV = 1; // Up or Down count���� 1 Up-Down�ϴ� 2 | |
736 | + else if (CTRMODE == 2) CTRDIV = 2; | |
737 | + | |
738 | + Tbclk = (SystemClock / ((HSPCLKDIV + 1) * (CLKDIV + 1))); //Tbclk = SYSCLKOUT / (HSPCLKDIV �� CLKDIV) | |
739 | + | |
740 | + EPwm10Regs.TBPRD = PwmPrdCal(Pwm_Freq, Tbclk, CTRDIV); | |
741 | + //EPwm10Regs.TBPHS.bit.TBPHS = PWMPrdCal(Pwm_Freq, Tbclk, CTRDIV) / 2; | |
742 | + EPwm10Regs.DBRED.bit.DBRED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
743 | + EPwm10Regs.DBFED.bit.DBFED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
744 | + | |
745 | + EDIS; | |
746 | + | |
747 | +} | |
748 | + | |
749 | +void InitEPwm11(float Pwm_Freq, float Pwm_Deadtime, unsigned int CTR_Mode, unsigned int Tbphs) | |
750 | +{ | |
751 | + float Tbclk = 0; | |
752 | + | |
753 | + EALLOW; | |
754 | + | |
755 | + //EPwm11Regs.TBPRD = Pwm_prd; // Set timer period | |
756 | + EPwm11Regs.TBPHS.bit.TBPHS = Tbphs; // Phase is 0 | |
757 | + EPwm11Regs.TBCTR = 0x0000; // Clear counter | |
758 | + | |
759 | + // Setup Tbclk | |
760 | + EPwm11Regs.TBCTL.bit.CTRMODE = CTR_Mode; // Count up | |
761 | + EPwm11Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Disable phase loading | |
762 | + //EPwm4Regs.TBCTL.bit.PHSDIR = TB_DOWN; | |
763 | + | |
764 | + EPwm11Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; | |
765 | + EPwm11Regs.TBCTL.bit.PRDLD = TB_SHADOW; | |
766 | + //EPwm11Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; // Clock ratio to SYSCLKOUT | |
767 | + EPwm11Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT | |
768 | + EPwm11Regs.TBCTL.bit.CLKDIV = TB_DIV1; // Slow so we can observe on the scope | |
769 | + | |
770 | + EPwm11Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; | |
771 | + EPwm11Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; | |
772 | + EPwm11Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO_PRD; // load on CTR=Zero | |
773 | + EPwm11Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO_PRD; // load on CTR=Zero | |
774 | + | |
775 | +// EPwm11Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; | |
776 | +// EPwm11Regs.ETSEL.bit.INTEN = PWM1_INT_ENABLE; | |
777 | +// EPwm11Regs.ETPS.bit.INTPRD = ET_1ST; | |
778 | + | |
779 | + // Set actions | |
780 | + EPwm11Regs.AQCTLA.bit.CAU = AQ_CLEAR; // set actions for EPWM1A | |
781 | + EPwm11Regs.AQCTLA.bit.CAD = AQ_SET; | |
782 | + | |
783 | +// EPwm11Regs.AQCTLB.bit.CBU = AQ_CLEAR; // set actions for EPWM1B | |
784 | +// EPwm11Regs.AQCTLB.bit.CBD = AQ_SET; | |
785 | + | |
786 | + // Setup compare | |
787 | + EPwm11Regs.CMPA.bit.CMPA = 0; | |
788 | + EPwm11Regs.CMPB.bit.CMPB = 0; | |
789 | + | |
790 | + EPwm11Regs.TZCTL.bit.TZA = TZ_FORCE_LO; | |
791 | + EPwm11Regs.TZCTL.bit.TZB = TZ_FORCE_LO; | |
792 | + | |
793 | + // Active high complementary PWMs - Setup the deadband | |
794 | + EPwm11Regs.DBCTL.bit.IN_MODE = DBA_ALL; | |
795 | + EPwm11Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | |
796 | + EPwm11Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; | |
797 | + | |
798 | +// EPwm11Regs.DBRED = Inv_Deadtime_prd; | |
799 | +// EPwm11Regs.DBFED = Inv_Deadtime_prd; | |
800 | + | |
801 | + //------------------TBPRD 및 Deadtime 자동계산 ---------------------// | |
802 | + unsigned int HSPCLKDIV = 0, CLKDIV = 0, CTRMODE = 0, CTRDIV = 0; | |
803 | + | |
804 | + HSPCLKDIV = EPwm11Regs.TBCTL.bit.HSPCLKDIV; | |
805 | + CLKDIV = EPwm11Regs.TBCTL.bit.CLKDIV; | |
806 | + CTRMODE = EPwm11Regs.TBCTL.bit.CTRMODE; | |
807 | + | |
808 | + if (CTRMODE == 0 || CTRMODE == 1) CTRDIV = 1; // Up or Down count���� 1 Up-Down�ϴ� 2 | |
809 | + else if (CTRMODE == 2) CTRDIV = 2; | |
810 | + | |
811 | + Tbclk = (SystemClock / ((HSPCLKDIV + 1) * (CLKDIV + 1))); //Tbclk = SYSCLKOUT / (HSPCLKDIV �� CLKDIV) | |
812 | + | |
813 | + EPwm11Regs.TBPRD = PwmPrdCal(Pwm_Freq, Tbclk, CTRDIV); | |
814 | + //EPwm11Regs.TBPHS.bit.TBPHS = PWMPrdCal(Pwm_Freq, Tbclk, CTRDIV) / 2; | |
815 | + EPwm11Regs.DBRED.bit.DBRED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
816 | + EPwm11Regs.DBFED.bit.DBFED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
817 | + | |
818 | + EDIS; | |
819 | + | |
820 | +} | |
821 | + | |
822 | +void InitEPwm12(float Pwm_Freq, float Pwm_Deadtime, unsigned int CTR_Mode, unsigned int Tbphs) | |
823 | +{ | |
824 | + float Tbclk = 0; | |
825 | + | |
826 | + EALLOW; | |
827 | + | |
828 | + //EPwm12Regs.TBPRD = Pwm_prd; // Set timer period | |
829 | + EPwm12Regs.TBPHS.bit.TBPHS = Tbphs; // Phase is 0 | |
830 | + EPwm12Regs.TBCTR = 0x0000; // Clear counter | |
831 | + | |
832 | + // Setup Tbclk | |
833 | + EPwm12Regs.TBCTL.bit.CTRMODE = CTR_Mode; // Count up | |
834 | + EPwm12Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Disable phase loading | |
835 | + //EPwm4Regs.TBCTL.bit.PHSDIR = TB_DOWN; | |
836 | + | |
837 | + EPwm12Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; | |
838 | + EPwm12Regs.TBCTL.bit.PRDLD = TB_SHADOW; | |
839 | + //EPwm12Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; // Clock ratio to SYSCLKOUT | |
840 | + EPwm12Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT | |
841 | + EPwm12Regs.TBCTL.bit.CLKDIV = TB_DIV1; // Slow so we can observe on the scope | |
842 | + | |
843 | + EPwm12Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; | |
844 | + EPwm12Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; | |
845 | + EPwm12Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO_PRD; // load on CTR=Zero | |
846 | + EPwm12Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO_PRD; // load on CTR=Zero | |
847 | + | |
848 | +// EPwm12Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; | |
849 | +// EPwm12Regs.ETSEL.bit.INTEN = PWM1_INT_ENABLE; | |
850 | +// EPwm12Regs.ETPS.bit.INTPRD = ET_1ST; | |
851 | + | |
852 | + // Set actions | |
853 | + EPwm12Regs.AQCTLA.bit.CAU = AQ_CLEAR; // set actions for EPWM1A | |
854 | + EPwm12Regs.AQCTLA.bit.CAD = AQ_SET; | |
855 | + | |
856 | +// EPwm12Regs.AQCTLB.bit.CBU = AQ_CLEAR; // set actions for EPWM1B | |
857 | +// EPwm12Regs.AQCTLB.bit.CBD = AQ_SET; | |
858 | + | |
859 | + // Setup compare | |
860 | + EPwm12Regs.CMPA.bit.CMPA = 0; | |
861 | + EPwm12Regs.CMPB.bit.CMPB = 0; | |
862 | + | |
863 | + EPwm12Regs.TZCTL.bit.TZA = TZ_FORCE_LO; | |
864 | + EPwm12Regs.TZCTL.bit.TZB = TZ_FORCE_LO; | |
865 | + | |
866 | + // Active high complementary PWMs - Setup the deadband | |
867 | + EPwm12Regs.DBCTL.bit.IN_MODE = DBA_ALL; | |
868 | + EPwm12Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | |
869 | + EPwm12Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; | |
870 | + | |
871 | + //------------------TBPRD 및 Deadtime 자동계산 ---------------------// | |
872 | + unsigned int HSPCLKDIV = 0, CLKDIV = 0, CTRMODE = 0, CTRDIV = 0; | |
873 | + | |
874 | + HSPCLKDIV = EPwm12Regs.TBCTL.bit.HSPCLKDIV; | |
875 | + CLKDIV = EPwm12Regs.TBCTL.bit.CLKDIV; | |
876 | + CTRMODE = EPwm12Regs.TBCTL.bit.CTRMODE; | |
877 | + | |
878 | + if (CTRMODE == 0 || CTRMODE == 1) CTRDIV = 1; // Up or Down count : 1, Up-Down : 2 | |
879 | + else if (CTRMODE == 2) CTRDIV = 2; | |
880 | + | |
881 | + Tbclk = (SystemClock / ((HSPCLKDIV + 1) * (CLKDIV + 1))); //Tbclk = SYSCLKOUT / (HSPCLKDIV �� CLKDIV) | |
882 | + | |
883 | + EPwm12Regs.TBPRD = PwmPrdCal(Pwm_Freq, Tbclk, CTRDIV); | |
884 | + EPwm12Regs.DBRED.bit.DBRED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
885 | + EPwm12Regs.DBFED.bit.DBFED = PwmDeadtimeCal(Pwm_Deadtime, Tbclk); | |
886 | + | |
887 | + EDIS; | |
888 | +} | |
889 | + | |
890 | +unsigned int PwmPrdCal(float PWM_FREQ, float Tbclk, unsigned int CTRDIV) | |
891 | +{ | |
892 | + unsigned int Prd = 0; | |
893 | + | |
894 | +// Prd = (unsigned int) ((1/PWM_FREQ) * (Tbclk / CTRDIV ) + 1); | |
895 | + Prd = (unsigned int) ((1 / PWM_FREQ) * (Tbclk / CTRDIV)); | |
896 | + | |
897 | + return Prd; | |
898 | +} | |
899 | + | |
900 | +unsigned int PwmDeadtimeCal(float PWM_DEADTIME, float Tbclk) | |
901 | +{ | |
902 | + unsigned Prd = 0; | |
903 | + | |
904 | + //Prd = (unsigned int) (PWM_DEADTIME * Tbclk + 1); | |
905 | + Prd = (unsigned int) (PWM_DEADTIME * Tbclk); | |
906 | + | |
907 | + return Prd; | |
908 | +} | |
909 | + | |
910 | + | |
911 | + | |
912 | +void InitEPwm1Gpio() | |
913 | +{ | |
914 | + GPIO_setPadConfig(145, GPIO_PIN_TYPE_PULLUP); //EPMW1A | |
915 | + GPIO_setPadConfig(146, GPIO_PIN_TYPE_PULLUP); //EPWM1B | |
916 | + | |
917 | + GPIO_setPinConfig(GPIO_145_EPWM1A); //EPMW1A | |
918 | + GPIO_setPinConfig(GPIO_146_EPWM1B); //EPWM1B | |
919 | +} | |
920 | + | |
921 | +void InitEPwm2Gpio() | |
922 | +{ | |
923 | + GPIO_setPadConfig(147, GPIO_PIN_TYPE_PULLUP); //EPMW2A | |
924 | + GPIO_setPadConfig(148, GPIO_PIN_TYPE_PULLUP); //EPWM2B | |
925 | + | |
926 | + GPIO_setPinConfig(GPIO_147_EPWM2A); //EPMW2A | |
927 | + GPIO_setPinConfig(GPIO_148_EPWM2B); //EPWM2B | |
928 | +} | |
929 | + | |
930 | +void InitEPwm3Gpio() | |
931 | +{ | |
932 | + GPIO_setPadConfig(149, GPIO_PIN_TYPE_PULLUP); //EPMW3A | |
933 | + GPIO_setPadConfig(150, GPIO_PIN_TYPE_PULLUP); //EPWM3B | |
934 | + | |
935 | + GPIO_setPinConfig(GPIO_149_EPWM3A); //EPMW3A | |
936 | + GPIO_setPinConfig(GPIO_150_EPWM3B); //EPWM3B | |
937 | +} | |
938 | + | |
939 | +void InitEPwm4Gpio() | |
940 | +{ | |
941 | + GPIO_setPadConfig(151, GPIO_PIN_TYPE_PULLUP); //EPMW4A | |
942 | + GPIO_setPadConfig(152, GPIO_PIN_TYPE_PULLUP); //EPWM4B | |
943 | + | |
944 | + GPIO_setPinConfig(GPIO_151_EPWM4A); //EPMW4A | |
945 | + GPIO_setPinConfig(GPIO_152_EPWM4B); //EPWM4B | |
946 | +} | |
947 | + | |
948 | +void InitEPwm5Gpio() | |
949 | +{ | |
950 | + GPIO_setPadConfig(153, GPIO_PIN_TYPE_PULLUP); //EPMW5A | |
951 | + GPIO_setPadConfig(154, GPIO_PIN_TYPE_PULLUP); //EPWM5B | |
952 | + | |
953 | + GPIO_setPinConfig(GPIO_153_EPWM5A); //EPMW5A | |
954 | + GPIO_setPinConfig(GPIO_154_EPWM5B); //EPWM5B | |
955 | +} | |
956 | + | |
957 | +void InitEPwm6Gpio() | |
958 | +{ | |
959 | + GPIO_setPadConfig(155, GPIO_PIN_TYPE_PULLUP); //EPMW6A | |
960 | + GPIO_setPadConfig(156, GPIO_PIN_TYPE_PULLUP); //EPWM6B | |
961 | + | |
962 | + GPIO_setPinConfig(GPIO_155_EPWM6A); //EPMW6A | |
963 | + GPIO_setPinConfig(GPIO_156_EPWM6B); //EPWM6B | |
964 | +} | |
965 | + | |
966 | +void InitEPwm7Gpio() | |
967 | +{ | |
968 | + GPIO_setPadConfig(157, GPIO_PIN_TYPE_PULLUP); //EPMW7A | |
969 | + GPIO_setPadConfig(158, GPIO_PIN_TYPE_PULLUP); //EPWM7B | |
970 | + | |
971 | + GPIO_setPinConfig(GPIO_157_EPWM7A); //EPMW7A | |
972 | + GPIO_setPinConfig(GPIO_158_EPWM7B); //EPWM7B | |
973 | +} | |
974 | + | |
975 | +void InitEPwm8Gpio() | |
976 | +{ | |
977 | + GPIO_setPadConfig(159, GPIO_PIN_TYPE_PULLUP); //EPMW8A | |
978 | + GPIO_setPadConfig(160, GPIO_PIN_TYPE_PULLUP); //EPWM8B | |
979 | + | |
980 | + GPIO_setPinConfig(GPIO_159_EPWM8A); //EPMW8A | |
981 | + GPIO_setPinConfig(GPIO_160_EPWM8B); //EPWM8B | |
982 | +} | |
983 | + | |
984 | +void InitEPwm9Gpio() | |
985 | +{ | |
986 | + GPIO_setPadConfig(161, GPIO_PIN_TYPE_PULLUP); //EPMW9A | |
987 | + GPIO_setPadConfig(162, GPIO_PIN_TYPE_PULLUP); //EPWM9B | |
988 | + | |
989 | + GPIO_setPinConfig(GPIO_161_EPWM9A); //EPMW9A | |
990 | + GPIO_setPinConfig(GPIO_162_EPWM9B); //EPWM9B | |
991 | +} | |
992 | + | |
993 | +void InitEPwm10Gpio() | |
994 | +{ | |
995 | + GPIO_setPadConfig(163, GPIO_PIN_TYPE_PULLUP); //EPMW10A | |
996 | + GPIO_setPadConfig(164, GPIO_PIN_TYPE_PULLUP); //EPWM10B | |
997 | + | |
998 | + GPIO_setPinConfig(GPIO_163_EPWM10A); //EPMW10A | |
999 | + GPIO_setPinConfig(GPIO_164_EPWM10B); //EPWM10B | |
1000 | +} | |
1001 | + | |
1002 | +void InitEPwm11Gpio() | |
1003 | +{ | |
1004 | + GPIO_setPadConfig(165, GPIO_PIN_TYPE_PULLUP); //EPMW11A | |
1005 | + GPIO_setPadConfig(166, GPIO_PIN_TYPE_PULLUP); //EPWM11B | |
1006 | + | |
1007 | + GPIO_setPinConfig(GPIO_165_EPWM11A); //EPMW11A | |
1008 | + GPIO_setPinConfig(GPIO_166_EPWM11B); //EPWM11B | |
1009 | +} | |
1010 | + | |
1011 | +void InitEPwm12Gpio() | |
1012 | +{ | |
1013 | + GPIO_setPadConfig(167, GPIO_PIN_TYPE_PULLUP); //EPMW12A | |
1014 | + GPIO_setPadConfig(168, GPIO_PIN_TYPE_PULLUP); //EPWM12B | |
1015 | + | |
1016 | + GPIO_setPinConfig(GPIO_167_EPWM12A); //EPMW12A | |
1017 | + GPIO_setPinConfig(GPIO_168_EPWM12B); //EPWM12B | |
1018 | +} | |
1019 | + |
+++ Common_Resource/CommonLibrary/source/F28377D_TempSensor.cpp
... | ... | @@ -0,0 +1,68 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU2 | |
3 | +// File Name : F28377D_TempSensor.cpp | |
4 | +// Created on : 2022. 12. 16. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#include "CommonLib.h" | |
12 | + | |
13 | +#define FP_SCALE 32768 //Scale factor for Q15 fixed point numbers (2^15) | |
14 | +#define FP_ROUND FP_SCALE/2 //Added to Q15 numbers before converting to | |
15 | + //integer to round the number. | |
16 | +#define KELVIN 273 // Amount to add to Q15 fixed point numbers | |
17 | + // to shift from Celsius to Kelvin | |
18 | + // (Converting guarantees number is | |
19 | + // positive, which makes rounding more | |
20 | + // efficient) | |
21 | +#define KELVIN_OFF FP_SCALE*KELVIN | |
22 | +#define getTempSlope() (*(int (*)(void))0x7036E)() //Slope of temperature sensor | |
23 | + //(deg. C / ADC code). | |
24 | + //Stored in fixed point Q15 | |
25 | + //format. | |
26 | +#define getTempOffset() (*(int (*)(void))0x70372)() //ADC code corresponding to | |
27 | + //temperature sensor output | |
28 | + //at 0 deg. C | |
29 | + | |
30 | +float32 tempSensor_tempSlope; | |
31 | +float32 tempSensor_tempOffset; | |
32 | +float32 tempSensor_scaleFactor; | |
33 | + | |
34 | + | |
35 | +void InitDspTempSensor() | |
36 | +{ | |
37 | + | |
38 | +#ifdef CPU1 | |
39 | + EALLOW; | |
40 | + AnalogSubsysRegs.TSNSCTL.bit.ENABLE = 1; | |
41 | + | |
42 | + DEVICE_DELAY_US(1000); | |
43 | + | |
44 | + EDIS; | |
45 | + | |
46 | + | |
47 | + tempSensor_scaleFactor = 3.0; | |
48 | + | |
49 | + tempSensor_tempSlope = (int32)getTempSlope(); | |
50 | + tempSensor_tempOffset = getTempOffset(); | |
51 | +#endif | |
52 | + | |
53 | +} | |
54 | + | |
55 | +int16 GetTemperatureC(int16 sensorSample) | |
56 | +{ | |
57 | + sensorSample = (int16) ((tempSensor_scaleFactor / 2.5) * (sensorSample)); | |
58 | + | |
59 | + return (((sensorSample - tempSensor_tempOffset) * tempSensor_tempSlope + FP_ROUND + KELVIN_OFF) / FP_SCALE - KELVIN); | |
60 | +} | |
61 | + | |
62 | +int16 GetTemperatureK(int16 sensorSample) | |
63 | +{ | |
64 | + sensorSample = (int16) ((tempSensor_scaleFactor / 2.5) * (sensorSample)); | |
65 | + | |
66 | + return (((sensorSample - tempSensor_tempOffset) * tempSensor_tempSlope + FP_ROUND + KELVIN_OFF) / FP_SCALE); | |
67 | +} | |
68 | + |
+++ Common_Resource/CommonLibrary/source/FaultDefine.cpp
... | ... | @@ -0,0 +1,28 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : FaultDefine.cpp | |
4 | +// Created on : 2022. 11. 12. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#include "CommonLib.h" | |
12 | + | |
13 | +struct sFault Fault; | |
14 | + | |
15 | +struct sFaultSet FT_UV_OV; | |
16 | +struct sFaultSet FT_VIS_OV; | |
17 | +struct sFaultSet FT_IR_OV; | |
18 | + | |
19 | +struct sFaultSet FT_Combo_1; | |
20 | +struct sFaultSet FT_Combo_2; | |
21 | +struct sFaultSet FT_Combo_3; | |
22 | + | |
23 | +struct sFaultSet OtNtc5; | |
24 | +struct sFaultSet OtNtc6; | |
25 | + | |
26 | +struct sMesureList FaultLatch; | |
27 | + | |
28 | + |
+++ Common_Resource/CommonLibrary/source/Modbus.cpp
... | ... | @@ -0,0 +1,870 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : Modbus.cpp | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "CommonLib.h" | |
11 | + | |
12 | + | |
13 | +// | |
14 | +// 1. SCIRXBUF레지스터는 EasyDSP나 에뮬레이터에서 절대 보지 말것. | |
15 | +// FIFO 카운터를 감소시켜 처리 시퀀스에 오류를 발생함. | |
16 | +// 이는 모든 FIFO를 사용하는 UART의 경우 문제 발생의 여지가 있음. | |
17 | +// 꼭 모니터링이 필요 한 경우는 SCIRXEMU 레지스터를 이용하여 볼것. | |
18 | +// | |
19 | +// 2. FIFO를 사용하는 경유 SCIRXBUF.all 대신 SCIRXBUF.RXDT를 사용 하여야 함 | |
20 | +// | |
21 | +// 3. RX FIFO가 Overflow가 되는 경우 먼저 들어온 순서대로 삭제됨 (FIFO) | |
22 | + | |
23 | +#define CPUCLK 200000000L // CPU Main Clock | |
24 | + | |
25 | + | |
26 | +#if(MODBUSA_ENB) | |
27 | + | |
28 | +#define MODBUSA_RX_RDY ScicRegs.SCIRXST.bit.RXRDY | |
29 | +#define MODBUSA_RX_FIFO ScicRegs.SCIFFRX.bit.RXFFST | |
30 | +#define MODBUSA_RX_FIFO_RST ScicRegs.SCIFFRX.bit.RXFIFORESET | |
31 | +#define MODBUSA_RX_OVF ScicRegs.SCIFFRX.bit.RXFFOVF | |
32 | +#define MODBUSA_RX_OVFCLR ScicRegs.SCIFFRX.bit.RXFFOVRCLR | |
33 | + | |
34 | +#define MODBUSA_RX_BUF ScicRegs.SCIRXBUF.bit.SAR | |
35 | +#define MODBUSA_RX_ERROR ScicRegs.SCIRXST.bit.RXERROR | |
36 | + | |
37 | +#define MODBUSA_TX_RDY ScicRegs.SCICTL2.bit.TXRDY | |
38 | +#define MODBUSA_TX_FIFO ScicRegs.SCIFFTX.bit.TXFFST | |
39 | +#define MODBUSA_TX_BUF ScicRegs.SCITXBUF.bit.TXDT | |
40 | +#define MODBUSA_TX_EMTPY ScicRegs.SCICTL2.bit.TXEMPTY | |
41 | +#define MODBUSA_SWRESET ScicRegs.SCICTL1.bit.SWRESET = 0,\ | |
42 | + ScicRegs.SCICTL1.all = 0x0023 | |
43 | +#define MODBUSA_FIFO_RST ScicRegs.SCIFFTX.bit.SCIRST = 1 | |
44 | + | |
45 | +//---------------------------- Serial Modbus A set parameter RS485----------------------------------// | |
46 | + | |
47 | +#define MODBUSA_LSPCLK (CPUCLK/4) // Peripheral Low Speed Clock for SCI- | |
48 | +#define MODBUSA_BAUDRATE 9600L | |
49 | +#define MODBUSA_BRR_VAL (MODBUSA_LSPCLK/(8*MODBUSA_BAUDRATE)-1) // MODBUSA BaudRate ���� Register �� | |
50 | + | |
51 | +//16번 funccode로 123개 동시 write 명령시 231 바이트 | |
52 | +// | |
53 | +#define MODBUSA_RECEIVE_MAX_BYTE 250 | |
54 | +#define MODBUSA_RECEIVE_MIN_BYTE 2 | |
55 | +#define MODBUSA_TRANS_MAX_BYTE 250 | |
56 | + | |
57 | +#define MODBUSA_START_ADDR 0 | |
58 | +#define MODBUSA_MAX_ADDR 1500 | |
59 | + | |
60 | + | |
61 | +#pragma SET_DATA_SECTION(".Modbus") | |
62 | +unsigned int ModbusASlaveID = 1; | |
63 | +unsigned int ModbusARxCnt = 0, ModbusARxOk = 0, ModbusARxErr = 0, ModbusATxReady = 0, ModbusATxCnt = 0, ModbusATxDataLength = 0; | |
64 | +unsigned int ModbusACharTime = 0, ModbusACnt = 0, ModbusAStop = 0, ModbusACharTimeset = 8; | |
65 | +unsigned int ModbusAExceptionCode = 0; | |
66 | +unsigned char ModbusARxBuf[MODBUSA_RECEIVE_MAX_BYTE]; | |
67 | +unsigned char ModbusATxBuf[MODBUSA_TRANS_MAX_BYTE]; | |
68 | +unsigned int ModbusA_Connection_Check = 0; | |
69 | +unsigned int Flag_ModbusA_Data_reset = 0; | |
70 | + | |
71 | +volatile void *ModbusAPtr[MODBUSAPTRMAX]; | |
72 | + | |
73 | +unsigned int ModbusATxWaitCnt = 0; | |
74 | +unsigned int ModbusAFrmStartFlag = 0; | |
75 | +unsigned int ModbusARxMaxFlag = 0; | |
76 | + | |
77 | +unsigned int ModbusARxStop = 0; | |
78 | +#pragma SET_DATA_SECTION() | |
79 | + | |
80 | +#endif | |
81 | + | |
82 | +//--------------------------------------------------------------------------------------------------// | |
83 | + | |
84 | +#if (MODBUSA_ENB) | |
85 | +void ModbusACheckBuffer() | |
86 | +{ | |
87 | + int kk = 0; | |
88 | + | |
89 | + if (MODBUSA_RX_OVF == 0) | |
90 | + { | |
91 | + if (MODBUSA_RX_FIFO != 0) | |
92 | + { | |
93 | + if (ModbusAFrmStartFlag == 0) | |
94 | + { | |
95 | + ModbusARxBuf[0] = MODBUSA_RX_BUF; | |
96 | + if (ModbusARxBuf[0] == ModbusASlaveID) | |
97 | + { | |
98 | + ModbusAFrmStartFlag = 1; | |
99 | + ModbusARxCnt = 1; | |
100 | + } | |
101 | + } | |
102 | + else if (ModbusAFrmStartFlag == 1) | |
103 | + { | |
104 | + if (ModbusARxCnt <= MODBUSA_RECEIVE_MAX_BYTE) | |
105 | + { | |
106 | + ModbusARxBuf[ModbusARxCnt++] = MODBUSA_RX_BUF; | |
107 | + } | |
108 | + else | |
109 | + { | |
110 | + ModbusAFrmStartFlag = 0; | |
111 | + ModbusARxCnt = 0; | |
112 | + } | |
113 | + } | |
114 | + | |
115 | + ModbusACharTime = 0; | |
116 | + ModbusAStop = 0; | |
117 | + } // | |
118 | + else if (MODBUSA_RX_FIFO == 0) | |
119 | + { | |
120 | + if (ModbusACharTime <= ModbusACharTimeset) ModbusACharTime++; | |
121 | + else if (ModbusACharTime > ModbusACharTimeset) | |
122 | + { | |
123 | + | |
124 | + ModbusACharTime = 0; | |
125 | + kk = ModbusARxCnt; | |
126 | + ModbusARxCnt = 0; | |
127 | + | |
128 | + if (ModbusAFrmStartFlag == 1) | |
129 | + { | |
130 | + ModbusACnt = kk; | |
131 | + if ((ModbusARxBuf[0] == ModbusASlaveID) && (ModbusACnt >= 4)) | |
132 | + { | |
133 | + if (ModbusACRC16(ModbusACnt - 2, 1)) // CRC check | |
134 | + { | |
135 | + //CRC | |
136 | + memcpy(&ModbusATxBuf, &ModbusARxBuf, ModbusACnt); | |
137 | + ModbusARxOk = 1; | |
138 | + } | |
139 | + } | |
140 | + } | |
141 | + ModbusAFrmStartFlag = 0; | |
142 | + } | |
143 | + } | |
144 | + } | |
145 | + else | |
146 | + { | |
147 | + MODBUSA_RX_OVFCLR = 1; | |
148 | + MODBUSA_RX_FIFO_RST = 0; | |
149 | + MODBUSA_RX_FIFO_RST = 1; | |
150 | + } | |
151 | + | |
152 | + if (ModbusATxReady == 1) | |
153 | + { | |
154 | + if (MODBUSA_TX_FIFO < 16) | |
155 | + { | |
156 | + if (ModbusATxCnt < (ModbusATxDataLength)) | |
157 | + { | |
158 | + MODBUSA_TX_BUF = ModbusATxBuf[ModbusATxCnt]; | |
159 | + ModbusATxCnt++; | |
160 | + ModbusATxWaitCnt = 0; | |
161 | + } | |
162 | + else | |
163 | + { | |
164 | + if (MODBUSA_TX_EMTPY == 1) | |
165 | + { | |
166 | + if (ModbusATxWaitCnt++ > (ModbusACharTimeset - 1)) | |
167 | + { | |
168 | + ModbusATxReady = 0; | |
169 | + ModbusATxCnt = 0; | |
170 | + ModbusATxWaitCnt = 0; | |
171 | + } | |
172 | + | |
173 | + } | |
174 | + else | |
175 | + { | |
176 | + | |
177 | + } | |
178 | + } | |
179 | + } | |
180 | + } | |
181 | + if (MODBUSA_RX_ERROR != 0) MODBUSA_SWRESET; | |
182 | +} | |
183 | + | |
184 | +void ModbusAResponse() // 10msec routine | |
185 | +{ | |
186 | + | |
187 | + if (ModbusARxOk == 1) | |
188 | + { | |
189 | + if (ModbusACnt > MODBUSA_RECEIVE_MAX_BYTE) | |
190 | + { | |
191 | + ModbusAExceptionCode = 2; | |
192 | + ModbusABadResponse(); //to many bytes in frame */ | |
193 | + } | |
194 | + else if (ModbusACnt < MODBUSA_RECEIVE_MIN_BYTE) | |
195 | + { | |
196 | + ModbusAExceptionCode = 2; | |
197 | + ModbusABadResponse(); //to few bytes frame*/ | |
198 | + } | |
199 | + else | |
200 | + { | |
201 | + if (ModbusATxBuf[1] == 3) ModbusA3rdResponse(); | |
202 | + else if (ModbusATxBuf[1] == 4) ModbusA4thResponse(); | |
203 | + else if (ModbusATxBuf[1] == 6) ModbusA6thResponse(); | |
204 | + else if (ModbusATxBuf[1] == 16) ModbusA16thResponse(); | |
205 | + else ModbusABadResponse(); | |
206 | + } | |
207 | + | |
208 | + ModbusARxOk = 0; | |
209 | + } | |
210 | +} | |
211 | + | |
212 | +int ModbusACRC16(int dataLength, int RXTXset) //CRC 16 for SERIAL checksum | |
213 | +{ | |
214 | + //RXTXset : 0 TX CRC, 1 RX CRC | |
215 | + | |
216 | + Uint16 lowCRC; | |
217 | + Uint16 highCRC; | |
218 | + Uint16 CRC; | |
219 | + Uint16 CRC_OK; | |
220 | + | |
221 | + if (RXTXset == 1) | |
222 | + { | |
223 | + CRC = CRC16(ModbusARxBuf, dataLength); | |
224 | + highCRC = (CRC >> 8) & 0x00FF; | |
225 | + lowCRC = (CRC & 0x00FF); | |
226 | + | |
227 | + if (ModbusARxBuf[dataLength + 1] == highCRC) | |
228 | + { | |
229 | + if (ModbusARxBuf[dataLength] == lowCRC) CRC_OK = 1; | |
230 | + else CRC_OK = 0; | |
231 | + //for test | |
232 | + } | |
233 | + else CRC_OK = 0; | |
234 | + } | |
235 | + else if (RXTXset == 0) | |
236 | + { | |
237 | + CRC = CRC16(ModbusATxBuf, dataLength); | |
238 | + highCRC = (CRC >> 8) & 0x00FF; | |
239 | + lowCRC = (CRC & 0x00FF); | |
240 | + | |
241 | + ModbusATxBuf[dataLength] = lowCRC; | |
242 | + ModbusATxBuf[dataLength + 1] = highCRC; | |
243 | + | |
244 | + CRC_OK = 1; | |
245 | + } | |
246 | + | |
247 | + return CRC_OK; | |
248 | +} | |
249 | + | |
250 | +void ModbusA3rdResponse() //response for ipos 03 function (read registers) | |
251 | +{ | |
252 | + int j, temp_address, temp_length, *temp_data; | |
253 | + temp_address = ((ModbusATxBuf[2] << 8) & 0x0ff00) + (ModbusATxBuf[3] & 0x00ff); | |
254 | + temp_length = ModbusATxBuf[5] & 0x00ff; | |
255 | + | |
256 | + ModbusATxBuf[2] = temp_length * 2; | |
257 | + | |
258 | + for (j = 0; j < temp_length; j++) | |
259 | + { | |
260 | + temp_data = (int*) (ModbusAPtr[MODBUSA_START_ADDR + temp_address + j]); | |
261 | + | |
262 | + ModbusATxBuf[j * 2 + 3] = ((*temp_data & 0x0ff00) >> 8) & 0x00ff; | |
263 | + ModbusATxBuf[j * 2 + 4] = (*temp_data & 0x00ff); | |
264 | + } | |
265 | + | |
266 | + ModbusATxReady = ModbusACRC16(temp_length * 2 + 3, 0); //ADD+FUNC(2)+DATA | |
267 | + ModbusATxDataLength = temp_length * 2 + 5; | |
268 | +} | |
269 | + | |
270 | +void ModbusA4thResponse() //response for MODBUS 4 function read registers | |
271 | +{ | |
272 | + int temp_address, temp_length, *temp_data, j; | |
273 | + temp_address = ((ModbusATxBuf[2] << 8) & 0x0ff00) + (ModbusATxBuf[3] & 0x0ff); | |
274 | + temp_length = ModbusATxBuf[5] & 0xff; | |
275 | + | |
276 | + ModbusATxBuf[2] = temp_length * 2; | |
277 | + | |
278 | + for (j = 0; j < temp_length; j++) | |
279 | + { | |
280 | + temp_data = (int*) (ModbusAPtr[MODBUSA_START_ADDR + temp_address + j]); | |
281 | + ModbusATxBuf[j * 2 + 3] = ((*temp_data & 0x0ff00) >> 8) & 0xff; | |
282 | + ModbusATxBuf[j * 2 + 4] = (*temp_data & 0xff); | |
283 | + } | |
284 | + | |
285 | + ModbusATxReady = ModbusACRC16(temp_length * 2 + 3, 0); //ADD+FUNC(2)+DATA | |
286 | + ModbusATxDataLength = temp_length * 2 + 5; | |
287 | +// ModbusTxDataLength=temp_length*2+7; | |
288 | + | |
289 | +} | |
290 | + | |
291 | +void ModbusA6thResponse() //response for MODBUS 3 function write single registers | |
292 | +{ | |
293 | + int temp_address; | |
294 | + int temp_data; | |
295 | + int *ari1; | |
296 | + temp_address = (short) ((ModbusATxBuf[2] << 8) & 0x0ff00) + (ModbusATxBuf[3] & 0x0ff); | |
297 | + if (ModbusASerialRange(temp_address) == 1) ModbusAExceptionCode = 2; | |
298 | + else | |
299 | + { | |
300 | + temp_data = (((ModbusATxBuf[4] & 0xff) << 8) & 0xff00) + (ModbusATxBuf[5] & 0xff); | |
301 | + ari1 = (int*) ModbusAPtr[MODBUSA_START_ADDR + temp_address]; | |
302 | + if (temp_data > 32767) *ari1 = (temp_data | 0xffff0000); | |
303 | + else *ari1 = temp_data; | |
304 | + | |
305 | + ModbusATxReady = ModbusACRC16(6, 0); | |
306 | + ModbusATxDataLength = 8; | |
307 | + } | |
308 | +} | |
309 | + | |
310 | +void ModbusA16thResponse() //response for MODBUS 16 function write multiple registers | |
311 | +{ | |
312 | + int temp_address, temp_length, j; | |
313 | + register int temp_data; | |
314 | + int *ari1; | |
315 | + temp_address = ((ModbusATxBuf[2] << 8) & 0x0ff00) + (ModbusATxBuf[3] & 0x0ff); | |
316 | + temp_length = ModbusATxBuf[5] & 0xff; | |
317 | + if (ModbusASerialRange(temp_address + temp_length) == 1) ModbusAExceptionCode = 2; | |
318 | + else | |
319 | + { | |
320 | + for (j = 0; j < temp_length; j++) | |
321 | + { | |
322 | + temp_data = (((ModbusATxBuf[7 + 2 * j] & 0xff) << 8) & 0xff00) + (ModbusATxBuf[8 + 2 * j] & 0xff); | |
323 | + ari1 = (int*) ModbusAPtr[MODBUSA_START_ADDR + temp_address + j]; | |
324 | + if (temp_data > 32767) *ari1 = (temp_data | 0xffff0000); | |
325 | + else *ari1 = temp_data; | |
326 | + } | |
327 | + } | |
328 | + ModbusATxReady = ModbusACRC16(6, 0); | |
329 | + ModbusATxDataLength = 8; | |
330 | +} | |
331 | + | |
332 | +void ModbusABadResponse() | |
333 | +{ | |
334 | + ModbusATxBuf[0] = ModbusASlaveID; | |
335 | + ModbusATxBuf[1] = ModbusATxBuf[1] + 0x00000080; | |
336 | + ModbusATxBuf[2] = ModbusAExceptionCode; | |
337 | + | |
338 | + ModbusATxReady = ModbusACRC16(3, 0); | |
339 | + ModbusATxDataLength = 5; | |
340 | +} | |
341 | + | |
342 | +int ModbusASerialRange(int address) | |
343 | +{ | |
344 | + if ((address >= 0) && (address < MODBUSA_MAX_ADDR)) return 0; //read write enable | |
345 | + else return 1; //read only | |
346 | +} | |
347 | + | |
348 | +void Init_ModbusA_Buffer() | |
349 | +{ | |
350 | + memset(&ModbusARxBuf, 0, sizeof(ModbusARxBuf) / sizeof(int)); | |
351 | + memset(&ModbusATxBuf, 0, sizeof(ModbusATxBuf) / sizeof(int)); | |
352 | + | |
353 | +} | |
354 | +#endif | |
355 | + | |
356 | +//-------------------------ModbusB------------------------------------------------------// | |
357 | + | |
358 | +#if (MODBUSB_ENB) | |
359 | + | |
360 | +#define MODBUSB_RX_RDY ScibRegs.SCIRXST.bit.RXRDY | |
361 | +#define MODBUSB_RX_FIFO ScibRegs.SCIFFRX.bit.RXFFST | |
362 | +#define MODBUSB_RX_FIFO_RST ScibRegs.SCIFFRX.bit.RXFIFORESET | |
363 | +#define MODBUSB_RX_OVF ScibRegs.SCIFFRX.bit.RXFFOVF | |
364 | +#define MODBUSB_RX_OVFCLR ScibRegs.SCIFFRX.bit.RXFFOVRCLR | |
365 | + | |
366 | +#define MODBUSB_RX_BUF ScibRegs.SCIRXBUF.bit.SAR | |
367 | +#define MODBUSB_RX_ERROR ScibRegs.SCIRXST.bit.RXERROR | |
368 | + | |
369 | +#define MODBUSB_TX_RDY ScibRegs.SCICTL2.bit.TXRDY | |
370 | +#define MODBUSB_TX_FIFO ScibRegs.SCIFFTX.bit.TXFFST | |
371 | +#define MODBUSB_TX_BUF ScibRegs.SCITXBUF.bit.TXDT | |
372 | +#define MODBUSB_TX_EMTPY ScibRegs.SCICTL2.bit.TXEMPTY | |
373 | +#define MODBUSB_SWRESET ScibRegs.SCICTL1.bit.SWRESET = 0,\ | |
374 | + ScibRegs.SCICTL1.all = 0x0023 | |
375 | +#define MODBUSB_FIFO_RST ScibRegs.SCIFFTX.bit.SCIRST = 1; | |
376 | + | |
377 | +//#define MODBUSB_RX_RDY ScidRegs.SCIRXST.bit.RXRDY | |
378 | +//#define MODBUSB_RX_FIFO ScidRegs.SCIFFRX.bit.RXFFST | |
379 | +//#define MODBUSB_RX_FIFO_RST ScidRegs.SCIFFRX.bit.RXFIFORESET | |
380 | +//#define MODBUSB_RX_OVF ScidRegs.SCIFFRX.bit.RXFFOVF | |
381 | +//#define MODBUSB_RX_OVFCLR ScidRegs.SCIFFRX.bit.RXFFOVRCLR | |
382 | +// | |
383 | +//#define MODBUSB_RX_BUF ScidRegs.SCIRXBUF.bit.SAR | |
384 | +//#define MODBUSB_RX_ERROR ScidRegs.SCIRXST.bit.RXERROR | |
385 | +// | |
386 | +//#define MODBUSB_TX_RDY ScidRegs.SCICTL2.bit.TXRDY | |
387 | +//#define MODBUSB_TX_FIFO ScidRegs.SCIFFTX.bit.TXFFST | |
388 | +//#define MODBUSB_TX_BUF ScidRegs.SCITXBUF.bit.TXDT | |
389 | +//#define MODBUSB_TX_EMTPY ScidRegs.SCICTL2.bit.TXEMPTY | |
390 | +//#define MODBUSB_SWRESET ScidRegs.SCICTL1.bit.SWRESET = 0,\ | |
391 | +// ScidRegs.SCICTL1.all = 0x0023 | |
392 | +//#define MODBUSB_FIFO_RST ScidRegs.SCIFFTX.bit.SCIRST = 1; | |
393 | + | |
394 | +//---------------------------- Serial Modbus B set parameter RS485----------------------------------// | |
395 | + | |
396 | +#define MODBUSB_LSPCLK (CPUCLK/4) // Peripheral Low Speed Clock for SCI- | |
397 | +#define MODBUSB_BAUDRATE 38400L | |
398 | +#define MODBUSB_BRR_VAL (MODBUSB_LSPCLK/(8*MODBUSB_BAUDRATE)-1) // MODBUSB BaudRate ���� Register �� | |
399 | + | |
400 | +//16�� funccode�� 123�� ���� write ��ɽ� 231 ����Ʈ | |
401 | +#define MODBUSB_RECEIVE_MAX_BYTE 400 | |
402 | +#define MODBUSB_RECEIVE_MIN_BYTE 2 | |
403 | +#define MODBUSB_TRANS_MAX_BYTE 400 | |
404 | + | |
405 | +#define MODBUSB_START_ADDR 0 | |
406 | +#define MODBUSB_MAX_ADDR 1500 | |
407 | + | |
408 | +unsigned int ModbusBSlaveID = 2; | |
409 | + | |
410 | +unsigned int ModbusBRxCnt = 0, ModbusBRxOk = 0, ModbusBRxErr = 0, ModbusBTxReady = 0, ModbusBTxCnt = 0, ModbusBTxDataLength = 0; | |
411 | + | |
412 | +unsigned int ModbusBCharTime = 0, ModbusBCnt = 0, ModbusBStop = 0, ModbusBCharTimeset = 8; | |
413 | +unsigned int ModbusBExceptionCode = 0; | |
414 | +unsigned char ModbusBRxBuf[MODBUSB_RECEIVE_MAX_BYTE]; | |
415 | +unsigned char ModbusBTxBuf[MODBUSB_TRANS_MAX_BYTE]; | |
416 | +unsigned int ModbusB_Connection_Check = 0; | |
417 | +unsigned int Flag_ModbusB_Data_reset = 0; | |
418 | + | |
419 | +volatile void *ModbusBPtr[MODBUSBPTRMAX]; | |
420 | + | |
421 | +unsigned int ModbusBTxWaitCnt = 0; | |
422 | +unsigned int ModbusBFrmStartFlag = 0; | |
423 | +unsigned int ModbusBRxMaxFlag = 0; | |
424 | + | |
425 | +unsigned int ModbusBRxStop = 0; | |
426 | + | |
427 | +#endif | |
428 | +//--------------------------------------------------------------------------------------------------// | |
429 | +#if (MODBUSB_ENB) | |
430 | + | |
431 | +void ModbusBCheckBuffer() | |
432 | +{ | |
433 | + int kk = 0; | |
434 | + | |
435 | + if (MODBUSB_RX_OVF == 0) | |
436 | + { | |
437 | + if (MODBUSB_RX_FIFO != 0) | |
438 | + { | |
439 | + if (ModbusBFrmStartFlag == 0) | |
440 | + { | |
441 | + ModbusBRxBuf[0] = MODBUSB_RX_BUF; | |
442 | + if (ModbusBRxBuf[0] == ModbusBSlaveID) | |
443 | + { | |
444 | + ModbusBFrmStartFlag = 1; | |
445 | + ModbusBRxCnt = 1; | |
446 | + } | |
447 | + } | |
448 | + else if (ModbusBFrmStartFlag == 1) | |
449 | + { | |
450 | + if (ModbusBRxCnt <= MODBUSB_RECEIVE_MAX_BYTE) | |
451 | + { | |
452 | + ModbusBRxBuf[ModbusBRxCnt++] = MODBUSB_RX_BUF; | |
453 | + } | |
454 | + else | |
455 | + { | |
456 | + ModbusBFrmStartFlag = 0; | |
457 | + ModbusBRxCnt = 0; | |
458 | + } | |
459 | + } | |
460 | + | |
461 | + ModbusBCharTime = 0; | |
462 | + ModbusBStop = 0; | |
463 | + } // | |
464 | + else if (MODBUSB_RX_FIFO == 0) | |
465 | + { | |
466 | + if (ModbusBCharTime <= ModbusBCharTimeset) ModbusBCharTime++; | |
467 | + else if (ModbusBCharTime > ModbusBCharTimeset) | |
468 | + { | |
469 | + | |
470 | + ModbusBCharTime = 0; | |
471 | + kk = ModbusBRxCnt; | |
472 | + ModbusBRxCnt = 0; | |
473 | + | |
474 | + if (ModbusBFrmStartFlag == 1) | |
475 | + { | |
476 | + ModbusBCnt = kk; | |
477 | + if ((ModbusBRxBuf[0] == ModbusBSlaveID) && (ModbusBCnt >= 4)) | |
478 | + { | |
479 | + if (ModbusBCRC16(ModbusBCnt - 2, 1)) // ���ŵ� ������ CRC check | |
480 | + { | |
481 | + //CRC ���� | |
482 | + memcpy(&ModbusBTxBuf, &ModbusBRxBuf, ModbusBCnt); | |
483 | + ModbusBRxOk = 1; | |
484 | + } | |
485 | + } | |
486 | + } | |
487 | + ModbusBFrmStartFlag = 0; | |
488 | + } | |
489 | + } | |
490 | + } | |
491 | + else | |
492 | + { | |
493 | + MODBUSB_RX_OVFCLR = 1; | |
494 | + MODBUSB_RX_FIFO_RST = 0; | |
495 | + MODBUSB_RX_FIFO_RST = 1; | |
496 | + } | |
497 | + | |
498 | + if (ModbusBTxReady == 1) | |
499 | + { | |
500 | + if (MODBUSB_TX_FIFO < 16) | |
501 | + { | |
502 | + if (ModbusBTxCnt < (ModbusBTxDataLength)) | |
503 | + { | |
504 | + MODBUSB_TX_BUF = ModbusBTxBuf[ModbusBTxCnt]; | |
505 | + ModbusBTxCnt++; | |
506 | + ModbusBTxWaitCnt = 0; | |
507 | + } | |
508 | + else | |
509 | + { | |
510 | + if (MODBUSB_TX_EMTPY == 1) | |
511 | + { | |
512 | + if (ModbusBTxWaitCnt++ > (ModbusBCharTimeset - 1)) | |
513 | + { | |
514 | + ModbusBTxReady = 0; | |
515 | + ModbusBTxCnt = 0; | |
516 | + ModbusBTxWaitCnt = 0; | |
517 | + } | |
518 | + | |
519 | + } | |
520 | + else | |
521 | + { | |
522 | + | |
523 | + } | |
524 | + } | |
525 | + } | |
526 | + } | |
527 | + if (MODBUSB_RX_ERROR != 0) MODBUSB_SWRESET; | |
528 | +} | |
529 | + | |
530 | +void ModbusBResponse() // 10msec routine�� ���� | |
531 | +{ | |
532 | + | |
533 | + if (ModbusBRxOk == 1) | |
534 | + { | |
535 | + if (ModbusBCnt > MODBUSB_RECEIVE_MAX_BYTE) | |
536 | + { | |
537 | + ModbusBExceptionCode = 2; | |
538 | + ModbusBBadResponse(); //to many bytes in frame */ | |
539 | + } | |
540 | + else if (ModbusBCnt < MODBUSB_RECEIVE_MIN_BYTE) | |
541 | + { | |
542 | + ModbusBExceptionCode = 2; | |
543 | + ModbusBBadResponse(); //to few bytes frame*/ | |
544 | + } | |
545 | + else | |
546 | + { | |
547 | + if (ModbusBTxBuf[1] == 3) ModbusB3rdResponse(); | |
548 | + else if (ModbusBTxBuf[1] == 4) ModbusB4thResponse(); | |
549 | + else if (ModbusBTxBuf[1] == 6) ModbusB6thResponse(); | |
550 | + else if (ModbusBTxBuf[1] == 16) ModbusB16thResponse(); | |
551 | + else ModbusBBadResponse(); | |
552 | + } | |
553 | + | |
554 | + ModbusBRxOk = 0; | |
555 | + } | |
556 | +} | |
557 | + | |
558 | +int ModbusBCRC16(int dataLength, int RXTXset) //CRC 16 for SERIAL checksum | |
559 | +{ | |
560 | + //RXTXset : 0 TX CRC, 1 RX CRC | |
561 | + | |
562 | + Uint16 lowCRC; | |
563 | + Uint16 highCRC; | |
564 | + Uint16 CRC; | |
565 | + Uint16 CRC_OK; | |
566 | + | |
567 | + if (RXTXset == 1) | |
568 | + { | |
569 | + CRC = CRC16(ModbusBRxBuf, dataLength); | |
570 | + highCRC = (CRC >> 8) & 0x00FF; | |
571 | + lowCRC = (CRC & 0x00FF); | |
572 | + | |
573 | + if (ModbusBRxBuf[dataLength + 1] == highCRC) | |
574 | + { | |
575 | + if (ModbusBRxBuf[dataLength] == lowCRC) CRC_OK = 1; | |
576 | + else CRC_OK = 0; | |
577 | + //for test | |
578 | + dInverter_Status++; | |
579 | + } | |
580 | + else CRC_OK = 0; | |
581 | + } | |
582 | + else if (RXTXset == 0) | |
583 | + { | |
584 | + CRC = CRC16(ModbusBTxBuf, dataLength); | |
585 | + highCRC = (CRC >> 8) & 0x00FF; | |
586 | + lowCRC = (CRC & 0x00FF); | |
587 | + | |
588 | + ModbusBTxBuf[dataLength] = lowCRC; | |
589 | + ModbusBTxBuf[dataLength + 1] = highCRC; | |
590 | + | |
591 | + CRC_OK = 1; | |
592 | + } | |
593 | + | |
594 | + return CRC_OK; | |
595 | +} | |
596 | + | |
597 | +void ModbusB3rdResponse() //response for ipos 03 function (read registers) | |
598 | +{ | |
599 | + int j, temp_address, temp_length, *temp_data; | |
600 | + temp_address = ((ModbusBTxBuf[2] << 8) & 0x0ff00) + (ModbusBTxBuf[3] & 0x00ff); | |
601 | + temp_length = ModbusBTxBuf[5] & 0x00ff; | |
602 | + | |
603 | + ModbusBTxBuf[2] = temp_length * 2; | |
604 | + | |
605 | + for (j = 0; j < temp_length; j++) | |
606 | + { | |
607 | + temp_data = (int*) (ModbusBPtr[MODBUSB_START_ADDR + temp_address + j]); // ����address���� temp_length ��ŭ | |
608 | + | |
609 | + ModbusBTxBuf[j * 2 + 3] = ((*temp_data & 0x0ff00) >> 8) & 0x00ff; | |
610 | + ModbusBTxBuf[j * 2 + 4] = (*temp_data & 0x00ff); | |
611 | + } | |
612 | + | |
613 | + ModbusBTxReady = ModbusBCRC16(temp_length * 2 + 3, 0); //ADD+FUNC(2)+DATA | |
614 | + ModbusBTxDataLength = temp_length * 2 + 5; | |
615 | +} | |
616 | + | |
617 | +void ModbusB4thResponse() //response for MODBUS 4 function read registers | |
618 | +{ | |
619 | + int temp_address, temp_length, *temp_data, j; | |
620 | + temp_address = ((ModbusBTxBuf[2] << 8) & 0x0ff00) + (ModbusBTxBuf[3] & 0x0ff); | |
621 | + temp_length = ModbusBTxBuf[5] & 0xff; | |
622 | + | |
623 | + ModbusBTxBuf[2] = temp_length * 2; | |
624 | + | |
625 | + for (j = 0; j < temp_length; j++) | |
626 | + { | |
627 | + temp_data = (int*) (ModbusBPtr[MODBUSB_START_ADDR + temp_address + j]); | |
628 | + ModbusBTxBuf[j * 2 + 3] = ((*temp_data & 0x0ff00) >> 8) & 0xff; | |
629 | + ModbusBTxBuf[j * 2 + 4] = (*temp_data & 0xff); | |
630 | + } | |
631 | + | |
632 | + ModbusBTxReady = ModbusBCRC16(temp_length * 2 + 3, 0); //ADD+FUNC(2)+DATA | |
633 | + ModbusBTxDataLength = temp_length * 2 + 5; | |
634 | +// ModbusTxDataLength=temp_length*2+7; | |
635 | + | |
636 | +} | |
637 | + | |
638 | +void ModbusB6thResponse() //response for MODBUS 3 function write single registers | |
639 | +{ | |
640 | + int temp_address; | |
641 | + int temp_data; | |
642 | + int *ari1; | |
643 | + temp_address = (short) ((ModbusBTxBuf[2] << 8) & 0x0ff00) + (ModbusBTxBuf[3] & 0x0ff); | |
644 | + if (ModbusBSerialRange(temp_address) == 1) ModbusBExceptionCode = 2; | |
645 | + else | |
646 | + { | |
647 | + temp_data = (((ModbusBTxBuf[4] & 0xff) << 8) & 0xff00) + (ModbusBTxBuf[5] & 0xff); | |
648 | + ari1 = (int*) ModbusBPtr[MODBUSB_START_ADDR + temp_address]; | |
649 | + if (temp_data > 32767) *ari1 = (temp_data | 0xffff0000); | |
650 | + else *ari1 = temp_data; | |
651 | + | |
652 | + ModbusBTxReady = ModbusBCRC16(6, 0); | |
653 | + ModbusBTxDataLength = 8; | |
654 | + } | |
655 | +} | |
656 | + | |
657 | +void ModbusB16thResponse() //response for MODBUS 16 function write multiple registers | |
658 | +{ | |
659 | + int temp_address, temp_length, j; | |
660 | + register int temp_data; | |
661 | + int *ari1; | |
662 | + temp_address = ((ModbusBTxBuf[2] << 8) & 0x0ff00) + (ModbusBTxBuf[3] & 0x0ff); | |
663 | + temp_length = ModbusBTxBuf[5] & 0xff; | |
664 | + if (ModbusBSerialRange(temp_address + temp_length) == 1) ModbusBExceptionCode = 2; | |
665 | + else | |
666 | + { | |
667 | + for (j = 0; j < temp_length; j++) | |
668 | + { | |
669 | + temp_data = (((ModbusBTxBuf[7 + 2 * j] & 0xff) << 8) & 0xff00) + (ModbusBTxBuf[8 + 2 * j] & 0xff); | |
670 | + ari1 = (int*) ModbusBPtr[MODBUSB_START_ADDR + temp_address + j]; | |
671 | + if (temp_data > 32767) *ari1 = (temp_data | 0xffff0000); | |
672 | + else *ari1 = temp_data; | |
673 | + } | |
674 | + } | |
675 | + ModbusBTxReady = ModbusBCRC16(6, 0); | |
676 | + ModbusBTxDataLength = 8; | |
677 | +} | |
678 | + | |
679 | +void ModbusBBadResponse() | |
680 | +{ | |
681 | + ModbusBTxBuf[0] = ModbusBSlaveID; | |
682 | + ModbusBTxBuf[1] = ModbusBTxBuf[1] + 0x00000080; | |
683 | + ModbusBTxBuf[2] = ModbusBExceptionCode; | |
684 | + | |
685 | + ModbusBTxReady = ModbusBCRC16(3, 0); | |
686 | + ModbusBTxDataLength = 5; | |
687 | +} | |
688 | + | |
689 | +int ModbusBSerialRange(int address) | |
690 | +{ | |
691 | + if ((address >= 0) && (address < MODBUSB_MAX_ADDR)) return 0; //read write enable | |
692 | + else return 1; //read only | |
693 | +} | |
694 | + | |
695 | +void Init_ModbusB_Buffer() | |
696 | +{ | |
697 | + memset(&ModbusBRxBuf, 0, sizeof(ModbusBRxBuf) / sizeof(int)); | |
698 | + memset(&ModbusBTxBuf, 0, sizeof(ModbusBTxBuf) / sizeof(int)); | |
699 | + | |
700 | +} | |
701 | + | |
702 | +#endif | |
703 | + | |
704 | + | |
705 | +float Char3_5Time = 0.; | |
706 | + | |
707 | + | |
708 | +void InitModbusSci() | |
709 | +{ | |
710 | + | |
711 | +#if (MODBUSA_ENB) | |
712 | + | |
713 | + ScicRegs.SCIFFTX.bit.SCIFFENA = 1; //FIFO Enable | |
714 | + | |
715 | + ScicRegs.SCIFFTX.bit.TXFFIENA = 0; //FIFO Tx-Interrupt Disable | |
716 | + ScicRegs.SCIFFRX.bit.RXFFIENA = 0; //FIFO Rx-Interrupt Disable | |
717 | + ScicRegs.SCIFFTX.bit.TXFIFORESET = 1; | |
718 | + ScicRegs.SCIFFRX.bit.RXFIFORESET = 1; | |
719 | + ScicRegs.SCIFFCT.bit.FFTXDLY = 0; | |
720 | + // | |
721 | + ScicRegs.SCIFFTX.bit.SCIRST = 1; | |
722 | + | |
723 | + ScicRegs.SCIFFCT.bit.ABDCLR = 1; // Clear ABD(Auto baud bit) | |
724 | + | |
725 | + ScicRegs.SCICCR.all = 0x0007; // 1 stop bit, No loopback | |
726 | + // No parity,8 char bits, | |
727 | + // async mode, idle-line protocol | |
728 | + ScicRegs.SCICTL1.all = 0x0003; // enable TX, RX, internal SCICLK, | |
729 | + // Disable RX ERR, SLEEP, TXWAKE | |
730 | + // ScicRegs.SCICTL2.all = 0x0003; | |
731 | + // ScicRegs.SCICTL2.bit.RXBKINTENA = 1; // RX/BK INT ENA=1, | |
732 | + // ScicRegs.SCICTL2.bit.TXINTENA = 1; // TX INT ENA=1, | |
733 | + | |
734 | + ScicRegs.SCIHBAUD.bit.BAUD = (MODBUSA_BRR_VAL >> 8); | |
735 | + ScicRegs.SCILBAUD.bit.BAUD = (MODBUSA_BRR_VAL & 0xFF); | |
736 | + | |
737 | + ScicRegs.SCICTL1.all = 0x0023; // Relinquish SCI from Reset | |
738 | + | |
739 | + | |
740 | + Init_ModbusA_Buffer(); | |
741 | + | |
742 | + | |
743 | + // 11bit per char | |
744 | + Char3_5Time = 1.0 / MODBUSA_BAUDRATE * 11 * 3.5; | |
745 | + if(Char3_5Time <= 1.75e-3 ) Char3_5Time = 1.75e-3; | |
746 | + //1.75ms 이하인 경우 1.75ms | |
747 | + ModbusACharTimeset = (unsigned int)(Char3_5Time / Tsamp); | |
748 | + | |
749 | +#endif | |
750 | + | |
751 | +#if(MODBUSB_ENB) | |
752 | +//-------------------------------------SCI-B----------------------------------------------------// | |
753 | + | |
754 | + ScibRegs.SCIFFTX.bit.SCIFFENA = 1; //FIFO Enable | |
755 | + | |
756 | + ScibRegs.SCIFFTX.bit.TXFFIENA = 0; //FIFO Tx-Interrupt Disable | |
757 | + ScibRegs.SCIFFRX.bit.RXFFIENA = 0; //FIFO Rx-Interrupt Disable | |
758 | + ScibRegs.SCIFFTX.bit.TXFIFORESET = 1; | |
759 | + ScibRegs.SCIFFRX.bit.RXFIFORESET = 1; | |
760 | + ScibRegs.SCIFFCT.bit.FFTXDLY = 0; | |
761 | + | |
762 | + ScibRegs.SCIFFTX.bit.SCIRST = 1; | |
763 | + | |
764 | + ScibRegs.SCIFFCT.bit.ABDCLR = 1; // Clear ABD(Auto baud bit) | |
765 | + | |
766 | + ScibRegs.SCICCR.all = 0x0007; // 1 stop bit, No loopback | |
767 | + // No parity,8 char bits, | |
768 | + // async mode, idle-line protocol | |
769 | + ScibRegs.SCICTL1.all = 0x0003; // enable TX, RX, internal SCICLK, | |
770 | + | |
771 | + ScibRegs.SCIHBAUD.bit.BAUD = (MODBUSB_BRR_VAL >> 8); | |
772 | + ScibRegs.SCILBAUD.bit.BAUD = (MODBUSB_BRR_VAL & 0xFF); | |
773 | + | |
774 | + ScibRegs.SCICTL1.all = 0x0023; // Relinquish SCI from Reset | |
775 | +//-------------------------------------SCI-D----------------------------------------------------// | |
776 | +// ScidRegs.SCIFFTX.bit.SCIFFENA = 1; //FIFO Enable | |
777 | +// | |
778 | +// ScidRegs.SCIFFTX.bit.TXFFIENA = 0; //FIFO Tx-Interrupt Disable | |
779 | +// ScidRegs.SCIFFRX.bit.RXFFIENA = 0; //FIFO Rx-Interrupt Disable | |
780 | +// ScidRegs.SCIFFTX.bit.TXFIFORESET = 1; | |
781 | +// ScidRegs.SCIFFRX.bit.RXFIFORESET = 1; | |
782 | +// ScidRegs.SCIFFCT.bit.FFTXDLY = 0; | |
783 | +// // | |
784 | +// ScidRegs.SCIFFTX.bit.SCIRST = 1; | |
785 | +// | |
786 | +// ScidRegs.SCIFFCT.bit.ABDCLR = 1; // Clear ABD(Auto baud bit) | |
787 | +// | |
788 | +// ScidRegs.SCICCR.all = 0x0007; // 1 stop bit, No loopback | |
789 | +// // No parity,8 char bits, | |
790 | +// // async mode, idle-line protocol | |
791 | +// ScidRegs.SCICTL1.all = 0x0003; // enable TX, RX, internal SCICLK, | |
792 | +// | |
793 | +// ScidRegs.SCIHBAUD.bit.BAUD = (MODBUSB_BRR_VAL >> 8); | |
794 | +// ScidRegs.SCILBAUD.bit.BAUD = (MODBUSB_BRR_VAL & 0xFF); | |
795 | +// | |
796 | +// ScidRegs.SCICTL1.all = 0x0023; // Relinquish SCI from Reset | |
797 | + | |
798 | + Init_ModbusB_Buffer(); | |
799 | + | |
800 | + Char3_5Time = 1.0 / MODBUSB_BAUDRATE * 11 * 3.5; | |
801 | + if(Char3_5Time <= 1.75e-3 ) Char3_5Time = 1.75e-3; | |
802 | + //char 타임자동계산 | |
803 | + ModbusBCharTimeset = (unsigned int)(Char3_5Time / Tsamp); | |
804 | + | |
805 | +#endif | |
806 | + | |
807 | + | |
808 | + InitModbusPtr(); | |
809 | + | |
810 | +} | |
811 | + | |
812 | +//-------------------------ModbusA/B ���� �Լ�--------------------------------------// | |
813 | +void ModbusALLCheckBuffer() | |
814 | +{ | |
815 | +#if(MODBUSA_ENB) | |
816 | + ModbusACheckBuffer(); | |
817 | +#endif | |
818 | + | |
819 | +#if(MODBUSB_ENB) | |
820 | + ModbusBCheckBuffer(); | |
821 | +#endif | |
822 | +} | |
823 | + | |
824 | +void ModbusALLResponse() | |
825 | +{ | |
826 | +#if(MODBUSA_ENB) | |
827 | + ModbusAResponse(); | |
828 | +#endif | |
829 | + | |
830 | +#if(MODBUSB_ENB) | |
831 | + ModbusBResponse(); | |
832 | +#endif | |
833 | +} | |
834 | + void InitSci() | |
835 | + { | |
836 | +// SCI_setConfig(SCID_BASE, DEVICE_LSPCLK_FREQ, 9600, (SCI_CONFIG_WLEN_8 | SCI_CONFIG_STOP_ONE | SCI_CONFIG_PAR_NONE)); | |
837 | +// SCI_resetChannels(SCID_BASE); | |
838 | +// SCI_resetRxFIFO(SCID_BASE); | |
839 | +// SCI_resetTxFIFO(SCID_BASE); | |
840 | +// SCI_clearInterruptStatus(SCID_BASE, SCI_INT_TXFF | SCI_INT_RXFF); | |
841 | +// SCI_enableFIFO(SCID_BASE); | |
842 | +// SCI_enableModule(SCID_BASE); | |
843 | +// SCI_performSoftwareReset(SCID_BASE); | |
844 | + | |
845 | + ScidRegs.SCIFFTX.bit.SCIFFENA = 1; //FIFO Enable | |
846 | + | |
847 | + ScidRegs.SCIFFTX.bit.TXFFIENA = 0; //FIFO Tx-Interrupt Disable | |
848 | + ScidRegs.SCIFFRX.bit.RXFFIENA = 0; //FIFO Rx-Interrupt Disable | |
849 | + ScidRegs.SCIFFTX.bit.TXFIFORESET = 1; | |
850 | + ScidRegs.SCIFFRX.bit.RXFIFORESET = 1; | |
851 | + ScidRegs.SCIFFCT.bit.FFTXDLY = 0; | |
852 | + // | |
853 | + ScidRegs.SCIFFTX.bit.SCIRST = 1; | |
854 | + | |
855 | + ScidRegs.SCIFFCT.bit.ABDCLR = 1; // Clear ABD(Auto baud bit) | |
856 | + | |
857 | + ScidRegs.SCICCR.all = 0x0007; // 1 stop bit, No loopback | |
858 | + // No parity,8 char bits, | |
859 | + // async mode, idle-line protocol | |
860 | + ScidRegs.SCICTL1.all = 0x0003; // enable TX, RX, internal SCICLK, | |
861 | + // Disable RX ERR, SLEEP, TXWAKE | |
862 | + // ScicRegs.SCICTL2.all = 0x0003; | |
863 | + // ScicRegs.SCICTL2.bit.RXBKINTENA = 1; // RX/BK INT ENA=1, | |
864 | + // ScicRegs.SCICTL2.bit.TXINTENA = 1; // TX INT ENA=1, | |
865 | + | |
866 | + ScidRegs.SCIHBAUD.bit.BAUD = (MODBUSA_BRR_VAL >> 8); | |
867 | + ScidRegs.SCILBAUD.bit.BAUD = (MODBUSA_BRR_VAL & 0xFF); | |
868 | + | |
869 | + ScidRegs.SCICTL1.all = 0x0023; // Relinquish SCI from Reset | |
870 | + } |
+++ Common_Resource/CommonLibrary/source/ModbusMap.cpp
... | ... | @@ -0,0 +1,517 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : ModbusMap.cpp | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#include "CommonLib.h" | |
12 | + | |
13 | + | |
14 | +#pragma SET_DATA_SECTION(".ModbusData") | |
15 | +// Packet1 | |
16 | +unsigned char COMM_Operation_Status = 0; // Add : 0 // ON = 0x30 // OFF = 0x31 // Set/Get //* | |
17 | +unsigned char COMM_Installation_location = 1; // Add : 1 // See “2.2 ‘Installation location’ property.” // Set/Get //* | |
18 | +unsigned char COMM_Standard_version_information = 2; // Add : 10 // Get //* | |
19 | +unsigned char COMM_Identification_number = 3; // Add : 12 // Get | |
20 | +unsigned short COMM_Measured_instantaneous_power_consumption = 4; // Add : 21 // Get | |
21 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
22 | +unsigned char COMM_Measured_cumulative_power_consumption_H = 5; // Add : 22 // Get | |
23 | +unsigned char COMM_Measured_cumulative_power_consumption_L = 5; // Add : 23 // Get | |
24 | +// Packet2 | |
25 | +unsigned char COMM_Manufacturer_fault_code = 1; // Add : 24 // Get | |
26 | +unsigned char COMM_Current_limit_setting = 2; // Add : 137 // Set/Get | |
27 | +unsigned char COMM_Fault_status = 3; // Add : 138 // Fault = 0x41, No fault = 0x42// Get //* | |
28 | +unsigned short COMM_Fault_description = 4; // Add : 139 // Get | |
29 | +unsigned char COMM_Manufacturer_code = 5; // Add : 140 // Get //* | |
30 | +unsigned char COMM_Business_facility_code = 6; // Add : 142 // Get | |
31 | +unsigned char COMM_Product_code = 7; // Add : 143 // Get | |
32 | +// Packet3 | |
33 | +unsigned char COMM_Production_number = 1; // Add : 149 // Get | |
34 | +unsigned char COMM_Production_date = 2; // Add : 155 // Get | |
35 | +unsigned char COMM_Power_saving_operation_setting = 3;// Add : 157 // Set/Get | |
36 | +unsigned char COMM_Remote_control_setting = 4; // Add : 158 // Set/Get | |
37 | +unsigned char COMM_Current_time_setting = 5; // Add : 159 // Set/Get | |
38 | +unsigned char COMM_Current_date_setting = 6; // Add : 161 // Set/Get | |
39 | +unsigned char COMM_Power_limit_setting = 7; // Add : 163 // Set/Get | |
40 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 3개로 분리 | |
41 | +unsigned char COMM_Cumulative_operating_time_1 = 8; // Add : 164 // Get | |
42 | +unsigned char COMM_Cumulative_operating_time_H = 9; // Add : 165 // Get | |
43 | +unsigned char COMM_Cumulative_operating_time_L = 9; // Add : 166 // Get | |
44 | +unsigned char COMM_SetM_property_map = 10; // Add : 167 // Get //* | |
45 | +unsigned char COMM_GetM_property_map = 11; // Add : 176 // Get //* | |
46 | +unsigned char COMM_Status_change_announcement_property_map = 12;// Add : 185 // Get //* | |
47 | +unsigned char COMM_Set_property_map = 13; // Add : 194 // Get //* | |
48 | +unsigned char COMM_Get_property_map = 14; // Add : 203 // Get //* | |
49 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
50 | +unsigned char COMM_Dischargeable_capacity_of_vehicle_mounted_battery_1_H = 15; // Add : 212 // Get //* | |
51 | +unsigned char COMM_Dischargeable_capacity_of_vehicle_mounted_battery_1_L = 15; // Add : 213 // Get //* | |
52 | +unsigned short COMM_Dischargeable_capacity_of_vehicle_mounted_battery_2 = 16; // Add : 214 // Get | |
53 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
54 | +unsigned char COMM_Remaining_dischargeable_capacity_of_vehicle_mounted_battery_1_H = 17; // Add : 215 // Get //* | |
55 | +unsigned char COMM_Remaining_dischargeable_capacity_of_vehicle_mounted_battery_1_L = 17; // Add : 216 // Get //* | |
56 | +unsigned short COMM_Remaining_dischargeable_capacity_of_vehicle_mounted_battery_2 = 18; // Add : 217 // Get | |
57 | +unsigned char COMM_Remaining_dischargeable_capacity_of_vehicle_mounted_battery_3 = 19;// Add : 218 // Get //* | |
58 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
59 | +unsigned char COMM_Rated_charge_capacity_H = 20;// Add : 219 // Get //* | |
60 | +unsigned char COMM_Rated_charge_capacity_L = 20;// Add : 220 // Get //* | |
61 | +unsigned char COMM_Rated_discharge_capacity_H = 21;// Add : 222 // Get //* | |
62 | +unsigned char COMM_Rated_discharge_capacity_L = 21;// Add : 223 // Get //* | |
63 | +unsigned char COMM_Vehicle_connection_and_charge_able_discharge_able_status = 22; // Add : 224 // Get //* | |
64 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
65 | +unsigned char COMM_Minimum_maximum_charging_electric_energy_H = 23;// Add : 225 // Get //* | |
66 | +unsigned char COMM_Minimum_maximum_charging_electric_energy_L = 23;// Add : 226 // Get //* | |
67 | +unsigned char COMM_Minimum_maximum_discharging_electric_energy_H = 24;// Add : 229 // Get //* | |
68 | +unsigned char COMM_Minimum_maximum_discharging_electric_energy_L = 24;// Add : 230 // Get //* | |
69 | +unsigned short COMM_Minimum_maximum_charging_current = 25;// Add : 233 // Get //* | |
70 | +unsigned short COMM_Minimum_maximum_discharging_current = 26;// Add : 235 // Get //* | |
71 | +unsigned char COMM_Charger_discharger_type = 27;// Add : 237 // Get //* | |
72 | +unsigned char COMM_Vehicle_connection_confirmation = 28; // Add : 238 // Get //* | |
73 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
74 | +unsigned char COMM_Chargeable_capacity_of_vehicle_mounted_battery_H = 29;// Add : 239 // Get //* | |
75 | +unsigned char COMM_Chargeable_capacity_of_vehicle_mounted_battery_L = 29;// Add : 240 // Get //* | |
76 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
77 | +unsigned char COMM_Remaining_charg_eable_capacity_of_vehicle_mounted_battery_H = 30;// Add : 241 // Get //* | |
78 | +unsigned char COMM_Remaining_charg_eable_capacity_of_vehicle_mounted_battery_L = 30;// Add : 242 // Get //* | |
79 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
80 | +unsigned char COMM_Used_capacity_of_vehicle_mounted_battery_1_H = 31; // Add : 243 // Get //* | |
81 | +unsigned char COMM_Used_capacity_of_vehicle_mounted_battery_1_L = 31; // Add : 244 // Get //* | |
82 | +unsigned short COMM_Used_capacity_of_vehicle_mounted_battery_2 = 32; // Add : 245 // Get | |
83 | +unsigned short COMM_Rated_voltage = 33; // Add : 246 // Get | |
84 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
85 | +signed char COMM_Measured_instantaneous_charging_discharging_electric_energy_H = 34; // Add : 247 // Get | |
86 | +signed char COMM_Measured_instantaneous_charging_discharging_electric_energy_L = 34; // Add : 248 // Get | |
87 | +signed short COMM_Measured_instantaneous_charging_discharging_current = 35; // Add : 249 // Get | |
88 | +signed short COMM_Measured_instantaneous_charging_discharging_voltage = 36; // Add : 250 // Get | |
89 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
90 | +unsigned char COMM_Measured_cumulative_amount_of_discharging_electric_energy_H = 37; // Add : 251 // Get | |
91 | +unsigned char COMM_Measured_cumulative_amount_of_discharging_electric_energy_L = 37; // Add : 252 // Get | |
92 | +unsigned short COMM_Cumulative_amount_of_discharging_electric_energy_reset_setting = 38; // Add : 253 // Set | |
93 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
94 | +unsigned char COMM_Measured_cumulative_amount_of_charging_electric_energy_H = 39; // Add : 254 // Get | |
95 | +unsigned char COMM_Measured_cumulative_amount_of_charging_electric_energy_L = 39; // Add : 255 // Get | |
96 | +unsigned char COMM_Cumulative_amount_of_charging_electric_energy_reset_setting = 40; // Add : 256 // Get | |
97 | +unsigned char COMM_Operation_mode_setting = 41; // Add : 257 // Set/Get //* | |
98 | +unsigned char COMM_System_interconnected_type = 42; // Add : 258 // Get | |
99 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
100 | +unsigned char COMM_Remaining_stored_electricity_of_vehicle_mounted_battery_1_H = 43; // Add : 259 // Get //* // Wh | |
101 | +unsigned char COMM_Remaining_stored_electricity_of_vehicle_mounted_battery_1_L = 43; // Add : 260 // Get //* // Wh | |
102 | +unsigned short COMM__Remaining_stored_electricity_of_vehicle_mounted_battery_2 = 44; // Add : 261 // Get // Ah | |
103 | +unsigned char COMM__Remaining_stored_electricity_of_vehicle_mounted_battery_3 = 45; // Add : 262 // Get //* // % | |
104 | +// Packet4 | |
105 | +unsigned char COMM_Vehicle_ID = 1; // Add : 263 // Get //* | |
106 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
107 | +unsigned char COMM_Charging_amount_setting_1_H = 2; // Add : 275 // Set/Get | |
108 | +unsigned char COMM_Charging_amount_setting_1_L = 2; // Add : 276 // Set/Get | |
109 | +unsigned short COMM_Charging_amount_setting_2 = 3; // Add : 277 // Set/Get | |
110 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
111 | +unsigned char COMM_Discharging_amount_setting_H = 4; // Add : 278 // Set/Get | |
112 | +unsigned char COMM_Discharging_amount_setting_L = 4; // Add : 279 // Set/Get | |
113 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
114 | +unsigned char COMM_Charging_electric_energy_setting_H = 5; // Add : 280 // Set/Get | |
115 | +unsigned char COMM_Charging_electric_energy_setting_L = 5; // Add : 281 // Set/Get | |
116 | +//long 사이즈 char 사이즈로 변경하기 위해 변수를 2개로 분리 | |
117 | +unsigned char COMM_Discharging_electric_energy_setting_H = 6; // Add : 282 // Set/Get | |
118 | +unsigned char COMM_Discharging_electric_energy_setting_L = 6; // Add : 283 // Set/Get | |
119 | +unsigned short COMM_Charging_current_setting = 7; // Add : 284 // Set/Get | |
120 | +unsigned short COMM_Discharging_current_setting = 8; // Add : 285 // Set/Get | |
121 | +unsigned short COMM_Rated_voltage_Independent = 9; // Add : 286 // Get | |
122 | + | |
123 | +unsigned char COMM_Operation_status = 1;//Add : 1000//bit0(Stop),bit1(Charge),bit2(Discharge) | |
124 | +unsigned char COMM_Connectrion_state = 1;//Add : 1001//bit0(Disconnect),bit1(Connect) | |
125 | +unsigned char COMM_SOC;//Add : 1002//0x00-0x64 (0 - 100%) | |
126 | +unsigned char COMM_Instantaneous_power;//Add : 1003//0x00-0x63 (0 - 99) (ex> 8.9kW = 89) | |
127 | + | |
128 | + | |
129 | +//todo 테스트용 | |
130 | +int idummy = 0; | |
131 | + | |
132 | +#pragma SET_DATA_SECTION() | |
133 | + | |
134 | + | |
135 | +void InitModbusPtr() | |
136 | +{ | |
137 | + unsigned int i = 0; | |
138 | + | |
139 | + for (i = 0; i < MODBUSAPTRMAX; i++) ModbusAPtr[i] = &idummy; | |
140 | + | |
141 | +#if(MODBUSA_ENB) | |
142 | + InitModbusAPtr(); | |
143 | +#endif | |
144 | + | |
145 | +#if(MODBUSB_ENB) | |
146 | + InitModbusBPtr(); | |
147 | +#endif | |
148 | + | |
149 | +} | |
150 | + | |
151 | +void ModbusATxDataUpdate() | |
152 | +{ | |
153 | + | |
154 | +} | |
155 | + | |
156 | +void ModbusARxDataUpdate() | |
157 | +{ | |
158 | + COMM_Instantaneous_power = PbatAvg; | |
159 | + | |
160 | +} | |
161 | + | |
162 | +void InitModbusAPtr() | |
163 | +{ | |
164 | + | |
165 | + // Packet1 | |
166 | + ModbusAPtr[0] = &COMM_Operation_Status; | |
167 | + ModbusAPtr[1] = &COMM_Installation_location; | |
168 | +// ModbusAPtr[2] = &idummy; | |
169 | +// ModbusAPtr[3] = &idummy; | |
170 | +// ModbusAPtr[4] = &idummy; | |
171 | +// ModbusAPtr[5] = &idummy; | |
172 | +// ModbusAPtr[6] = &idummy; | |
173 | +// ModbusAPtr[7] = &idummy; | |
174 | +// ModbusAPtr[8] = &idummy; | |
175 | +// ModbusAPtr[9] = &idummy; | |
176 | + | |
177 | + ModbusAPtr[10] = &COMM_Standard_version_information; | |
178 | +// ModbusAPtr[11] = &idummy; | |
179 | + ModbusAPtr[12] = &COMM_Identification_number; | |
180 | +// ModbusAPtr[13] = &idummy; | |
181 | +// ModbusAPtr[14] = &idummy; | |
182 | +// ModbusAPtr[15] = &idummy; | |
183 | +// ModbusAPtr[16] = &idummy; | |
184 | +// ModbusAPtr[17] = &idummy; | |
185 | +// ModbusAPtr[18] = &idummy; | |
186 | +// ModbusAPtr[19] = &idummy; | |
187 | + | |
188 | +// ModbusAPtr[20] = &idummy; | |
189 | + ModbusAPtr[21] = &COMM_Measured_instantaneous_power_consumption; | |
190 | + ModbusAPtr[22] = &COMM_Measured_cumulative_power_consumption_H; | |
191 | + ModbusAPtr[23] = &COMM_Measured_cumulative_power_consumption_L; | |
192 | + | |
193 | + // Packet2 | |
194 | + ModbusAPtr[24] = &COMM_Manufacturer_fault_code; | |
195 | +// ModbusAPtr[25] = &idummy; | |
196 | +// ModbusAPtr[26] = &idummy; | |
197 | +// ModbusAPtr[27] = &idummy; | |
198 | +// ModbusAPtr[28] = &idummy; | |
199 | +// ModbusAPtr[29] = &idummy; | |
200 | +// | |
201 | +// ModbusAPtr[30] = &idummy; | |
202 | +// ModbusAPtr[31] = &idummy; | |
203 | +// ModbusAPtr[32] = &idummy; | |
204 | +// ModbusAPtr[33] = &idummy; | |
205 | +// ModbusAPtr[34] = &idummy; | |
206 | +// ModbusAPtr[35] = &idummy; | |
207 | +// ModbusAPtr[36] = &idummy; | |
208 | +// ModbusAPtr[37] = &idummy; | |
209 | +// ModbusAPtr[38] = &idummy; | |
210 | +// ModbusAPtr[39] = &idummy; | |
211 | +// | |
212 | +// ModbusAPtr[40] = &idummy; | |
213 | +// ModbusAPtr[41] = &idummy; | |
214 | +// ModbusAPtr[42] = &idummy; | |
215 | +// ModbusAPtr[43] = &idummy; | |
216 | +// ModbusAPtr[44] = &idummy; | |
217 | +// ModbusAPtr[45] = &idummy; | |
218 | +// ModbusAPtr[46] = &idummy; | |
219 | +// ModbusAPtr[47] = &idummy; | |
220 | +// ModbusAPtr[48] = &idummy; | |
221 | +// ModbusAPtr[49] = &idummy; | |
222 | +// | |
223 | +// ModbusAPtr[50] = &idummy; | |
224 | +// ModbusAPtr[51] = &idummy; | |
225 | +// ModbusAPtr[52] = &idummy; | |
226 | +// ModbusAPtr[53] = &idummy; | |
227 | +// ModbusAPtr[54] = &idummy; | |
228 | +// ModbusAPtr[55] = &idummy; | |
229 | +// ModbusAPtr[56] = &idummy; | |
230 | +// ModbusAPtr[57] = &idummy; | |
231 | +// ModbusAPtr[58] = &idummy; | |
232 | +// ModbusAPtr[59] = &idummy; | |
233 | +// | |
234 | +// ModbusAPtr[60] = &idummy; | |
235 | +// ModbusAPtr[61] = &idummy; | |
236 | +// ModbusAPtr[62] = &idummy; | |
237 | +// ModbusAPtr[63] = &idummy; | |
238 | +// ModbusAPtr[64] = &idummy; | |
239 | +// ModbusAPtr[65] = &idummy; | |
240 | +// ModbusAPtr[66] = &idummy; | |
241 | +// ModbusAPtr[67] = &idummy; | |
242 | +// ModbusAPtr[68] = &idummy; | |
243 | +// ModbusAPtr[69] = &idummy; | |
244 | +// | |
245 | +// ModbusAPtr[70] = &idummy; | |
246 | +// ModbusAPtr[71] = &idummy; | |
247 | +// ModbusAPtr[72] = &idummy; | |
248 | +// ModbusAPtr[73] = &idummy; | |
249 | +// ModbusAPtr[74] = &idummy; | |
250 | +// ModbusAPtr[75] = &idummy; | |
251 | +// ModbusAPtr[76] = &idummy; | |
252 | +// ModbusAPtr[77] = &idummy; | |
253 | +// ModbusAPtr[78] = &idummy; | |
254 | +// ModbusAPtr[79] = &idummy; | |
255 | +// | |
256 | +// ModbusAPtr[80] = &idummy; | |
257 | +// ModbusAPtr[81] = &idummy; | |
258 | +// ModbusAPtr[82] = &idummy; | |
259 | +// ModbusAPtr[83] = &idummy; | |
260 | +// ModbusAPtr[84] = &idummy; | |
261 | +// ModbusAPtr[85] = &idummy; | |
262 | +// ModbusAPtr[86] = &idummy; | |
263 | +// ModbusAPtr[87] = &idummy; | |
264 | +// ModbusAPtr[88] = &idummy; | |
265 | +// ModbusAPtr[89] = &idummy; | |
266 | +// | |
267 | +// ModbusAPtr[90] = &idummy; | |
268 | +// ModbusAPtr[91] = &idummy; | |
269 | +// ModbusAPtr[92] = &idummy; | |
270 | +// ModbusAPtr[93] = &idummy; | |
271 | +// ModbusAPtr[94] = &idummy; | |
272 | +// ModbusAPtr[95] = &idummy; | |
273 | +// ModbusAPtr[96] = &idummy; | |
274 | +// ModbusAPtr[97] = &idummy; | |
275 | +// ModbusAPtr[98] = &idummy; | |
276 | +// ModbusAPtr[99] = &idummy; | |
277 | +// | |
278 | +// ModbusAPtr[100] = &idummy; | |
279 | +// ModbusAPtr[101] = &idummy; | |
280 | +// ModbusAPtr[102] = &idummy; | |
281 | +// ModbusAPtr[103] = &idummy; | |
282 | +// ModbusAPtr[104] = &idummy; | |
283 | +// ModbusAPtr[105] = &idummy; | |
284 | +// ModbusAPtr[106] = &idummy; | |
285 | +// ModbusAPtr[107] = &idummy; | |
286 | +// ModbusAPtr[108] = &idummy; | |
287 | +// ModbusAPtr[109] = &idummy; | |
288 | +// | |
289 | +// ModbusAPtr[110] = &idummy; | |
290 | +// ModbusAPtr[111] = &idummy; | |
291 | +// ModbusAPtr[112] = &idummy; | |
292 | +// ModbusAPtr[113] = &idummy; | |
293 | +// ModbusAPtr[114] = &idummy; | |
294 | +// ModbusAPtr[115] = &idummy; | |
295 | +// ModbusAPtr[116] = &idummy; | |
296 | +// ModbusAPtr[117] = &idummy; | |
297 | +// ModbusAPtr[118] = &idummy; | |
298 | +// ModbusAPtr[119] = &idummy; | |
299 | +// | |
300 | +// ModbusAPtr[120] = &idummy; | |
301 | +// ModbusAPtr[121] = &idummy; | |
302 | +// ModbusAPtr[122] = &idummy; | |
303 | +// ModbusAPtr[123] = &idummy; | |
304 | +// ModbusAPtr[124] = &idummy; | |
305 | +// ModbusAPtr[125] = &idummy; | |
306 | +// ModbusAPtr[126] = &idummy; | |
307 | +// ModbusAPtr[127] = &idummy; | |
308 | +// ModbusAPtr[128] = &idummy; | |
309 | +// ModbusAPtr[129] = &idummy; | |
310 | +// | |
311 | +// ModbusAPtr[130] = &idummy; | |
312 | +// ModbusAPtr[131] = &idummy; | |
313 | +// ModbusAPtr[132] = &idummy; | |
314 | +// ModbusAPtr[133] = &idummy; | |
315 | +// ModbusAPtr[134] = &idummy; | |
316 | +// ModbusAPtr[135] = &idummy; | |
317 | +// ModbusAPtr[136] = &idummy; | |
318 | + ModbusAPtr[137] = &COMM_Current_limit_setting; | |
319 | + ModbusAPtr[138] = &COMM_Fault_status; | |
320 | + ModbusAPtr[139] = &COMM_Fault_description; | |
321 | + | |
322 | + ModbusAPtr[140] = &COMM_Manufacturer_code; | |
323 | +// ModbusAPtr[141] = &idummy; | |
324 | + ModbusAPtr[142] = &COMM_Business_facility_code; | |
325 | + ModbusAPtr[143] = &COMM_Product_code; | |
326 | +// ModbusAPtr[144] = &idummy; | |
327 | +// ModbusAPtr[145] = &idummy; | |
328 | +// ModbusAPtr[146] = &idummy; | |
329 | +// ModbusAPtr[147] = &idummy; | |
330 | +// ModbusAPtr[148] = &idummy; | |
331 | + | |
332 | + // Packet3 | |
333 | + ModbusAPtr[149] = &COMM_Production_number; | |
334 | + | |
335 | +// ModbusAPtr[150] = &idummy; | |
336 | +// ModbusAPtr[151] = &idummy; | |
337 | +// ModbusAPtr[152] = &idummy; | |
338 | +// ModbusAPtr[153] = &idummy; | |
339 | +// ModbusAPtr[154] = &idummy; | |
340 | + ModbusAPtr[155] = &COMM_Production_date; | |
341 | +// ModbusAPtr[156] = &idummy; | |
342 | + ModbusAPtr[157] = &COMM_Power_saving_operation_setting; | |
343 | + ModbusAPtr[158] = &COMM_Remote_control_setting; | |
344 | + ModbusAPtr[159] = &COMM_Current_time_setting; | |
345 | + | |
346 | + ModbusAPtr[160] = &COMM_Current_date_setting; | |
347 | + ModbusAPtr[161] = &COMM_Current_date_setting; | |
348 | + ModbusAPtr[162] = &COMM_Power_limit_setting; | |
349 | + ModbusAPtr[163] = &COMM_Cumulative_operating_time_1; | |
350 | + ModbusAPtr[164] = &COMM_Cumulative_operating_time_H; | |
351 | + ModbusAPtr[165] = &COMM_Cumulative_operating_time_L; | |
352 | + ModbusAPtr[166] = &COMM_SetM_property_map; | |
353 | +// ModbusAPtr[167] = &idummy; | |
354 | +// ModbusAPtr[168] = &idummy; | |
355 | +// ModbusAPtr[169] = &idummy; | |
356 | +// | |
357 | +// ModbusAPtr[170] = &idummy; | |
358 | +// ModbusAPtr[171] = &idummy; | |
359 | +// ModbusAPtr[172] = &idummy; | |
360 | +// ModbusAPtr[173] = &idummy; | |
361 | +// ModbusAPtr[174] = &idummy; | |
362 | + ModbusAPtr[175] = &COMM_GetM_property_map; | |
363 | +// ModbusAPtr[176] = &idummy; | |
364 | +// ModbusAPtr[177] = &idummy; | |
365 | +// ModbusAPtr[178] = &idummy; | |
366 | +// ModbusAPtr[179] = &idummy; | |
367 | + | |
368 | +// ModbusAPtr[180] = &idummy; | |
369 | +// ModbusAPtr[181] = &idummy; | |
370 | +// ModbusAPtr[182] = &idummy; | |
371 | +// ModbusAPtr[183] = &idummy; | |
372 | + ModbusAPtr[184] = &COMM_Status_change_announcement_property_map; | |
373 | +// ModbusAPtr[185] = &idummy; | |
374 | +// ModbusAPtr[186] = &idummy; | |
375 | +// ModbusAPtr[187] = &idummy; | |
376 | +// ModbusAPtr[188] = &idummy; | |
377 | +// ModbusAPtr[189] = &idummy; | |
378 | + | |
379 | +// ModbusAPtr[190] = &idummy; | |
380 | +// ModbusAPtr[191] = &idummy; | |
381 | +// ModbusAPtr[192] = &idummy; | |
382 | + ModbusAPtr[193] = &COMM_Set_property_map; | |
383 | +// ModbusAPtr[194] = &idummy; | |
384 | +// ModbusAPtr[195] = &idummy; | |
385 | +// ModbusAPtr[196] = &idummy; | |
386 | +// ModbusAPtr[197] = &idummy; | |
387 | +// ModbusAPtr[198] = &idummy; | |
388 | +// ModbusAPtr[199] = &idummy; | |
389 | + | |
390 | +// ModbusAPtr[200] = &idummy; | |
391 | +// ModbusAPtr[201] = &idummy; | |
392 | + ModbusAPtr[202] = &COMM_Get_property_map; | |
393 | +// ModbusAPtr[203] = &idummy; | |
394 | +// ModbusAPtr[204] = &idummy; | |
395 | +// ModbusAPtr[205] = &idummy; | |
396 | +// ModbusAPtr[206] = &idummy; | |
397 | +// ModbusAPtr[207] = &idummy; | |
398 | +// ModbusAPtr[208] = &idummy; | |
399 | +// ModbusAPtr[209] = &idummy; | |
400 | + | |
401 | +// ModbusAPtr[210] = &idummy; | |
402 | + ModbusAPtr[211] = &COMM_Dischargeable_capacity_of_vehicle_mounted_battery_1_H; | |
403 | + ModbusAPtr[212] = &COMM_Dischargeable_capacity_of_vehicle_mounted_battery_1_L; | |
404 | + ModbusAPtr[213] = &COMM_Dischargeable_capacity_of_vehicle_mounted_battery_2; | |
405 | + ModbusAPtr[214] = &COMM_Remaining_dischargeable_capacity_of_vehicle_mounted_battery_1_H; | |
406 | + ModbusAPtr[215] = &COMM_Remaining_dischargeable_capacity_of_vehicle_mounted_battery_1_L; | |
407 | + ModbusAPtr[216] = &COMM_Remaining_dischargeable_capacity_of_vehicle_mounted_battery_2; | |
408 | + ModbusAPtr[217] = &COMM_Remaining_dischargeable_capacity_of_vehicle_mounted_battery_3; | |
409 | + ModbusAPtr[218] = &COMM_Rated_charge_capacity_H; | |
410 | + ModbusAPtr[219] = &COMM_Rated_charge_capacity_L; | |
411 | + | |
412 | + ModbusAPtr[220] = &COMM_Rated_discharge_capacity_H; | |
413 | + ModbusAPtr[221] = &COMM_Rated_discharge_capacity_L; | |
414 | + ModbusAPtr[222] = &COMM_Vehicle_connection_and_charge_able_discharge_able_status; | |
415 | + ModbusAPtr[223] = &COMM_Minimum_maximum_charging_electric_energy_H; | |
416 | + ModbusAPtr[224] = &COMM_Minimum_maximum_charging_electric_energy_L; | |
417 | +// ModbusAPtr[225] = &idummy; | |
418 | +// ModbusAPtr[226] = &idummy; | |
419 | + ModbusAPtr[227] = &COMM_Minimum_maximum_discharging_electric_energy_H; | |
420 | + ModbusAPtr[228] = &COMM_Minimum_maximum_discharging_electric_energy_L; | |
421 | +// ModbusAPtr[229] = &idummy; | |
422 | + | |
423 | +// ModbusAPtr[230] = &idummy; | |
424 | + ModbusAPtr[231] = &COMM_Minimum_maximum_charging_current; | |
425 | +// ModbusAPtr[232] = &idummy; | |
426 | + ModbusAPtr[233] = &COMM_Minimum_maximum_discharging_current; | |
427 | +// ModbusAPtr[234] = &idummy; | |
428 | + ModbusAPtr[235] = &COMM_Charger_discharger_type; | |
429 | + ModbusAPtr[236] = &COMM_Vehicle_connection_confirmation; | |
430 | + ModbusAPtr[237] = &COMM_Chargeable_capacity_of_vehicle_mounted_battery_H; | |
431 | + ModbusAPtr[238] = &COMM_Chargeable_capacity_of_vehicle_mounted_battery_L; | |
432 | + ModbusAPtr[239] = &COMM_Remaining_charg_eable_capacity_of_vehicle_mounted_battery_H; | |
433 | + | |
434 | + ModbusAPtr[240] = &COMM_Remaining_charg_eable_capacity_of_vehicle_mounted_battery_L; | |
435 | + ModbusAPtr[241] = &COMM_Used_capacity_of_vehicle_mounted_battery_1_H; | |
436 | + ModbusAPtr[242] = &COMM_Used_capacity_of_vehicle_mounted_battery_1_L; | |
437 | + ModbusAPtr[243] = &COMM_Used_capacity_of_vehicle_mounted_battery_2; | |
438 | + ModbusAPtr[244] = &COMM_Rated_voltage; | |
439 | + ModbusAPtr[245] = &COMM_Measured_instantaneous_charging_discharging_electric_energy_H; | |
440 | + ModbusAPtr[246] = &COMM_Measured_instantaneous_charging_discharging_electric_energy_L; | |
441 | + ModbusAPtr[247] = &COMM_Measured_instantaneous_charging_discharging_current; | |
442 | + ModbusAPtr[248] = &COMM_Measured_instantaneous_charging_discharging_voltage; | |
443 | + ModbusAPtr[249] = &COMM_Measured_cumulative_amount_of_discharging_electric_energy_H; | |
444 | + | |
445 | + ModbusAPtr[250] = &COMM_Measured_cumulative_amount_of_discharging_electric_energy_L; | |
446 | + ModbusAPtr[251] = &COMM_Cumulative_amount_of_discharging_electric_energy_reset_setting; | |
447 | + ModbusAPtr[252] = &COMM_Measured_cumulative_amount_of_charging_electric_energy_H; | |
448 | + ModbusAPtr[253] = &COMM_Measured_cumulative_amount_of_charging_electric_energy_L; | |
449 | + ModbusAPtr[254] = &COMM_Cumulative_amount_of_charging_electric_energy_reset_setting; | |
450 | + ModbusAPtr[255] = &COMM_Operation_mode_setting; | |
451 | + ModbusAPtr[256] = &COMM_System_interconnected_type; | |
452 | + ModbusAPtr[257] = &COMM_Remaining_stored_electricity_of_vehicle_mounted_battery_1_H; | |
453 | + ModbusAPtr[258] = &COMM_Remaining_stored_electricity_of_vehicle_mounted_battery_1_L; | |
454 | + ModbusAPtr[259] = &COMM__Remaining_stored_electricity_of_vehicle_mounted_battery_2; | |
455 | + | |
456 | + ModbusAPtr[260] = &COMM__Remaining_stored_electricity_of_vehicle_mounted_battery_3; | |
457 | + ModbusAPtr[261] = &COMM_Vehicle_ID; | |
458 | +// ModbusAPtr[262] = &idummy; | |
459 | + | |
460 | + // Packet4 | |
461 | +// ModbusAPtr[263] = &idummy; | |
462 | +// ModbusAPtr[264] = &idummy; | |
463 | +// ModbusAPtr[265] = &idummy; | |
464 | +// ModbusAPtr[266] = &idummy; | |
465 | +// ModbusAPtr[267] = &idummy; | |
466 | +// ModbusAPtr[268] = &idummy; | |
467 | +// ModbusAPtr[269] = &idummy; | |
468 | + | |
469 | +// ModbusAPtr[270] = &idummy; | |
470 | +// ModbusAPtr[271] = &idummy; | |
471 | +// ModbusAPtr[272] = &idummy; | |
472 | + ModbusAPtr[273] = &COMM_Charging_amount_setting_1_H; | |
473 | + ModbusAPtr[274] = &COMM_Charging_amount_setting_1_L; | |
474 | + ModbusAPtr[275] = &COMM_Charging_amount_setting_2; | |
475 | + ModbusAPtr[276] = &COMM_Discharging_amount_setting_H; | |
476 | + ModbusAPtr[277] = &COMM_Discharging_amount_setting_L; | |
477 | + ModbusAPtr[278] = &COMM_Charging_electric_energy_setting_H; | |
478 | + ModbusAPtr[279] = &COMM_Charging_electric_energy_setting_L; | |
479 | + | |
480 | + ModbusAPtr[280] = &COMM_Discharging_electric_energy_setting_H; | |
481 | + ModbusAPtr[281] = &COMM_Discharging_electric_energy_setting_L; | |
482 | + ModbusAPtr[282] = &COMM_Charging_current_setting; | |
483 | + ModbusAPtr[283] = &COMM_Discharging_current_setting; | |
484 | + ModbusAPtr[284] = &COMM_Rated_voltage_Independent; | |
485 | +// ModbusAPtr[285] = &idummy; | |
486 | +// ModbusAPtr[286] = &idummy; | |
487 | + | |
488 | +//---------------------------------------------// | |
489 | + | |
490 | +// ModbusAPtr[287] = &idummy; | |
491 | +// ModbusAPtr[288] = &idummy; | |
492 | +// ModbusAPtr[289] = &idummy; | |
493 | + | |
494 | + ModbusAPtr[1000] = &COMM_Operation_status; | |
495 | + ModbusAPtr[1001] = &COMM_Connectrion_state; | |
496 | + ModbusAPtr[1002] = &COMM_SOC; | |
497 | + ModbusAPtr[1003] = &COMM_Instantaneous_power; | |
498 | +} | |
499 | + | |
500 | +void ModbusBTxDataUpdate() | |
501 | +{ | |
502 | + | |
503 | +} | |
504 | + | |
505 | +void ModbusBRxDataUpdate() | |
506 | +{ | |
507 | + | |
508 | +} | |
509 | + | |
510 | +void InitModbusBPtr() | |
511 | +{ | |
512 | + | |
513 | + | |
514 | +} | |
515 | + | |
516 | + | |
517 | + |
+++ Common_Resource/CommonLibrary/source/NtcLib.cpp
... | ... | @@ -0,0 +1,48 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-ME-CPU1 | |
3 | +// File Name : Ntc.cpp | |
4 | +// Created on : 2022. 10. 17. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | + | |
11 | +#include <CommonLib.h> | |
12 | + | |
13 | +sNTCTABLE NtcHeatSink; | |
14 | + | |
15 | + | |
16 | +sTEMP_LIST Temp; | |
17 | + | |
18 | +void InitNtcTable() | |
19 | +{ | |
20 | + memset(&NtcHeatSink, 0, (sizeof(NtcHeatSink) / sizeof(int))); | |
21 | + | |
22 | + //내기온도 측정용 : NTCALUG02A103G | |
23 | + //Beta(25/85) = 3984 | |
24 | + //Tolerance R +-2% | |
25 | + NtcHeatSink.R25 = 10000.; | |
26 | + NtcHeatSink.Rset = 20000.; | |
27 | + NtcHeatSink.Vset = 3.; | |
28 | + NtcHeatSink.Beta = 3984.; | |
29 | + NtcHeatSink.TempStep = 1; | |
30 | + NtcHeatSink.Size = 200; | |
31 | + | |
32 | + NtcTableGen(&NtcHeatSink); | |
33 | + | |
34 | +} | |
35 | + | |
36 | + | |
37 | + | |
38 | +void NtcRead() | |
39 | +{ | |
40 | + NtcTableReadTemp(&Temp.DcSwHeatSink1, &Adc.Data[15], &NtcHeatSink); | |
41 | + NtcTableReadTemp(&Temp.DcSwHeatSink2, &Adc.Data[16], &NtcHeatSink); | |
42 | +// NtcTableReadTemp(&Temp.AcSwHeatSink1, &Adc.Data[24], &NtcHeatSink); | |
43 | +// NtcTableReadTemp(&Temp.AcSwHeatSink2, &Adc.Data[25], &NtcHeatSink); | |
44 | +// NtcTableReadTemp(&Temp.Spare1, &Adc.Data[26], &NtcHeatSink); | |
45 | +// NtcTableReadTemp(&Temp.Spare2, &Adc.Data[27], &NtcHeatSink); | |
46 | + | |
47 | + Temp.MCU = (float)GetTemperatureC(AdcaResultRegs.ADCRESULT8); | |
48 | +} |
+++ Common_Resource/CommonLibrary/source/RTC.c
... | ... | @@ -0,0 +1,329 @@ |
1 | +/* | |
2 | +* RTC.c | |
3 | +* | |
4 | +* Created on: 2017. 1. 25. | |
5 | +* Author: kdkor | |
6 | +*/ | |
7 | + | |
8 | +#include "Cpu1DeviceDefine.h" | |
9 | + | |
10 | +struct sDS3234_REGS RTCRegs; | |
11 | +struct sDS3234_REGS RTCWrBuf; | |
12 | + | |
13 | +//----------------------RTC---------------------------------------// | |
14 | +unsigned int Flag_write_time = 0; | |
15 | +unsigned int Flag_write_date = 0; | |
16 | +unsigned long RTCDate = 0; | |
17 | +unsigned long RTCTime = 0; | |
18 | + | |
19 | +#define CS_LOW GPIO_writePin(61, 0) | |
20 | +#define CS_HIGH GPIO_writePin(61, 1) | |
21 | + | |
22 | +//TODO 임시 코드 이므로 나중에 리뷰 할 것 | |
23 | + | |
24 | +void InitRTC() | |
25 | +{ | |
26 | +// SPI GPIO핀 설정 | |
27 | +// InitSpidGpio(); | |
28 | + | |
29 | + GPIO_setMasterCore(58, GPIO_CORE_CPU1); | |
30 | + GPIO_setPinConfig(GPIO_58_SPISIMOA); | |
31 | + GPIO_setDirectionMode(58, GPIO_DIR_MODE_OUT); | |
32 | + GPIO_setPadConfig(58, GPIO_PIN_TYPE_STD); | |
33 | + GPIO_setQualificationMode(58, GPIO_QUAL_ASYNC); | |
34 | + | |
35 | + GPIO_setMasterCore(59, GPIO_CORE_CPU1); | |
36 | + GPIO_setPinConfig(GPIO_59_SPISOMIA); | |
37 | + GPIO_setDirectionMode(59, GPIO_DIR_MODE_IN); | |
38 | + GPIO_setPadConfig(59, GPIO_PIN_TYPE_PULLUP); | |
39 | + GPIO_setQualificationMode(59, GPIO_QUAL_ASYNC); | |
40 | + | |
41 | + GPIO_setMasterCore(60, GPIO_CORE_CPU1); | |
42 | + GPIO_setPinConfig(GPIO_60_SPICLKA); | |
43 | + GPIO_setDirectionMode(60, GPIO_DIR_MODE_OUT); | |
44 | + GPIO_setPadConfig(60, GPIO_PIN_TYPE_STD); | |
45 | + GPIO_setQualificationMode(60, GPIO_QUAL_ASYNC); | |
46 | + | |
47 | + GPIO_setMasterCore(61, GPIO_CORE_CPU1); | |
48 | + GPIO_setPinConfig(GPIO_61_GPIO61); | |
49 | + GPIO_setDirectionMode(61, GPIO_DIR_MODE_OUT); | |
50 | + GPIO_setPadConfig(61, GPIO_PIN_TYPE_STD); | |
51 | + GPIO_setQualificationMode(61, GPIO_QUAL_ASYNC); | |
52 | + | |
53 | + SPI_disableModule(SPIA_BASE); | |
54 | + SPI_setConfig(SPIA_BASE, DEVICE_LSPCLK_FREQ, SPI_PROT_POL0PHA0, SPI_MODE_MASTER_OD, 400000, 8); | |
55 | + SPI_enableTalk(SPIA_BASE); | |
56 | + | |
57 | + SPI_enableModule(SPIA_BASE); | |
58 | + | |
59 | +// // SPI FIFO 초기화 | |
60 | +// SpiaRegs.SPIFFTX.all = 0xE040; | |
61 | +// SpiaRegs.SPIFFRX.all = 0x204f; | |
62 | +// SpiaRegs.SPIFFCT.all = 0x0; | |
63 | +// | |
64 | +// //SPI 초기화 | |
65 | +// SpiaRegs.SPICCR.all = 0x000F; // Relinquish SPI from Reset | |
66 | +// SpiaRegs.SPICTL.all = 0x0006; // Enable master mode, normal phase, | |
67 | +// // enable talk, and SPI interrupt disabled. | |
68 | +// | |
69 | +// SpiaRegs.SPIBRR.bit.SPI_BIT_RATE = 0x0012; // 4Mbps Baud | |
70 | +// SpiaRegs.SPICCR.all = 0x008F; // Relinquish SPI from Reset | |
71 | +// SpiaRegs.SPIPRI.bit.FREE = 1; // Set so breakpoints don't disturb xmission | |
72 | + | |
73 | + memset(&RTCRegs, 0, (sizeof(RTCRegs) / sizeof(int))); | |
74 | + memset(&RTCWrBuf, 0, (sizeof(RTCWrBuf) / sizeof(int))); | |
75 | +} | |
76 | + | |
77 | +unsigned int Flag_RTC_request = 0; | |
78 | + | |
79 | +unsigned int Spid_TxErr_Cnt = 0; | |
80 | +unsigned int Spid_RxErr_Cnt = 0; | |
81 | +unsigned int Spid_Rx_Data = 0; | |
82 | +unsigned int Spid_Tx_Data = 0; | |
83 | +unsigned int Spi_RTC_Flag_Rx = 0; | |
84 | +unsigned int Spi_RTC_Flag_Tx = 0; | |
85 | + | |
86 | +unsigned int Flag_Wr_RTC= 0; | |
87 | +unsigned int RTC_rAddr = 0; | |
88 | +unsigned int RTC_wAddr = 0; | |
89 | + | |
90 | + | |
91 | +void Spid_Tx(unsigned int Tx_Data) | |
92 | +{ | |
93 | + | |
94 | +// if (SpiaRegs.SPIFFTX.bit.TXFFST == 0 && SpiaRegs.SPIFFRX.bit.RXFIFORESET == 1) | |
95 | +// { | |
96 | +// SpiaRegs.SPITXBUF = Tx_Data; | |
97 | +// } | |
98 | +// else if (SpiaRegs.SPIFFTX.bit.TXFFST > 1) | |
99 | +// { | |
100 | +// Spid_TxErr_Cnt = Spid_TxErr_Cnt + SpiaRegs.SPIFFTX.bit.TXFFST; | |
101 | +// } | |
102 | + | |
103 | + int temp=0; | |
104 | + | |
105 | + CS_LOW; | |
106 | + | |
107 | + SPI_writeDataBlockingNonFIFO(SPIA_BASE, Tx_Data); | |
108 | + SPI_readDataBlockingNonFIFO(SPIA_BASE); | |
109 | + | |
110 | + CS_HIGH; | |
111 | + | |
112 | +} | |
113 | + | |
114 | +//unsigned int Spid_Rx(void) | |
115 | +unsigned int Spid_Rx(unsigned int Read_addr) | |
116 | +{ | |
117 | +// if (Spi_RTC_Flag_Rx == 0) | |
118 | +// { | |
119 | +// if (SpiaRegs.SPIFFRX.bit.RXFFST == 1) | |
120 | +// { | |
121 | +// Spid_Rx_Data = (0x00ff) & (SpiaRegs.SPIRXBUF); | |
122 | +// Spi_RTC_Flag_Rx = 1; | |
123 | +// return 1; | |
124 | +// } | |
125 | +// else if (SpiaRegs.SPIFFRX.bit.RXFFST > 1) | |
126 | +// { | |
127 | +// Spid_RxErr_Cnt = Spid_RxErr_Cnt + SpiaRegs.SPIFFRX.bit.RXFFST; | |
128 | +// SpiaRegs.SPIFFRX.bit.RXFIFORESET = 0; | |
129 | +// delay_us(1); | |
130 | +// SpiaRegs.SPIFFRX.bit.RXFIFORESET = 1; | |
131 | +// } | |
132 | +// | |
133 | +// } | |
134 | +// | |
135 | +// return 0; | |
136 | + | |
137 | + int temp=0; | |
138 | + | |
139 | + CS_LOW; | |
140 | + | |
141 | + SPI_writeDataBlockingNonFIFO(SPIA_BASE, Read_addr); | |
142 | + temp = SPI_readDataBlockingNonFIFO(SPIA_BASE); | |
143 | + SPI_writeDataBlockingNonFIFO(SPIA_BASE, Read_addr); | |
144 | + temp = SPI_readDataBlockingNonFIFO(SPIA_BASE); | |
145 | + | |
146 | +// delay_us(3); | |
147 | + CS_HIGH; | |
148 | + | |
149 | + return(temp); | |
150 | +} | |
151 | + | |
152 | +void RtcRun() | |
153 | +{ | |
154 | + if (Flag_Wr_RTC == 0) RtcReadTime(); | |
155 | + else RtcWriteTime(); | |
156 | + | |
157 | +} | |
158 | + | |
159 | +int wAddr = 0, wData = 0; | |
160 | + | |
161 | + | |
162 | +void RtcWriteTime() | |
163 | +{ | |
164 | + | |
165 | + if (Spi_RTC_Flag_Rx == 0) | |
166 | + { | |
167 | + switch (RTC_wAddr) | |
168 | + { | |
169 | + case RTC_SEC: | |
170 | + RTCWrBuf.SecDAT.bit.Tens = RTCWrBuf.Sec / 10; | |
171 | + RTCWrBuf.SecDAT.bit.Unit = RTCWrBuf.Sec % 10; | |
172 | + wData = RTCWrBuf.SecDAT.all; | |
173 | + wAddr = (RTC_SEC | RTC_WR | wData); | |
174 | + Spid_Tx(wAddr); | |
175 | + RTC_wAddr = RTC_MIN; | |
176 | + | |
177 | + break; | |
178 | + | |
179 | + case RTC_MIN: | |
180 | + RTCWrBuf.MinDAT.bit.Tens = RTCWrBuf.Min / 10; | |
181 | + RTCWrBuf.MinDAT.bit.Unit = RTCWrBuf.Min % 10; | |
182 | + wData = RTCWrBuf.MinDAT.all; | |
183 | + wAddr = (RTC_MIN | RTC_WR | wData); | |
184 | + Spid_Tx(wAddr); | |
185 | + RTC_wAddr = RTC_HOUR; | |
186 | + break; | |
187 | + | |
188 | + case RTC_HOUR: | |
189 | + RTCWrBuf.HourDAT.bit.Tens = RTCWrBuf.Hour / 10; | |
190 | + RTCWrBuf.HourDAT.bit.Unit = RTCWrBuf.Hour % 10; | |
191 | + wData = RTCWrBuf.HourDAT.all; | |
192 | + wAddr = (RTC_HOUR | RTC_WR | wData); | |
193 | + Spid_Tx(wAddr); | |
194 | + RTC_wAddr = RTC_DAY; | |
195 | + break; | |
196 | + | |
197 | + case RTC_DAY: | |
198 | + RTCWrBuf.DayDAT.bit.Day = RTCWrBuf.Day; | |
199 | + wData = RTCWrBuf.DayDAT.all; | |
200 | + wAddr = (RTC_DAY | RTC_WR | wData); | |
201 | + Spid_Tx(wAddr); | |
202 | + RTC_wAddr = RTC_DATE; | |
203 | + break; | |
204 | + | |
205 | + case RTC_DATE: | |
206 | + RTCWrBuf.DateDAT.bit.Tens = RTCWrBuf.Date / 10; | |
207 | + RTCWrBuf.DateDAT.bit.Unit = RTCWrBuf.Date % 10; | |
208 | + wData = RTCWrBuf.DateDAT.all; | |
209 | + wAddr = (RTC_DATE | RTC_WR | wData); | |
210 | + Spid_Tx(wAddr); | |
211 | + RTC_wAddr = RTC_MONTH; | |
212 | + break; | |
213 | + | |
214 | + case RTC_MONTH: | |
215 | + RTCWrBuf.MonthDAT.bit.Tens = RTCWrBuf.Month / 10; | |
216 | + RTCWrBuf.MonthDAT.bit.Unit = RTCWrBuf.Month % 10; | |
217 | + wData = RTCWrBuf.MonthDAT.all; | |
218 | + wAddr = (RTC_MONTH | RTC_WR | wData); | |
219 | + Spid_Tx(wAddr); | |
220 | + RTC_wAddr = RTC_YEAR; | |
221 | + break; | |
222 | + | |
223 | + case RTC_YEAR: | |
224 | + if(RTCWrBuf.Year > 2000) RTCWrBuf.Year = RTCWrBuf.Year - 2000; | |
225 | + | |
226 | + RTCWrBuf.YearDAT.bit.Tens = (RTCWrBuf.Year / 10); | |
227 | + RTCWrBuf.YearDAT.bit.Unit = RTCWrBuf.Year % 10; | |
228 | + wData = RTCWrBuf.YearDAT.all; | |
229 | + wAddr = (RTC_YEAR | RTC_WR | wData); | |
230 | + Spid_Tx(wAddr); | |
231 | + | |
232 | + RTC_wAddr = RTC_SEC; | |
233 | + Flag_Wr_RTC = 0; | |
234 | + break; | |
235 | + | |
236 | + default: | |
237 | + RTC_wAddr = RTC_SEC; | |
238 | + Flag_Wr_RTC = 0; | |
239 | + break; | |
240 | + } | |
241 | + } | |
242 | + | |
243 | +} | |
244 | + | |
245 | +void RtcReadTime() | |
246 | +{ | |
247 | + int rAddr = 0; | |
248 | + | |
249 | + if (Flag_Wr_RTC == 0) Spid_Rx_Data = Spid_Rx(RTC_rAddr); | |
250 | + | |
251 | +// if (Spi_RTC_Flag_Rx == 1 && Flag_Wr_RTC == 0) | |
252 | + if (Flag_Wr_RTC == 0) | |
253 | + { | |
254 | + | |
255 | + switch (RTC_rAddr) | |
256 | + { | |
257 | + case RTC_SEC: | |
258 | + RTCRegs.SecDAT.all = Spid_Rx_Data; | |
259 | + RTCRegs.Sec = (RTCRegs.SecDAT.bit.Tens * 10 + RTCRegs.SecDAT.bit.Unit); | |
260 | + RTC_rAddr = RTC_MIN; | |
261 | + Spi_RTC_Flag_Rx = 0; | |
262 | + | |
263 | + break; | |
264 | + | |
265 | + case RTC_MIN: | |
266 | + RTCRegs.MinDAT.all = Spid_Rx_Data; | |
267 | + RTCRegs.Min = (RTCRegs.MinDAT.bit.Tens * 10 + RTCRegs.MinDAT.bit.Unit); | |
268 | + RTC_rAddr = RTC_HOUR; | |
269 | + Spi_RTC_Flag_Rx = 0; | |
270 | + | |
271 | + break; | |
272 | + | |
273 | + case RTC_HOUR: | |
274 | + RTCRegs.HourDAT.all = Spid_Rx_Data; | |
275 | + RTCRegs.Hour = (RTCRegs.HourDAT.bit.Tens * 10 + RTCRegs.HourDAT.bit.Unit); | |
276 | + RTC_rAddr = RTC_DAY; | |
277 | + Spi_RTC_Flag_Rx = 0; | |
278 | + | |
279 | + break; | |
280 | + | |
281 | + case RTC_DAY: | |
282 | + RTCRegs.DayDAT.all = Spid_Rx_Data; | |
283 | + RTCRegs.Day = (RTCRegs.DayDAT.bit.Day); | |
284 | + RTC_rAddr = RTC_DATE; | |
285 | + Spi_RTC_Flag_Rx = 0; | |
286 | + break; | |
287 | + | |
288 | + case RTC_DATE: | |
289 | + RTCRegs.DateDAT.all = Spid_Rx_Data; | |
290 | + RTCRegs.Date = (RTCRegs.DateDAT.bit.Tens * 10 + RTCRegs.DateDAT.bit.Unit); | |
291 | + RTC_rAddr = RTC_MONTH; | |
292 | + Spi_RTC_Flag_Rx = 0; | |
293 | + break; | |
294 | + | |
295 | + case RTC_MONTH: | |
296 | + RTCRegs.MonthDAT.all = Spid_Rx_Data; | |
297 | + RTCRegs.Month = (RTCRegs.MonthDAT.bit.Tens * 10 + RTCRegs.MonthDAT.bit.Unit); | |
298 | + RTC_rAddr = RTC_YEAR; | |
299 | + Spi_RTC_Flag_Rx = 0; | |
300 | + break; | |
301 | + | |
302 | + case RTC_YEAR: | |
303 | + RTCRegs.YearDAT.all = Spid_Rx_Data; | |
304 | + RTCRegs.Year = (RTCRegs.YearDAT.bit.Tens * 10 + RTCRegs.YearDAT.bit.Unit); | |
305 | + RTC_rAddr = RTC_SEC; | |
306 | + Spi_RTC_Flag_Rx = 0; | |
307 | + break; | |
308 | + | |
309 | + default: | |
310 | + RTC_rAddr = RTC_SEC; | |
311 | + Spi_RTC_Flag_Rx = 0; | |
312 | + break; | |
313 | + } | |
314 | + } | |
315 | + else | |
316 | + { | |
317 | + RTC_rAddr = RTC_SEC; | |
318 | + } | |
319 | + | |
320 | + RTCDate = (unsigned long)RTCRegs.Year * 10000 + RTCRegs.Month * 100 + RTCRegs.Date; | |
321 | + RTCTime = (unsigned long)RTCRegs.Hour * 10000 + RTCRegs.Min * 100 + RTCRegs.Sec; | |
322 | + | |
323 | + if (Flag_Wr_RTC == 0) | |
324 | + { | |
325 | + rAddr = ((RTC_rAddr | RTC_RD) << 8); | |
326 | + Spid_Tx(rAddr); | |
327 | + } | |
328 | + | |
329 | +} |
+++ Common_Resource/CommonLibrary/source/RTC_SPI.c
... | ... | @@ -0,0 +1,261 @@ |
1 | +/*************************************************************** | |
2 | + RTC_SPI.c | |
3 | + copyright (c) 2017 by Sang-Yong Kim | |
4 | + Next Square Co. Ltd. | |
5 | + All Rights Reserved. | |
6 | +****************************************************************/ | |
7 | +#include "CommonLib.h" | |
8 | + | |
9 | +#define RTC_sec 0x0000 | |
10 | +#define RTC_min 0x0100 | |
11 | +#define RTC_hour 0x0200 | |
12 | +#define RTC_day 0x0300 | |
13 | +#define RTC_date 0x0400 | |
14 | +#define RTC_month 0x0500 | |
15 | +#define RTC_year 0x0600 | |
16 | +#define RTC_write 0x8000 | |
17 | + | |
18 | +#define RTC_Status 0x0E00 | |
19 | + | |
20 | +// Defines for Chip Select toggle. | |
21 | +// | |
22 | +#define CS_LOW_A GPIO_writePin(61, 0) | |
23 | +#define CS_HIGH_A GPIO_writePin(61, 1) | |
24 | + | |
25 | +int RTC_Read_seq=0; | |
26 | +int RTC_Write_seq=0; | |
27 | +int Time_sec=0, Time_min=0, Time_hour=0; | |
28 | +int Day_date=0, Day_month=0, Day_year=0; | |
29 | +int Write_sec=0,Write_min=0,Write_hour=0; | |
30 | +int Write_date=0,Write_month=0,Write_year=0; | |
31 | +int Time_1224=0, Time_AMPM=0; | |
32 | +int State_RTC_Write_complete=0; | |
33 | +//int Flag_RTC_Write=0; | |
34 | +int Read_addr=0; | |
35 | + | |
36 | +//unsigned int Spid_TxErr_Cnt = 0; | |
37 | +//unsigned int Spid_RxErr_Cnt = 0; | |
38 | +//unsigned int Spid_Rx_Data = 0; | |
39 | +//unsigned int Spid_Tx_Data = 0; | |
40 | +unsigned int Spid_Flag_Rx = 1; | |
41 | +//unsigned int Spid_Flag_Tx = 0; | |
42 | + | |
43 | +//int Testpcs4 = 0; | |
44 | + | |
45 | +unsigned int BCDtoDEC(int bcd) | |
46 | +{ | |
47 | +// int dec_num = 0; | |
48 | +// int weight = 1; | |
49 | +// | |
50 | +// while (bcd_num > 0) { | |
51 | +// int nibble = bcd_num & 0xF; // 마지막 4비트(한 니블) 추출 | |
52 | +// dec_num += nibble * weight; | |
53 | +// weight *= 10; | |
54 | +// bcd_num >>= 4; // 다음 니블로 이동 | |
55 | +// } | |
56 | + | |
57 | + // 0~3비트에서 1초 자리 추출 | |
58 | + int onesPlace = bcd & 0xF; // 0b1111과 AND 연산하여 0~3비트 값 추출 | |
59 | + | |
60 | + // 4~6비트에서 10초 자리 추출 | |
61 | + int tensPlace = (bcd >> 4) & 0x7; // 0b0111과 AND 연산하여 4~6비트 값 추출 | |
62 | + | |
63 | + // 십진수로 변환 | |
64 | + int dec = tensPlace * 10 + onesPlace; | |
65 | + | |
66 | + return dec; | |
67 | +} | |
68 | + | |
69 | +unsigned int decToBcd(int dec) { | |
70 | + unsigned int bcd = 0; | |
71 | + int shift = 0; | |
72 | + | |
73 | + while (dec != 0) { | |
74 | + // 각 10진수 자리를 BCD로 변환 | |
75 | + bcd |= (dec % 10) << (shift * 4); | |
76 | + dec /= 10; | |
77 | + shift++; | |
78 | + } | |
79 | + | |
80 | + return bcd; | |
81 | +} | |
82 | + | |
83 | +//int Spid_Tx(unsigned int Tx_Data) | |
84 | +//{ | |
85 | +// int temp=0; | |
86 | +// CS_LOW_A; | |
87 | +// SPI_writeDataBlockingNonFIFO(SPIA_BASE, Tx_Data); | |
88 | +// temp = SPI_readDataBlockingNonFIFO(SPIA_BASE); | |
89 | +// | |
90 | +// delay_us(2); | |
91 | +// CS_HIGH_A; | |
92 | +// | |
93 | +//} | |
94 | +// | |
95 | +//unsigned int Spid_Rx(unsigned int Read_addr) | |
96 | +//{ | |
97 | +// int a=0,b=0,temp=0; | |
98 | +// | |
99 | +// CS_LOW_A; | |
100 | +// | |
101 | +// SPI_writeDataBlockingNonFIFO(SPIA_BASE, Read_addr); | |
102 | +// temp = SPI_readDataBlockingNonFIFO(SPIA_BASE); | |
103 | +// SPI_writeDataBlockingNonFIFO(SPIA_BASE, Read_addr); | |
104 | +// temp = SPI_readDataBlockingNonFIFO(SPIA_BASE); | |
105 | +//// SPI_writeDataBlockingNonFIFO(SPIA_BASE, 0000); | |
106 | +//// Testpcs4 = SPI_readDataBlockingNonFIFO(SPIA_BASE); | |
107 | +// | |
108 | +// delay_us(2); | |
109 | +// CS_HIGH_A; | |
110 | +// | |
111 | +// return(temp); | |
112 | +//} | |
113 | + | |
114 | +void SPI_RTC_Read_Sequence() | |
115 | +{ | |
116 | + int a=0, b=0, c=0, d=0, temp=0; | |
117 | + int Spid_Rx_Data = 0; | |
118 | + | |
119 | + if(State_RTC_Write_complete==0) | |
120 | + { | |
121 | + switch(RTC_Read_seq) | |
122 | + { | |
123 | + | |
124 | + //-----------Read second from DS1390 -----------// | |
125 | + case RTC_sec: | |
126 | + | |
127 | + Spid_Rx_Data = Spid_Rx(RTC_sec); | |
128 | + | |
129 | + RTCRegs.SecDAT.all = Spid_Rx_Data; | |
130 | + RTCRegs.Sec = (RTCRegs.SecDAT.bit.Tens * 10 + RTCRegs.SecDAT.bit.Unit); | |
131 | + RTC_Read_seq = RTC_min; | |
132 | + | |
133 | + break; | |
134 | + //-----------Read minute from DS1390 -----------// | |
135 | + case RTC_min: | |
136 | + | |
137 | + Spid_Rx_Data = Spid_Rx(RTC_min); | |
138 | + | |
139 | + RTCRegs.MinDAT.all = Spid_Rx_Data; | |
140 | + RTCRegs.Min = (RTCRegs.MinDAT.bit.Tens * 10 + RTCRegs.MinDAT.bit.Unit); | |
141 | + RTC_Read_seq = RTC_hour; | |
142 | + | |
143 | + break; | |
144 | + //-----------Read hour from DS1390 -----------// | |
145 | + case RTC_hour: | |
146 | + | |
147 | + Spid_Rx_Data = Spid_Rx(RTC_hour); | |
148 | + | |
149 | + RTCRegs.HourDAT.all = Spid_Rx_Data; | |
150 | + RTCRegs.Hour = (RTCRegs.HourDAT.bit.Tens * 10 + RTCRegs.HourDAT.bit.Unit); | |
151 | + RTC_Read_seq = RTC_day; | |
152 | + | |
153 | + break; | |
154 | + //-----------Read date from DS1390 -----------// | |
155 | + case RTC_day: | |
156 | + | |
157 | + Spid_Rx_Data = Spid_Rx(RTC_day); | |
158 | + | |
159 | + RTCRegs.DayDAT.all = Spid_Rx_Data; | |
160 | + RTCRegs.Day = (RTCRegs.DayDAT.bit.Day); | |
161 | + RTC_Read_seq = RTC_date; | |
162 | + | |
163 | + break; | |
164 | + //-----------Read month from DS1390 -----------// | |
165 | + case RTC_date: | |
166 | + | |
167 | + Spid_Rx_Data = Spid_Rx(RTC_date); | |
168 | + | |
169 | + RTCRegs.DateDAT.all = Spid_Rx_Data; | |
170 | + RTCRegs.Date = (RTCRegs.DateDAT.bit.Tens * 10 + RTCRegs.DateDAT.bit.Unit); | |
171 | + RTC_Read_seq = RTC_month; | |
172 | + | |
173 | + break; | |
174 | + //-----------Read year from DS1390 -----------// | |
175 | + case RTC_month: | |
176 | + | |
177 | + Spid_Rx_Data = Spid_Rx(RTC_month); | |
178 | + | |
179 | + RTCRegs.MonthDAT.all = Spid_Rx_Data; | |
180 | + RTCRegs.Month = (RTCRegs.MonthDAT.bit.Tens * 10 + RTCRegs.MonthDAT.bit.Unit); | |
181 | + RTC_Read_seq = RTC_year; | |
182 | + | |
183 | + break; | |
184 | + //-----------Read year from DS1390 -----------// | |
185 | + case RTC_year: | |
186 | + | |
187 | + Spid_Rx_Data = Spid_Rx(RTC_year); | |
188 | + | |
189 | + RTCRegs.MonthDAT.all = Spid_Rx_Data; | |
190 | + RTCRegs.Month = (RTCRegs.MonthDAT.bit.Tens * 10 + RTCRegs.MonthDAT.bit.Unit); | |
191 | + RTC_Read_seq = RTC_sec; | |
192 | + | |
193 | + break; | |
194 | + | |
195 | + default: | |
196 | + RTC_Read_seq=0; | |
197 | + Spid_Flag_Rx=0; | |
198 | + break; | |
199 | + } | |
200 | + } | |
201 | +} | |
202 | + | |
203 | +void SPI_RTC_Write_Sequence() | |
204 | +{ | |
205 | + if(State_RTC_Write_complete) | |
206 | + { | |
207 | + switch(RTC_Write_seq) | |
208 | + { | |
209 | + unsigned int temp; | |
210 | + | |
211 | + default: break; | |
212 | + //-----------Read second from DS1390 -----------// | |
213 | + case 0: | |
214 | + temp = RTC_write|RTC_sec|(decToBcd(Write_sec)&0x7F); | |
215 | + Spid_Tx(temp); | |
216 | + RTC_Write_seq=1; | |
217 | + break; | |
218 | + //-----------Read minute from DS1390 -----------// | |
219 | + case 1: | |
220 | + | |
221 | + Spid_Tx(RTC_write|RTC_min|(decToBcd(Write_min)&0x7F)); | |
222 | + RTC_Write_seq=2; | |
223 | + break; | |
224 | + //-----------Read hour from DS1390 -----------// | |
225 | + case 2: | |
226 | + | |
227 | + Spid_Tx(RTC_write|RTC_hour|(decToBcd(Write_hour)&0x3F)); | |
228 | + RTC_Write_seq=3; | |
229 | + break; | |
230 | + //-----------Read date from DS1390 -----------// | |
231 | + case 3: | |
232 | + | |
233 | + Spid_Tx(RTC_write|RTC_date|(decToBcd(Write_date)&0x3F)); | |
234 | + RTC_Write_seq=4; | |
235 | + break; | |
236 | + //-----------Read month from DS1390 -----------// | |
237 | + case 4: | |
238 | + | |
239 | + Spid_Tx(RTC_write|RTC_month|(decToBcd(Write_month)&0x1F)); | |
240 | + RTC_Write_seq=5; | |
241 | + break; | |
242 | + //-----------Read year from DS1390 -----------// | |
243 | + case 5: | |
244 | + | |
245 | + Spid_Tx(RTC_write|RTC_year|(decToBcd(Write_year)&0xFF)); | |
246 | + RTC_Write_seq=0; | |
247 | + State_RTC_Write_complete=0; | |
248 | + break; | |
249 | + } | |
250 | + } | |
251 | + | |
252 | +} | |
253 | + | |
254 | +void InitSpi_RTC() | |
255 | +{ | |
256 | + | |
257 | + | |
258 | +} | |
259 | + | |
260 | + | |
261 | + |
+++ Common_Resource/CommonLibrary/source/RmsAvgCal.cpp
... | ... | @@ -0,0 +1,208 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : RmsAvgCal.cpp | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "CommonLib.h" | |
11 | + | |
12 | +float VbatSum = 0.; | |
13 | +float VbatAvg = 0.; | |
14 | + | |
15 | +float IbatSum = 0.; | |
16 | +float IbatAvg = 0.; | |
17 | + | |
18 | +float VboostSum = 0.; | |
19 | +float VboostAvg = 0.; | |
20 | + | |
21 | +float VdabSum = 0.; | |
22 | +float VdabAvg = 0.; | |
23 | + | |
24 | +float VdcHSum = 0.; | |
25 | +float VdcHAvg = 0.; | |
26 | + | |
27 | +float VdcLSum = 0.; | |
28 | +float VdcLAvg = 0.; | |
29 | + | |
30 | +float VdcSum = 0.; | |
31 | +float VdcAvg = 0.; | |
32 | + | |
33 | +float VunInvRms = 0.; | |
34 | +float VunInvRmsSum = 0.; | |
35 | + | |
36 | +float VnwInvRms = 0.; | |
37 | +float VnwInvRmsSum = 0.; | |
38 | + | |
39 | +float VacInvRms = 0.; | |
40 | +float VacInvRmsSum = 0.; | |
41 | + | |
42 | +float VunGridRms = 0.; | |
43 | +float VunGridRmsSum = 0.; | |
44 | + | |
45 | +float VnwGridRms = 0.; | |
46 | +float VnwGridRmsSum = 0.; | |
47 | + | |
48 | +float VacGridRms = 0.; | |
49 | +float VacGridRmsSum = 0.; | |
50 | + | |
51 | +float IacInvRms = 0.; | |
52 | +float IacInvRmsSum = 0.; | |
53 | + | |
54 | +float IuInvRms = 0.; | |
55 | +float IuInvRmsSum = 0.; | |
56 | + | |
57 | +float IwInvRms = 0.; | |
58 | +float IwInvRmsSum = 0.; | |
59 | + | |
60 | +float InInvRms = 0.; | |
61 | +float InInvRmsSum = 0.; | |
62 | + | |
63 | +float IacGridRms = 0.; | |
64 | +float IacGridRmsSum = 0.; | |
65 | + | |
66 | +float IuGridRms = 0.; | |
67 | +float IuGridRmsSum = 0.; | |
68 | + | |
69 | +float IwGridRms = 0.; | |
70 | +float IwGridRmsSum = 0.; | |
71 | + | |
72 | +float InGridRms = 0.; | |
73 | +float InGridRmsSum = 0.; | |
74 | + | |
75 | +float IzctRms = 0.; | |
76 | +float IzctRmsSum = 0.; | |
77 | + | |
78 | + | |
79 | +float PinvReactive = 0.; | |
80 | +float PinvReactiveSum = 0.; | |
81 | +float PinvReactiveAvg = 0.; | |
82 | + | |
83 | +float PinvActive = 0.; | |
84 | +float PinvActiveSum = 0.; | |
85 | +float PinvActiveAvg = 0.; | |
86 | + | |
87 | +float PinvApparentAvg = 0; | |
88 | + | |
89 | +float Pbat = 0.; | |
90 | +float PbatAvg = 0.; | |
91 | +float PbatSum = 0.; | |
92 | + | |
93 | +float IdeSum = 0.; | |
94 | +float IdeAvg = 0.; | |
95 | + | |
96 | +float IqeSum = 0.; | |
97 | +float IqeAvg = 0.; | |
98 | + | |
99 | +float VdeSum = 0.; | |
100 | +float VdeAvg = 0.; | |
101 | + | |
102 | +float VqeSum = 0.; | |
103 | +float VqeAvg = 0.; | |
104 | + | |
105 | +float PfAvg = 0.; | |
106 | + | |
107 | +void RmsAvgCal() | |
108 | +{ | |
109 | + VbatAvg = AVG(&VbatSum, INV_RMS_T500ms); | |
110 | + IbatAvg = AVG(&IbatSum, INV_RMS_T500ms); | |
111 | + VboostAvg = AVG(&VboostSum, INV_RMS_T500ms); | |
112 | + VdabAvg = AVG(&VdabSum, INV_RMS_T500ms); | |
113 | + VdcLAvg = AVG(&VdcLSum, INV_RMS_T500ms); | |
114 | + VdcHAvg = AVG(&VdcHSum, INV_RMS_T500ms); | |
115 | + VdcAvg = AVG(&VdcSum, INV_RMS_T500ms); | |
116 | + | |
117 | + VunInvRms = RMS(&VunInvRmsSum, INV_RMS_T500ms); | |
118 | + VnwInvRms = RMS(&VnwInvRmsSum, INV_RMS_T500ms); | |
119 | + VacInvRms = RMS(&VacInvRmsSum, INV_RMS_T500ms); | |
120 | + | |
121 | + VunGridRms = RMS(&VunGridRmsSum, INV_RMS_T500ms); | |
122 | + VnwGridRms = RMS(&VnwGridRmsSum, INV_RMS_T500ms); | |
123 | + VacGridRms = RMS(&VacGridRmsSum, INV_RMS_T500ms); | |
124 | + | |
125 | + IuInvRms = RMS(&IuInvRmsSum, INV_RMS_T500ms); | |
126 | + IwInvRms = RMS(&IwInvRmsSum, INV_RMS_T500ms); | |
127 | + InInvRms = RMS(&InInvRmsSum, INV_RMS_T500ms); | |
128 | + IacInvRms = RMS(&IacInvRmsSum, INV_RMS_T500ms); | |
129 | + | |
130 | + IuGridRms = RMS(&IuGridRmsSum, INV_RMS_T500ms); | |
131 | + IwGridRms = RMS(&IwGridRmsSum, INV_RMS_T500ms); | |
132 | + InGridRms = RMS(&InGridRmsSum, INV_RMS_T500ms); | |
133 | + IacGridRms = RMS(&IacGridRmsSum, INV_RMS_T500ms); | |
134 | + | |
135 | + IzctRms = RMS(&IzctRmsSum, INV_RMS_T500ms); | |
136 | + | |
137 | + PinvActiveAvg = AVG(&PinvActiveSum, INV_RMS_T500ms); | |
138 | + PinvReactiveAvg = AVG(&PinvReactiveSum, INV_RMS_T500ms); | |
139 | + PinvReactive = AVG(&PinvReactiveSum, INV_RMS_T500ms); | |
140 | + | |
141 | + Pbat = AVG(&VbatSum, INV_RMS_T500ms); | |
142 | + | |
143 | +} | |
144 | + | |
145 | +void RmsAvgSum() | |
146 | +{ | |
147 | +// VbatSum += Vbat; | |
148 | +// IbatSum += Ibat; | |
149 | +// VboostSum += Vboost; | |
150 | +// VdabSum += Vdab; | |
151 | +// VdcLSum += VdcL; | |
152 | +// VdcHSum += VdcH; | |
153 | +// VdcSum += Vdc; | |
154 | +// | |
155 | +// VunInvRmsSum += VunInv * VunInv; | |
156 | +// VnwInvRmsSum += VnwInv * VnwInv; | |
157 | +// VacInvRmsSum += VacInv * VacInv; | |
158 | +// | |
159 | +// VunGridRmsSum += VunGrid * VunGrid; | |
160 | +// VnwGridRmsSum += VnwGrid * VnwGrid; | |
161 | +// VacGridRmsSum += VacGrid * VacGrid; | |
162 | +// | |
163 | +// IuInvRmsSum += IuInv * IuInv; | |
164 | +// IwInvRmsSum += IwInv * IwInv; | |
165 | +// InInvRmsSum += InInv * InInv; | |
166 | +// IacInvRmsSum += IacInv * IacInv; | |
167 | +// | |
168 | +// IuGridRmsSum += IuGrid * IuGrid; | |
169 | +// IwGridRmsSum += IwGrid * IwGrid; | |
170 | +// InGridRmsSum += InGrid * InGrid; | |
171 | +// IacGridRmsSum += IacGrid * IacGrid; | |
172 | +// | |
173 | +// IzctRmsSum += Izct * Izct; | |
174 | +// | |
175 | +// PinvActive = -1.5 * (VdsGrid * IdsGrid + VqsGrid * IqsGrid); | |
176 | +// PinvActiveSum += PinvActive; | |
177 | +// | |
178 | +// PinvReactive = -1.5 * (VqsGrid * IdsGrid - VdsGrid * IqsGrid); | |
179 | +// PinvReactiveSum += PinvReactive; | |
180 | +// | |
181 | +// PinvApparentAvg = sqrt(PinvActiveAvg * PinvActiveAvg + PinvReactiveAvg * PinvReactiveAvg); | |
182 | +// | |
183 | +// PfAvg = PinvActiveAvg / PinvApparentAvg; | |
184 | +// Pbat = Vbat * Ibat; | |
185 | +// PbatSum += Pbat; | |
186 | + | |
187 | +} | |
188 | + | |
189 | +float RMS(float *RMSSum, float InversTime) | |
190 | +{ | |
191 | + float Rms_Value = 0; | |
192 | + | |
193 | + Rms_Value = sqrt((*RMSSum) * InversTime); | |
194 | + (*RMSSum) = 0; | |
195 | + | |
196 | + return Rms_Value; | |
197 | +} | |
198 | + | |
199 | +float AVG(float *Sum, float InversTime) | |
200 | +{ | |
201 | + float Avg_Value = 0; | |
202 | + | |
203 | + Avg_Value = (*Sum) * InversTime; | |
204 | + (*Sum) = 0; | |
205 | + | |
206 | + return Avg_Value; | |
207 | +} | |
208 | + |
+++ Common_Resource/CommonLibrary/source/SensingScale.cpp
... | ... | @@ -0,0 +1,280 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ALE300K03-21-LGE-GEN2.0-BE-CPU1 | |
3 | +// File Name : SensingScale.cpp | |
4 | +// Created on : 2022. 11. 8. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "CommonLib.h" | |
11 | + | |
12 | +unsigned int MuxSel = 0; | |
13 | + | |
14 | +struct sMesureList Scale; | |
15 | +struct sMesureList ScaleDefault; | |
16 | +struct sMesureList ScaleDelt; | |
17 | + | |
18 | +//struct sMesureList Offset; | |
19 | +//struct sMesureList OffsetDefault; | |
20 | +//struct sMesureList OffsetSum; | |
21 | +//struct sMesureList OffsetDelt; | |
22 | + | |
23 | +//------------------------------------------------------------------------// | |
24 | +float CH1_UV = 0, CH1_VIS = 0, CH1_IR = 0; | |
25 | +float CH2_UV = 0, CH2_VIS = 0, CH2_IR = 0; | |
26 | +float CH3_UV = 0, CH3_VIS = 0, CH3_IR = 0; | |
27 | +float CH4_UV = 0, CH4_VIS = 0, CH4_IR = 0; | |
28 | + | |
29 | +float DAC_1 = 0, DAC_2 = 0, DAC_3 = 0; | |
30 | + | |
31 | +void InitScale() | |
32 | +{ | |
33 | +// memset(&Offset, 0, (sizeof(Offset) / sizeof(int))); | |
34 | +// memset(&OffsetDefault, 0, (sizeof(OffsetDefault) / sizeof(int))); | |
35 | +// memset(&OffsetSum, 0, (sizeof(OffsetSum) / sizeof(int))); | |
36 | +// memset(&OffsetDelt, 0, (sizeof(OffsetDelt) / sizeof(int))); | |
37 | + | |
38 | + memset(&Scale, 0, (sizeof(Scale) / sizeof(int))); | |
39 | + memset(&ScaleDefault, 0, (sizeof(ScaleDefault) / sizeof(int))); | |
40 | + memset(&ScaleDelt, 0, (sizeof(ScaleDelt) / sizeof(int))); | |
41 | + | |
42 | + | |
43 | + ScaleDefaultCal(); | |
44 | + ReadScaleDelt(); | |
45 | + ScaleUpdate(); | |
46 | + | |
47 | + OffsetDefaultCal(); | |
48 | + ReadOffsetDelt(); | |
49 | + OffsetUpdate(); | |
50 | + | |
51 | +} | |
52 | + | |
53 | +void OffsetDefaultCal() | |
54 | +{ | |
55 | + Adc.OffsetDefault[0] = ADC_OFFSET1V5; //Vbat | |
56 | + Adc.OffsetDefault[1] = ADC_OFFSET1V5; //Ibat | |
57 | + Adc.OffsetDefault[2] = ADC_OFFSET1V5; //Vboost | |
58 | + Adc.OffsetDefault[3] = ADC_OFFSET1V5; //Vdab | |
59 | + Adc.OffsetDefault[4] = ADC_OFFSET1V5; //GFD | |
60 | + Adc.OffsetDefault[5] = ADC_OFFSET1V5; //VdcH | |
61 | + Adc.OffsetDefault[6] = ADC_OFFSET1V5; //IuGrid | |
62 | + Adc.OffsetDefault[7] = ADC_OFFSET1V5; //IwGrid | |
63 | + Adc.OffsetDefault[8] = ADC_OFFSET1V5; //VdcL | |
64 | + Adc.OffsetDefault[9] = ADC_OFFSET1V5; //VunGrid | |
65 | + Adc.OffsetDefault[10] = ADC_OFFSET1V5; //VnwGrid | |
66 | + Adc.OffsetDefault[11] = ADC_OFFSET1V5; //IuInv | |
67 | + Adc.OffsetDefault[12] = ADC_OFFSET1V5; //IwInv | |
68 | +// Adc.OffsetDefault[13] = ADC_OFFSET1V5; //Izct | |
69 | +// Adc.OffsetDefault[14] = ADC_OFFSET1V5; //reserved | |
70 | +// Adc.OffsetDefault[15] = ADC_OFFSET1V5; //reserved | |
71 | +// Adc.OffsetDefault[16] = ADC_OFFSET1V5; //reserved | |
72 | +// Adc.OffsetDefault[17] = ADC_OFFSET1V5; //reserved | |
73 | +// Adc.OffsetDefault[18] = ADC_OFFSET1V5; //IuGridExt | |
74 | +// Adc.OffsetDefault[19] = ADC_OFFSET1V5; //IuGridExt | |
75 | +// Adc.OffsetDefault[20] = ADC_OFFSET1V5; //VntcBoost | |
76 | +// Adc.OffsetDefault[21] = ADC_OFFSET1V5; //VntcLvDab | |
77 | +// Adc.OffsetDefault[22] = ADC_OFFSET1V5; //reserved | |
78 | +// Adc.OffsetDefault[23] = ADC_OFFSET1V5; //reserved | |
79 | +// Adc.OffsetDefault[24] = ADC_OFFSET1V5; //VntcHvDab | |
80 | +// Adc.OffsetDefault[25] = ADC_OFFSET1V5; //VntcInv | |
81 | +// Adc.OffsetDefault[26] = ADC_OFFSET1V5; //Vntc5 | |
82 | +// Adc.OffsetDefault[27] = ADC_OFFSET1V5; //Vntc6 | |
83 | +// Adc.OffsetDefault[28] = ADC_OFFSET1V5; //VunInv | |
84 | +// Adc.OffsetDefault[29] = ADC_OFFSET1V5; //VnwInv | |
85 | +// Adc.OffsetDefault[30] = ADC_OFFSET1V5; //reserved | |
86 | +// Adc.OffsetDefault[31] = ADC_OFFSET1V5; //reserved | |
87 | + | |
88 | + | |
89 | + //임시 EEPROM 올때까지만 | |
90 | + Adc.OffsetDelt[0] = 0.; //Vbat | |
91 | + Adc.OffsetDelt[1] = 0.; //Ibat | |
92 | + Adc.OffsetDelt[2] = 0.; //Vboost | |
93 | + Adc.OffsetDelt[3] = 0.; //Vdab | |
94 | + Adc.OffsetDelt[4] = 0.; //GFD | |
95 | + Adc.OffsetDelt[5] = 0.; //VdcH | |
96 | + Adc.OffsetDelt[6] = 0.; //IuGrid | |
97 | + Adc.OffsetDelt[7] = 0.; //IwGrid | |
98 | + Adc.OffsetDelt[8] = 0.; //VdcL | |
99 | + Adc.OffsetDelt[9] = 0.; //VunGrid | |
100 | + Adc.OffsetDelt[10] = 0.; //VnwGrid | |
101 | + Adc.OffsetDelt[11] = 0.; //IuInv | |
102 | + Adc.OffsetDelt[12] = 0.; //IwInv | |
103 | +// Adc.OffsetDelt[13] = 0.; //Izct | |
104 | +// Adc.OffsetDelt[14] = 0.; //reserved | |
105 | +// Adc.OffsetDelt[15] = 0.; //reserved | |
106 | +// Adc.OffsetDelt[16] = 0.; //reserved | |
107 | +// Adc.OffsetDelt[17] = 0.; //reserved | |
108 | +// Adc.OffsetDelt[18] = 0.; //IuGridExt | |
109 | +// Adc.OffsetDelt[19] = 0.; //IuGridExt | |
110 | +// Adc.OffsetDelt[20] = 0.; //VntcBoost | |
111 | +// Adc.OffsetDelt[21] = 0.; //VntcLvDab | |
112 | +// Adc.OffsetDelt[22] = 0.; //reserved | |
113 | +// Adc.OffsetDelt[23] = 0.; //reserved | |
114 | +// Adc.OffsetDelt[24] = 0.; //VntcHvDab | |
115 | +// Adc.OffsetDelt[25] = 0.; //VntcInv | |
116 | +// Adc.OffsetDelt[26] = 0.; //Vntc5 | |
117 | +// Adc.OffsetDelt[27] = 0.; //Vntc6 | |
118 | +// Adc.OffsetDelt[28] = 0.; //VunInv | |
119 | +// Adc.OffsetDelt[29] = 0.; //VnwInv | |
120 | +// Adc.OffsetDelt[30] = 0.; //reserved | |
121 | +// Adc.OffsetDelt[31] = 0.; //reserved | |
122 | + | |
123 | +} | |
124 | + | |
125 | +void OffsetUpdate() | |
126 | +{ | |
127 | + Adc.Offset[0] = Adc.OffsetDefault[0] + Adc.OffsetDelt[0]; //Vbat | |
128 | + Adc.Offset[1] = Adc.OffsetDefault[1] + Adc.OffsetDelt[1]; //Ibat | |
129 | + Adc.Offset[2] = Adc.OffsetDefault[2] + Adc.OffsetDelt[2]; //Vboost | |
130 | + Adc.Offset[3] = Adc.OffsetDefault[3] + Adc.OffsetDelt[3]; //Vdab | |
131 | + Adc.Offset[4] = Adc.OffsetDefault[4] + Adc.OffsetDelt[4]; //GFD | |
132 | + Adc.Offset[5] = Adc.OffsetDefault[5] + Adc.OffsetDelt[5]; //VdcH | |
133 | + Adc.Offset[6] = Adc.OffsetDefault[6] + Adc.OffsetDelt[6]; //IuGrid | |
134 | + Adc.Offset[7] = Adc.OffsetDefault[7] + Adc.OffsetDelt[7]; //IwGrid | |
135 | + Adc.Offset[8] = Adc.OffsetDefault[8] + Adc.OffsetDelt[8]; //VdcL | |
136 | + Adc.Offset[9] = Adc.OffsetDefault[9] + Adc.OffsetDelt[9]; //VunGrid | |
137 | + Adc.Offset[10] = Adc.OffsetDefault[10] + Adc.OffsetDelt[10]; //VnwGrid | |
138 | + Adc.Offset[11] = Adc.OffsetDefault[11] + Adc.OffsetDelt[11]; //IuInv | |
139 | + Adc.Offset[12] = Adc.OffsetDefault[12] + Adc.OffsetDelt[12]; //IwInv | |
140 | +// Adc.Offset[13] = Adc.OffsetDefault[13] + Adc.OffsetDelt[13]; //Izct | |
141 | +// Adc.Offset[14] = Adc.OffsetDefault[14] + Adc.OffsetDelt[14]; //reserved | |
142 | +// Adc.Offset[15] = Adc.OffsetDefault[15] + Adc.OffsetDelt[15]; //reserved | |
143 | +// Adc.Offset[16] = Adc.OffsetDefault[16] + Adc.OffsetDelt[16]; //reserved | |
144 | +// Adc.Offset[17] = Adc.OffsetDefault[17] + Adc.OffsetDelt[17]; //reserved | |
145 | +// Adc.Offset[18] = Adc.OffsetDefault[18] + Adc.OffsetDelt[18]; //IuGridExt | |
146 | +// Adc.Offset[19] = Adc.OffsetDefault[19] + Adc.OffsetDelt[19]; //IuGridExt | |
147 | +// Adc.Offset[20] = Adc.OffsetDefault[20] + Adc.OffsetDelt[20]; //VntcBoost | |
148 | +// Adc.Offset[21] = Adc.OffsetDefault[21] + Adc.OffsetDelt[21]; //VntcLvDab | |
149 | +// Adc.Offset[22] = Adc.OffsetDefault[22] + Adc.OffsetDelt[22]; //reserved | |
150 | +// Adc.Offset[23] = Adc.OffsetDefault[23] + Adc.OffsetDelt[23]; //reserved | |
151 | +// Adc.Offset[24] = Adc.OffsetDefault[24] + Adc.OffsetDelt[24]; //VntcHvDab | |
152 | +// Adc.Offset[25] = Adc.OffsetDefault[25] + Adc.OffsetDelt[25]; //VntcInv | |
153 | +// Adc.Offset[26] = Adc.OffsetDefault[26] + Adc.OffsetDelt[26]; //Vntc5 | |
154 | +// Adc.Offset[27] = Adc.OffsetDefault[27] + Adc.OffsetDelt[27]; //Vntc6 | |
155 | +// Adc.Offset[28] = Adc.OffsetDefault[28] + Adc.OffsetDelt[28]; //VunInv | |
156 | +// Adc.Offset[29] = Adc.OffsetDefault[29] + Adc.OffsetDelt[29]; //VnwInv | |
157 | +// Adc.Offset[30] = Adc.OffsetDefault[30] + Adc.OffsetDelt[30]; //reserved | |
158 | +// Adc.Offset[31] = Adc.OffsetDefault[31] + Adc.OffsetDelt[31]; //reserved | |
159 | + | |
160 | +} | |
161 | + | |
162 | +void ScaleDefaultCal() | |
163 | +{ | |
164 | + | |
165 | +// ScaleDefault.VunInv = INV_AC_PT_GAIN; //Adc21 인버터 출력 전압 UN | |
166 | +// ScaleDefault.VnwInv = INV_AC_PT_GAIN; //Adc22 인버터 출력 전압 UN | |
167 | +// ScaleDefault.IuGrid = -INV_AC_CT_GAIN; //Adc23 계통 전류 U | |
168 | +// ScaleDefault.IwGrid = -INV_AC_CT_GAIN; //Adc24 계통 전류 W | |
169 | + | |
170 | + //임시 EEPROM 올때까지만 | |
171 | + ScaleDelt.ADC_CH1_UV = 1.; | |
172 | + ScaleDelt.ADC_CH1_VIS = 1.; | |
173 | + ScaleDelt.ADC_CH1_IR = 1.; | |
174 | + ScaleDelt.ADC_CH2_UV = 1.; | |
175 | + ScaleDelt.ADC_CH2_VIS = 1.; | |
176 | + ScaleDelt.ADC_CH2_IR = 1.; | |
177 | + ScaleDelt.ADC_CH3_UV = 1.; | |
178 | + ScaleDelt.ADC_CH3_VIS = 1.; | |
179 | + ScaleDelt.ADC_CH3_IR = 1.; | |
180 | + ScaleDelt.ADC_CH4_UV = 1.; | |
181 | + ScaleDelt.ADC_CH4_VIS = 1.; | |
182 | + ScaleDelt.ADC_CH4_IR = 1.; | |
183 | + | |
184 | +} | |
185 | + | |
186 | +//AMC3330 | |
187 | +// Input Offset Current -10nA, 0.8nA, 10nA(Min, Typ, Max) | |
188 | +// Input Bias Current -10nA, 2.5nA, 10nA(Min, Typ, Max) | |
189 | +// 계산 다시 할것 | |
190 | + | |
191 | +void ScaleUpdate() | |
192 | +{ | |
193 | + | |
194 | + Scale.ADC_CH1_UV = ScaleDefault.ADC_CH1_UV + ScaleDelt.ADC_CH1_UV; | |
195 | + Scale.ADC_CH1_VIS = ScaleDefault.ADC_CH1_VIS + ScaleDelt.ADC_CH1_VIS; | |
196 | + Scale.ADC_CH1_IR = ScaleDefault.ADC_CH1_IR + ScaleDelt.ADC_CH1_IR; | |
197 | + | |
198 | + Scale.ADC_CH2_UV = ScaleDefault.ADC_CH2_UV + ScaleDelt.ADC_CH2_UV; | |
199 | + Scale.ADC_CH2_VIS = ScaleDefault.ADC_CH2_VIS + ScaleDelt.ADC_CH2_VIS; | |
200 | + Scale.ADC_CH2_IR = ScaleDefault.ADC_CH2_IR + ScaleDelt.ADC_CH2_IR; | |
201 | + | |
202 | + Scale.ADC_CH3_UV = ScaleDefault.ADC_CH3_UV + ScaleDelt.ADC_CH3_UV; | |
203 | + Scale.ADC_CH3_VIS = ScaleDefault.ADC_CH3_VIS + ScaleDelt.ADC_CH3_VIS; | |
204 | + Scale.ADC_CH3_IR = ScaleDefault.ADC_CH3_IR + ScaleDelt.ADC_CH3_IR; | |
205 | + | |
206 | + Scale.ADC_CH4_UV = ScaleDefault.ADC_CH4_UV + ScaleDelt.ADC_CH4_UV; | |
207 | + Scale.ADC_CH4_VIS = ScaleDefault.ADC_CH4_VIS + ScaleDelt.ADC_CH4_VIS; | |
208 | + Scale.ADC_CH4_IR = ScaleDefault.ADC_CH4_IR + ScaleDelt.ADC_CH4_IR; | |
209 | +} | |
210 | + | |
211 | +unsigned int TestAdcData = 4029; | |
212 | +float AdcOffset = 4095./2. ; | |
213 | +float VbatTestVar = 0.; | |
214 | + | |
215 | +void AdcResult(void) | |
216 | +{ | |
217 | + int AdcCnt = 0; | |
218 | + for (AdcCnt = 0; AdcCnt < 32; AdcCnt++) | |
219 | + { | |
220 | + Adc.Data[AdcCnt] = (float)Adc.RawData[AdcCnt] - Adc.Offset[AdcCnt]; | |
221 | + } | |
222 | + | |
223 | + CH1_UV = Adc.Data[2] * Scale.ADC_CH1_UV; | |
224 | + CH1_VIS = Adc.Data[3] * Scale.ADC_CH1_VIS; | |
225 | + CH1_IR = Adc.Data[4] * Scale.ADC_CH1_IR; | |
226 | + | |
227 | + CH2_UV = Adc.Data[5] * Scale.ADC_CH2_UV; | |
228 | + CH2_VIS = Adc.Data[8] * Scale.ADC_CH2_VIS; | |
229 | + CH2_IR = Adc.Data[10] * Scale.ADC_CH2_IR; | |
230 | + | |
231 | + CH3_UV = Adc.Data[11] * Scale.ADC_CH3_UV; | |
232 | + CH3_VIS = Adc.Data[12] * Scale.ADC_CH3_VIS; | |
233 | + CH3_IR = Adc.Data[13] * Scale.ADC_CH3_IR; | |
234 | + | |
235 | + CH4_UV = Adc.Data[20] * Scale.ADC_CH4_UV; | |
236 | + CH4_VIS = Adc.Data[19] * Scale.ADC_CH4_VIS; | |
237 | + CH4_IR = Adc.Data[18] * Scale.ADC_CH4_IR; | |
238 | + | |
239 | + DAC_1 = Adc.Data[0]; | |
240 | + DAC_2 = Adc.Data[1]; | |
241 | + DAC_3 = Adc.Data[9]; | |
242 | + | |
243 | +} | |
244 | + | |
245 | +void ReadScaleDelt(void) | |
246 | +{ | |
247 | + | |
248 | + | |
249 | +} | |
250 | + | |
251 | +void WriteScaleDelt(void) | |
252 | +{ | |
253 | +// NV.Adc.ScaleDelt.AdcExtBUTTON = ScaleDelt.AdcExtBUTTON; | |
254 | + | |
255 | +} | |
256 | + | |
257 | +void ResetScaleDelt(void) | |
258 | +{ | |
259 | + memset(&ScaleDelt, 0, (sizeof(ScaleDelt) / sizeof(int))); | |
260 | +} | |
261 | + | |
262 | + | |
263 | +void ReadOffsetDelt(void) | |
264 | +{ | |
265 | + | |
266 | + | |
267 | +} | |
268 | + | |
269 | +void WriteOffsetDelt(void) | |
270 | +{ | |
271 | +// NV.Adc.ScaleDelt.AdcExtBUTTON = ScaleDelt.AdcExtBUTTON; | |
272 | + | |
273 | +} | |
274 | + | |
275 | +void ResetOffsetDelt(void) | |
276 | +{ | |
277 | + memset(&ScaleDelt, 0, (sizeof(ScaleDelt) / sizeof(int))); | |
278 | +} | |
279 | + | |
280 | + |
+++ Common_Resource/CommonLibrary/source/SpiEepromLib.cpp
... | ... | @@ -0,0 +1,315 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : V2H6K01-23-ENEMAN | |
3 | +// File Name : EepromLib.cpp | |
4 | +// Created on : 2023. 10. 31. | |
5 | +// Description : EEPROM Library for CAT25512VI-GT3 | |
6 | +// Author : "Kim JeongWoo" | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "CommonLib.h" | |
11 | + | |
12 | + | |
13 | +unsigned int EepromAddr = 0x0000; | |
14 | +unsigned int EepromNumofBytes = 100; | |
15 | + | |
16 | +//나중에 DMA로 처리 할 것!!!! | |
17 | +//FIFO 적용할 것!!!!!!!! | |
18 | +//지금은 임시!!!!!!!!!! | |
19 | +//코드 컨벤션 및 변수 네이밍 나중에 수정 할 것!!!!!!!! | |
20 | + | |
21 | + | |
22 | + | |
23 | +// SPI EEPROM status | |
24 | +#define MSG_STATUS_READY_M 0x0000 // EEPROM is ready (not busy) | |
25 | +#define MSG_STATUS_WRITE_READY_M 0x0002 // EEPROM | |
26 | +#define MSG_STATUS_BUSY 0xFFFF // EEPROM is busy (internal write) | |
27 | + | |
28 | +// Opcodes for the EEPROM (8-bit) | |
29 | +//#define RDSR 0x0500 | |
30 | +//#define READ 0x0300 | |
31 | +//#define WRITE 0x0200 | |
32 | +//#define WREN 0x0600 | |
33 | +//#define WRDI 0x0400 | |
34 | +//#define WRSR 0x0100 | |
35 | + | |
36 | +#define RDSR 0x0500 //Read status | |
37 | +#define READ 0x0300 //Read from Memory Array | |
38 | +#define WRITE 0x0200 //Write from Memory Array | |
39 | +#define WREN 0x0600 //Write enable | |
40 | +#define WRDI 0x0400 //Write Disable | |
41 | +#define WRSR 0x0100 //Write status | |
42 | + | |
43 | +// | |
44 | +// Defines for Chip Select toggle. | |
45 | +// | |
46 | +#define CS_LOW GPIO_writePin(103, 0) | |
47 | +#define CS_HIGH GPIO_writePin(103, 1) | |
48 | + | |
49 | + | |
50 | +int FlagReadEeprom = 0; | |
51 | +int FlagWriteEeprom = 0; | |
52 | + | |
53 | + | |
54 | +// | |
55 | +// Function Prototypes | |
56 | +// | |
57 | +uint16_t ReadEepromStatusReg(void); | |
58 | +void writeData(uint16_t address, uint16_t * data, uint16_t length); | |
59 | +void readData(uint16_t address, uint16_t * data, uint16_t length); | |
60 | +void enableWrite(void); | |
61 | + | |
62 | +union FLOAT32_BYTE | |
63 | +{ | |
64 | + float wd32; | |
65 | + struct | |
66 | + { | |
67 | + unsigned byte0 :8; | |
68 | + unsigned byte1 :8; | |
69 | + unsigned byte2 :8; | |
70 | + unsigned byte3 :8; | |
71 | + }wdcode; | |
72 | +}; | |
73 | + | |
74 | +union INT16_BYTE | |
75 | +{ | |
76 | + unsigned int wd16; | |
77 | + struct | |
78 | + { | |
79 | + unsigned byte0 :8; | |
80 | + unsigned byte1 :8; | |
81 | + }wdcode; | |
82 | +}; | |
83 | + | |
84 | + | |
85 | +union FLOAT32_BYTE FloatWrBuf; | |
86 | +union FLOAT32_BYTE FloatRdBuf; | |
87 | + | |
88 | +union INT16_BYTE IntWrBuf; | |
89 | +union INT16_BYTE IntRdBuf; | |
90 | + | |
91 | + | |
92 | + | |
93 | +uint16_t EepromWrBuf[4] = {0,}; | |
94 | +uint16_t EepromRdBuf[4] = {0,}; | |
95 | + | |
96 | + | |
97 | +void InitSpi() | |
98 | +{ | |
99 | + | |
100 | + GPIO_setMasterCore(100, GPIO_CORE_CPU1); | |
101 | + GPIO_setPinConfig(GPIO_100_SPISIMOC); | |
102 | + GPIO_setDirectionMode(100, GPIO_DIR_MODE_OUT); | |
103 | + GPIO_setPadConfig(100, GPIO_PIN_TYPE_STD); | |
104 | + GPIO_setQualificationMode(100, GPIO_QUAL_ASYNC); | |
105 | + | |
106 | + GPIO_setMasterCore(101, GPIO_CORE_CPU1); | |
107 | + GPIO_setPinConfig(GPIO_101_SPISOMIC); | |
108 | + GPIO_setDirectionMode(101, GPIO_DIR_MODE_IN); | |
109 | + GPIO_setPadConfig(101, GPIO_PIN_TYPE_PULLUP); | |
110 | + GPIO_setQualificationMode(101, GPIO_QUAL_ASYNC); | |
111 | + | |
112 | + GPIO_setMasterCore(102, GPIO_CORE_CPU1); | |
113 | + GPIO_setPinConfig(GPIO_102_SPICLKC); | |
114 | + GPIO_setDirectionMode(102, GPIO_DIR_MODE_OUT); | |
115 | + GPIO_setPadConfig(102, GPIO_PIN_TYPE_STD); | |
116 | + GPIO_setQualificationMode(102, GPIO_QUAL_ASYNC); | |
117 | + | |
118 | + GPIO_setMasterCore(103, GPIO_CORE_CPU1); | |
119 | + GPIO_setPinConfig(GPIO_103_GPIO103); | |
120 | + GPIO_setDirectionMode(103, GPIO_DIR_MODE_OUT); | |
121 | + GPIO_setPadConfig(103, GPIO_PIN_TYPE_STD); | |
122 | + GPIO_setQualificationMode(103, GPIO_QUAL_ASYNC); | |
123 | + | |
124 | + SPI_disableModule(SPIC_BASE); | |
125 | + SPI_setConfig(SPIC_BASE, DEVICE_LSPCLK_FREQ, SPI_PROT_POL0PHA1, SPI_MODE_MASTER_OD, 1500000, 8); | |
126 | + SPI_enableTalk(SPIC_BASE); | |
127 | + | |
128 | + SPI_enableModule(SPIC_BASE); | |
129 | + | |
130 | +} | |
131 | + | |
132 | + | |
133 | +void ReadEeprom(uint16_t address, uint16_t *data, uint16_t length) | |
134 | +{ | |
135 | + while(ReadEepromStatusReg() & MSG_STATUS_READY_M == MSG_STATUS_READY_M); | |
136 | + | |
137 | + readData(address, data, length); | |
138 | +} | |
139 | + | |
140 | +float ReadEepromFloat(uint16_t address, float *Val) | |
141 | +{ | |
142 | + ReadEeprom(address * 4, EepromRdBuf, 4); | |
143 | + | |
144 | + FloatRdBuf.wdcode.byte0 = EepromRdBuf[0]; | |
145 | + FloatRdBuf.wdcode.byte1 = EepromRdBuf[1]; | |
146 | + FloatRdBuf.wdcode.byte2 = EepromRdBuf[2]; | |
147 | + FloatRdBuf.wdcode.byte3 = EepromRdBuf[3]; | |
148 | + | |
149 | + *(float *)Val = FloatRdBuf.wd32; | |
150 | + | |
151 | + return FloatRdBuf.wd32; | |
152 | +} | |
153 | + | |
154 | +int ReadEepromInt(uint16_t address, void *Val) | |
155 | +{ | |
156 | + ReadEeprom(address * 4, EepromRdBuf, 4); | |
157 | + | |
158 | + IntRdBuf.wdcode.byte0 = EepromRdBuf[0]; | |
159 | + IntRdBuf.wdcode.byte1 = EepromRdBuf[1]; | |
160 | + //FloatRdBuf.wdcode.byte2 = EEPROM_RdBuf[2]; | |
161 | + //FloatRdBuf.wdcode.byte3 = EEPROM_RdBuf[3]; | |
162 | + | |
163 | + *(int *)Val = IntRdBuf.wd16; | |
164 | + | |
165 | + return IntRdBuf.wd16; | |
166 | +} | |
167 | + | |
168 | + | |
169 | +void WriteEepromFloat(uint16_t Address, float *Val) | |
170 | +{ | |
171 | + FloatWrBuf.wd32 = *(float *)Val; | |
172 | + | |
173 | + EepromWrBuf[0] = FloatWrBuf.wdcode.byte0; | |
174 | + EepromWrBuf[1] = FloatWrBuf.wdcode.byte1; | |
175 | + EepromWrBuf[2] = FloatWrBuf.wdcode.byte2; | |
176 | + EepromWrBuf[3] = FloatWrBuf.wdcode.byte3; | |
177 | + | |
178 | + WriteEeprom(Address * 4, EepromWrBuf, 4); | |
179 | +} | |
180 | + | |
181 | +void WriteEepromInt(uint16_t Address, void *Val) | |
182 | +{ | |
183 | + IntWrBuf.wd16 = *(int *)Val; | |
184 | + | |
185 | + EepromWrBuf[0] = IntWrBuf.wdcode.byte0; | |
186 | + EepromWrBuf[1] = IntWrBuf.wdcode.byte1; | |
187 | + EepromWrBuf[2] = 0; | |
188 | + EepromWrBuf[3] = 0; | |
189 | + | |
190 | + WriteEeprom(Address * 4, EepromWrBuf, 4); | |
191 | +} | |
192 | + | |
193 | + | |
194 | +void WriteEeprom(uint16_t address, uint16_t *data, uint16_t length) | |
195 | +{ | |
196 | + while (ReadEepromStatusReg() & MSG_STATUS_READY_M == MSG_STATUS_READY_M); | |
197 | + | |
198 | + enableWrite(); | |
199 | + | |
200 | + while (ReadEepromStatusReg() & MSG_STATUS_WRITE_READY_M == MSG_STATUS_WRITE_READY_M); | |
201 | + | |
202 | + writeData(address, data, length); | |
203 | + | |
204 | +} | |
205 | + | |
206 | + | |
207 | +unsigned int EEPROM_Page_Buffer = 128; | |
208 | +int EEPROM_Start_Addr = 0; | |
209 | + | |
210 | + | |
211 | +void WriteEepromArray(uint16_t address, uint16_t *data, uint16_t length) | |
212 | +{ | |
213 | + int NUM_BYTES_Quotient = 0; | |
214 | + int NUM_BYTES_Remain = 0; | |
215 | + int EEPROM_ADDR_Offset = 0; | |
216 | + int i = 0; | |
217 | + | |
218 | + NUM_BYTES_Quotient = length / EEPROM_Page_Buffer; | |
219 | + NUM_BYTES_Remain = length % EEPROM_Page_Buffer; | |
220 | + | |
221 | + for(i = 0; i < NUM_BYTES_Quotient; i++) | |
222 | + { | |
223 | + EEPROM_ADDR_Offset = i * EEPROM_Page_Buffer; | |
224 | + EEPROM_Start_Addr = address + EEPROM_ADDR_Offset; | |
225 | + | |
226 | + WriteEeprom(EEPROM_Start_Addr, data, EEPROM_Page_Buffer); | |
227 | + | |
228 | + EEPROM_ADDR_Offset = EEPROM_ADDR_Offset + EEPROM_Page_Buffer; | |
229 | + } | |
230 | + | |
231 | + if(NUM_BYTES_Remain != 0 ) | |
232 | + { | |
233 | + EEPROM_ADDR_Offset = EEPROM_ADDR_Offset; | |
234 | + EEPROM_Start_Addr = address + EEPROM_ADDR_Offset; | |
235 | + WriteEeprom(EEPROM_Start_Addr, data, NUM_BYTES_Remain); | |
236 | + } | |
237 | + | |
238 | +} | |
239 | + | |
240 | +uint16_t ReadEepromStatusReg(void) | |
241 | +{ | |
242 | + uint16_t temp; | |
243 | + | |
244 | + //임시 나중에 STE 레지스터 찾아서 수정 할 것 | |
245 | + CS_LOW; | |
246 | + | |
247 | + SPI_writeDataBlockingNonFIFO(SPIC_BASE, RDSR); | |
248 | + temp = SPI_readDataBlockingNonFIFO(SPIC_BASE); | |
249 | + SPI_writeDataBlockingNonFIFO(SPIC_BASE, 0x0000); | |
250 | + temp = SPI_readDataBlockingNonFIFO(SPIC_BASE); | |
251 | + | |
252 | + CS_HIGH; | |
253 | + | |
254 | + return(temp); | |
255 | +} | |
256 | + | |
257 | + | |
258 | +void enableWrite(void) | |
259 | +{ | |
260 | + CS_LOW; | |
261 | + | |
262 | + SPI_writeDataBlockingNonFIFO(SPIC_BASE, WREN); | |
263 | + SPI_readDataBlockingNonFIFO(SPIC_BASE); | |
264 | + | |
265 | + CS_HIGH; | |
266 | +} | |
267 | + | |
268 | + | |
269 | +void writeData(uint16_t address, uint16_t * data, uint16_t length) | |
270 | +{ | |
271 | + uint16_t i; | |
272 | + | |
273 | + CS_LOW; | |
274 | + | |
275 | + SPI_writeDataBlockingNonFIFO(SPIC_BASE, WRITE); | |
276 | + SPI_readDataBlockingNonFIFO(SPIC_BASE); | |
277 | + SPI_writeDataBlockingNonFIFO(SPIC_BASE, (address & 0xFF00)); | |
278 | + SPI_readDataBlockingNonFIFO(SPIC_BASE); | |
279 | + SPI_writeDataBlockingNonFIFO(SPIC_BASE, address << 8); | |
280 | + SPI_readDataBlockingNonFIFO(SPIC_BASE); | |
281 | + for(i = 0; i < length; i++) | |
282 | + { | |
283 | + SPI_writeDataBlockingNonFIFO(SPIC_BASE, data[i] << 8); | |
284 | + SPI_readDataBlockingNonFIFO(SPIC_BASE); | |
285 | + } | |
286 | + | |
287 | + CS_HIGH; | |
288 | +} | |
289 | + | |
290 | + | |
291 | +void readData(uint16_t address, uint16_t * data, uint16_t length) | |
292 | +{ | |
293 | + uint16_t i; | |
294 | + | |
295 | + CS_LOW; | |
296 | + | |
297 | + SPI_writeDataBlockingNonFIFO(SPIC_BASE, READ); | |
298 | + SPI_readDataBlockingNonFIFO(SPIC_BASE); | |
299 | + SPI_writeDataBlockingNonFIFO(SPIC_BASE, (address & 0xFF00)); | |
300 | + SPI_readDataBlockingNonFIFO(SPIC_BASE); | |
301 | + SPI_writeDataBlockingNonFIFO(SPIC_BASE, (address << 8)); | |
302 | + SPI_readDataBlockingNonFIFO(SPIC_BASE); | |
303 | + | |
304 | + for(i = 0; i < length; i++) | |
305 | + { | |
306 | + SPI_writeDataBlockingNonFIFO(SPIC_BASE, 0x0000); | |
307 | + data[i] = SPI_readDataBlockingNonFIFO(SPIC_BASE); | |
308 | + } | |
309 | + | |
310 | + CS_HIGH; | |
311 | +} | |
312 | + | |
313 | + | |
314 | + | |
315 | + |
+++ Common_Resource/CommonLibrary/source/Status.cpp
... | ... | @@ -0,0 +1,15 @@ |
1 | +//-------------------------------------------------------// | |
2 | +// Project Code : ESS100K3L-01-19 | |
3 | +// File Name : Status.cpp | |
4 | +// Created on : 2019. 06. 07. | |
5 | +// Description : | |
6 | +// Author : KimJeongWoo | |
7 | +// Last modified Date : | |
8 | +//-------------------------------------------------------// | |
9 | + | |
10 | +#include "CommonLib.h" | |
11 | + | |
12 | +union uSTATUS Status = {0}; | |
13 | +unsigned int FlagCanBeMasSlvChange = 0; | |
14 | +unsigned int FlagParaInvBuilup = 0; //병렬운전시 Mas,Slv Inv 빌드업 확인 변수 | |
15 | + |
+++ Common_Resource/CommonLibrary/source/SystemVar.cpp
This diff is skipped because there are too many other diffs. |
+++ Common_Resource/CommonLibrary/source/TimerLib.cpp
This diff is skipped because there are too many other diffs. |
+++ Common_Resource/EasyDSP_Resource/EasyDSP_Resource.zip
Binary file is not shown |
+++ Common_Resource/EasyDSP_Resource/easy28x_driverlib_v10.8.c
This diff is skipped because there are too many other diffs. |
+++ Common_Resource/EasyDSP_Resource/easy28x_driverlib_v10.8.h
This diff is skipped because there are too many other diffs. |
+++ EZDSP/ArcCtrl-23-NEXTSQ-CPU1.ez.bin
Binary file is not shown |
+++ EZDSP/ArcCtrl-23-NEXTSQ-CPU1.out
Binary file is not shown |
+++ EZDSP/ArcCtrl-23-NEXTSQ-CPU2.ez.bin
Binary file is not shown |
+++ EZDSP/ArcCtrl-23-NEXTSQ-CPU2.out
Binary file is not shown |
+++ EZDSP/ArcCtrl_CPU1.cfg
This diff is skipped because there are too many other diffs. |
+++ EZDSP/ArcCtrl_CPU1.ezd
This diff is skipped because there are too many other diffs. |
+++ EZDSP/ArcCtrl_CPU1.vars
This diff is skipped because there are too many other diffs. |
+++ EZDSP/Preset/Sensing.sym
This diff is skipped because there are too many other diffs. |
+++ EZDSP/easyDSP_FlashApiWrapper_CPU1.ez.bin
Binary file is not shown |
+++ EZDSP/easyDSP_FlashApiWrapper_CPU1.out
Binary file is not shown |
+++ EZDSP/easyDSP_FlashApiWrapper_CPU1.ou~
Binary file is not shown |
+++ EZDSP/easyDSP_FlashApiWrapper_CPU2.ez.bin
Binary file is not shown |
+++ EZDSP/easyDSP_FlashApiWrapper_CPU2.out
Binary file is not shown |
+++ EZDSP/easyDSP_FlashApiWrapper_CPU2.ou~
Binary file is not shown |
+++ TI_Lib/FPU/include/dsp.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/f2837xd_filter/fpu_filter.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_cfft.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_barthann.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_bartlett.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_blackman.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_blackmanharris.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_bohman.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_cheb.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_flattop.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_gauss.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_hamming.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_hann.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_kaiser.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_nuttall.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_parzen.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_rect.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_taylor.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_triang.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_fft_tukey.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_filter.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_math.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_rfft.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_types.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/include/fpu32/fpu_vector.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/FPU/lib/c28x_fpu_dsp_library.lib
Binary file is not shown |
+++ TI_Lib/FPU/lib/c28x_fpu_dsp_library_coff.lib
Binary file is not shown |
+++ TI_Lib/FPUfastRTS/c28/lib/rts2800_fpu32_fast_supplement.lib
Binary file is not shown |
+++ TI_Lib/FPUfastRTS/c28/lib/rts2800_fpu32_fast_supplement_coff.lib
Binary file is not shown |
+++ TI_Lib/device/F2837xD_CodeStartBranch.asm
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/device/F2837xD_DBGIER.asm
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/device/F2837xD_usDelay.asm
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/device/device.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/device/device.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/device/driverlib.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/adc.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/adc.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/asysctl.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/asysctl.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/can.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/can.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/ccs/Debug/driverlib.lib
Binary file is not shown |
+++ TI_Lib/driverlib/f2837xd/driverlib/ccs/Debug/driverlib_coff.lib
Binary file is not shown |
+++ TI_Lib/driverlib/f2837xd/driverlib/ccs/Debug/driverlib_eabi.lib
Binary file is not shown |
+++ TI_Lib/driverlib/f2837xd/driverlib/ccs/Release/driverlib.lib
Binary file is not shown |
+++ TI_Lib/driverlib/f2837xd/driverlib/ccs/Release/driverlib_coff.lib
Binary file is not shown |
+++ TI_Lib/driverlib/f2837xd/driverlib/ccs/Release/driverlib_eabi.lib
Binary file is not shown |
+++ TI_Lib/driverlib/f2837xd/driverlib/ccs/driverlib.projectspec
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/cla.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/cla.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/clb.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/clb.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/cmpss.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/cmpss.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/cpu.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/cputimer.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/cputimer.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/dac.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/dac.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/dcsm.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/dcsm.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/debug.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/dma.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/dma.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/ecap.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/ecap.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/emif.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/emif.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/epwm.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/epwm.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/eqep.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/eqep.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/flash.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/flash.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/gpio.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/gpio.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/hrpwm.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/hrpwm.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/i2c.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/i2c.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_adc.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_asysctl.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_can.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_cla.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_clb.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_clbxbar.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_cmpss.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_cputimer.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_dac.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_dcsm.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_dma.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_ecap.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_emif.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_epwm.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_epwmxbar.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_eqep.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_flash.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_gpio.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_hrpwm.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_i2c.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_inputxbar.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_ints.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_ipc.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_mcbsp.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_memcfg.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_memmap.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_nmi.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_outputxbar.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_pie.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_sci.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_sdfm.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_spi.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_sysctl.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_types.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_upp.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_usb.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_xbar.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/inc/hw_xint.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/interrupt.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/interrupt.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/ipc.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/ipc.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/mcbsp.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/mcbsp.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/memcfg.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/memcfg.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/pin_map.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/pin_map_legacy.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/sci.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/sci.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/sdfm.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/sdfm.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/spi.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/spi.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/sysctl.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/sysctl.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/upp.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/upp.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/usb.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/usb.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/version.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/version.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/xbar.c
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/driverlib/f2837xd/driverlib/xbar.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_Adc_defines.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_Can_defines.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_Cla_defines.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_Cla_typedefs.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_Dma_defines.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_EPwm_defines.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_Emif_defines.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_Examples.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_GlobalPrototypes.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_Gpio_defines.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_I2c_defines.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_Ipc_defines.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_Ipc_drivers.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_Pie_defines.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_SWPrioritizedIsrLevels.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_SysCtrl_defines.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_Systick_defines.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_Upp_defines.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_cputimervars.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_defaultisr.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_sci_io.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_sdfm_drivers.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F2837xD_struct.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/F28x_Project.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/include/include.zip
Binary file is not shown |
+++ TI_Lib/f2837xd/common/include/sw_interrupt_prioritization_logic.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/common/source/source.zip
Binary file is not shown |
+++ TI_Lib/f2837xd/headers/include/F2837xD_adc.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_analogsubsys.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_can.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_cla.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_clb.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_clbxbar.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_cmpss.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_cputimer.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_dac.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_dcsm.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_device.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_dma.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_ecap.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_emif.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_epwm.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_epwm_xbar.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_eqep.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_flash.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_gpio.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_i2c.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_input_xbar.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_ipc.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_mcbsp.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_memconfig.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_nmiintrupt.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_output_xbar.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_piectrl.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_pievect.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_sci.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_sdfm.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_spi.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_sysctrl.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_upp.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_xbar.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/include/F2837xD_xint.h
This diff is skipped because there are too many other diffs. |
+++ TI_Lib/f2837xd/headers/source/F2837xD_GlobalVariableDefs.c
This diff is skipped because there are too many other diffs. |
+++ sci/CCS/baud_tune_via_uart.projectspec
This diff is skipped because there are too many other diffs. |
+++ sci/CCS/sci_ex1_loopback.projectspec
This diff is skipped because there are too many other diffs. |
+++ sci/CCS/sci_ex2_loopback_interrupts.projectspec
This diff is skipped because there are too many other diffs. |
+++ sci/CCS/sci_ex3_echoback.projectspec
This diff is skipped because there are too many other diffs. |
+++ sci/baud_tune_via_uart.c
This diff is skipped because there are too many other diffs. |
+++ sci/baud_tune_via_uart.syscfg
This diff is skipped because there are too many other diffs. |
+++ sci/sci_ex1_loopback.c
This diff is skipped because there are too many other diffs. |
+++ sci/sci_ex1_loopback.syscfg
This diff is skipped because there are too many other diffs. |
+++ sci/sci_ex2_loopback_interrupts.c
This diff is skipped because there are too many other diffs. |
+++ sci/sci_ex3_echoback.c
This diff is skipped because there are too many other diffs. |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?