Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 16d792d62b | |||
| 7d03c00122 | |||
| aab1672cb2 | |||
| 79b18664d3 |
@@ -0,0 +1,52 @@
|
||||
#Generated from Visual Studio settings
|
||||
---
|
||||
BasedOnStyle: webkit
|
||||
BraceWrapping:
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
AfterClass: true
|
||||
AfterFunction: true
|
||||
AfterControlStatement: true
|
||||
AfterEnum: true
|
||||
AfterNamespace: true
|
||||
AfterObjCDeclaration: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterExternBlock: true
|
||||
ColumnLimit: 80
|
||||
BreakBeforeBraces: Custom
|
||||
NamespaceIndentation: All
|
||||
TabWidth: 4
|
||||
IndentCaseLabels: true
|
||||
AlignAfterOpenBracket: Align
|
||||
PointerAlignment: Right
|
||||
AlignOperands: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortLoopsOnASingleLine: true
|
||||
AllowShortIfStatementsOnASingleLine: true
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BreakBeforeBinaryOperators: All
|
||||
BreakBeforeTernaryOperators: false
|
||||
BreakAfterJavaFieldAnnotations: true
|
||||
AlignTrailingComments: true
|
||||
BreakConstructorInitializers: AfterColon
|
||||
AlignConsecutiveMacros:
|
||||
Enabled: true
|
||||
AcrossEmptyLines: true
|
||||
AcrossComments: true
|
||||
AlignArrayOfStructures: Right
|
||||
AlignConsecutiveAssignments:
|
||||
Enabled: true
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: true
|
||||
PadOperators: true
|
||||
AlignConsecutiveBitFields:
|
||||
Enabled: true
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: true
|
||||
PadOperators: true
|
||||
AlignEscapedNewlines: Right
|
||||
...
|
||||
@@ -0,0 +1,294 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.926872659">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.926872659" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.RV_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.926872659" name="Debug" parent="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug" postbuildStep="${cross_prefix}${cross_objcopy}${cross_suffix} -O binary ${ProjName}.elf ${ProjName}.bin">
|
||||
<folderInfo id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.926872659." name="/" resourcePath="">
|
||||
<toolChain id="ilg.gnumcueclipse.managedbuild.cross.riscv.toolchain.elf.debug.1243233573" name="RISC-V Cross GCC" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.toolchain.elf.debug">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createflash.249191345" name="Create flash image" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createflash" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createlisting.243120876" name="Create extended listing" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createlisting" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.printsize.1566043258" name="Print size" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.printsize" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.level.1801001334" name="Optimization Level" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.level" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.level.none" valueType="enumerated"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.messagelength.651682061" name="Message length (-fmessage-length=0)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.messagelength" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.signedchar.1219903449" name="'char' is signed (-fsigned-char)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.signedchar" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.functionsections.168524687" name="Function sections (-ffunction-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.functionsections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.datasections.2098519515" name="Data sections (-fdata-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.datasections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.level.1093129020" name="Debug level" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.level" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.level.max" valueType="enumerated"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.format.449325272" name="Debug format" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.format"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.id.758656032" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.id" value="2262347901" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.name.932361954" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.name" value="RISC-V GCC/Newlib" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.prefix.1942787399" name="Prefix" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.prefix" value="riscv64-unknown-elf-" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.c.684525315" name="C compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.c" value="gcc" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.cpp.1638988330" name="C++ compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.cpp" value="g++" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.ar.1234563299" name="Archiver" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.ar" value="ar" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objcopy.1492404953" name="Hex/Bin converter" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objcopy" value="objcopy" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objdump.1394253527" name="Listing generator" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objdump" value="objdump" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.size.1332389637" name="Size command" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.size" value="size" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.make.2031126337" name="Build command" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.make" value="make" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.rm.1285759101" name="Remove command" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.rm" value="rm" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.base.1410576671" name="Architecture" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.base" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.arch.rv32e" valueType="enumerated"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.compressed.353152664" name="Compressed extension (RVC)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.compressed" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.abi.integer.1735833830" name="Integer ABI" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.abi.integer" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.abi.integer.ilp32e" valueType="enumerated"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.codemodel.796386542" name="Code model" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.codemodel" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.codemodel.low" valueType="enumerated"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.tune.90660292" name="Tuning" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.tune" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.tune.n200series" valueType="enumerated"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.preferxpacksbin.159763604" name="Prefer xpacks/.bin" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.preferxpacksbin" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.multiply.1863445619" name="Multiply extension (RVM)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.multiply" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.atomic.1533438913" name="Atomic extension (RVA)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.atomic" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.extensions.447179843" name="Other extensions" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.extensions" value="_zba_zbb_zbs_zca_zcb_zcmp_zcmt_zicond" valueType="string"/>
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.RV_ELF;org.eclipse.cdt.core.ELF" id="ilg.gnumcueclipse.managedbuild.cross.riscv.targetPlatform.624485565" isAbstract="false" osList="all" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.targetPlatform"/>
|
||||
<builder buildPath="${workspace_loc:/Project}/Debug" id="ilg.gnumcueclipse.managedbuild.cross.riscv.builder.1494546460" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.builder"/>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler.1909166920" name="GNU RISC-V Cross Assembler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.usepreprocessor.1982625252" name="Use preprocessor" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.usepreprocessor" value="true" valueType="boolean"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.defs.1756055012" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.defs" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__IDE_RV_CORE=N203E"/>
|
||||
<listOptionValue builtIn="false" value="CONFIG_USE_PEC930"/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.paths.1624800055" name="Include paths (-I)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/NMSIS/Core/Include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/Device/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/HAL_Lib/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/BSP/StarterKit}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Common}""/>
|
||||
</option>
|
||||
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler.input.724532243" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.991594434" name="GNU RISC-V Cross C Compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs.1630974101" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__IDE_RV_CORE=N203E"/>
|
||||
<listOptionValue builtIn="false" value="CONFIG_USE_PEC930"/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.paths.1504538192" name="Include paths (-I)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/NMSIS/Core/Include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/Device/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/HAL_Lib/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/BSP/StarterKit}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Common}""/>
|
||||
</option>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std.345216805" name="Language standard" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std.c99" valueType="enumerated"/>
|
||||
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input.1843576227" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.compiler.958908384" name="GNU RISC-V Cross C++ Compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.compiler">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.defs.665145577" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__IDE_RV_CORE=N203E"/>
|
||||
</option>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker.1832379824" name="GNU RISC-V Cross C Linker" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.gcsections.1847575804" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.gcsections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.other.962260539" name="Other linker flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.other" value="" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nostart.1331613792" name="Do not use standard start files (-nostartfiles)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nostart" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nodeflibs.1405041078" name="Do not use default libraries (-nodefaultlibs)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nodeflibs" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printmap.663083040" name="Print link map (-Xlinker --print-map)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printmap" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.cref.986670320" name="Cross reference (-Xlinker --cref)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.cref" value="true" valueType="boolean"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.scriptfile.1007616047" name="Script files (-T)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.scriptfile" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/gcc_flashxip.ld}""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.libs.2005823803" name="Libraries (-l)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.libs" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="c_nano"/>
|
||||
<listOptionValue builtIn="false" value="m"/>
|
||||
<listOptionValue builtIn="false" value="gcc"/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.flags.1425978507" name="Linker flags (-Xlinker [option])" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.flags" valueType="stringList"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.grouplibs.1661588098" name="Group libraries (-Wl,--start-group, ... ,--end-group)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.grouplibs" value="true" valueType="boolean"/>
|
||||
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker.input.393723091" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.linker.1387419752" name="GNU RISC-V Cross C++ Linker" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.linker">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.gcsections.297993148" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.gcsections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.other.720519285" name="Other linker flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.other" value="-u _isatty -u _write -u _sbrk -u _read -u _close -u _fstat -u _lseek " valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.libs.2127007227" name="Libraries (-l)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.libs"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.archiver.2145124977" name="GNU RISC-V Cross Archiver" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.archiver"/>
|
||||
<tool command="${cross_prefix}${cross_objcopy}${cross_suffix}" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT}" id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createflash.586549949" name="GNU RISC-V Cross Create Flash Image" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createflash">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.choice.283218197" name="Output file format (-O)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.choice" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.choice.ihex" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createlisting.1070118556" name="GNU RISC-V Cross Create Listing" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createlisting">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.source.1733954628" name="Display source (--source|-S)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.source" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.allheaders.1626209232" name="Display all headers (--all-headers|-x)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.allheaders" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.demangle.280684598" name="Demangle names (--demangle|-C)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.demangle" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.linenumbers.1695987115" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.linenumbers" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.wide.1148871387" name="Wide lines (--wide|-w)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.wide" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.disassemble.1301534980" name="Disassemble (--disassemble|-d)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.disassemble" value="true" valueType="boolean"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.printsize.315205585" name="GNU RISC-V Cross Print Size" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.printsize">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.format.1467048234" name="Size format" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.format"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
<storageModule moduleId="ilg.gnumcueclipse.managedbuild.packs"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.16434552">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.16434552" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.RV_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.16434552" name="Release" parent="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release">
|
||||
<folderInfo id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.16434552." name="/" resourcePath="">
|
||||
<toolChain id="ilg.gnumcueclipse.managedbuild.cross.riscv.toolchain.elf.release.837856819" name="RISC-V Cross GCC" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.toolchain.elf.release">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createflash.1208613512" name="Create flash image" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createflash" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createlisting.1016401583" name="Create extended listing" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createlisting" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.printsize.1246797237" name="Print size" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.printsize" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.level.2012455781" name="Optimization Level" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.level" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.level.size" valueType="enumerated"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.messagelength.1493955924" name="Message length (-fmessage-length=0)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.messagelength" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.signedchar.651822097" name="'char' is signed (-fsigned-char)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.signedchar" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.functionsections.1717953891" name="Function sections (-ffunction-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.functionsections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.datasections.541048735" name="Data sections (-fdata-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.datasections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.level.360621726" name="Debug level" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.level"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.format.1281181250" name="Debug format" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.format"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.id.723143813" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.id" value="2262347901" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.name.399597377" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.name" value="RISC-V GCC/Newlib" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.prefix.568227293" name="Prefix" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.prefix" value="riscv64-unknown-elf-" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.c.639974320" name="C compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.c" value="gcc" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.cpp.1733841476" name="C++ compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.cpp" value="g++" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.ar.789308737" name="Archiver" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.ar" value="ar" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objcopy.1273467405" name="Hex/Bin converter" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objcopy" value="objcopy" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objdump.1863146323" name="Listing generator" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objdump" value="objdump" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.size.350346878" name="Size command" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.size" value="size" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.make.1982710953" name="Build command" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.make" value="make" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.rm.1369963916" name="Remove command" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.rm" value="rm" valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.base.371627411" name="Architecture" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.base" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.arch.rv32e" valueType="enumerated"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.compressed.325570710" name="Compressed extension (RVC)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.compressed" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.abi.integer.268981471" name="Integer ABI" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.abi.integer" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.abi.integer.ilp32e" valueType="enumerated"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.codemodel.1135863126" name="Code model" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.codemodel" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.codemodel.low" valueType="enumerated"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.tune.1264121613" name="Tuning" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.tune" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.tune.n200series" valueType="enumerated"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.multiply.2138851355" name="Multiply extension (RVM)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.multiply" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.atomic.1576924112" name="Atomic extension (RVA)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.atomic" value="true" valueType="boolean"/>
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.RV_ELF;org.eclipse.cdt.core.ELF" id="ilg.gnumcueclipse.managedbuild.cross.riscv.targetPlatform.930977981" isAbstract="false" osList="all" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.targetPlatform"/>
|
||||
<builder buildPath="${workspace_loc:/Project}/Release" id="ilg.gnumcueclipse.managedbuild.cross.riscv.builder.1235026887" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.builder"/>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler.1274001025" name="GNU RISC-V Cross Assembler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.usepreprocessor.1238271906" name="Use preprocessor" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.usepreprocessor" value="true" valueType="boolean"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.defs.1967727594" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.defs" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__IDE_RV_CORE=N203E"/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.paths.284910497" name="Include paths (-I)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/NMSIS/Core/Include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/Device/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/HAL_Lib/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/BSP/StarterKit}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Common}""/>
|
||||
</option>
|
||||
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler.input.1276065282" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.1901433257" name="GNU RISC-V Cross C Compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs.687116111" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__IDE_RV_CORE=N203E"/>
|
||||
<listOptionValue builtIn="false" value="NDEBUG"/>
|
||||
<listOptionValue builtIn="false" value="CONFIG_USE_PEC930"/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.paths.140100445" name="Include paths (-I)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/NMSIS/Core/Include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/Device/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/HAL_Lib/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/BSP/StarterKit}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Common}""/>
|
||||
</option>
|
||||
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input.868354821" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.compiler.1780721496" name="GNU RISC-V Cross C++ Compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.compiler">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.defs.1060583602" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__IDE_RV_CORE=N203E"/>
|
||||
</option>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker.1023024678" name="GNU RISC-V Cross C Linker" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.gcsections.589554014" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.gcsections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.other.170075676" name="Other linker flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.other" value="--specs=nosys.specs" valueType="string"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.scriptfile.123103120" name="Script files (-T)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.scriptfile" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Drivers/PEC930/gcc_flashxip.ld}""/>
|
||||
</option>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nodeflibs.122457886" name="Do not use default libraries (-nodefaultlibs)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nodeflibs" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nostart.507700170" name="Do not use standard start files (-nostartfiles)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nostart" value="true" valueType="boolean"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.libs.1049690196" name="Libraries (-l)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.libs" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="c_nano"/>
|
||||
<listOptionValue builtIn="false" value="gcc"/>
|
||||
</option>
|
||||
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker.input.1639406854" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.linker.554290345" name="GNU RISC-V Cross C++ Linker" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.linker">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.gcsections.1904431755" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.gcsections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.other.450429501" name="Other linker flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.other" value="-u _isatty -u _write -u _sbrk -u _read -u _close -u _fstat -u _lseek " valueType="string"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.libs.1125125661" name="Libraries (-l)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.libs"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.archiver.1507570544" name="GNU RISC-V Cross Archiver" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.archiver"/>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createflash.841899246" name="GNU RISC-V Cross Create Flash Image" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createflash">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.choice.413941719" name="Output file format (-O)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.choice" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.choice.ihex" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createlisting.39250443" name="GNU RISC-V Cross Create Listing" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createlisting">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.source.778908801" name="Display source (--source|-S)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.source" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.allheaders.1081260692" name="Display all headers (--all-headers|-x)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.allheaders" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.demangle.212671820" name="Demangle names (--demangle|-C)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.demangle" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.linenumbers.1206119075" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.linenumbers" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.wide.625905344" name="Wide lines (--wide|-w)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.wide" value="true" valueType="boolean"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.printsize.1552514466" name="GNU RISC-V Cross Print Size" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.printsize">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.format.1158424346" name="Size format" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.format"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="Project.ilg.gnumcueclipse.managedbuild.cross.riscv.target.rvelf.1157615279" name="Executable" projectType="ilg.gnumcueclipse.managedbuild.cross.riscv.target.rvelf"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
<scannerConfigBuildInfo instanceId="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.926872659;ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.926872659.;ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.991594434;ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input.1843576227">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.16434552;ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.16434552.;ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.1901433257;ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input.868354821">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Debug">
|
||||
<resource resourceType="PROJECT" workspacePath="/Project"/>
|
||||
</configuration>
|
||||
<configuration configurationName="Release">
|
||||
<resource resourceType="PROJECT" workspacePath="/Project"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
||||
</cproject>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Project</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>Common</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/Common</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>Drivers</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/Drivers</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>Profiles</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/Tools/scripts/Profiles</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>0</id>
|
||||
<name></name>
|
||||
<type>6</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||
<arguments>1.0-name-matches-false-false-*.nuproject</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,25 @@
|
||||
SDK_CONFIG:
|
||||
Debug:
|
||||
core: N203E
|
||||
extra_asmflags:
|
||||
archext:
|
||||
extra_cxxflags:
|
||||
cmodel: medlow
|
||||
extra_commonflags:
|
||||
abi: ilp32e
|
||||
arch: rv32ema_zba_zbb_zbs_zca_zcb_zcmp_zcmt_zicond
|
||||
toolchain: gnu
|
||||
extra_cflags:
|
||||
extra_ldflags:
|
||||
Release:
|
||||
core: N203E
|
||||
extra_asmflags:
|
||||
archext:
|
||||
extra_cxxflags:
|
||||
cmodel: medlow
|
||||
extra_commonflags:
|
||||
abi: ilp32e
|
||||
arch: rv32emac_zba_zbb_zbs
|
||||
toolchain: gnu
|
||||
extra_cflags:
|
||||
extra_ldflags:
|
||||
@@ -0,0 +1,16 @@
|
||||
#
|
||||
# component Makefile
|
||||
#
|
||||
|
||||
|
||||
C_SOURCES += \
|
||||
$(srctree)/$(PROJ)/src/isr.c \
|
||||
$(srctree)/$(PROJ)/src/main.c
|
||||
|
||||
C_INCLUDES += -I$(srctree)/$(PROJ)/inc
|
||||
|
||||
|
||||
LIBS +=
|
||||
CFLAGS +=
|
||||
LDFLAGS +=
|
||||
LIBDIR +=
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* init.h
|
||||
*
|
||||
* Created on: 2025年10月9日
|
||||
* Author: jim_liao
|
||||
*/
|
||||
|
||||
#ifndef INC_INIT_H_
|
||||
#define INC_INIT_H_
|
||||
|
||||
#include "main.h"
|
||||
|
||||
void SYS_Config();
|
||||
void gpio_config();
|
||||
void opa_config();
|
||||
void adc_config();
|
||||
void pwm_config();
|
||||
void pwm_set_duty(uint16_t ch1_val, uint16_t ch2_val, uint16_t ch3_val);
|
||||
void pwm_enable();
|
||||
void pwm_disable();
|
||||
void pwm_brake();
|
||||
void uart_config();
|
||||
void UART_Send_Wait(UART_Type *pHUart, uint16_t value);
|
||||
#endif /* INC_INIT_H_ */
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* Copyright (c) 2024 Wei-Lun Hsu. All Rights Reserved.
|
||||
*/
|
||||
/** @file isr.h
|
||||
*
|
||||
* @author Wei-Lun Hsu
|
||||
* @version 0.1
|
||||
* @date 2024/09/16
|
||||
* @license
|
||||
* @description
|
||||
*/
|
||||
|
||||
#ifndef __isr_H_wuraIpBA_lTJm_HvJw_sNDo_uEd5JnucTReY__
|
||||
#define __isr_H_wuraIpBA_lTJm_HvJw_sNDo_uEd5JnucTReY__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "main.h"
|
||||
//=============================================================================
|
||||
// Constant Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Macro Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Structure Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Global Data Definition
|
||||
//=============================================================================
|
||||
extern volatile bool flag_24Khz_timer;
|
||||
extern volatile bool stringComplete;
|
||||
extern volatile char rxBuffer[128];
|
||||
//=============================================================================
|
||||
// Private Function Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Public Function Definition
|
||||
//=============================================================================
|
||||
void isr_epwm_handle(void);
|
||||
void isr_adc_handle(void);
|
||||
void isr_uart0_handle(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Copyright (c) 2024 Wei-Lun Hsu. All Rights Reserved.
|
||||
*/
|
||||
/** @file main.h
|
||||
*
|
||||
* @author Wei-Lun Hsu
|
||||
* @version 0.1
|
||||
* @date 2024/08/29
|
||||
* @license
|
||||
* @description
|
||||
*/
|
||||
|
||||
#ifndef __main_H_wxBnwdPw_lq7D_H4I5_sHPp_uXof15pFLp4V__
|
||||
#define __main_H_wxBnwdPw_lq7D_H4I5_sHPp_uXof15pFLp4V__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "hal_device.h"
|
||||
#include "syslog.h"
|
||||
//=============================================================================
|
||||
// Constant Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Macro Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Structure Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Global Data Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Private Function Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Public Function Definition
|
||||
//=============================================================================
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
demo_project
|
||||
---
|
||||
|
||||
This example is a demo project to descript `how to log message`
|
||||
|
||||
## Log
|
||||
|
||||
Use serial port with baudrate 115200, 8bit, no parity check.
|
||||
@@ -0,0 +1,258 @@
|
||||
/*
|
||||
* init.c
|
||||
*
|
||||
* Created on: 2025年8月18日
|
||||
* Author: jim_liao
|
||||
*/
|
||||
#include "init.h"
|
||||
#include "hal_device.h"
|
||||
#include "isr.h"
|
||||
#include "main.h"
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Constant Definition
|
||||
//=============================================================================
|
||||
#define CONFIG_OPA_PGA_GAIN OPAMP_PGAGain_5
|
||||
|
||||
unsigned long ADC0Sum = 0;
|
||||
unsigned char k;
|
||||
|
||||
#define HIRC_Freq 60000000 // Hz
|
||||
#define CurrentLoopIsrFreq 24000 // Hz
|
||||
#define PWM_PERIOD HIRC_Freq / CurrentLoopIsrFreq
|
||||
#define DEAD_TIME 200 // ns
|
||||
#define DEAD_TIME_VALUE DEAD_TIME * 0.06
|
||||
//=============================================================================
|
||||
// Public Function Definition
|
||||
//=============================================================================
|
||||
void SYS_Config()
|
||||
{
|
||||
SYSCFG_ClkInitTypeDef SysClkInit = { 0 };
|
||||
SysClkInit.ClkSource = SYSCFG_ClkSrc_HSI;
|
||||
SYSCFG_SysClkConfig(&SysClkInit);
|
||||
sys_config_systick(SYS_TICK_1_MS);
|
||||
|
||||
gpio_config();
|
||||
opa_config();
|
||||
adc_config();
|
||||
pwm_config();
|
||||
uart_config();
|
||||
|
||||
__enable_irq();
|
||||
}
|
||||
|
||||
void gpio_config()
|
||||
{
|
||||
//-----------------//
|
||||
// PWM
|
||||
//-----------------//
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_00 | GPIO_Pin_01 | GPIO_Pin_02
|
||||
| GPIO_Pin_03 | GPIO_Pin_04 | GPIO_Pin_05;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStruct.GPIO_AF_Mode = GPIO_AF_6;
|
||||
GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
//-----------------//
|
||||
// UART
|
||||
// PB3:TX PB5:RX
|
||||
//-----------------//
|
||||
GPIO_InitTypeDef GPIOA_InitUart;
|
||||
GPIOA_InitUart.GPIO_Pin = GPIO_Pin_03;
|
||||
GPIOA_InitUart.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIOA_InitUart.GPIO_AF_Mode = GPIO_AF_1;
|
||||
GPIO_Init(GPIOB, &GPIOA_InitUart);
|
||||
|
||||
GPIO_InitTypeDef GPIOB_InitUart;
|
||||
GPIOB_InitUart.GPIO_Pin = GPIO_Pin_05;
|
||||
GPIOB_InitUart.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIOB_InitUart.GPIO_AF_Mode = GPIO_AF_1;
|
||||
GPIO_Init(GPIOB, &GPIOB_InitUart);
|
||||
//-----------------//
|
||||
// ADC
|
||||
// PA12/13/14:OVP/OTP/CMD
|
||||
//-----------------//
|
||||
GPIO_InitTypeDef GPIO_InitADC;
|
||||
GPIO_InitADC.GPIO_Pin = GPIO_Pin_06 | GPIO_Pin_12;
|
||||
GPIO_InitADC.GPIO_Mode = GPIO_Mode_ANAL;
|
||||
GPIO_Init(GPIOA, &GPIO_InitADC);
|
||||
#if 1
|
||||
//-----------------//
|
||||
// test
|
||||
//-----------------//
|
||||
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_14;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
#endif
|
||||
}
|
||||
|
||||
void opa_config(void)
|
||||
{
|
||||
OPAMP_InitTypeDef opa_init = { 0 };
|
||||
|
||||
opa_init.OPAMP_VinP = OPAMP_VinP_IO;
|
||||
opa_init.OPAMP_VinM = OPAMP_VinM_GND;
|
||||
opa_init.OPAMP_Gain = CONFIG_OPA_PGA_GAIN;
|
||||
|
||||
OPAMP_Init(OPAMP0, &opa_init);
|
||||
OPAMP_Init(OPAMP1, &opa_init);
|
||||
|
||||
OPAMP_Enable(OPAMP0);
|
||||
OPAMP_Enable(OPAMP1);
|
||||
}
|
||||
|
||||
void adc_config(void)
|
||||
{
|
||||
|
||||
ADC_InitTypeDef init = { 0 };
|
||||
ADC_StructInit(&init);
|
||||
|
||||
//-----------------//
|
||||
// set
|
||||
//-----------------//
|
||||
ADC_InitTypeDef init1 = { 0 };
|
||||
ADC_StructInit(&init1);
|
||||
init1.SelChannels = ADC_Channel_06 | ADC_Channel_08;
|
||||
init1.ClkPrescaler = ADC_ClkDiv_4;
|
||||
init1.DataAlign = ADC_DataAlign_Right;
|
||||
init1.Mode = ADC_Mode_Scan;
|
||||
ADC_Init(ADC0, &init1);
|
||||
|
||||
ADC_ExtTrigConfig(ADC0, ADC_ExtTrigSource_EPWM_CCR4_UP,
|
||||
ADC_ExtTrigMode_Enable);
|
||||
ADC_ExtTrigConfig(ADC0, ADC_ExtTrigSource_EPWM_CCDR4_UP,
|
||||
ADC_ExtTrigMode_Enable);
|
||||
|
||||
#if 0
|
||||
{ /* Configure TIM interrupts */
|
||||
sys_irq_attr_t irq_attr = { .disable_vector = false, };
|
||||
|
||||
irq_attr.trig_mode = SYS_IRQ_TRIGGER_LEVEL;
|
||||
irq_attr.level = SYS_IRQ_LEVEL_H;
|
||||
irq_attr.priority = SYS_IRQ_PRIORITY_MIDDEN;
|
||||
sys_register_IRQ(ADC0_IRQn, isr_adc_handle, &irq_attr);
|
||||
ADC0->CON0_b.INT_EN = 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void pwm_config()
|
||||
{
|
||||
TIM_OCInitTypeDef TIM_OCInitStruct;
|
||||
TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStruct;
|
||||
|
||||
{ /* Configure TIM interrupts */
|
||||
sys_irq_attr_t irq_attr = {
|
||||
.disable_vector = false,
|
||||
};
|
||||
|
||||
irq_attr.trig_mode = SYS_IRQ_TRIGGER_LEVEL;
|
||||
irq_attr.level = SYS_IRQ_LEVEL_H;
|
||||
irq_attr.priority = SYS_IRQ_PRIORITY_MIDDEN;
|
||||
sys_register_IRQ(EPWM_IRQn, isr_epwm_handle, &irq_attr);
|
||||
}
|
||||
|
||||
TIM_DeInit(EPWM);
|
||||
|
||||
TIM_TimeBaseStructInit(&TIM_TimeBaseInitStruct);
|
||||
TIM_TimeBaseInitStruct.TIM_Prescaler = 0;
|
||||
TIM_TimeBaseInitStruct.TIM_CounterMode = TIM_CounterMode_Up;
|
||||
TIM_TimeBaseInitStruct.TIM_Period = PWM_PERIOD - 1;
|
||||
TIM_TimeBaseInitStruct.TIM_ClockDivision = TIM_CKD_Div1;
|
||||
TIM_TimeBaseInitStruct.TIM_RepetitionCounter = 0;
|
||||
TIM_TimeBaseInit(EPWM, &TIM_TimeBaseInitStruct);
|
||||
|
||||
TIM_ARRPreloadConfig(EPWM, ENABLE);
|
||||
|
||||
TIM_OCStructInit(&TIM_OCInitStruct);
|
||||
TIM_OCInitStruct.TIM_OCMode = TIM_OCMode_PWM1;
|
||||
TIM_OCInitStruct.TIM_OutputState = TIM_OutputState_Disable;
|
||||
TIM_OCInitStruct.TIM_Pulse = 0;
|
||||
TIM_OCInitStruct.TIM_OCPolarity = TIM_OCPolarity_High;
|
||||
TIM_OCInitStruct.TIM_OCIdleState = TIM_OCIdleState_Reset;
|
||||
TIM_OCInitStruct.TIM_Pulse = 1;
|
||||
|
||||
TIM_OCInitStruct.TIM_OutputNState = TIM_OutputNState_Disable;
|
||||
TIM_OCInitStruct.TIM_OCNPolarity = TIM_OCPolarity_High;
|
||||
TIM_OC1Init(EPWM, &TIM_OCInitStruct);
|
||||
|
||||
TIM_OCInitStruct.TIM_Pulse = 1;
|
||||
TIM_OC2Init(EPWM, &TIM_OCInitStruct);
|
||||
|
||||
TIM_OCInitStruct.TIM_Pulse = 1;
|
||||
TIM_OC3Init(EPWM, &TIM_OCInitStruct);
|
||||
|
||||
{ /* Automatic Output enable, Break, dead time and lock configuration */
|
||||
TIM_BDTRInitTypeDef bdtr_init = { 0 };
|
||||
bdtr_init.TIM_LOCKLevel = TIM_LockLevel_OFF;
|
||||
bdtr_init.TIM_DeadTime = DEAD_TIME_VALUE;
|
||||
|
||||
TIM_BDTRConfig(EPWM, &bdtr_init);
|
||||
}
|
||||
|
||||
EPWM->DIER |= 0x0800; // over flow
|
||||
|
||||
// enable preload for CCR1, CCR2 and CCR3
|
||||
EPWM->CCMR1_OUTPUT_b.OC1PE = 1;
|
||||
EPWM->CCMR1_OUTPUT_b.OC2PE = 1;
|
||||
EPWM->CCMR2_OUTPUT_b.OC3PE = 1;
|
||||
|
||||
TIM_Cmd(EPWM, ENABLE);
|
||||
TIM_CtrlPWMOutputs(EPWM, ENABLE);
|
||||
}
|
||||
|
||||
void pwm_set_duty(uint16_t ch1_val, uint16_t ch2_val, uint16_t ch3_val)
|
||||
{
|
||||
EPWM->CCR1 = ch1_val;
|
||||
EPWM->CCR2 = ch2_val;
|
||||
EPWM->CCR3 = ch3_val;
|
||||
return;
|
||||
}
|
||||
void pwm_enable()
|
||||
{
|
||||
REG_SET_BITS(EPWM->CCER, TIM_CCER_CC1E_Msk | TIM_CCER_CC1NE_Msk
|
||||
| TIM_CCER_CC2E_Msk | TIM_CCER_CC2NE_Msk
|
||||
| TIM_CCER_CC3E_Msk | TIM_CCER_CC3NE_Msk);
|
||||
return;
|
||||
}
|
||||
|
||||
void pwm_disable()
|
||||
{
|
||||
REG_CLR_BITS(EPWM->CCER, TIM_CCER_CC1E_Msk | TIM_CCER_CC1NE_Msk
|
||||
| TIM_CCER_CC2E_Msk | TIM_CCER_CC2NE_Msk
|
||||
| TIM_CCER_CC3E_Msk | TIM_CCER_CC3NE_Msk);
|
||||
return;
|
||||
}
|
||||
|
||||
void uart_config()
|
||||
{
|
||||
UART_InitTypeDef uart_init = { 0 };
|
||||
uart_init.BaudRate = 115200;
|
||||
uart_init.WordLength = UART_WordLength_8b;
|
||||
uart_init.StopBits = UART_StopBits_1;
|
||||
uart_init.Parity = UART_Parity_No;
|
||||
uart_init.Mode = UART_Mode_TxRx;
|
||||
UART_Init(UART0, &uart_init);
|
||||
UART_Start(UART0);
|
||||
|
||||
UART_ITConfig(UART0, UART_FLAG_RXNE, ENABLE);
|
||||
{ /* Configure TIM interrupts */
|
||||
sys_irq_attr_t irq_attr = {
|
||||
.disable_vector = false,
|
||||
};
|
||||
|
||||
irq_attr.trig_mode = SYS_IRQ_TRIGGER_LEVEL;
|
||||
irq_attr.level = SYS_IRQ_LEVEL_H;
|
||||
irq_attr.priority = SYS_IRQ_PRIORITY_MIDDEN;
|
||||
sys_register_IRQ(UART0_IRQn, isr_uart0_handle, &irq_attr);
|
||||
}
|
||||
}
|
||||
|
||||
void UART_Send_Wait(UART_Type *pHUart, uint16_t value)
|
||||
{
|
||||
UART_SendData(pHUart, value);
|
||||
UART_WaitTxFifoEmpty(pHUart);
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* Copyright (c) 2024 Wei-Lun Hsu. All Rights Reserved.
|
||||
*/
|
||||
/** @file isr.c
|
||||
*
|
||||
* @author Wei-Lun Hsu
|
||||
* @version 0.1
|
||||
* @date 2024/09/16
|
||||
* @license
|
||||
* @description
|
||||
*/
|
||||
|
||||
#include "isr.h"
|
||||
#include "init.h"
|
||||
#include "main.h"
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Constant Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Macro Definition
|
||||
//=============================================================================
|
||||
#define RX_BUFFER_SIZE 128
|
||||
//=============================================================================
|
||||
// Global Data Definition
|
||||
//=============================================================================
|
||||
long ADC_DATA[10];
|
||||
volatile bool flag_24Khz_timer = false;
|
||||
|
||||
volatile char rxBuffer[RX_BUFFER_SIZE];
|
||||
volatile bool stringComplete = false;
|
||||
volatile uint16_t rxIndex = 0;
|
||||
//=============================================================================
|
||||
// Private Function Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Public Function Definition
|
||||
//=============================================================================
|
||||
__INTERRUPT void isr_epwm_handle(void)
|
||||
{
|
||||
|
||||
if ((EPWM->SR & 0x10000) == 0x10000)
|
||||
{
|
||||
flag_24Khz_timer = true;
|
||||
ADC_DATA[0] = ADC0->DAT6_b.DATA;
|
||||
ADC_DATA[1] = ADC0->DAT8_b.DATA;
|
||||
TIM_ClearITPendingBit(EPWM, 0x10000); // clear OVIF
|
||||
}
|
||||
}
|
||||
|
||||
__INTERRUPT void isr_uart0_handle(void)
|
||||
{
|
||||
if (UART_GetITStatus(UART0, UART_FLAG_RXNE) == 1)
|
||||
{
|
||||
char receivedChar = (char)UART_ReceiveData(UART0);
|
||||
|
||||
if (receivedChar == '\n' || receivedChar == '\r')
|
||||
{
|
||||
if (rxIndex > 0)
|
||||
{
|
||||
rxBuffer[rxIndex] = '\0';
|
||||
stringComplete = true;
|
||||
rxIndex = 0;
|
||||
msg("Received: %s\n", rxBuffer);
|
||||
}
|
||||
}
|
||||
else if (rxIndex < RX_BUFFER_SIZE - 1)
|
||||
{
|
||||
rxBuffer[rxIndex++] = receivedChar;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
/**
|
||||
* Copyright (c) 2024 Wei-Lun Hsu. All Rights Reserved.
|
||||
*/
|
||||
/** @file main.c
|
||||
*
|
||||
* @author Wei-Lun Hsu
|
||||
* @version 0.1
|
||||
* @date 2024/08/29
|
||||
* @license
|
||||
* @description
|
||||
*/
|
||||
#include <string.h>
|
||||
|
||||
#include "hal_gpio.h"
|
||||
#include "hal_tim.h"
|
||||
#include "init.h"
|
||||
#include "isr.h"
|
||||
#include "main.h"
|
||||
|
||||
//=============================================================================
|
||||
// Constant Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Macro Definition
|
||||
//=============================================================================
|
||||
#define PWM_TABLE_SIZE 64
|
||||
//=============================================================================
|
||||
// Structure Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Global Data Definition
|
||||
//=============================================================================
|
||||
const uint16_t pwm_table[PWM_TABLE_SIZE]
|
||||
= { 1250, 1372, 1493, 1612, 1728, 1839, 1944, 2042, 2133, 2216, 2289,
|
||||
2352, 2404, 2446, 2475, 2493, 2499, 2493, 2475, 2446, 2404, 2352,
|
||||
2289, 2216, 2133, 2042, 1944, 1839, 1728, 1612, 1493, 1372, 1250,
|
||||
1127, 1006, 887, 771, 660, 555, 457, 366, 283, 210, 147,
|
||||
95, 53, 24, 6, 0, 6, 24, 53, 95, 147, 210,
|
||||
283, 366, 457, 555, 660, 771, 887, 1006, 1127 };
|
||||
|
||||
|
||||
|
||||
// 64-point sine wave lookup table (-2048-2047 range)
|
||||
// Sine_table[i] = sin(i*2*pi/64)*(4095/2) where i = 0 to 63
|
||||
// Use sine_amplitude parameter to scale to desired duty cycle range later
|
||||
const int16_t LUT_sin[64]
|
||||
= { 0, 200, 399, 594, 783, 965, 1137, 1298, 1447, 1582,
|
||||
1702, 1805, 1891, 1959, 2008, 2037, 2047, 2037, 2008, 1959,
|
||||
1891, 1805, 1702, 1582, 1447, 1298, 1137, 965, 783, 594,
|
||||
399, 200, 0, -200, -399, -594, -783, -965, -1137, -1298,
|
||||
-1447, -1582, -1702, -1805, -1891, -1959, -2008, -2037, -2047, -2037,
|
||||
-2008, -1959, -1891, -1805, -1702, -1582, -1447, -1298, -1137, -965,
|
||||
-783, -594, -399, -200 };
|
||||
|
||||
const int16_t LUT_cos[64]
|
||||
= { 2047, 2037, 2008, 1959, 1891, 1805, 1702, 1582, 1447, 1298,
|
||||
1137, 965, 783, 594, 399, 200, 0, -200, -399, -594,
|
||||
-783, -965, -1137, -1298, -1447, -1582, -1702, -1805, -1891, -1959,
|
||||
-2008, -2037, -2047, -2037, -2008, -1959, -1891, -1805, -1702, -1582,
|
||||
-1447, -1298, -1137, -965, -783, -594, -399, -200, 0, 200,
|
||||
399, 594, 783, 965, 1137, 1298, 1447, 1582, 1702, 1805,
|
||||
1891, 1959, 2008, 2037 };
|
||||
|
||||
//=============================================================================
|
||||
// Private Function Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Public Function Definition
|
||||
//=============================================================================
|
||||
#define ENABLE_DDS
|
||||
#ifdef ENABLE_DDS
|
||||
|
||||
struct dds_cal_param
|
||||
{
|
||||
uint32_t phase_acc;
|
||||
uint8_t lut_idx;
|
||||
uint8_t nquadrant;
|
||||
uint8_t last_quadrant;
|
||||
int16_t lut_sin_val;
|
||||
int16_t lut_cos_val;
|
||||
uint16_t duty;
|
||||
};
|
||||
|
||||
struct dds_param_t dds ={0};
|
||||
#define PHASE_COUNT 3
|
||||
const uint32_t phase_offset[PHASE_COUNT] = { 0, 1398101, 2796203 };
|
||||
static struct dds_cal_param phase[PHASE_COUNT] = { 0 };
|
||||
|
||||
void dds_pwm_duty_cycle_update(void)
|
||||
{
|
||||
for (int i = 0; i < PHASE_COUNT; i++)
|
||||
{
|
||||
struct dds_cal_param *p = &phase[i];
|
||||
p->phase_acc = (dds.phase_acc_base + phase_offset[i]) % 0x003FFFFF;
|
||||
}
|
||||
|
||||
for (int i = 0; i < PHASE_COUNT; i++)
|
||||
{
|
||||
struct dds_cal_param *p = &phase[i];
|
||||
|
||||
p->last_quadrant = p->nquadrant;
|
||||
p->lut_idx = p->phase_acc >> 16;
|
||||
p->nquadrant = p->lut_idx >> 4;
|
||||
p->lut_sin_val = LUT_sin[p->lut_idx];
|
||||
p->lut_cos_val = LUT_cos[p->lut_idx];
|
||||
p->duty = (((int32_t)p->lut_sin_val * dds.set_dds_amp) >> 18) + 1250; // 0~2500 duty cycle range
|
||||
}
|
||||
|
||||
pwm_set_duty(phase[0].duty, phase[1].duty, phase[2].duty);
|
||||
}
|
||||
|
||||
#else
|
||||
void uvw_set_duty(uint16_t base_idx)
|
||||
{
|
||||
uint16_t iA = base_idx;
|
||||
uint16_t iB = (base_idx + PWM_TABLE_SIZE / 3) % PWM_TABLE_SIZE;
|
||||
uint16_t iC = (base_idx + 2 * PWM_TABLE_SIZE / 3) % PWM_TABLE_SIZE;
|
||||
|
||||
EPWM->CCR1 = pwm_table[iA];
|
||||
EPWM->CCR2 = pwm_table[iB];
|
||||
EPWM->CCR3 = pwm_table[iC];
|
||||
}
|
||||
#endif
|
||||
|
||||
static void cmd_parser(char *data, uint32_t len)
|
||||
{
|
||||
char cmd_reply[64] = { 0 };
|
||||
|
||||
// echo back received command
|
||||
sprintf(cmd_reply, "Received command: %s\r\n", data);
|
||||
msg("%s", cmd_reply);
|
||||
|
||||
// parse commands
|
||||
if (strncmp(data, "help", 4) == 0)
|
||||
{
|
||||
msg("Available commands:\r\n");
|
||||
msg(" help - Show this help message\r\n");
|
||||
msg(" fw_ver - Show firmware version\r\n");
|
||||
}
|
||||
else if (strncmp(data, "fw_ver", 6) == 0)
|
||||
{
|
||||
msg("FW_VER_1.0.0_20260320\r\n");
|
||||
}
|
||||
else if (strncmp(data, "pwm_enable", 10) == 0)
|
||||
{
|
||||
memset(phase, 0, sizeof(phase));
|
||||
dds.phase_acc_base = 0;
|
||||
dds.set_dds_ftw = 1740;
|
||||
dds.set_dds_amp = 160000;
|
||||
pwm_enable();
|
||||
msg("PWM enabled.\r\n");
|
||||
}
|
||||
else if (strncmp(data, "pwm_disable", 11) == 0)
|
||||
{
|
||||
pwm_disable();
|
||||
msg("PWM disabled.\r\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("Unknown command. Type 'help' for available commands.\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uint16_t base_idx = 0;
|
||||
uint32_t timer = sys_get_tick();
|
||||
|
||||
SYS_Config();
|
||||
info("This is a demo project: JF_02\n");
|
||||
#ifdef ENABLE_DDS
|
||||
pwm_set_duty(1250, 1250, 1250);
|
||||
dds.phase_acc_base = 0;
|
||||
dds.set_dds_ftw = 1740;
|
||||
dds.set_dds_amp = 160000;
|
||||
pwm_enable();
|
||||
#else
|
||||
uvw_set_duty(base_idx);
|
||||
pwm_enable();
|
||||
#endif
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (stringComplete)
|
||||
{
|
||||
cmd_parser((char *)rxBuffer, strlen((char *)rxBuffer));
|
||||
stringComplete = false;
|
||||
}
|
||||
|
||||
if (sys_get_tick() - timer >= 1)
|
||||
{
|
||||
msg("%d tick\n", sys_get_tick());
|
||||
timer = sys_get_tick();
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DDS
|
||||
if (flag_24Khz_timer)
|
||||
{
|
||||
dds_pwm_duty_cycle_update();
|
||||
flag_24Khz_timer = false;
|
||||
}
|
||||
#else
|
||||
if (flag_24Khz_timer)
|
||||
{
|
||||
base_idx = (base_idx + 1) % PWM_TABLE_SIZE;
|
||||
uvw_set_duty(base_idx);
|
||||
flag_24Khz_timer = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@
|
||||
#ifndef INC_INIT_H_
|
||||
#define INC_INIT_H_
|
||||
|
||||
#include "main.h"
|
||||
|
||||
void SYS_Config();
|
||||
void gpio_config();
|
||||
void opa_config();
|
||||
|
||||
@@ -14,35 +14,39 @@
|
||||
#define __isr_H_wuraIpBA_lTJm_HvJw_sNDo_uEd5JnucTReY__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "main.h"
|
||||
//=============================================================================
|
||||
// Constant Definition
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
// Constant Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Macro Definition
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
// Macro Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Structure Definition
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
// Structure Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Global Data Definition
|
||||
//=============================================================================
|
||||
extern volatile bool flag_24Khz_timer;
|
||||
//=============================================================================
|
||||
// Private Function Definition
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
// Global Data Definition
|
||||
//=============================================================================
|
||||
extern volatile bool flag_24Khz_timer;
|
||||
extern volatile bool stringComplete;
|
||||
extern volatile char rxBuffer[128];
|
||||
//=============================================================================
|
||||
// Private Function Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Public Function Definition
|
||||
//=============================================================================
|
||||
void isr_epwm_handle(void);
|
||||
void isr_adc_handle(void);
|
||||
//=============================================================================
|
||||
// Public Function Definition
|
||||
//=============================================================================
|
||||
void isr_epwm_handle(void);
|
||||
void isr_adc_handle(void);
|
||||
void isr_uart0_handle(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -14,35 +14,45 @@
|
||||
#define __main_H_wxBnwdPw_lq7D_H4I5_sHPp_uXof15pFLp4V__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
#include "hal_device.h"
|
||||
#include "syslog.h"
|
||||
//=============================================================================
|
||||
// Constant Definition
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
// Constant Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Macro Definition
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
// Macro Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Structure Definition
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
// Structure Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Global Data Definition
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
// Global Data Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Private Function Definition
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
// Private Function Definition
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Public Function Definition
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
// Public Function Definition
|
||||
//=============================================================================
|
||||
|
||||
struct dds_param_t
|
||||
{
|
||||
uint32_t phase_acc_base;
|
||||
uint32_t set_dds_ftw;
|
||||
int32_t set_dds_amp;
|
||||
uint8_t notify_en;
|
||||
};
|
||||
|
||||
extern struct dds_param_t dds;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -4,34 +4,38 @@
|
||||
* Created on: 2025年8月18日
|
||||
* Author: jim_liao
|
||||
*/
|
||||
|
||||
#include "main.h"
|
||||
#include "isr.h"
|
||||
|
||||
#include "init.h"
|
||||
#include "hal_device.h"
|
||||
#include "isr.h"
|
||||
|
||||
//=============================================================================
|
||||
// Constant Definition
|
||||
//=============================================================================
|
||||
#define CONFIG_OPA_PGA_GAIN OPAMP_PGAGain_5
|
||||
#define CONFIG_OPA_PGA_GAIN OPAMP_PGAGain_5
|
||||
|
||||
unsigned long ADC0Sum = 0;
|
||||
unsigned char k;
|
||||
|
||||
#define HIRC_Freq 60000000 //Hz
|
||||
#define CurrentLoopIsrFreq 24000 //Hz
|
||||
#define PWM_PERIOD HIRC_Freq/CurrentLoopIsrFreq
|
||||
#define DEAD_TIME 200 //ns
|
||||
#define DEAD_TIME_VALUE DEAD_TIME*0.06
|
||||
#define HIRC_Freq 60000000 // Hz
|
||||
#define CurrentLoopIsrFreq 24000 // Hz
|
||||
#define PWM_PERIOD HIRC_Freq / CurrentLoopIsrFreq
|
||||
#define DEAD_TIME 200 // ns
|
||||
#define DEAD_TIME_VALUE DEAD_TIME * 0.06
|
||||
//=============================================================================
|
||||
// Public Function Definition
|
||||
//=============================================================================
|
||||
void SYS_Config()
|
||||
{
|
||||
SYSCFG_ClkInitTypeDef SysClkInit = {0};
|
||||
SysClkInit.ClkSource = SYSCFG_ClkSrc_HSI;
|
||||
SYSCFG_ClkInitTypeDef SysClkInit = { 0 };
|
||||
SysClkInit.ClkSource = SYSCFG_ClkSrc_HSI;
|
||||
SYSCFG_SysClkConfig(&SysClkInit);
|
||||
|
||||
sys_config_systick(SYS_TICK_1_MS);
|
||||
sys_delay(3000);
|
||||
|
||||
/* Disable ICE I/O */
|
||||
SYSCFG_SetICEPin2NormalIO(true);
|
||||
|
||||
gpio_config();
|
||||
opa_config();
|
||||
@@ -44,54 +48,54 @@ void SYS_Config()
|
||||
|
||||
void gpio_config()
|
||||
{
|
||||
//-----------------//
|
||||
// PWM
|
||||
//-----------------//
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
//-----------------//
|
||||
// PWM
|
||||
//-----------------//
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_00 | GPIO_Pin_01 | GPIO_Pin_02 | \
|
||||
GPIO_Pin_03 | GPIO_Pin_04 | GPIO_Pin_05;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStruct.GPIO_AF_Mode = GPIO_AF_6;
|
||||
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_00 | GPIO_Pin_01 | GPIO_Pin_02
|
||||
| GPIO_Pin_03 | GPIO_Pin_04 | GPIO_Pin_05;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStruct.GPIO_AF_Mode = GPIO_AF_6;
|
||||
GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
//-----------------//
|
||||
// UART
|
||||
// PB3:TX PB5:RX
|
||||
//-----------------//
|
||||
GPIO_InitTypeDef GPIOA_InitUart;
|
||||
GPIOA_InitUart.GPIO_Pin = GPIO_Pin_03;
|
||||
GPIOA_InitUart.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIOA_InitUart.GPIO_AF_Mode = GPIO_AF_1;
|
||||
//-----------------//
|
||||
// UART
|
||||
// PB3:TX PB5:RX
|
||||
//-----------------//
|
||||
GPIO_InitTypeDef GPIOA_InitUart;
|
||||
GPIOA_InitUart.GPIO_Pin = GPIO_Pin_03;
|
||||
GPIOA_InitUart.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIOA_InitUart.GPIO_AF_Mode = GPIO_AF_1;
|
||||
GPIO_Init(GPIOB, &GPIOA_InitUart);
|
||||
|
||||
GPIO_InitTypeDef GPIOB_InitUart;
|
||||
GPIOB_InitUart.GPIO_Pin = GPIO_Pin_05;
|
||||
GPIOB_InitUart.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIOB_InitUart.GPIO_AF_Mode = GPIO_AF_1;
|
||||
GPIO_InitTypeDef GPIOB_InitUart;
|
||||
GPIOB_InitUart.GPIO_Pin = GPIO_Pin_05;
|
||||
GPIOB_InitUart.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIOB_InitUart.GPIO_AF_Mode = GPIO_AF_1;
|
||||
GPIO_Init(GPIOB, &GPIOB_InitUart);
|
||||
//-----------------//
|
||||
// ADC
|
||||
// PA12/13/14:OVP/OTP/CMD
|
||||
//-----------------//
|
||||
GPIO_InitTypeDef GPIO_InitADC;
|
||||
GPIO_InitADC.GPIO_Pin = GPIO_Pin_06 | GPIO_Pin_12;
|
||||
GPIO_InitADC.GPIO_Mode = GPIO_Mode_ANAL;
|
||||
//-----------------//
|
||||
// ADC
|
||||
// PA06/12:VBUS/ADC_KEY
|
||||
//-----------------//
|
||||
GPIO_InitTypeDef GPIO_InitADC;
|
||||
GPIO_InitADC.GPIO_Pin = GPIO_Pin_06 | GPIO_Pin_12;
|
||||
GPIO_InitADC.GPIO_Mode = GPIO_Mode_ANAL;
|
||||
GPIO_Init(GPIOA, &GPIO_InitADC);
|
||||
#if 1
|
||||
//-----------------//
|
||||
// test
|
||||
//-----------------//
|
||||
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_14;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_Init(GPIOA , &GPIO_InitStruct);
|
||||
//-----------------//
|
||||
// test
|
||||
//-----------------//
|
||||
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_14;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
#endif
|
||||
}
|
||||
|
||||
void opa_config(void)
|
||||
{
|
||||
OPAMP_InitTypeDef opa_init = {0};
|
||||
OPAMP_InitTypeDef opa_init = { 0 };
|
||||
|
||||
opa_init.OPAMP_VinP = OPAMP_VinP_IO;
|
||||
opa_init.OPAMP_VinM = OPAMP_VinM_GND;
|
||||
@@ -104,28 +108,27 @@ void opa_config(void)
|
||||
OPAMP_Enable(OPAMP1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void adc_config(void)
|
||||
{
|
||||
|
||||
ADC_InitTypeDef init = {0};
|
||||
ADC_InitTypeDef init = { 0 };
|
||||
ADC_StructInit(&init);
|
||||
|
||||
//-----------------//
|
||||
// set
|
||||
//-----------------//
|
||||
ADC_InitTypeDef init1 = {0};
|
||||
//-----------------//
|
||||
// set
|
||||
//-----------------//
|
||||
ADC_InitTypeDef init1 = { 0 };
|
||||
ADC_StructInit(&init1);
|
||||
init1.SelChannels = ADC_Channel_06 |ADC_Channel_08;
|
||||
init1.ClkPrescaler = ADC_ClkDiv_4;
|
||||
init1.DataAlign = ADC_DataAlign_Right;
|
||||
init1.Mode = ADC_Mode_Scan;
|
||||
init1.SelChannels = ADC_Channel_06 | ADC_Channel_08;
|
||||
init1.ClkPrescaler = ADC_ClkDiv_4;
|
||||
init1.DataAlign = ADC_DataAlign_Right;
|
||||
init1.Mode = ADC_Mode_Scan;
|
||||
ADC_Init(ADC0, &init1);
|
||||
|
||||
ADC_ExtTrigConfig(ADC0,ADC_ExtTrigSource_EPWM_CCR4_UP,ADC_ExtTrigMode_Enable);
|
||||
ADC_ExtTrigConfig(ADC0,ADC_ExtTrigSource_EPWM_CCDR4_UP,ADC_ExtTrigMode_Enable);
|
||||
|
||||
ADC_ExtTrigConfig(ADC0, ADC_ExtTrigSource_EPWM_CCR4_UP,
|
||||
ADC_ExtTrigMode_Enable);
|
||||
ADC_ExtTrigConfig(ADC0, ADC_ExtTrigSource_EPWM_CCDR4_UP,
|
||||
ADC_ExtTrigMode_Enable);
|
||||
|
||||
#if 0
|
||||
{ /* Configure TIM interrupts */
|
||||
@@ -140,18 +143,19 @@ void adc_config(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void pwm_config()
|
||||
{
|
||||
TIM_OCInitTypeDef TIM_OCInitStruct;
|
||||
TIM_OCInitTypeDef TIM_OCInitStruct;
|
||||
TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStruct;
|
||||
|
||||
{ /* Configure TIM interrupts */
|
||||
sys_irq_attr_t irq_attr = { .disable_vector = false, };
|
||||
{ /* Configure TIM interrupts */
|
||||
sys_irq_attr_t irq_attr = {
|
||||
.disable_vector = false,
|
||||
};
|
||||
|
||||
irq_attr.trig_mode = SYS_IRQ_TRIGGER_LEVEL;
|
||||
irq_attr.level = SYS_IRQ_LEVEL_H;
|
||||
irq_attr.priority = SYS_IRQ_PRIORITY_MIDDEN;
|
||||
irq_attr.trig_mode = SYS_IRQ_TRIGGER_LEVEL;
|
||||
irq_attr.level = SYS_IRQ_LEVEL_H;
|
||||
irq_attr.priority = SYS_IRQ_PRIORITY_MIDDEN;
|
||||
sys_register_IRQ(EPWM_IRQn, isr_epwm_handle, &irq_attr);
|
||||
}
|
||||
|
||||
@@ -160,23 +164,23 @@ void pwm_config()
|
||||
TIM_TimeBaseStructInit(&TIM_TimeBaseInitStruct);
|
||||
TIM_TimeBaseInitStruct.TIM_Prescaler = 0;
|
||||
TIM_TimeBaseInitStruct.TIM_CounterMode = TIM_CounterMode_Up;
|
||||
TIM_TimeBaseInitStruct.TIM_Period = PWM_PERIOD-1;
|
||||
TIM_TimeBaseInitStruct.TIM_Period = PWM_PERIOD - 1;
|
||||
TIM_TimeBaseInitStruct.TIM_ClockDivision = TIM_CKD_Div1;
|
||||
TIM_TimeBaseInitStruct.TIM_RepetitionCounter = 0;
|
||||
TIM_TimeBaseInit(EPWM, &TIM_TimeBaseInitStruct);
|
||||
|
||||
TIM_ARRPreloadConfig(EPWM,ENABLE);
|
||||
TIM_ARRPreloadConfig(EPWM, ENABLE);
|
||||
|
||||
TIM_OCStructInit(&TIM_OCInitStruct);
|
||||
TIM_OCInitStruct.TIM_OCMode = TIM_OCMode_PWM1;
|
||||
TIM_OCInitStruct.TIM_OutputState = TIM_OutputState_Disable;
|
||||
TIM_OCInitStruct.TIM_Pulse = 0;
|
||||
TIM_OCInitStruct.TIM_OCPolarity = TIM_OCPolarity_High;
|
||||
TIM_OCInitStruct.TIM_OCIdleState = TIM_OCIdleState_Reset;
|
||||
TIM_OCInitStruct.TIM_Pulse = 1;
|
||||
TIM_OCInitStruct.TIM_OCMode = TIM_OCMode_PWM1;
|
||||
TIM_OCInitStruct.TIM_OutputState = TIM_OutputState_Disable;
|
||||
TIM_OCInitStruct.TIM_Pulse = 0;
|
||||
TIM_OCInitStruct.TIM_OCPolarity = TIM_OCPolarity_High;
|
||||
TIM_OCInitStruct.TIM_OCIdleState = TIM_OCIdleState_Reset;
|
||||
TIM_OCInitStruct.TIM_Pulse = 1;
|
||||
|
||||
TIM_OCInitStruct.TIM_OutputNState = TIM_OutputNState_Disable;
|
||||
TIM_OCInitStruct.TIM_OCNPolarity = TIM_OCPolarity_High;
|
||||
TIM_OCInitStruct.TIM_OutputNState = TIM_OutputNState_Disable;
|
||||
TIM_OCInitStruct.TIM_OCNPolarity = TIM_OCPolarity_High;
|
||||
TIM_OC1Init(EPWM, &TIM_OCInitStruct);
|
||||
|
||||
TIM_OCInitStruct.TIM_Pulse = 1;
|
||||
@@ -185,8 +189,8 @@ void pwm_config()
|
||||
TIM_OCInitStruct.TIM_Pulse = 1;
|
||||
TIM_OC3Init(EPWM, &TIM_OCInitStruct);
|
||||
|
||||
{ /* Automatic Output enable, Break, dead time and lock configuration */
|
||||
TIM_BDTRInitTypeDef bdtr_init = {0};
|
||||
{ /* Automatic Output enable, Break, dead time and lock configuration */
|
||||
TIM_BDTRInitTypeDef bdtr_init = { 0 };
|
||||
bdtr_init.TIM_LOCKLevel = TIM_LockLevel_OFF;
|
||||
bdtr_init.TIM_DeadTime = DEAD_TIME_VALUE;
|
||||
|
||||
@@ -201,8 +205,7 @@ void pwm_config()
|
||||
EPWM->CCMR2_OUTPUT_b.OC3PE = 1;
|
||||
|
||||
TIM_Cmd(EPWM, ENABLE);
|
||||
TIM_CtrlPWMOutputs(EPWM,ENABLE);
|
||||
|
||||
TIM_CtrlPWMOutputs(EPWM, ENABLE);
|
||||
}
|
||||
|
||||
void pwm_set_duty(uint16_t ch1_val, uint16_t ch2_val, uint16_t ch3_val)
|
||||
@@ -214,28 +217,49 @@ void pwm_set_duty(uint16_t ch1_val, uint16_t ch2_val, uint16_t ch3_val)
|
||||
}
|
||||
void pwm_enable()
|
||||
{
|
||||
REG_SET_BITS(EPWM->CCER, TIM_CCER_CC1E_Msk | TIM_CCER_CC1NE_Msk | \
|
||||
TIM_CCER_CC2E_Msk | TIM_CCER_CC2NE_Msk | \
|
||||
TIM_CCER_CC3E_Msk | TIM_CCER_CC3NE_Msk);
|
||||
REG_SET_BITS(EPWM->CCER, TIM_CCER_CC1E_Msk | TIM_CCER_CC1NE_Msk
|
||||
| TIM_CCER_CC2E_Msk | TIM_CCER_CC2NE_Msk
|
||||
| TIM_CCER_CC3E_Msk | TIM_CCER_CC3NE_Msk);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void pwm_disable()
|
||||
{
|
||||
REG_CLR_BITS(EPWM->CCER, TIM_CCER_CC1E_Msk | TIM_CCER_CC1NE_Msk
|
||||
| TIM_CCER_CC2E_Msk | TIM_CCER_CC2NE_Msk
|
||||
| TIM_CCER_CC3E_Msk | TIM_CCER_CC3NE_Msk);
|
||||
return;
|
||||
}
|
||||
|
||||
void uart_config()
|
||||
{
|
||||
UART_InitTypeDef uart_init = {0};
|
||||
uart_init.BaudRate = 115200;
|
||||
uart_init.WordLength = UART_WordLength_8b;
|
||||
uart_init.StopBits = UART_StopBits_1;
|
||||
uart_init.Parity = UART_Parity_No;
|
||||
uart_init.Mode = UART_Mode_TxRx;
|
||||
UART_InitTypeDef uart_init = { 0 };
|
||||
uart_init.BaudRate = 115200;
|
||||
uart_init.WordLength = UART_WordLength_8b;
|
||||
uart_init.StopBits = UART_StopBits_1;
|
||||
uart_init.Parity = UART_Parity_No;
|
||||
uart_init.Mode = UART_Mode_TxRx;
|
||||
UART_Init(UART0, &uart_init);
|
||||
UART_Start(UART0);
|
||||
|
||||
// Wait for UART to be ready after initialization
|
||||
for (volatile uint32_t i = 0; i < 10000; i++);
|
||||
|
||||
UART_ITConfig(UART0, UART_FLAG_RXNE, ENABLE);
|
||||
{ /* Configure TIM interrupts */
|
||||
sys_irq_attr_t irq_attr = {
|
||||
.disable_vector = false,
|
||||
};
|
||||
|
||||
irq_attr.trig_mode = SYS_IRQ_TRIGGER_LEVEL;
|
||||
irq_attr.level = SYS_IRQ_LEVEL_H;
|
||||
irq_attr.priority = SYS_IRQ_PRIORITY_MIDDEN;
|
||||
sys_register_IRQ(UART0_IRQn, isr_uart0_handle, &irq_attr);
|
||||
}
|
||||
}
|
||||
|
||||
void UART_Send_Wait(UART_Type *pHUart, uint16_t value)
|
||||
{
|
||||
UART_SendData(pHUart,value);
|
||||
UART_SendData(pHUart, value);
|
||||
UART_WaitTxFifoEmpty(pHUart);
|
||||
}
|
||||
|
||||
@@ -11,9 +11,11 @@
|
||||
*/
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include "isr.h"
|
||||
#include "init.h"
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Constant Definition
|
||||
//=============================================================================
|
||||
@@ -21,12 +23,16 @@
|
||||
//=============================================================================
|
||||
// Macro Definition
|
||||
//=============================================================================
|
||||
|
||||
#define RX_BUFFER_SIZE 128
|
||||
//=============================================================================
|
||||
// Global Data Definition
|
||||
//=============================================================================
|
||||
long ADC_DATA[10];
|
||||
volatile bool flag_24Khz_timer = false;
|
||||
|
||||
volatile char rxBuffer[RX_BUFFER_SIZE];
|
||||
volatile bool stringComplete = false;
|
||||
volatile uint16_t rxIndex = 0;
|
||||
//=============================================================================
|
||||
// Private Function Definition
|
||||
//=============================================================================
|
||||
@@ -37,17 +43,35 @@ volatile bool flag_24Khz_timer = false;
|
||||
__INTERRUPT void isr_epwm_handle(void)
|
||||
{
|
||||
|
||||
if ((EPWM->SR & 0x10000) == 0x10000)
|
||||
if ((EPWM->SR & 0x10000) == 0x10000)
|
||||
{
|
||||
flag_24Khz_timer = true;
|
||||
ADC_DATA[0] = ADC0->DAT6_b.DATA;
|
||||
ADC_DATA[1] = ADC0->DAT8_b.DATA;
|
||||
TIM_ClearITPendingBit(EPWM, 0x10000); // clear OVIF
|
||||
|
||||
GPIO_TogglePin(GPIOA, GPIO_Pin_14);
|
||||
flag_24Khz_timer = true;
|
||||
ADC_DATA[0] = ADC0->DAT6_b.DATA;
|
||||
ADC_DATA[1] = ADC0->DAT8_b.DATA;
|
||||
dds.phase_acc_base += dds.set_dds_ftw;
|
||||
TIM_ClearITPendingBit(EPWM, 0x10000); // clear OVIF
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__INTERRUPT void isr_uart0_handle(void)
|
||||
{
|
||||
if (UART_GetITStatus(UART0, UART_FLAG_RXNE) == 1)
|
||||
{
|
||||
char receivedChar = (char)UART_ReceiveData(UART0);
|
||||
|
||||
|
||||
if (receivedChar == '\n' || receivedChar == '\r')
|
||||
{
|
||||
if (rxIndex > 0)
|
||||
{
|
||||
rxBuffer[rxIndex] = '\0';
|
||||
stringComplete = true;
|
||||
rxIndex = 0;
|
||||
msg("Received: %s\n", rxBuffer);
|
||||
}
|
||||
}
|
||||
else if (rxIndex < RX_BUFFER_SIZE - 1)
|
||||
{
|
||||
rxBuffer[rxIndex++] = receivedChar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,11 @@
|
||||
* @license
|
||||
* @description
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "main.h"
|
||||
#include "hal_gpio.h"
|
||||
#include "hal_tim.h"
|
||||
|
||||
#include "init.h"
|
||||
#include "isr.h"
|
||||
|
||||
@@ -38,6 +39,28 @@ const uint16_t pwm_table[PWM_TABLE_SIZE]
|
||||
1127, 1006, 887, 771, 660, 555, 457, 366, 283, 210, 147,
|
||||
95, 53, 24, 6, 0, 6, 24, 53, 95, 147, 210,
|
||||
283, 366, 457, 555, 660, 771, 887, 1006, 1127 };
|
||||
|
||||
// 64-point sine wave lookup table (-2048-2047 range)
|
||||
// Sine_table[i] = sin(i*2*pi/64)*(4095/2) where i = 0 to 63
|
||||
// Use sine_amplitude parameter to scale to desired duty cycle range later
|
||||
const int16_t LUT_sin[64]
|
||||
= { 0, 200, 399, 594, 783, 965, 1137, 1298, 1447, 1582,
|
||||
1702, 1805, 1891, 1959, 2008, 2037, 2047, 2037, 2008, 1959,
|
||||
1891, 1805, 1702, 1582, 1447, 1298, 1137, 965, 783, 594,
|
||||
399, 200, 0, -200, -399, -594, -783, -965, -1137, -1298,
|
||||
-1447, -1582, -1702, -1805, -1891, -1959, -2008, -2037, -2047, -2037,
|
||||
-2008, -1959, -1891, -1805, -1702, -1582, -1447, -1298, -1137, -965,
|
||||
-783, -594, -399, -200 };
|
||||
|
||||
const int16_t LUT_cos[64]
|
||||
= { 2047, 2037, 2008, 1959, 1891, 1805, 1702, 1582, 1447, 1298,
|
||||
1137, 965, 783, 594, 399, 200, 0, -200, -399, -594,
|
||||
-783, -965, -1137, -1298, -1447, -1582, -1702, -1805, -1891, -1959,
|
||||
-2008, -2037, -2047, -2037, -2008, -1959, -1891, -1805, -1702, -1582,
|
||||
-1447, -1298, -1137, -965, -783, -594, -399, -200, 0, 200,
|
||||
399, 594, 783, 965, 1137, 1298, 1447, 1582, 1702, 1805,
|
||||
1891, 1959, 2008, 2037 };
|
||||
|
||||
//=============================================================================
|
||||
// Private Function Definition
|
||||
//=============================================================================
|
||||
@@ -45,6 +68,50 @@ const uint16_t pwm_table[PWM_TABLE_SIZE]
|
||||
//=============================================================================
|
||||
// Public Function Definition
|
||||
//=============================================================================
|
||||
#define ENABLE_DDS
|
||||
#ifdef ENABLE_DDS
|
||||
|
||||
struct dds_cal_param
|
||||
{
|
||||
uint32_t phase_acc;
|
||||
uint8_t lut_idx;
|
||||
uint8_t nquadrant;
|
||||
uint8_t last_quadrant;
|
||||
int16_t lut_sin_val;
|
||||
int16_t lut_cos_val;
|
||||
uint16_t duty;
|
||||
};
|
||||
|
||||
struct dds_param_t dds = { 0 };
|
||||
#define PHASE_COUNT 3
|
||||
const uint32_t phase_offset[PHASE_COUNT] = { 0, 1398101, 2796203 };
|
||||
static struct dds_cal_param phase[PHASE_COUNT] = { 0 };
|
||||
|
||||
void dds_pwm_duty_cycle_update(void)
|
||||
{
|
||||
for (int i = 0; i < PHASE_COUNT; i++)
|
||||
{
|
||||
struct dds_cal_param *p = &phase[i];
|
||||
p->phase_acc = (dds.phase_acc_base + phase_offset[i]) % 0x003FFFFF;
|
||||
}
|
||||
|
||||
for (int i = 0; i < PHASE_COUNT; i++)
|
||||
{
|
||||
struct dds_cal_param *p = &phase[i];
|
||||
|
||||
p->last_quadrant = p->nquadrant;
|
||||
p->lut_idx = p->phase_acc >> 16;
|
||||
p->nquadrant = p->lut_idx >> 4;
|
||||
p->lut_sin_val = LUT_sin[p->lut_idx];
|
||||
p->lut_cos_val = LUT_cos[p->lut_idx];
|
||||
p->duty = (((int32_t)p->lut_sin_val * dds.set_dds_amp) >> 18)
|
||||
+ 1250; // 0~2500 duty cycle range
|
||||
}
|
||||
|
||||
pwm_set_duty(phase[0].duty, phase[1].duty, phase[2].duty);
|
||||
}
|
||||
|
||||
#else
|
||||
void uvw_set_duty(uint16_t base_idx)
|
||||
{
|
||||
uint16_t iA = base_idx;
|
||||
@@ -55,30 +122,140 @@ void uvw_set_duty(uint16_t base_idx)
|
||||
EPWM->CCR2 = pwm_table[iB];
|
||||
EPWM->CCR3 = pwm_table[iC];
|
||||
}
|
||||
#endif
|
||||
|
||||
static void cmd_parser(char *data, uint32_t len)
|
||||
{
|
||||
char cmd_reply[64] = { 0 };
|
||||
|
||||
// echo back received command
|
||||
sprintf(cmd_reply, "Received command: %s\r\n", data);
|
||||
printf("%s", cmd_reply);
|
||||
|
||||
// parse commands
|
||||
if (strncmp(data, "help", 4) == 0)
|
||||
{
|
||||
printf("Available commands:\r\n");
|
||||
printf(" help - Show this help message\r\n");
|
||||
printf(" fw_ver - Show firmware version\r\n");
|
||||
}
|
||||
else if (strncmp(data, "fw_ver", 6) == 0)
|
||||
{
|
||||
printf("FW_VER_1.0.0_20260320\r\n");
|
||||
}
|
||||
else if (strncmp(data, "dds_init", 8) == 0)
|
||||
{
|
||||
memset(phase, 0, sizeof(phase));
|
||||
dds.phase_acc_base = 0;
|
||||
dds.set_dds_ftw = 174;
|
||||
dds.set_dds_amp = 0;
|
||||
}
|
||||
else if (strncmp(data, "pwm_enable", 10) == 0)
|
||||
{
|
||||
pwm_enable();
|
||||
printf("PWM enabled.\r\n");
|
||||
}
|
||||
else if (strncmp(data, "pwm_disable", 11) == 0)
|
||||
{
|
||||
pwm_disable();
|
||||
printf("PWM disabled.\r\n");
|
||||
}
|
||||
else if (strncmp(data, "dds_amp++", 9) == 0)
|
||||
{
|
||||
dds.set_dds_amp++;
|
||||
printf("dds_amp++\r\n");
|
||||
}
|
||||
else if (strncmp(data, "dds_amp--", 9) == 0)
|
||||
{
|
||||
dds.set_dds_amp--;
|
||||
printf("dds_amp--\r\n");
|
||||
}
|
||||
else if (strncmp(data, "dds_ftw++", 9) == 0)
|
||||
{
|
||||
dds.set_dds_ftw++;
|
||||
printf("dds_ftw++\r\n");
|
||||
}
|
||||
else if (strncmp(data, "dds_ftw--", 9) == 0)
|
||||
{
|
||||
dds.set_dds_ftw--;
|
||||
printf("dds_ftw--\r\n");
|
||||
}
|
||||
else if (strncmp(data, "dds_amp:", 8) == 0)
|
||||
{
|
||||
dds.set_dds_amp = atoi(data + 8);
|
||||
printf("dds_amp set to %d\r\n", dds.set_dds_amp);
|
||||
}
|
||||
else if (strncmp(data, "dds_ftw:", 8) == 0)
|
||||
{
|
||||
dds.set_dds_ftw = atoi(data + 8);
|
||||
printf("dds_ftw set to %d\r\n", dds.set_dds_ftw);
|
||||
}
|
||||
else if (strncmp(data, "notify_en:", 10) == 0)
|
||||
{
|
||||
dds.notify_en = atoi(data + 10);
|
||||
if (dds.notify_en)
|
||||
{
|
||||
printf("Notification enabled.\r\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Notification disabled.\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
printf("Unknown command. Type 'help' for available commands.\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uint16_t base_idx = 0;
|
||||
uint32_t timer = sys_get_tick();
|
||||
uint32_t timer;
|
||||
|
||||
SYS_Config();
|
||||
info("This is a demo project: JF_02\n");
|
||||
printf("This is a demo project: JF_02\n");
|
||||
|
||||
#ifdef ENABLE_DDS
|
||||
pwm_set_duty(1250, 1250, 1250);
|
||||
dds.phase_acc_base = 0;
|
||||
dds.set_dds_ftw = 174;
|
||||
dds.set_dds_amp = 0;
|
||||
pwm_enable();
|
||||
#else
|
||||
uvw_set_duty(base_idx);
|
||||
pwm_enable();
|
||||
#endif
|
||||
|
||||
timer = sys_get_tick();
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (sys_get_tick() - timer >= 1000)
|
||||
if (stringComplete)
|
||||
{
|
||||
msg("%d tick\n", sys_get_tick());
|
||||
timer = sys_get_tick();
|
||||
cmd_parser((char *)rxBuffer, strlen((char *)rxBuffer));
|
||||
stringComplete = false;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DDS
|
||||
if (flag_24Khz_timer)
|
||||
{
|
||||
dds_pwm_duty_cycle_update();
|
||||
if (dds.notify_en)
|
||||
{
|
||||
printf("%d tick: %d, %d, %d\n", sys_get_tick(), phase[0].duty,
|
||||
phase[1].duty, phase[2].duty);
|
||||
}
|
||||
flag_24Khz_timer = false;
|
||||
}
|
||||
#else
|
||||
if (flag_24Khz_timer)
|
||||
{
|
||||
base_idx = (base_idx + 1) % PWM_TABLE_SIZE;
|
||||
uvw_set_duty(base_idx);
|
||||
flag_24Khz_timer = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user