This commit is contained in:
qiyongshuang
2026-08-10 10:47:09 +08:00
parent 804daf39a2
commit dfe5ceea43
150 changed files with 20271 additions and 58 deletions
+295
View File
@@ -0,0 +1,295 @@
<?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.release.2606500741">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.2606500741" moduleId="org.eclipse.cdt.core.settings" name="obj">
<macros/>
<externalSettings/>
<extensions>
<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 artifactExtension="elf" 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="" errorParsers="org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GCCErrorParser" id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.2606500741" name="obj" parent="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release" postannouncebuildStep="" postbuildStep="" preannouncebuildStep="" prebuildStep="">
<folderInfo id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.2606500741" name="/" resourcePath="">
<toolChain id="ilg.gnumcueclipse.managedbuild.cross.riscv.toolchain.elf.release.2606500741" name="RISC-V Cross GCC" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.toolchain.elf.release">
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.rvGcc.1171217701" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.rvGcc" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.rvGcc.8" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.base.1900297968" name="Architecture" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.base" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.arch.rv32i" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.multiply.1509705449" name="Multiply extension (RVM)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.multiply" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.atomic.1590833110" name="Atomic extension (RVA)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.atomic" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.fp.1709872289" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.fp" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.isa.fp.none" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.compressed.1038505275" name="Compressed extension (RVC)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.compressed" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.xw.1505432023" name="Extra Compressed extension (RVXW)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.xw" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.b.1896185078" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.b" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.zmmul.724822239" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.zmmul" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.rvv.435767561" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.rvv" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.isa.rvv." valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.abi.integer.387605487" name="Integer ABI" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.abi.integer" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.abi.integer.ilp32" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.abi.fp.966196099" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.abi.fp" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.abi.fp.none" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.tune.394563202" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.tune" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.tune.default" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.codemodel.105093140" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.codemodel" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.codemodel.default" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.smalldatalimit.1147643442" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.smalldatalimit" useByScannerDiscovery="false" value="8" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.align.322546450" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.align" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.align.default" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.saverestore.367800619" name="Small prologue/epilogue (-msave-restore)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.saverestore" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.other.1526047739" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.other" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.level.514997414" name="Optimization Level" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.level" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.level.size" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.messagelength.1008570639" name="Message length (-fmessage-length=0)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.messagelength" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.signedchar.467272439" name="'char' is signed (-fsigned-char)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.signedchar" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.functionsections.2047756949" name="Function sections (-ffunction-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.functionsections" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.datasections.207613650" name="Data sections (-fdata-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.datasections" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.nocommon.358586167" name="No common unitialized (-fno-common)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.nocommon" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.noinlinefunctions.1298414520" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.noinlinefunctions" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.freestanding.213924425" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.freestanding" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.nobuiltin.2007120903" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.nobuiltin" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.spconstant.938841347" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.spconstant" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.PIC.234574726" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.PIC" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.lto.1002322664" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.lto" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.nomoveloopinvariants.1270575343" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.nomoveloopinvariants" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.highcode.114339272" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.highcode" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.asmsoftlib.896763512" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.asmsoftlib" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.pipe.1835231981" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.pipe" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.caret.2021231049" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.caret" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.ccv.2026012911" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.ccv" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.other.180560481" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.other" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.syntaxonly.1145714735" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.syntaxonly" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.pedantic.1546854128" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.pedantic" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.pedanticerrors.338820707" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.pedanticerrors" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.nowarn.254465728" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.nowarn" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.unused.1961191588" name="Warn on various unused elements (-Wunused)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.unused" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.uninitialized.929829166" name="Warn on uninitialized variables (-Wuninitialized)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.uninitialized" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.allwarn.1168626160" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.allwarn" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.extrawarn.291772487" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.extrawarn" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.missingdeclaration.102344169" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.missingdeclaration" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.conversion.550923640" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.conversion" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.pointerarith.773148082" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.pointerarith" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.padded.1788238782" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.padded" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.shadow.427580978" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.shadow" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.logicalop.1501889551" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.logicalop" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.agreggatereturn.1785504720" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.agreggatereturn" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.floatequal.134298453" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.floatequal" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.toerrors.1117291056" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.toerrors" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.other.1918769559" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.other" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.level.1204865254" name="Debug level" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.level" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.level.default" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.format.867779652" name="Debug format" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.format" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.format.default" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.prof.2131276390" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.prof" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.gprof.1910159761" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.gprof" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.other.1654431258" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.other" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.name.1218760634" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.name" useByScannerDiscovery="false" value="GNU MCU RISC-V GCC" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.prefix.103341323" name="Prefix" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.prefix" useByScannerDiscovery="false" value="riscv-none-embed-" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.c.487601824" name="C compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.c" useByScannerDiscovery="false" value="gcc" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.cpp.1062130429" name="C++ compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.cpp" useByScannerDiscovery="false" value="g++" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.ar.1194282993" name="Archiver" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.ar" useByScannerDiscovery="false" value="ar" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objcopy.1529355265" name="Hex/Bin converter" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objcopy" useByScannerDiscovery="false" value="objcopy" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objdump.1053750745" name="Listing generator" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objdump" useByScannerDiscovery="false" value="objdump" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.size.1441326233" name="Size command" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.size" useByScannerDiscovery="false" value="size" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.make.550105535" name="Build command" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.make" useByScannerDiscovery="false" value="make" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.rm.719280496" name="Remove command" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.rm" useByScannerDiscovery="false" value="rm" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.id.226017994" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.id" useByScannerDiscovery="false" value="512258282" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createflash.1311852988" name="Create flash image" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createflash" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createlisting.1983282875" name="Create extended listing" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createlisting" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.printsize.1000761142" name="Print size" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.printsize" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnumcueclipse.managedbuild.cross.riscv.targetPlatform.1944008784" isAbstract="false" osList="all" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.targetPlatform"/>
<builder buildPath="${workspace_loc:/wui_demo/obj" id="ilg.gnumcueclipse.managedbuild.cross.riscv.builder.1421508906" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="true" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.builder"/>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler.1244756189" name="GNU RISC-V Cross Assembler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler">
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.usepreprocessor.1692176068" name="Use preprocessor" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.usepreprocessor" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.nostdinc.821897907" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.nostdinc" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.preprocessonly.1205312655" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.preprocessonly" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.defs.181380015" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.defs" useByScannerDiscovery="true" valueType="definedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.undefs.1514976831" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.undefs" useByScannerDiscovery="true" valueType="undefDefinedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.paths.1034038285" name="Include paths (-I)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.paths" useByScannerDiscovery="true" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Startup}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.systempaths.496720673" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.systempaths" useByScannerDiscovery="true" valueType="includePath"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.files.1898455566" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.files" useByScannerDiscovery="true" valueType="includeFiles"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.otherwarnings.1717778600" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.otherwarnings" useByScannerDiscovery="true" value="" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.flags.1578223870" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.flags" useByScannerDiscovery="false" valueType="stringList"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.asmlisting.1937791148" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.asmlisting" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.savetemps.119863881" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.savetemps" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.verbose.1408057941" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.other.1308239903" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.other" useByScannerDiscovery="false" value="" valueType="string"/>
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler.input.126366858" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler.input"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.1731377187" name="GNU RISC-V Cross C Compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler">
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.nostdinc.1633344562" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.nostdinc" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.preprocessonly.208069239" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.preprocessonly" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs.177116515" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.undef.1820512625" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.undef" useByScannerDiscovery="true" valueType="undefDefinedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.paths.1567947810" name="Include paths (-I)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Debug}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Core}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/User}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Peripheral/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/User/Drivers}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/User/wui}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/User/wui_port}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/User/wui_user}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.systempaths.2011720354" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.systempaths" useByScannerDiscovery="true" valueType="includePath"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.files.542153928" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.files" useByScannerDiscovery="true" valueType="includeFiles"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std.2020844713" 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.gnu99" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.otheroptimizations.92321033" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.otheroptimizations" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.warning.missingprototypes.1180998530" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.warning.missingprototypes" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.warning.strictprototypes.684937223" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.warning.strictprototypes" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.warning.badfunctioncast.1090658371" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.warning.badfunctioncast" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.otherwarnings.882361093" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.otherwarnings" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.asmlisting.1019398219" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.asmlisting" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.savetemps.1858747105" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.savetemps" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.verbose.658438318" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.other.1132663916" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.other" useByScannerDiscovery="true" value="" valueType="string"/>
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input.2036806839" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.compiler.1610882921" name="GNU RISC-V Cross C++ Compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.compiler">
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nostdinc.1306818359" name="Do not search system directories (-nostdinc)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nostdinc" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nostdincpp.411115799" name="Do not search system C++ directories (-nostdinc++)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nostdincpp" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.preprocessonly.704235280" name="Preprocess only (-E)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.preprocessonly" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.defs.256688978" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.undef.1769659537" name="Undefined symbols (-U)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.undef" useByScannerDiscovery="true" valueType="undefDefinedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.include.paths.1641430352" name="Include paths (-I)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.include.systempaths.1217742259" name="Include system paths (-isystem)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.include.systempaths" useByScannerDiscovery="true" valueType="includePath"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.include.files.1922780842" name="Include files (-include)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.include.files" useByScannerDiscovery="true" valueType="includeFiles"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.std.426208505" name="Language standard" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.std" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.std.gnucpp11" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.abiversion.1671052931" name="ABI version" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.abiversion" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.abiversion.0" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.noexceptions.1891612477" name="Do not use exceptions (-fno-exceptions)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.noexceptions" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nortti.76308566" name="Do not use RTTI (-fno-rtti)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nortti" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nousecxaatexit.390229569" name="Do not use _cxa_atexit() (-fno-use-cxa-atexit)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nousecxaatexit" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nothreadsafestatics.1143999424" name="Do not use thread-safe statics (-fno-threadsafe-statics)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nothreadsafestatics" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.otheroptimizations.1589858535" name="Other optimization flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.otheroptimizations" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warnabi.1304561076" name="Warn on ABI violations (-Wabi)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warnabi" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.ctordtorprivacy.534922494" name="Warn on class privacy (-Wctor-dtor-privacy)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.ctordtorprivacy" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.noexcept.1102421587" name="Warn on no-except expressions (-Wnoexcept)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.noexcept" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.nonvirtualdtor.249412631" name="Warn on virtual destructors (-Wnon-virtual-dtor)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.nonvirtualdtor" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.strictnullsentinel.1022346732" name="Warn on uncast NULL (-Wstrict-null-sentinel)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.strictnullsentinel" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.signpromo.1510049602" name="Warn on sign promotion (-Wsign-promo)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.signpromo" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warneffc.1507924344" name="Warn about Effective C++ violations (-Weffc++)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warneffc" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.otherwarnings.521572828" name="Other warning flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.otherwarnings" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.asmlisting.842958016" name="Generate assembler listing (-Wa,-adhlns=&quot;$@.lst&quot;)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.asmlisting" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.savetemps.715871177" name="Save temporary files (--save-temps Use with caution!)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.savetemps" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.verbose.974774820" name="Verbose (-v)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.other.1293392631" name="Other compiler flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.other" useByScannerDiscovery="true" value="" valueType="string"/>
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.compiler.input.1079228323" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.compiler.input"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker.1620074387" name="GNU RISC-V Cross C Linker" outputPrefix="" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.scriptfile.1390103472" name="Script files (-T)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.scriptfile" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Ld/Link.ld}&quot;"/>
</option>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nostart.913830613" name="Do not use standard start files (-nostartfiles)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nostart" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nodeflibs.1285997013" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nodeflibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nostdlibs.179047434" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nostdlibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.gcsections.194760422" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.gcsections" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printgcsections.270824644" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printgcsections" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.strip.1802601885" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.strip" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.libs.813115939" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.libs" useByScannerDiscovery="false" valueType="libs"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.paths.2057340378" name="Library search path (-L)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.paths" useByScannerDiscovery="false" valueType="libPaths"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.flags.1125808200" name="Linker flags (-Xlinker [option])" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.flags" useByScannerDiscovery="false" valueType="stringList"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.otherobjs.16994550" name="Other objects" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.otherobjs" useByScannerDiscovery="false" valueType="userObjs">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/User/wui/libwui_0.2.a}&quot;"/>
</option>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.mapfilename.789195953" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.mapfilename" useByScannerDiscovery="false" value="&quot;${BuildArtifactFileBaseName}.map&quot;" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.picolibc.62047318" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.picolibc" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.picolibc.disabled" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.cref.824432654" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.cref" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printmap.751686263" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printmap" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.usenewlibnano.239404511" name="Use newlib-nano (--specs=nano.specs)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.usenewlibnano" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.usenewlibnosys.351964161" name="Do not use syscalls (--specs=nosys.specs)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.usenewlibnosys" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.useprintffloat.695795083" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.useprintffloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.usescanffloat.1839373535" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.usescanffloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.verbose.1444336626" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printfloat.2044235126" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printfloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printf.888161142" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printf" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.iqmath.1390292521" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.iqmath" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.other.1683775650" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.other" useByScannerDiscovery="false" value="" valueType="string"/>
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker.input.1859223768" 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.1947503520" name="GNU RISC-V Cross C++ Linker" outputPrefix="" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.linker">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.scriptfile.1751226764" name="Script files (-T)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.scriptfile" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Ld/Link.ld}&quot;"/>
</option>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.nostart.642896175" name="Do not use standard start files (-nostartfiles)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.nostart" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.nodeflibs.282300763" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.nodeflibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.nostdlibs.924960428" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.nostdlibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.gcsections.1689063433" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.gcsections" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printgcsections.621524254" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printgcsections" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.strip.679063538" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.strip" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.libs.579700779" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.libs" useByScannerDiscovery="false" valueType="libs"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.paths.1029177148" name="Library search path (-L)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.paths" useByScannerDiscovery="false" valueType="libPaths"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.flags.1251620602" name="Linker flags (-Xlinker [option])" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.flags" useByScannerDiscovery="false" valueType="stringList"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.otherobjs.1493906625" name="Other objects" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.otherobjs" useByScannerDiscovery="false" valueType="userObjs">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/User/wui/libwui_0.2.a}&quot;"/>
</option>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.mapfilename.1354773182" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.mapfilename" useByScannerDiscovery="false" value="&quot;${BuildArtifactFileBaseName}.map&quot;" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.picolibc.4345436542" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.picolibc" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.picolibc.disabled" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.cref.1007621036" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.cref" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printmap.2073713641" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printmap" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.usenewlibnano.1540675679" name="Use newlib-nano (--specs=nano.specs)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.usenewlibnano" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.usenewlibnosys.561457319" name="Do not use syscalls (--specs=nosys.specs)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.usenewlibnosys" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.useprintffloat.1497004994" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.useprintffloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.usescanffloat.881728961" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.usescanffloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.verbose.922041698" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printfloat.476377985" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printfloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printf.626387227" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printf" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.iqmath.1441123220" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.iqmath" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.other.1748689212" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.other" useByScannerDiscovery="false" value="" valueType="string"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.archiver.1292785366" name="GNU RISC-V Cross Archiver" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.archiver">
<outputType id="cdt.managedbuild.tool.gnu.archiver.output.1527226663" superClass="cdt.managedbuild.tool.gnu.archiver.output" outputPrefix="lib"/>
<option id="gnu.both.lib.option.flags.22122911" superClass="gnu.both.lib.option.flags" useByScannerDiscovery="false" value="-r" valueType="string"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createflash.1801165667" 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.textsection.1097396305" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.textsection" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.datasection.2034511797" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.datasection" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.choice.1726268709" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.choice" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.choice.ihex" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.createalgorithmfile.2643315497" superClass="ilg.gnuarmeclipse.managedbuild.cross.risv.option.createflash.createalgorithmfile" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.othersection.1890795928" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.othersection" useByScannerDiscovery="false" valueType="stringList"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.other.788974495" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.other" useByScannerDiscovery="false" value="" valueType="string"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createlisting.1356766765" 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.2052761852" name="Display source (--source|-S)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.source" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.allheaders.439659821" name="Display all headers (--all-headers|-x)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.allheaders" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.demangle.67111865" name="Demangle names (--demangle|-C)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.demangle" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.debugging.1623481730" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.debugging" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.disassemble.1859590835" name="Disassemble (--disassemble|-d)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.disassemble" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.fileheaders.160868348" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.fileheaders" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.linenumbers.1549373929" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.linenumbers" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.reloc.1008747895" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.reloc" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.symbols.577922241" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.symbols" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.wide.1298918921" name="Wide lines (--wide|-w)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.wide" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.other.1560864108" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.other" useByScannerDiscovery="false" value="" valueType="string"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.printsize.712424314" 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.1404031980" name="Size format" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.format" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.format.berkeley" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.hex.176087647" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.hex" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.totals.380903440" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.totals" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.other.1271150877" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.other" useByScannerDiscovery="false" value="" valueType="string"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="Startup/startup_ch32v20x_D8W.S|Startup/startup_ch32v20x_D8.S" 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>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="999.ilg.gnumcueclipse.managedbuild.cross.riscv.target.elf.275846018" name="Executable file" projectType="ilg.gnumcueclipse.managedbuild.cross.riscv.target.elf"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.767917625;ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.767917625.;ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.1375371130;ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input.1473381709">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.1008047074;ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.1008047074.;ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.1731377187;ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input.2036806839">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
</cproject>
+60
View File
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<projectDescription>
<name>wui_demo</name>
<comment/>
<projects/>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments/>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<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>Core</name>
<type>2</type>
<location>PARENT-2-PROJECT_LOC/SRC/Core</location>
</link>
<link>
<name>Debug</name>
<type>2</type>
<location>PARENT-2-PROJECT_LOC/SRC/Debug</location>
</link>
<link>
<name>Ld</name>
<type>2</type>
<location>PARENT-2-PROJECT_LOC/SRC/Ld</location>
</link>
<link>
<name>Peripheral</name>
<type>2</type>
<location>PARENT-2-PROJECT_LOC/SRC/Peripheral</location>
</link>
<link>
<name>Startup</name>
<type>2</type>
<location>PARENT-2-PROJECT_LOC/SRC/Startup</location>
</link>
</linkedResources>
<filteredResources>
<filter>
<name/>
<type>6</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-*.wvproj</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
+32
View File
@@ -0,0 +1,32 @@
Vendor=WCH
Toolchain=RISC-V
Series=CH32V203
RTOS=NoneOS
CalibrateSupport=false
CalibrateCommand=
UIConfigSupport=false
UIConfigCommand=
ExternalFlashSupport=false
MCU=CH32V203RBT
Link=WCH-Link
PeripheralVersion=1.0
Description=ROM(byte): 64K, SRAM(byte): 20K, CHIP PINS: 32, GPIO PORTS: 27.\nWCH CH32V2 series of mainstream MCUs covers the needs of a large variety of applications in the industrial,medical and consumer markets. High performance with first-class peripherals and low-power,low-voltage operation is paired with a high level of integration at accessible prices with a simple architecture and easy-to-use tools.
TempratureScope=
ArtifactType=executable
Mcu Type=CH32V20x
Address=0x08000000
Target Path=obj\wui_demo.hex
Exe Path=
Exe Arguments=
CLKSpeed=1
DebugInterfaceMode=0
Erase All=true
Program=true
Verify=true
Reset=true
SDIPrintf=false
Disable Power Output=false
Clear CodeFlash=false
Disable Code-Protect=false
Flash Type=
Algorithm File=
+383
View File
@@ -0,0 +1,383 @@
/*********************************************************************
* File Name : lcd.c
* Author : WCH
* Version : V1.0.0
* Date : 2023/8/15
* Description : file for lcd screen.
*********************************************************************************
* Copyright (c) 2023 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#include "lcd.h"
#include "debug.h"
#include "LCD_Font.h"
#define LCD_SOFT_RESET (0x01)
#define LCD_READ_ID (0x04)
#define LCD_READ_DISPLAY_STATUS (0x09)
#define LCD_ON (0x28)
#define LCD_OFF (0x29)
#define LCD_SET_X (0x2a)
#define LCD_SET_Y (0x2b)
#define LCD_MEM_WRITE (0x2C)
#define LCD_MEM_READ (0x2e)
static void LCD_WR_REG(uint8_t data)
{
LCD_DC_CLR();
SPI2_Write(data);
}
static void LCD_WR_DATA(uint8_t data)
{
LCD_DC_SET();
SPI2_Write(data);
}
/*********************************************************************
* @fn Lcd_WriteData_16Bit
*
* @brief write two bytes to the lcd screen
*
* @param Data - the data to write
*
* @return none
*/
void Lcd_WriteData_16Bit(uint16_t Data)
{
SPI2_Write(Data >> 8);
SPI2_Write(Data);
}
/*********************************************************************
* @fn LCD_GPIOInit
*
* @brief Configuring the control gpio for the lcd screen
*
* @return none
*/
void LCD_GPIOInit(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(LCD_LED_RCC, ENABLE);
RCC_APB2PeriphClockCmd(LCD_DC_RCC, ENABLE);
RCC_APB2PeriphClockCmd(LCD_RST_RCC, ENABLE);
RCC_APB2PeriphClockCmd(LCD_CS_RCC, ENABLE);
GPIO_InitStructure.GPIO_Pin = LCD_LED_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(LCD_LED_PORT, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = LCD_DC_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(LCD_DC_PORT, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = LCD_RST_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(LCD_RST_PORT, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = LCD_CS_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(LCD_CS_PORT, &GPIO_InitStructure);
LCD_LED_CLR();
LCD_CS_SET();
}
/*********************************************************************
* @fn LCD_RESET
*
* @brief reset the lcd screen by the rst pin
*
* @return none
*/
void LCD_RESET(void)
{
Delay_Ms(50);
LCD_RST_CLR();
Delay_Ms(100);
LCD_RST_SET();
Delay_Ms(50);
}
static const uint8_t lcd_st7789_init_cmds[] = {
1,
0x3A,
0x05,
2,
0xB0,
0x00,
0xF0,
5,
0xB2,
0x0C,
0x0C,
0x00,
0x33,
0x33,
1,
0xB7,
0x35,
1,
0xBB,
0x19,
1,
0xC0,
0x2C,
1,
0xC2,
0x01,
1,
0xC3,
0x12,
1,
0xC4,
0x20,
1,
0xC6,
0x0F,
2,
0xD0,
0xA4,
0xA1,
14,
0xE0,
0xD0,
0x04,
0x0D,
0x11,
0x13,
0x2B,
0x3F,
0x54,
0x4C,
0x18,
0x0D,
0x0B,
0x1F,
0x23,
14,
0xE1,
0xD0,
0x04,
0x0C,
0x11,
0x13,
0x2C,
0x3F,
0x44,
0x51,
0x2F,
0x1F,
0x1F,
0x20,
0x23,
0,
0x21,
1,
0x36,
#if USE_HORIZONTAL == 0
0,
#elif USE_HORIZONTAL == 1
(1 << 7) | (1 << 6) | (0 << 5),
#elif USE_HORIZONTAL == 2
(1 << 6) | (0 << 7) | (1 << 5),
#elif USE_HORIZONTAL == 3
(1 << 7) | (1 << 5),
#endif
0,
0x11,
0,
0x29,
0xff,
0xff,
};
void LCD_exec_init(uint8_t* init_code)
{
uint8_t* p = init_code;
uint8_t data_len;
uint8_t cmd;
LCD_CS_CLR();
while (1)
{
data_len = *p++;
cmd = *p++;
if (cmd == 0xFF)
{
break;
}
LCD_WR_REG(cmd);
for (uint8_t i = 0; i < data_len; i++)
{
LCD_WR_DATA(*p++);
}
}
LCD_CS_SET();
}
void LCD_Init(void)
{
SPI2_Init();
SPI2_DMA_Init();
LCD_GPIOInit();
LCD_RESET();
LCD_CS_CLR();
LCD_WR_REG(0x28);
LCD_exec_init((uint8_t*)lcd_st7789_init_cmds);
Delay_Ms(10);
LCD_Clear(LCD_BLACK);
Delay_Ms(10);
LCD_LED_SET();
}
/*********************************************************************
* @fn LCD_SetWindows
*
* @brief Setting LCD display window
*
* @param xStar - the bebinning x coordinate of the LCD display window
* yStar - the bebinning y coordinate of the LCD display window
* xEnd - the endning x coordinate of the LCD display window
* yEnd - the endning y coordinate of the LCD display window
*
* @return none
*/
void LCD_SetWindows(uint16_t xStar, uint16_t yStar, uint16_t xEnd, uint16_t yEnd)
{
LCD_CS_CLR();
LCD_WR_REG(LCD_SET_X);
LCD_WR_DATA(xStar >> 8);
LCD_WR_DATA(0x00FF & xStar);
LCD_WR_DATA(xEnd >> 8);
LCD_WR_DATA(0x00FF & xEnd);
LCD_WR_REG(LCD_SET_Y);
LCD_WR_DATA(yStar >> 8);
LCD_WR_DATA(0x00FF & yStar);
LCD_WR_DATA(yEnd >> 8);
LCD_WR_DATA(0x00FF & yEnd);
LCD_WR_REG(LCD_MEM_WRITE);
LCD_CS_SET();
}
// 设置引脚为高电平
void LCD_LED_SET(void)
{
LCD_LED_PORT->BSHR = LCD_LED_PIN;
}
void LCD_CS_SET(void)
{
LCD_CS_PORT->BSHR = LCD_CS_PIN;
}
void LCD_DC_SET(void)
{
LCD_DC_PORT->BSHR = LCD_DC_PIN;
}
void LCD_RST_SET(void)
{
LCD_RST_PORT->BSHR = LCD_RST_PIN;
}
// 设置引脚为低电平
void LCD_LED_CLR(void)
{
LCD_LED_PORT->BCR = LCD_LED_PIN;
}
void LCD_CS_CLR(void)
{
LCD_CS_PORT->BCR = LCD_CS_PIN;
}
void LCD_DC_CLR(void)
{
LCD_DC_PORT->BCR = LCD_DC_PIN;
}
void LCD_RST_CLR(void)
{
LCD_RST_PORT->BCR = LCD_RST_PIN;
}
void SPI1_wait_for_bsy()
{
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_BSY) == SET)
;
}
void SPI2_wait_for_bsy()
{
while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_BSY) == SET)
;
}
void SPI2_wait_for_txe()
{
while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_TXE) == RESET)
;
}
void SPI1_wait_for_DMA()
{
while (SPI1_DMA_TX_CH->CNTR > 0)
{
}
}
void SPI2_wait_for_DMA()
{
while (SPI2_DMA_TX_CH->CNTR > 0)
{
}
}
void LCD_Clear(uint16_t color)
{
LCD_Fill(0, 0, LCD_W, LCD_H, color);
}
@@ -0,0 +1,84 @@
/*********************************************************************
* File Name : lcd.h
* Author : WCH
* Version : V1.0.0
* Date : 2023/8/15
* Description : file for lcd screen.
*********************************************************************************
* Copyright (c) 2023 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#ifndef __LCD_H
#define __LCD_H
#include "spi.h"
#include "stdio.h"
#include "stdlib.h"
#include "flash.h"
#include "config.h"
#define USE_HORIZONTAL 2
#if USE_HORIZONTAL == 0 || USE_HORIZONTAL == 1
#define LCD_W 240
#define LCD_H 320
#endif
#if USE_HORIZONTAL == 2 || USE_HORIZONTAL == 3
#define LCD_W 320
#define LCD_H 240
#endif
#define LCD_WIDTH LCD_W
#define LCD_HEIGHT LCD_H
#define LCD_SWAP16(x) ((((x) & 0xFF) << 8) | (((x) >> 8) & 0xFF))
#define RGB888_TO_RGB565(r, g, b) LCD_SWAP16((((r) & 0xF8) << 8) | (((g) & 0xFC) << 3) | (((b) & 0xF8) >> 3))
#define RGB24_TO_RGB565(rgb) LCD_SWAP16((((rgb) >> 8) & 0xF800) | (((rgb) >> 5) & 0x07E0) | (((rgb) >> 3) & 0x001F))
#define LCD_red RGB888_TO_RGB565(255, 0, 0)
#define LCD_green RGB888_TO_RGB565(0, 255, 0)
#define LCD_blue RGB888_TO_RGB565(0, 0, 255)
#define LCD_white RGB888_TO_RGB565(255, 255, 255)
#define LCD_gray RGB888_TO_RGB565(128, 128, 128)
#define LCD_black RGB888_TO_RGB565(0, 0, 0)
#define LCD_yellow RGB888_TO_RGB565(255, 255, 0)
#define LCD_WHITE LCD_white
#define LCD_BLACK LCD_black
#define LCD_BLUE LCD_blue
#define LCD_RED LCD_red
#define LCD_MAGENTA RGB888_TO_RGB565(255, 0, 255)
#define LCD_GREEN LCD_green
#define LCD_CYAN RGB888_TO_RGB565(0, 255, 255)
#define LCD_YELLOW LCD_yellow
#define LCD_BROWN RGB888_TO_RGB565(165, 42, 42)
#define LCD_GRAY LCD_gray
void LCD_LED_SET(void);
void LCD_CS_SET(void);
void LCD_DC_SET(void);
void LCD_RST_SET(void);
void LCD_LED_CLR(void);
void LCD_CS_CLR(void);
void LCD_DC_CLR(void);
void LCD_RST_CLR(void);
void SPI1_wait_for_bsy();
void SPI2_wait_for_bsy();
void SPI2_wait_for_txe();
void SPI1_wait_for_DMA();
void SPI2_wait_for_DMA();
void LCD_Init(void);
void LCD_Clear(uint16_t Color);
void Lcd_WriteData_16Bit(uint16_t Data);
void LCD_SetWindows(uint16_t xStar, uint16_t yStar, uint16_t xEnd, uint16_t yEnd);
void LCD_Fill(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t Color);
#endif
@@ -0,0 +1,200 @@
#include "LCD_Font.h"
#include "wui.h"
//12*12
const unsigned char asc2_1206[95][12]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/
{0x00,0x00,0x00,0x00,0x3F,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/
{0x00,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x40,0x00,0x00,0x00},/*""",2*/
{0x09,0x00,0x0B,0xC0,0x3D,0x00,0x0B,0xC0,0x3D,0x00,0x09,0x00},/*"#",3*/
{0x18,0xC0,0x24,0x40,0x7F,0xE0,0x22,0x40,0x31,0x80,0x00,0x00},/*"$",4*/
{0x18,0x00,0x24,0xC0,0x1B,0x00,0x0D,0x80,0x32,0x40,0x01,0x80},/*"%",5*/
{0x03,0x80,0x1C,0x40,0x27,0x40,0x1C,0x80,0x07,0x40,0x00,0x40},/*"&",6*/
{0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x20,0x40,0x40,0x20},/*"(",8*/
{0x00,0x00,0x40,0x20,0x20,0x40,0x1F,0x80,0x00,0x00,0x00,0x00},/*")",9*/
{0x09,0x00,0x06,0x00,0x1F,0x80,0x06,0x00,0x09,0x00,0x00,0x00},/*"*",10*/
{0x04,0x00,0x04,0x00,0x3F,0x80,0x04,0x00,0x04,0x00,0x00,0x00},/*"+",11*/
{0x00,0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/
{0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x00},/*"-",13*/
{0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/
{0x00,0x20,0x01,0xC0,0x06,0x00,0x38,0x00,0x40,0x00,0x00,0x00},/*"/",15*/
{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"0",16*/
{0x00,0x00,0x10,0x40,0x3F,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"1",17*/
{0x18,0xC0,0x21,0x40,0x22,0x40,0x24,0x40,0x18,0x40,0x00,0x00},/*"2",18*/
{0x10,0x80,0x20,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"3",19*/
{0x02,0x00,0x0D,0x00,0x11,0x00,0x3F,0xC0,0x01,0x40,0x00,0x00},/*"4",20*/
{0x3C,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x23,0x80,0x00,0x00},/*"5",21*/
{0x1F,0x80,0x24,0x40,0x24,0x40,0x34,0x40,0x03,0x80,0x00,0x00},/*"6",22*/
{0x30,0x00,0x20,0x00,0x27,0xC0,0x38,0x00,0x20,0x00,0x00,0x00},/*"7",23*/
{0x1B,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"8",24*/
{0x1C,0x00,0x22,0xC0,0x22,0x40,0x22,0x40,0x1F,0x80,0x00,0x00},/*"9",25*/
{0x00,0x00,0x00,0x00,0x08,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/
{0x00,0x00,0x00,0x00,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/
{0x00,0x00,0x04,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0x40,0x40},/*"<",28*/
{0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x00,0x00},/*"=",29*/
{0x00,0x00,0x40,0x40,0x20,0x80,0x11,0x00,0x0A,0x00,0x04,0x00},/*">",30*/
{0x18,0x00,0x20,0x00,0x23,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"?",31*/
{0x1F,0x80,0x20,0x40,0x27,0x40,0x29,0x40,0x1F,0x40,0x00,0x00},/*"@",32*/
{0x00,0x40,0x07,0xC0,0x39,0x00,0x0F,0x00,0x01,0xC0,0x00,0x40},/*"A",33*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"B",34*/
{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x30,0x80,0x00,0x00},/*"C",35*/
{0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"D",36*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x40,0x30,0xC0,0x00,0x00},/*"E",37*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x00,0x30,0x00,0x00,0x00},/*"F",38*/
{0x0F,0x00,0x10,0x80,0x20,0x40,0x22,0x40,0x33,0x80,0x02,0x00},/*"G",39*/
{0x20,0x40,0x3F,0xC0,0x04,0x00,0x04,0x00,0x3F,0xC0,0x20,0x40},/*"H",40*/
{0x20,0x40,0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x00,0x00},/*"I",41*/
{0x00,0x60,0x20,0x20,0x20,0x20,0x3F,0xC0,0x20,0x00,0x20,0x00},/*"J",42*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x0B,0x00,0x30,0xC0,0x20,0x40},/*"K",43*/
{0x20,0x40,0x3F,0xC0,0x20,0x40,0x00,0x40,0x00,0x40,0x00,0xC0},/*"L",44*/
{0x3F,0xC0,0x3C,0x00,0x03,0xC0,0x3C,0x00,0x3F,0xC0,0x00,0x00},/*"M",45*/
{0x20,0x40,0x3F,0xC0,0x0C,0x40,0x23,0x00,0x3F,0xC0,0x20,0x00},/*"N",46*/
{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"O",47*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"P",48*/
{0x1F,0x80,0x21,0x40,0x21,0x40,0x20,0xE0,0x1F,0xA0,0x00,0x00},/*"Q",49*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x26,0x00,0x19,0xC0,0x00,0x40},/*"R",50*/
{0x18,0xC0,0x24,0x40,0x24,0x40,0x22,0x40,0x31,0x80,0x00,0x00},/*"S",51*/
{0x30,0x00,0x20,0x40,0x3F,0xC0,0x20,0x40,0x30,0x00,0x00,0x00},/*"T",52*/
{0x20,0x00,0x3F,0x80,0x00,0x40,0x00,0x40,0x3F,0x80,0x20,0x00},/*"U",53*/
{0x20,0x00,0x3E,0x00,0x01,0xC0,0x07,0x00,0x38,0x00,0x20,0x00},/*"V",54*/
{0x38,0x00,0x07,0xC0,0x3C,0x00,0x07,0xC0,0x38,0x00,0x00,0x00},/*"W",55*/
{0x20,0x40,0x39,0xC0,0x06,0x00,0x39,0xC0,0x20,0x40,0x00,0x00},/*"X",56*/
{0x20,0x00,0x38,0x40,0x07,0xC0,0x38,0x40,0x20,0x00,0x00,0x00},/*"Y",57*/
{0x30,0x40,0x21,0xC0,0x26,0x40,0x38,0x40,0x20,0xC0,0x00,0x00},/*"Z",58*/
{0x00,0x00,0x00,0x00,0x7F,0xE0,0x40,0x20,0x40,0x20,0x00,0x00},/*"[",59*/
{0x00,0x00,0x70,0x00,0x0C,0x00,0x03,0x80,0x00,0x40,0x00,0x00},/*"\",60*/
{0x00,0x00,0x40,0x20,0x40,0x20,0x7F,0xE0,0x00,0x00,0x00,0x00},/*"]",61*/
{0x00,0x00,0x20,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00},/*"^",62*/
{0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10},/*"_",63*/
{0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/
{0x00,0x00,0x02,0x80,0x05,0x40,0x05,0x40,0x03,0xC0,0x00,0x40},/*"a",65*/
{0x20,0x00,0x3F,0xC0,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"b",66*/
{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x06,0x40,0x00,0x00},/*"c",67*/
{0x00,0x00,0x03,0x80,0x04,0x40,0x24,0x40,0x3F,0xC0,0x00,0x40},/*"d",68*/
{0x00,0x00,0x03,0x80,0x05,0x40,0x05,0x40,0x03,0x40,0x00,0x00},/*"e",69*/
{0x00,0x00,0x04,0x40,0x1F,0xC0,0x24,0x40,0x24,0x40,0x20,0x00},/*"f",70*/
{0x00,0x00,0x02,0xE0,0x05,0x50,0x05,0x50,0x06,0x50,0x04,0x20},/*"g",71*/
{0x20,0x40,0x3F,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"h",72*/
{0x00,0x00,0x04,0x40,0x27,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"i",73*/
{0x00,0x10,0x00,0x10,0x04,0x10,0x27,0xE0,0x00,0x00,0x00,0x00},/*"j",74*/
{0x20,0x40,0x3F,0xC0,0x01,0x40,0x07,0x00,0x04,0xC0,0x04,0x40},/*"k",75*/
{0x20,0x40,0x20,0x40,0x3F,0xC0,0x00,0x40,0x00,0x40,0x00,0x00},/*"l",76*/
{0x07,0xC0,0x04,0x00,0x07,0xC0,0x04,0x00,0x03,0xC0,0x00,0x00},/*"m",77*/
{0x04,0x40,0x07,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"n",78*/
{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"o",79*/
{0x04,0x10,0x07,0xF0,0x04,0x50,0x04,0x40,0x03,0x80,0x00,0x00},/*"p",80*/
{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x50,0x07,0xF0,0x00,0x10},/*"q",81*/
{0x04,0x40,0x07,0xC0,0x02,0x40,0x04,0x00,0x04,0x00,0x00,0x00},/*"r",82*/
{0x00,0x00,0x06,0x40,0x05,0x40,0x05,0x40,0x04,0xC0,0x00,0x00},/*"s",83*/
{0x00,0x00,0x04,0x00,0x1F,0x80,0x04,0x40,0x00,0x40,0x00,0x00},/*"t",84*/
{0x04,0x00,0x07,0x80,0x00,0x40,0x04,0x40,0x07,0xC0,0x00,0x40},/*"u",85*/
{0x04,0x00,0x07,0x00,0x04,0xC0,0x01,0x80,0x06,0x00,0x04,0x00},/*"v",86*/
{0x06,0x00,0x01,0xC0,0x07,0x00,0x01,0xC0,0x06,0x00,0x00,0x00},/*"w",87*/
{0x04,0x40,0x06,0xC0,0x01,0x00,0x06,0xC0,0x04,0x40,0x00,0x00},/*"x",88*/
{0x04,0x10,0x07,0x10,0x04,0xE0,0x01,0x80,0x06,0x00,0x04,0x00},/*"y",89*/
{0x00,0x00,0x04,0x40,0x05,0xC0,0x06,0x40,0x04,0x40,0x00,0x00},/*"z",90*/
{0x00,0x00,0x00,0x00,0x04,0x00,0x7B,0xE0,0x40,0x20,0x00,0x00},/*"{",91*/
{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF0,0x00,0x00,0x00,0x00},/*"|",92*/
{0x00,0x00,0x40,0x20,0x7B,0xE0,0x04,0x00,0x00,0x00,0x00,0x00},/*"}",93*/
{0x40,0x00,0x80,0x00,0x40,0x00,0x20,0x00,0x20,0x00,0x40,0x00},/*"~",94*/
};
//16*16
const unsigned char asc2_1608[95][16]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xCC,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/
{0x00,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x00,0x00},/*""",2*/
{0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x00,0x00},/*"#",3*/
{0x00,0x00,0x0E,0x18,0x11,0x04,0x3F,0xFF,0x10,0x84,0x0C,0x78,0x00,0x00,0x00,0x00},/*"$",4*/
{0x0F,0x00,0x10,0x84,0x0F,0x38,0x00,0xC0,0x07,0x78,0x18,0x84,0x00,0x78,0x00,0x00},/*"%",5*/
{0x00,0x78,0x0F,0x84,0x10,0xC4,0x11,0x24,0x0E,0x98,0x00,0xE4,0x00,0x84,0x00,0x08},/*"&",6*/
{0x08,0x00,0x68,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x18,0x18,0x20,0x04,0x40,0x02,0x00,0x00},/*"(",8*/
{0x00,0x00,0x40,0x02,0x20,0x04,0x18,0x18,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00},/*")",9*/
{0x02,0x40,0x02,0x40,0x01,0x80,0x0F,0xF0,0x01,0x80,0x02,0x40,0x02,0x40,0x00,0x00},/*"*",10*/
{0x00,0x80,0x00,0x80,0x00,0x80,0x0F,0xF8,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x00},/*"+",11*/
{0x00,0x01,0x00,0x0D,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/
{0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80},/*"-",13*/
{0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/
{0x00,0x00,0x00,0x06,0x00,0x18,0x00,0x60,0x01,0x80,0x06,0x00,0x18,0x00,0x20,0x00},/*"/",15*/
{0x00,0x00,0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"0",16*/
{0x00,0x00,0x08,0x04,0x08,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"1",17*/
{0x00,0x00,0x0E,0x0C,0x10,0x14,0x10,0x24,0x10,0x44,0x11,0x84,0x0E,0x0C,0x00,0x00},/*"2",18*/
{0x00,0x00,0x0C,0x18,0x10,0x04,0x11,0x04,0x11,0x04,0x12,0x88,0x0C,0x70,0x00,0x00},/*"3",19*/
{0x00,0x00,0x00,0xE0,0x03,0x20,0x04,0x24,0x08,0x24,0x1F,0xFC,0x00,0x24,0x00,0x00},/*"4",20*/
{0x00,0x00,0x1F,0x98,0x10,0x84,0x11,0x04,0x11,0x04,0x10,0x88,0x10,0x70,0x00,0x00},/*"5",21*/
{0x00,0x00,0x07,0xF0,0x08,0x88,0x11,0x04,0x11,0x04,0x18,0x88,0x00,0x70,0x00,0x00},/*"6",22*/
{0x00,0x00,0x1C,0x00,0x10,0x00,0x10,0xFC,0x13,0x00,0x1C,0x00,0x10,0x00,0x00,0x00},/*"7",23*/
{0x00,0x00,0x0E,0x38,0x11,0x44,0x10,0x84,0x10,0x84,0x11,0x44,0x0E,0x38,0x00,0x00},/*"8",24*/
{0x00,0x00,0x07,0x00,0x08,0x8C,0x10,0x44,0x10,0x44,0x08,0x88,0x07,0xF0,0x00,0x00},/*"9",25*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0C,0x03,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/
{0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/
{0x00,0x00,0x00,0x80,0x01,0x40,0x02,0x20,0x04,0x10,0x08,0x08,0x10,0x04,0x00,0x00},/*"<",28*/
{0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x00,0x00},/*"=",29*/
{0x00,0x00,0x10,0x04,0x08,0x08,0x04,0x10,0x02,0x20,0x01,0x40,0x00,0x80,0x00,0x00},/*">",30*/
{0x00,0x00,0x0E,0x00,0x12,0x00,0x10,0x0C,0x10,0x6C,0x10,0x80,0x0F,0x00,0x00,0x00},/*"?",31*/
{0x03,0xE0,0x0C,0x18,0x13,0xE4,0x14,0x24,0x17,0xC4,0x08,0x28,0x07,0xD0,0x00,0x00},/*"@",32*/
{0x00,0x04,0x00,0x3C,0x03,0xC4,0x1C,0x40,0x07,0x40,0x00,0xE4,0x00,0x1C,0x00,0x04},/*"A",33*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x11,0x04,0x0E,0x88,0x00,0x70,0x00,0x00},/*"B",34*/
{0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x04,0x10,0x08,0x1C,0x10,0x00,0x00},/*"C",35*/
{0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"D",36*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x17,0xC4,0x10,0x04,0x08,0x18,0x00,0x00},/*"E",37*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x17,0xC0,0x10,0x00,0x08,0x00,0x00,0x00},/*"F",38*/
{0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x44,0x1C,0x78,0x00,0x40,0x00,0x00},/*"G",39*/
{0x10,0x04,0x1F,0xFC,0x10,0x84,0x00,0x80,0x00,0x80,0x10,0x84,0x1F,0xFC,0x10,0x04},/*"H",40*/
{0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x00,0x00,0x00,0x00},/*"I",41*/
{0x00,0x03,0x00,0x01,0x10,0x01,0x10,0x01,0x1F,0xFE,0x10,0x00,0x10,0x00,0x00,0x00},/*"J",42*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x03,0x80,0x14,0x64,0x18,0x1C,0x10,0x04,0x00,0x00},/*"K",43*/
{0x10,0x04,0x1F,0xFC,0x10,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x0C,0x00,0x00},/*"L",44*/
{0x10,0x04,0x1F,0xFC,0x1F,0x00,0x00,0xFC,0x1F,0x00,0x1F,0xFC,0x10,0x04,0x00,0x00},/*"M",45*/
{0x10,0x04,0x1F,0xFC,0x0C,0x04,0x03,0x00,0x00,0xE0,0x10,0x18,0x1F,0xFC,0x10,0x00},/*"N",46*/
{0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"O",47*/
{0x10,0x04,0x1F,0xFC,0x10,0x84,0x10,0x80,0x10,0x80,0x10,0x80,0x0F,0x00,0x00,0x00},/*"P",48*/
{0x07,0xF0,0x08,0x18,0x10,0x24,0x10,0x24,0x10,0x1C,0x08,0x0A,0x07,0xF2,0x00,0x00},/*"Q",49*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x11,0xC0,0x11,0x30,0x0E,0x0C,0x00,0x04},/*"R",50*/
{0x00,0x00,0x0E,0x1C,0x11,0x04,0x10,0x84,0x10,0x84,0x10,0x44,0x1C,0x38,0x00,0x00},/*"S",51*/
{0x18,0x00,0x10,0x00,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x00,0x18,0x00,0x00,0x00},/*"T",52*/
{0x10,0x00,0x1F,0xF8,0x10,0x04,0x00,0x04,0x00,0x04,0x10,0x04,0x1F,0xF8,0x10,0x00},/*"U",53*/
{0x10,0x00,0x1E,0x00,0x11,0xE0,0x00,0x1C,0x00,0x70,0x13,0x80,0x1C,0x00,0x10,0x00},/*"V",54*/
{0x1F,0xC0,0x10,0x3C,0x00,0xE0,0x1F,0x00,0x00,0xE0,0x10,0x3C,0x1F,0xC0,0x00,0x00},/*"W",55*/
{0x10,0x04,0x18,0x0C,0x16,0x34,0x01,0xC0,0x01,0xC0,0x16,0x34,0x18,0x0C,0x10,0x04},/*"X",56*/
{0x10,0x00,0x1C,0x00,0x13,0x04,0x00,0xFC,0x13,0x04,0x1C,0x00,0x10,0x00,0x00,0x00},/*"Y",57*/
{0x08,0x04,0x10,0x1C,0x10,0x64,0x10,0x84,0x13,0x04,0x1C,0x04,0x10,0x18,0x00,0x00},/*"Z",58*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x40,0x02,0x40,0x02,0x40,0x02,0x00,0x00},/*"[",59*/
{0x00,0x00,0x30,0x00,0x0C,0x00,0x03,0x80,0x00,0x60,0x00,0x1C,0x00,0x03,0x00,0x00},/*"\",60*/
{0x00,0x00,0x40,0x02,0x40,0x02,0x40,0x02,0x7F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00},/*"]",61*/
{0x00,0x00,0x00,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00},/*"^",62*/
{0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01},/*"_",63*/
{0x00,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/
{0x00,0x00,0x00,0x98,0x01,0x24,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xFC,0x00,0x04},/*"a",65*/
{0x10,0x00,0x1F,0xFC,0x00,0x88,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"b",66*/
{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x00},/*"c",67*/
{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x11,0x08,0x1F,0xFC,0x00,0x04},/*"d",68*/
{0x00,0x00,0x00,0xF8,0x01,0x44,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xC8,0x00,0x00},/*"e",69*/
{0x00,0x00,0x01,0x04,0x01,0x04,0x0F,0xFC,0x11,0x04,0x11,0x04,0x11,0x00,0x18,0x00},/*"f",70*/
{0x00,0x00,0x00,0xD6,0x01,0x29,0x01,0x29,0x01,0x29,0x01,0xC9,0x01,0x06,0x00,0x00},/*"g",71*/
{0x10,0x04,0x1F,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"h",72*/
{0x00,0x00,0x01,0x04,0x19,0x04,0x19,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"i",73*/
{0x00,0x00,0x00,0x03,0x00,0x01,0x01,0x01,0x19,0x01,0x19,0xFE,0x00,0x00,0x00,0x00},/*"j",74*/
{0x10,0x04,0x1F,0xFC,0x00,0x24,0x00,0x40,0x01,0xB4,0x01,0x0C,0x01,0x04,0x00,0x00},/*"k",75*/
{0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"l",76*/
{0x01,0x04,0x01,0xFC,0x01,0x04,0x01,0x00,0x01,0xFC,0x01,0x04,0x01,0x00,0x00,0xFC},/*"m",77*/
{0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"n",78*/
{0x00,0x00,0x00,0xF8,0x01,0x04,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0xF8,0x00,0x00},/*"o",79*/
{0x01,0x01,0x01,0xFF,0x00,0x85,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"p",80*/
{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x05,0x01,0xFF,0x00,0x01},/*"q",81*/
{0x01,0x04,0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x04,0x01,0x00,0x01,0x80,0x00,0x00},/*"r",82*/
{0x00,0x00,0x00,0xCC,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x98,0x00,0x00},/*"s",83*/
{0x00,0x00,0x01,0x00,0x01,0x00,0x07,0xF8,0x01,0x04,0x01,0x04,0x00,0x00,0x00,0x00},/*"t",84*/
{0x01,0x00,0x01,0xF8,0x00,0x04,0x00,0x04,0x00,0x04,0x01,0x08,0x01,0xFC,0x00,0x04},/*"u",85*/
{0x01,0x00,0x01,0x80,0x01,0x70,0x00,0x0C,0x00,0x10,0x01,0x60,0x01,0x80,0x01,0x00},/*"v",86*/
{0x01,0xF0,0x01,0x0C,0x00,0x30,0x01,0xC0,0x00,0x30,0x01,0x0C,0x01,0xF0,0x01,0x00},/*"w",87*/
{0x00,0x00,0x01,0x04,0x01,0x8C,0x00,0x74,0x01,0x70,0x01,0x8C,0x01,0x04,0x00,0x00},/*"x",88*/
{0x01,0x01,0x01,0x81,0x01,0x71,0x00,0x0E,0x00,0x18,0x01,0x60,0x01,0x80,0x01,0x00},/*"y",89*/
{0x00,0x00,0x01,0x84,0x01,0x0C,0x01,0x34,0x01,0x44,0x01,0x84,0x01,0x0C,0x00,0x00},/*"z",90*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x3E,0xFC,0x40,0x02,0x40,0x02},/*"{",91*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},/*"|",92*/
{0x00,0x00,0x40,0x02,0x40,0x02,0x3E,0xFC,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"}",93*/
{0x00,0x00,0x60,0x00,0x80,0x00,0x80,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x20,0x00},/*"~",94*/
};
@@ -0,0 +1,18 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : lcd_font.h
* Author : WCH
* Version : V1.0.1
* Date : 2025/09/15
* Description : ASCII character library.
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#ifndef __LCD_FONT_H
#define __LCD_FONT_H
extern const unsigned char asc2_1206[95][12];
extern const unsigned char asc2_1608[95][16];
#endif
@@ -0,0 +1,36 @@
/*********************************************************************
* File Name : config.h
* Author : WCH
* Version : V1.0.0
* Date : 2023/8/15
* Description : file for Config.
*********************************************************************************
* Copyright (c) 2023 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#ifndef __CONFIG_H__
#define __CONFIG_H__
/* SPI FLASH and LCD_SCREEN GPIO Definition */
#define FLASH_CS_PORT GPIOA
#define FLASH_CS_RCC RCC_APB2Periph_GPIOA
#define FLASH_CS_PIN (GPIO_Pin_4)
#define LCD_LED_RCC RCC_APB2Periph_GPIOB
#define LCD_LED_PORT GPIOB
#define LCD_LED_PIN (GPIO_Pin_9)
#define LCD_DC_RCC RCC_APB2Periph_GPIOB
#define LCD_DC_PORT GPIOB
#define LCD_DC_PIN (GPIO_Pin_10)
#define LCD_RST_RCC RCC_APB2Periph_GPIOB
#define LCD_RST_PORT GPIOB
#define LCD_RST_PIN (GPIO_Pin_11)
#define LCD_CS_RCC RCC_APB2Periph_GPIOB
#define LCD_CS_PORT GPIOB
#define LCD_CS_PIN (GPIO_Pin_12)
#endif
@@ -0,0 +1,465 @@
/*********************************************************************
* File Name : flash.c
* Author : WCH
* Version : V1.0.0
* Date : 2023/8/15
* Description : file for spi flash.
*********************************************************************************
* Copyright (c) 2023 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#include "flash.h"
#include "spi.h"
static uint8_t FLASH_readWrite(uint8_t TxData)
{
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET)
;
SPI_I2S_SendData(SPI1, TxData);
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET)
;
return SPI_I2S_ReceiveData(SPI1);
}
/*********************************************************************
* @fn cs_pin_init
*
* @brief gpio cs pin init
*
* @return none
*/
static void cs_pin_init()
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(FLASH_CS_RCC, ENABLE);
GPIO_InitStructure.GPIO_Pin = FLASH_CS_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(FLASH_CS_PORT, &GPIO_InitStructure);
}
/*********************************************************************
* @fn SPI_FLASH_Init
*
* @brief SPI FLASH Init
*
* @return none
*/
void SPI_FLASH_Init(void)
{
SPI1_Init();
SPI1_Read_DMA_Init();
cs_pin_init();
FLASH_CS_SET;
}
/*********************************************************************
* @fn SPI_Flash_ReadSR
*
* @brief Read W25Qxx status register.
* !!BIT7 6 5 4 3 2 1 0
* !!SPR RV TB BP2 BP1 BP0 WEL BUSY
*
* @return byte - status register value.
*/
uint8_t SPI_Flash_ReadSR(void)
{
uint8_t byte = 0;
FLASH_CS_CLR;
FLASH_readWrite(W25X_ReadStatusReg);
byte = FLASH_readWrite(0Xff);
FLASH_CS_SET;
return byte;
}
/*********************************************************************
* @fn SPI_FLASH_Write_SR
*
* @brief Write W25Qxx status register.
*
* @param sr - status register value.
*
* @return none
*/
void SPI_FLASH_Write_SR(uint8_t sr)
{
FLASH_CS_CLR;
FLASH_readWrite(W25X_WriteStatusReg);
FLASH_readWrite(sr);
FLASH_CS_SET;
}
/*********************************************************************
* @fn SPI_Flash_Wait_Busy
*
* @brief Wait flash free.
*
* @return none
*/
void SPI_Flash_Wait_Busy(void)
{
while ((SPI_Flash_ReadSR() & 0x01) == 0x01)
;
}
/*********************************************************************
* @fn SPI_FLASH_Write_Enable
*
* @brief Enable flash write.
*
* @return none
*/
void SPI_FLASH_Write_Enable(void)
{
FLASH_CS_CLR;
FLASH_readWrite(W25X_WriteEnable);
FLASH_CS_SET;
}
/*********************************************************************
* @fn SPI_FLASH_Write_Disable
*
* @brief Disable flash write.
*
* @return none
*/
void SPI_FLASH_Write_Disable(void)
{
FLASH_CS_CLR;
FLASH_readWrite(W25X_WriteDisable);
FLASH_CS_SET;
}
/*********************************************************************
* @fn SPI_Flash_ReadID
*
* @brief Read flash ID.
*
* @return Temp - FLASH ID.
*/
uint16_t SPI_Flash_ReadID(void)
{
uint16_t Temp = 0;
FLASH_CS_CLR;
FLASH_readWrite(W25X_ManufactDeviceID);
FLASH_readWrite(0x00);
FLASH_readWrite(0x00);
FLASH_readWrite(0x00);
Temp |= FLASH_readWrite(0xFF) << 8;
Temp |= FLASH_readWrite(0xFF);
FLASH_CS_SET;
return Temp;
}
/*********************************************************************
* @fn SPI_Flash_ReadJedecDeviceID
*
* @brief Read JedecDevice ID.
*
* @return JedecDevice ID.
*/
uint32_t SPI_Flash_ReadJedecDeviceID(void)
{
uint32_t Temp = 0;
FLASH_CS_CLR;
FLASH_readWrite(W25X_JedecDeviceID);
Temp |= FLASH_readWrite(0xFF) << 16;
Temp |= FLASH_readWrite(0xFF) << 8;
Temp |= FLASH_readWrite(0xFF);
FLASH_CS_SET;
return Temp;
}
/*********************************************************************
* @fn SPI_Flash_Erase_Sector
*
* @brief Erase one sector(4Kbyte).
*
* @param Dst_Addr - 0 !! 2047
*
* @return none
*/
void SPI_Flash_Erase_Sector(uint32_t Dst_Addr)
{
Dst_Addr *= 4096;
SPI_FLASH_Write_Enable();
SPI_Flash_Wait_Busy();
FLASH_CS_CLR;
FLASH_readWrite(W25X_SectorErase);
FLASH_readWrite((uint8_t)((Dst_Addr) >> 16));
FLASH_readWrite((uint8_t)((Dst_Addr) >> 8));
FLASH_readWrite((uint8_t)Dst_Addr);
FLASH_CS_SET;
SPI_Flash_Wait_Busy();
}
/*********************************************************************
* @fn SPI_Flash_Read
*
* @brief Read data from flash.
*
* @param pBuffer -
* ReadAddr -Initial address(24bit).
* size - Data length.
*
* @return none
*/
void SPI_Flash_Read(uint8_t *pBuffer, uint32_t ReadAddr, uint16_t size)
{
uint16_t i;
FLASH_CS_CLR;
FLASH_readWrite(W25X_ReadData);
FLASH_readWrite((uint8_t)((ReadAddr) >> 16));
FLASH_readWrite((uint8_t)((ReadAddr) >> 8));
FLASH_readWrite((uint8_t)ReadAddr);
for (i = 0; i < size; i++)
{
pBuffer[i] = FLASH_readWrite(0XFF);
}
FLASH_CS_SET;
}
/*********************************************************************
* @fn SPI_Flash_Write_Page
*
* @brief Write data by one page.
*
* @param pBuffer -
* WriteAddr - Initial address(24bit).
* size - Data length.
*
* @return none
*/
void SPI_Flash_Write_Page(uint8_t *pBuffer, uint32_t WriteAddr, uint16_t size)
{
uint16_t i;
SPI_FLASH_Write_Enable();
FLASH_CS_CLR;
FLASH_readWrite(W25X_PageProgram);
FLASH_readWrite((uint8_t)((WriteAddr) >> 16));
FLASH_readWrite((uint8_t)((WriteAddr) >> 8));
FLASH_readWrite((uint8_t)WriteAddr);
for (i = 0; i < size; i++)
{
FLASH_readWrite(pBuffer[i]);
}
FLASH_CS_SET;
SPI_Flash_Wait_Busy();
}
/*********************************************************************
* @fn SPI_Flash_Write_NoCheck
*
* @brief Write data to flash.(need Erase)
* All data in address rang is 0xFF.
*
* @param pBuffer -
* WriteAddr - Initial address(24bit).
* size - Data length.
*
* @return none
*/
void SPI_Flash_Write_NoCheck(uint8_t *pBuffer, uint32_t WriteAddr, uint16_t size)
{
uint16_t pageremain;
pageremain = 256 - WriteAddr % 256;
if (size <= pageremain)
pageremain = size;
while (1)
{
SPI_Flash_Write_Page(pBuffer, WriteAddr, pageremain);
if (size == pageremain)
{
break;
}
else
{
pBuffer += pageremain;
WriteAddr += pageremain;
size -= pageremain;
if (size > 256)
pageremain = 256;
else
pageremain = size;
}
}
}
static uint8_t W25QXX_BUFFER[4096];
/*********************************************************************
* @fn SPI_Flash_Write
*
* @brief Write data to flash.(no need Erase)
*
* @param pBuffer -
* WriteAddr - Initial address(24bit).
* size - Data length.
*
* @return none
*/
void SPI_Flash_Write(uint8_t *pBuffer, uint32_t WriteAddr, uint16_t size)
{
uint32_t secpos;
uint16_t secoff;
uint16_t secremain;
uint16_t i;
secpos = WriteAddr / 4096;
secoff = WriteAddr % 4096;
secremain = 4096 - secoff;
if (size <= secremain)
secremain = size;
while (1)
{
SPI_Flash_Read(W25QXX_BUFFER, secpos * 4096, 4096);
for (i = 0; i < secremain; i++)
{
if (W25QXX_BUFFER[secoff + i] != 0XFF)
break;
}
if (i < secremain)
{
SPI_Flash_Erase_Sector(secpos);
for (i = 0; i < secremain; i++)
{
W25QXX_BUFFER[i + secoff] = pBuffer[i];
}
SPI_Flash_Write_NoCheck(W25QXX_BUFFER, secpos * 4096, 4096);
}
else
{
SPI_Flash_Write_NoCheck(pBuffer, WriteAddr, secremain);
}
if (size == secremain)
{
break;
}
else
{
secpos++;
secoff = 0;
pBuffer += secremain;
WriteAddr += secremain;
size -= secremain;
if (size > 4096)
{
secremain = 4096;
}
else
{
secremain = size;
}
}
}
}
/*********************************************************************
* @fn SPI_Flash_Erase_Block
*
* @brief Erase all FLASH pages.
*
*
* @return none
*/
void SPI_Flash_Erase_Block(uint32_t Dst_Addr)
{
SPI_FLASH_Write_Enable();
SPI_Flash_Wait_Busy();
FLASH_CS_CLR;
FLASH_readWrite(W25X_BlockErase);
FLASH_readWrite((uint8_t)((Dst_Addr) >> 16));
FLASH_readWrite((uint8_t)((Dst_Addr) >> 8));
FLASH_readWrite((uint8_t)Dst_Addr);
FLASH_CS_SET;
SPI_Flash_Wait_Busy();
}
/*********************************************************************
* @fn SPI_Flash_PowerDown
*
* @brief Enter power down mode.
*
* @return none
*/
void SPI_Flash_PowerDown(void)
{
FLASH_CS_CLR;
FLASH_readWrite(W25X_PowerDown);
FLASH_CS_SET;
Delay_Us(3);
}
/*********************************************************************
* @fn SPI_Flash_WAKEUP
*
* @brief Power down wake up.
*
* @return none
*/
void SPI_Flash_WAKEUP(void)
{
FLASH_CS_CLR;
FLASH_readWrite(W25X_ReleasePowerDown);
FLASH_CS_SET;
Delay_Us(3);
}
/*********************************************************************
* @fn SPI_Flash_Read_dma_start
*
* @brief enable spi dma and set read address
*
* @param ReadAddr - the address in spi flash
*
* @return none
*/
void SPI_Flash_Read_dma_start(uint32_t ReadAddr)
{
FLASH_CS_CLR;
FLASH_readWrite(W25X_FastReadData);
FLASH_readWrite((uint8_t)((ReadAddr) >> 16));
FLASH_readWrite((uint8_t)((ReadAddr) >> 8));
FLASH_readWrite((uint8_t)ReadAddr);
FLASH_readWrite(0xFF);
SPI_I2S_DMACmd(SPI1, SPI_I2S_DMAReq_Tx | SPI_I2S_DMAReq_Rx, ENABLE);
}
/*********************************************************************
* @fn SPI_Flash_Read_dma_end
*
* @brief disable spi dma
*
* @return none
*/
void SPI_Flash_Read_dma_end(void)
{
FLASH_CS_SET;
SPI_I2S_DMACmd(SPI1, SPI_I2S_DMAReq_Tx | SPI_I2S_DMAReq_Rx, DISABLE);
}
@@ -0,0 +1,57 @@
/*********************************************************************
* File Name : flash.h
* Author : WCH
* Version : V1.0.0
* Date : 2023/8/15
* Description : file for spi flash.
*********************************************************************************
* Copyright (c) 2023 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#ifndef __SPI_FLASH_H
#define __SPI_FLASH_H
#include "debug.h"
#include "spi.h"
#include "config.h"
#define W25X_WriteEnable 0x06
#define W25X_WriteDisable 0x04
#define W25X_ReadStatusReg 0x05
#define W25X_WriteStatusReg 0x01
#define W25X_ReadData 0x03
#define W25X_FastReadData 0x0B
#define W25X_FastReadDual 0x3B
#define W25X_PageProgram 0x02
#define W25X_BlockErase 0xD8
#define W25X_SectorErase 0x20
#define W25X_ChipErase 0xC7
#define W25X_PowerDown 0xB9
#define W25X_ReleasePowerDown 0xAB
#define W25X_DeviceID 0xAB
#define W25X_ManufactDeviceID 0x90
#define W25X_JedecDeviceID 0x9F
#define FLASH_CS_SET (FLASH_CS_PORT->BSHR = FLASH_CS_PIN)
#define FLASH_CS_CLR (FLASH_CS_PORT->BCR = FLASH_CS_PIN)
void SPI_FLASH_Init(void);
uint8_t SPI_Flash_ReadSR(void);
void SPI_FLASH_Write_SR(uint8_t sr);
void SPI_Flash_Wait_Busy(void);
void SPI_FLASH_Write_Enable(void);
void SPI_FLASH_Write_Disable(void);
uint16_t SPI_Flash_ReadID(void);
uint32_t SPI_Flash_ReadJedecDeviceID(void);
void SPI_Flash_Erase_Sector(uint32_t Dst_Addr);
void SPI_Flash_Read(uint8_t *pBuffer, uint32_t ReadAddr, uint16_t size);
void SPI_Flash_Write_Page(uint8_t *pBuffer, uint32_t WriteAddr, uint16_t size);
void SPI_Flash_Write_NoCheck(uint8_t *pBuffer, uint32_t WriteAddr, uint16_t size);
void SPI_Flash_Write(uint8_t *pBuffer, uint32_t WriteAddr, uint16_t size);
void SPI_Flash_Erase_Chip(void);
void SPI_Flash_PowerDown(void);
void SPI_Flash_WAKEUP(void);
void SPI_Flash_Read_dma_start(uint32_t ReadAddr);
void SPI_Flash_Read_dma_end(void);
#endif
+247
View File
@@ -0,0 +1,247 @@
/*********************************************************************
* File Name : spi.c
* Author : WCH
* Version : V1.0.0
* Date : 2023/8/15
* Description : file for spi.
*********************************************************************************
* Copyright (c) 2023 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#include "spi.h"
/*********************************************************************
* @fn SPI1_Init
*
* @brief Initialize SPI1
*
* @return none
*/
void SPI1_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure = {0};
SPI_InitTypeDef SPI_InitStructure = {0};
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_SPI1, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;
SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_4;
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
SPI_InitStructure.SPI_CRCPolynomial = 7;
SPI_Init(SPI1, &SPI_InitStructure);
SPI_Cmd(SPI1, ENABLE);
SPI1->HSCR = 1;
}
/*********************************************************************
* @fn SPI1_Read_DMA_Init
*
* @brief Initialize DMA for SPI1, In this condition every time send 0XFF to read data
*
* @return none
*/
void SPI1_Read_DMA_Init()
{
static uint32_t DummyByte = 0xff;
DMA_InitTypeDef DMA_InitStructure = {0};
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE);
// Tx
DMA_DeInit(SPI1_DMA_TX_CH);
DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&SPI1->DATAR;
DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&DummyByte;
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;
DMA_InitStructure.DMA_BufferSize = 0;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Disable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
DMA_InitStructure.DMA_Priority = DMA_Priority_High;
DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
DMA_Init(SPI1_DMA_TX_CH, &DMA_InitStructure);
// Rx
DMA_DeInit(SPI1_DMA_RX_CH);
DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&SPI1->DATAR;
DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)NULL;
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC;
DMA_InitStructure.DMA_BufferSize = 0;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
DMA_InitStructure.DMA_Priority = DMA_Priority_High;
DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
DMA_Init(SPI1_DMA_RX_CH, &DMA_InitStructure);
}
/*********************************************************************
* @fn SPI1_Read_DMA
*
* @brief read data from SPI1 via DMA
*
* @param data - the data to recive
* len - read length
*
* @return none
*/
void SPI1_Read_DMA(uint8_t* data, uint16_t len)
{
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_BSY) == SET)
;
DMA_Cmd(SPI1_DMA_TX_CH, DISABLE);
DMA_Cmd(SPI1_DMA_RX_CH, DISABLE);
DMA_ClearFlag(DMA1_FLAG_TC3);
DMA_ClearFlag(DMA1_FLAG_TC3);
SPI1_DMA_TX_CH->CNTR = len;
SPI1_DMA_RX_CH->MADDR = (uint32_t)data;
SPI1_DMA_RX_CH->CNTR = len;
DMA_Cmd(SPI1_DMA_TX_CH, ENABLE);
DMA_Cmd(SPI1_DMA_RX_CH, ENABLE);
}
/*********************************************************************
* @fn SPI2_Init
*
* @brief Initialize SPI2
*
* @return none
*/
void SPI2_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure = {0};
SPI_InitTypeDef SPI_InitStructure = {0};
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB, ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI2, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOB, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOB, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOB, &GPIO_InitStructure);
SPI_InitStructure.SPI_Direction = SPI_Direction_1Line_Tx;
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;
SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2;
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
SPI_InitStructure.SPI_CRCPolynomial = 7;
SPI_Init(SPI2, &SPI_InitStructure);
SPI_Cmd(SPI2, ENABLE);
}
/*********************************************************************
* @fn SPI2_DMA_Init
*
* @brief Initialize DMA for SPI2
*
* @return none
*/
void SPI2_DMA_Init()
{
DMA_InitTypeDef DMA_InitStructure = {0};
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE);
DMA_DeInit(SPI2_DMA_TX_CH);
DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&SPI2->DATAR;
DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)NULL;
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;
DMA_InitStructure.DMA_BufferSize = 0;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
DMA_InitStructure.DMA_Priority = DMA_Priority_High;
DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
DMA_Init(SPI2_DMA_TX_CH, &DMA_InitStructure);
SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Tx, ENABLE);
}
/*********************************************************************
* @fn SPI2_Write
*
* @brief send one byte
*
* @param data - the data to send
*
* @return none
*/
void SPI2_Write(uint8_t data)
{
while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_TXE) == RESET)
;
SPI_I2S_SendData(SPI2, data);
while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_BSY) == SET)
;
}
/*********************************************************************
* @fn SPI2_Write_DMA
*
* @brief send a lot of data
*
* @param data - the data to be send
* len - the length of data
*
* @return none
*/
void SPI2_Write_DMA(uint8_t* data, uint16_t len)
{
while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_BSY) == SET)
;
DMA_Cmd(SPI2_DMA_TX_CH, DISABLE);
DMA_ClearFlag(SPI2_DMA_TC_FLAG);
SPI2_DMA_TX_CH->MADDR = (uint32_t)data;
SPI2_DMA_TX_CH->CNTR = len;
SPI2_DMA_TX_CH->CFGR = 0x2090;
DMA_Cmd(SPI2_DMA_TX_CH, ENABLE);
}
@@ -0,0 +1,39 @@
/*********************************************************************
* File Name : spi.h
* Author : WCH
* Version : V1.0.0
* Date : 2023/8/15
* Description : file for spi.
*********************************************************************************
* Copyright (c) 2023 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#ifndef __SPI_H__
#define __SPI_H__
#include "debug.h"
#include "config.h"
#define SPI1_DMA_RX_CH DMA1_Channel2
#define SPI1_DMA_TX_CH DMA1_Channel3
#define SPI1_DMA_TC_FLAG DMA1_FLAG_TC3
#define SPI1_DMA_RC_FLAG DMA1_FLAG_TC2
#define SPI2_DMA_RX_CH DMA1_Channel4
#define SPI2_DMA_TX_CH DMA1_Channel5
#define SPI2_DMA_TC_FLAG DMA1_FLAG_TC5
#define SPI2_DMA_RC_FLAG DMA1_FLAG_TC4
void SPI1_Init(void);
void SPI1_Read_DMA_Init(void);
void SPI1_Read_DMA(uint8_t *data, uint16_t len);
void SPI2_Init(void);
void SPI2_DMA_Init(void);
void SPI2_Write(uint8_t data);
void SPI2_Write_DMA(uint8_t *data, uint16_t len);
#endif
@@ -0,0 +1,42 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : ch32v20x_conf.h
* Author : WCH
* Version : V1.0.0
* Date : 2021/06/06
* Description : Library configuration file.
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#ifndef __CH32V20x_CONF_H
#define __CH32V20x_CONF_H
#include "ch32v20x_adc.h"
#include "ch32v20x_bkp.h"
#include "ch32v20x_can.h"
#include "ch32v20x_crc.h"
#include "ch32v20x_dbgmcu.h"
#include "ch32v20x_dma.h"
#include "ch32v20x_exti.h"
#include "ch32v20x_flash.h"
#include "ch32v20x_gpio.h"
#include "ch32v20x_i2c.h"
#include "ch32v20x_iwdg.h"
#include "ch32v20x_pwr.h"
#include "ch32v20x_rcc.h"
#include "ch32v20x_rtc.h"
#include "ch32v20x_spi.h"
#include "ch32v20x_tim.h"
#include "ch32v20x_usart.h"
#include "ch32v20x_wwdg.h"
#include "ch32v20x_it.h"
#include "ch32v20x_misc.h"
#endif /* __CH32V20x_CONF_H */
@@ -0,0 +1,46 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : ch32v20x_it.c
* Author : WCH
* Version : V1.0.0
* Date : 2023/12/29
* Description : Main Interrupt Service Routines.
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#include "ch32v20x_it.h"
void NMI_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
void HardFault_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
/*********************************************************************
* @fn NMI_Handler
*
* @brief This function handles NMI exception.
*
* @return none
*/
void NMI_Handler(void)
{
while (1)
{
}
}
/*********************************************************************
* @fn HardFault_Handler
*
* @brief This function handles Hard Fault exception.
*
* @return none
*/
void HardFault_Handler(void)
{
NVIC_SystemReset();
while (1)
{
}
}
@@ -0,0 +1,20 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : ch32v20x_it.h
* Author : WCH
* Version : V1.0.0
* Date : 2021/06/06
* Description : This file contains the headers of the interrupt handlers.
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#ifndef __CH32V20x_IT_H
#define __CH32V20x_IT_H
#include "debug.h"
#endif /* __CH32V20x_IT_H */
+304
View File
@@ -0,0 +1,304 @@
/*********************************************************************
* File Name : main.c
* Author : WCH
* Version : V1.0.0
* Date : 2026/08/06
* Description : Main program body.
*********************************************************************************
* Copyright (c) 2023 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
/*
*@Note
A demo for wui
pins:
FLASH_CS -- PA4
FLASH_DO -- PA6
FLASH_DI -- PA7
FLASH_CLK -- PA5
LCD_LED -- PB9
LCD_DC -- PB10
LCD_RST -- PB11
LCD_CS -- PB12
LCD_SCK -- PB13
LCD_MOSI -- PB15
*/
#include <math.h>
#include "debug.h"
#include "string.h"
#include "lcd.h"
#include "flash.h"
#include "config.h"
#include "wui.h"
#include "wui_port.h"
#include "wui_user/wui_page.h"
/* Global define */
/* Global Variable */
#define TIM_PCK (8000ul)
/*********************************************************************
* @fn TIM4_init
*
* @brief Initialize TIM2 for WCHGUI
*
* @return none.
*/
void TIM4_init()
{
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4, ENABLE);
TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStructure = {0};
TIM_Cmd(TIM4, DISABLE);
TIM_TimeBaseInitStructure.TIM_Period = 0xffff;
TIM_TimeBaseInitStructure.TIM_Prescaler = ((SystemCoreClock) / TIM_PCK) - 1;
TIM_TimeBaseInitStructure.TIM_ClockDivision = TIM_CKD_DIV1;
TIM_TimeBaseInitStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseInit(TIM4, &TIM_TimeBaseInitStructure);
TIM_ARRPreloadConfig(TIM4, DISABLE);
TIM_ClearFlag(TIM4, TIM_FLAG_Update);
TIM_Cmd(TIM4, ENABLE);
}
/*********************************************************************
* @fn TIM3_Encoder_Init
*
* @brief Initialize TIM1 for encoder
*
* @return none.
*/
void TIM3_Encoder_Init()
{
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
TIM_ICInitTypeDef TIM_ICInitStructure;
GPIO_InitTypeDef GPIO_InitStructure = {0};
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
{
GPIO_PinRemapConfig(GPIO_PartialRemap_TIM3, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 | GPIO_Pin_5;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOB, &GPIO_InitStructure);
}
TIM_TimeBaseStructInit(&TIM_TimeBaseStructure);
TIM_TimeBaseStructure.TIM_Prescaler = 0x0;
TIM_TimeBaseStructure.TIM_Period = 160;
TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStructure);
TIM_EncoderInterfaceConfig(TIM3, TIM_EncoderMode_TI12, TIM_ICPolarity_Rising, TIM_ICPolarity_Rising);
TIM_ICStructInit(&TIM_ICInitStructure);
TIM_ICInitStructure.TIM_ICFilter = 10;
TIM_ICInit(TIM3, &TIM_ICInitStructure);
TIM_SetCounter(TIM3, 0);
TIM_Cmd(TIM3, ENABLE);
}
/*********************************************************************
* @fn check_direction
*
* @brief Compute the absolute value of a signed 32-bit integer.
*
* @param a Signed 32-bit integer.
*
* @return Absolute value of a
*/
uint32_t static inline iabs(int32_t a)
{
if (a < 0)
{
return -a;
}
return a;
}
/*********************************************************************
* @fn check_direction
*
* @brief Detect the rotation direction of the encoder
*
* @param current_value The current count value
*
* @return direction The direction of the encoder's rotation
*/
int32_t check_direction(int current_value)
{
static int last_value = 0;
if (current_value == last_value)
{
return 0;
}
int diff = current_value - last_value;
if (iabs(diff) < 4)
{
return 0;
}
int32_t direction;
if (iabs(diff) < 80)
{
if (diff > 0)
{
direction = 1;
}
else
{
direction = -1;
}
}
else
{
if (diff > 0)
{
direction = -1;
}
else
{
direction = 1;
}
}
last_value = current_value;
return direction;
}
#define ENC_KEY_PORT GPIOA
#define ENC_KEY_PIN (GPIO_Pin_15)
#define ENC_KEY() ((ENC_KEY_PORT->INDR & ENC_KEY_PIN) == 0)
uint32_t key3_state = 0;
/*********************************************************************
* @fn Key_GPIOInit
*
* @brief Initialization of the key pins of the encoder
*
* @return none.
*/
void Key_GPIOInit(void)
{
GPIO_InitTypeDef GPIO_InitStructure = {0};
GPIO_InitStructure.GPIO_Pin = ENC_KEY_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
GPIO_Init(ENC_KEY_PORT, &GPIO_InitStructure);
}
static uint8_t wui_heap_buffer[4 * 1024];
/*********************************************************************
* @fn main
*
* @brief Main program.
*
* @return none
*/
int main(void)
{
SystemCoreClockUpdate();
Delay_Init();
USART_Printf_Init(115200);
printf("SystemClk:%d\r\n", SystemCoreClock);
printf(__TIME__ "\n");
SPI_FLASH_Init();
uint32_t id = SPI_Flash_ReadJedecDeviceID();
printf("flash_id %x\n", id);
LCD_Init();
TIM3_Encoder_Init();
TIM4_init();
Key_GPIOInit();
wui_init_data_t data = {
.page_count = WUI_PAGE_COUNT,
.width = LCD_WIDTH,
.height = LCD_HEIGHT,
.heap_addr = wui_heap_buffer,
.heap_size = sizeof(wui_heap_buffer),
};
wui_init(&data);
wui_register_hal(wui_get_hal());
wui_page_switch(WUI_START_PAGE);
while (1)
{
uint16_t now = TIM4->CNT;
if (now > 16)
{
now = now / 8;
TIM4->CNT = 0;
wui_page_ui_tick(now);
}
wui_page_ui_update();
uint32_t tcnt = TIM3->CNT;
int32_t dir = check_direction(tcnt);
if (dir > 0)
{
HW_Key_event('a');
}
else if (dir < 0)
{
HW_Key_event('d');
}
uint32_t k3 = ENC_KEY();
if (k3)
{
if (key3_state)
{
}
else
{
key3_state = 1;
HW_Key_event('b');
}
}
else
{
key3_state = 0;
}
}
while (1)
{
}
}
+305
View File
@@ -0,0 +1,305 @@
/*********************************************************************
* File Name : main.c
* Author : WCH
* Version : V1.0.0
* Date : 2026/08/06
* Description : Main program body.
*********************************************************************************
* Copyright (c) 2023 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
/*
*@Note
A demo for wui
pins:
pins:
FLASH_CS -- PA4
FLASH_DO -- PA6
FLASH_DI -- PA7
FLASH_CLK -- PA5
LCD_LED -- PB9
LCD_DC -- PB10
LCD_RST -- PB11
LCD_CS -- PB12
LCD_SCK -- PB13
LCD_MOSI -- PB15
*/
#include <math.h>
#include "debug.h"
#include "string.h"
#include "lcd.h"
#include "flash.h"
#include "config.h"
#include "wui.h"
#include "wui_port.h"
#include "wui_user/wui_page.h"
/* Global define */
/* Global Variable */
#define TIM_PCK (8000ul)
/*********************************************************************
* @fn TIM4_init
*
* @brief Initialize TIM2 for WCHGUI
*
* @return none.
*/
void TIM4_init()
{
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4, ENABLE);
TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStructure = {0};
TIM_Cmd(TIM4, DISABLE);
TIM_TimeBaseInitStructure.TIM_Period = 0xffff;
TIM_TimeBaseInitStructure.TIM_Prescaler = ((SystemCoreClock) / TIM_PCK) - 1;
TIM_TimeBaseInitStructure.TIM_ClockDivision = TIM_CKD_DIV1;
TIM_TimeBaseInitStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseInit(TIM4, &TIM_TimeBaseInitStructure);
TIM_ARRPreloadConfig(TIM4, DISABLE);
TIM_ClearFlag(TIM4, TIM_FLAG_Update);
TIM_Cmd(TIM4, ENABLE);
}
/*********************************************************************
* @fn TIM3_Encoder_Init
*
* @brief Initialize TIM1 for encoder
*
* @return none.
*/
void TIM3_Encoder_Init()
{
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
TIM_ICInitTypeDef TIM_ICInitStructure;
GPIO_InitTypeDef GPIO_InitStructure = {0};
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
{
GPIO_PinRemapConfig(GPIO_PartialRemap_TIM3, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 | GPIO_Pin_5;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOB, &GPIO_InitStructure);
}
TIM_TimeBaseStructInit(&TIM_TimeBaseStructure);
TIM_TimeBaseStructure.TIM_Prescaler = 0x0;
TIM_TimeBaseStructure.TIM_Period = 160;
TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStructure);
TIM_EncoderInterfaceConfig(TIM3, TIM_EncoderMode_TI12, TIM_ICPolarity_Rising, TIM_ICPolarity_Rising);
TIM_ICStructInit(&TIM_ICInitStructure);
TIM_ICInitStructure.TIM_ICFilter = 10;
TIM_ICInit(TIM3, &TIM_ICInitStructure);
TIM_SetCounter(TIM3, 0);
TIM_Cmd(TIM3, ENABLE);
}
/*********************************************************************
* @fn check_direction
*
* @brief Compute the absolute value of a signed 32-bit integer.
*
* @param a Signed 32-bit integer.
*
* @return Absolute value of a
*/
uint32_t static inline iabs(int32_t a)
{
if (a < 0)
{
return -a;
}
return a;
}
/*********************************************************************
* @fn check_direction
*
* @brief Detect the rotation direction of the encoder
*
* @param current_value The current count value
*
* @return direction The direction of the encoder's rotation
*/
int32_t check_direction(int current_value)
{
static int last_value = 0;
if (current_value == last_value)
{
return 0;
}
int diff = current_value - last_value;
if (iabs(diff) < 4)
{
return 0;
}
int32_t direction;
if (iabs(diff) < 80)
{
if (diff > 0)
{
direction = 1;
}
else
{
direction = -1;
}
}
else
{
if (diff > 0)
{
direction = -1;
}
else
{
direction = 1;
}
}
last_value = current_value;
return direction;
}
#define ENC_KEY_PORT GPIOA
#define ENC_KEY_PIN (GPIO_Pin_15)
#define ENC_KEY() ((ENC_KEY_PORT->INDR & ENC_KEY_PIN) == 0)
uint32_t key3_state = 0;
/*********************************************************************
* @fn Key_GPIOInit
*
* @brief Initialization of the key pins of the encoder
*
* @return none.
*/
void Key_GPIOInit(void)
{
GPIO_InitTypeDef GPIO_InitStructure = {0};
GPIO_InitStructure.GPIO_Pin = ENC_KEY_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
GPIO_Init(ENC_KEY_PORT, &GPIO_InitStructure);
}
static uint8_t wui_heap_buffer[4 * 1024];
/*********************************************************************
* @fn main
*
* @brief Main program.
*
* @return none
*/
int main(void)
{
SystemCoreClockUpdate();
Delay_Init();
USART_Printf_Init(115200);
printf("SystemClk:%d\r\n", SystemCoreClock);
printf(__TIME__ "\n");
SPI_FLASH_Init();
uint32_t id = SPI_Flash_ReadJedecDeviceID();
printf("flash_id %x\n", id);
LCD_Init();
TIM3_Encoder_Init();
TIM4_init();
Key_GPIOInit();
wui_init_data_t data = {
.page_count = WUI_PAGE_COUNT,
.width = LCD_WIDTH,
.height = LCD_HEIGHT,
.heap_addr = wui_heap_buffer,
.heap_size = sizeof(wui_heap_buffer),
};
wui_init(&data);
wui_register_hal(wui_get_hal());
wui_page_switch(WUI_START_PAGE);
while (1)
{
uint16_t now = TIM4->CNT;
if (now > 16)
{
now = now / 8;
TIM4->CNT = 0;
wui_page_ui_tick(now);
}
wui_page_ui_update();
uint32_t tcnt = TIM3->CNT;
int32_t dir = check_direction(tcnt);
if (dir > 0)
{
HW_Key_event('a');
}
else if (dir < 0)
{
HW_Key_event('d');
}
uint32_t k3 = ENC_KEY();
if (k3)
{
if (key3_state)
{
}
else
{
key3_state = 1;
HW_Key_event('b');
}
}
else
{
key3_state = 0;
}
}
while (1)
{
}
}
@@ -0,0 +1,987 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : system_ch32v20x.c
* Author : WCH
* Version : V1.0.0
* Date : 2021/06/06
* Description : CH32V20x Device Peripheral Access Layer System Source File.
* For HSE = 32Mhz (CH32V208x/CH32V203RBT)
* For HSE = 8Mhz (other CH32V203x)
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#include "ch32v20x.h"
/*
* Uncomment the line corresponding to the desired System clock (SYSCLK) frequency (after
* reset the HSI is used as SYSCLK source).
* If none of the define below is enabled, the HSI is used as System clock source.
*/
//#define SYSCLK_FREQ_HSE HSE_VALUE
//#define SYSCLK_FREQ_48MHz_HSE 48000000
//#define SYSCLK_FREQ_56MHz_HSE 56000000
//#define SYSCLK_FREQ_72MHz_HSE 72000000
#define SYSCLK_FREQ_96MHz_HSE 96000000
//#define SYSCLK_FREQ_120MHz_HSE 120000000
//#define SYSCLK_FREQ_144MHz_HSE 144000000
//#define SYSCLK_FREQ_HSI HSI_VALUE
//#define SYSCLK_FREQ_48MHz_HSI 48000000
//#define SYSCLK_FREQ_56MHz_HSI 56000000
//#define SYSCLK_FREQ_72MHz_HSI 72000000
//#define SYSCLK_FREQ_96MHz_HSI 96000000
//#define SYSCLK_FREQ_120MHz_HSI 120000000
//#define SYSCLK_FREQ_144MHz_HSI 144000000
/* Clock Definitions */
#ifdef SYSCLK_FREQ_HSE
uint32_t SystemCoreClock = SYSCLK_FREQ_HSE; /* System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_48MHz_HSE
uint32_t SystemCoreClock = SYSCLK_FREQ_48MHz_HSE; /* System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_56MHz_HSE
uint32_t SystemCoreClock = SYSCLK_FREQ_56MHz_HSE; /* System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_72MHz_HSE
uint32_t SystemCoreClock = SYSCLK_FREQ_72MHz_HSE; /* System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_96MHz_HSE
uint32_t SystemCoreClock = SYSCLK_FREQ_96MHz_HSE; /* System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_120MHz_HSE
uint32_t SystemCoreClock = SYSCLK_FREQ_120MHz_HSE; /* System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_144MHz_HSE
uint32_t SystemCoreClock = SYSCLK_FREQ_144MHz_HSE; /* System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_48MHz_HSI
uint32_t SystemCoreClock = SYSCLK_FREQ_48MHz_HSI; /* System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_56MHz_HSI
uint32_t SystemCoreClock = SYSCLK_FREQ_56MHz_HSI; /* System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_72MHz_HSI
uint32_t SystemCoreClock = SYSCLK_FREQ_72MHz_HSI; /* System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_96MHz_HSI
uint32_t SystemCoreClock = SYSCLK_FREQ_96MHz_HSI; /* System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_120MHz_HSI
uint32_t SystemCoreClock = SYSCLK_FREQ_120MHz_HSI; /* System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_144MHz_HSI
uint32_t SystemCoreClock = SYSCLK_FREQ_144MHz_HSI; /* System Clock Frequency (Core Clock) */
#else
uint32_t SystemCoreClock = HSI_VALUE; /* System Clock Frequency (Core Clock) */
#endif
__I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
/* system_private_function_proto_types */
static void SetSysClock(void);
#ifdef SYSCLK_FREQ_HSE
static void SetSysClockToHSE( void );
#elif defined SYSCLK_FREQ_48MHz_HSE
static void SetSysClockTo48_HSE( void );
#elif defined SYSCLK_FREQ_56MHz_HSE
static void SetSysClockTo56_HSE( void );
#elif defined SYSCLK_FREQ_72MHz_HSE
static void SetSysClockTo72_HSE( void );
#elif defined SYSCLK_FREQ_96MHz_HSE
static void SetSysClockTo96_HSE( void );
#elif defined SYSCLK_FREQ_120MHz_HSE
static void SetSysClockTo120_HSE( void );
#elif defined SYSCLK_FREQ_144MHz_HSE
static void SetSysClockTo144_HSE( void );
#elif defined SYSCLK_FREQ_48MHz_HSI
static void SetSysClockTo48_HSI( void );
#elif defined SYSCLK_FREQ_56MHz_HSI
static void SetSysClockTo56_HSI( void );
#elif defined SYSCLK_FREQ_72MHz_HSI
static void SetSysClockTo72_HSI( void );
#elif defined SYSCLK_FREQ_96MHz_HSI
static void SetSysClockTo96_HSI( void );
#elif defined SYSCLK_FREQ_120MHz_HSI
static void SetSysClockTo120_HSI( void );
#elif defined SYSCLK_FREQ_144MHz_HSI
static void SetSysClockTo144_HSI( void );
#endif
/*********************************************************************
* @fn SystemInit
*
* @brief Setup the microcontroller system Initialize the Embedded Flash Interface,
* the PLL and update the SystemCoreClock variable.
*
* @return none
*/
void SystemInit (void)
{
RCC->CTLR |= (uint32_t)0x00000001;
RCC->CFGR0 &= (uint32_t)0xF0FF0000;
RCC->CTLR &= (uint32_t)0xFEF6FFFF;
RCC->CTLR &= (uint32_t)0xFFFBFFFF;
RCC->CFGR0 &= (uint32_t)0xFF00FFFF;
RCC->INTR = 0x009F0000;
SetSysClock();
}
/*********************************************************************
* @fn SystemCoreClockUpdate
*
* @brief Update SystemCoreClock variable according to Clock Register Values.
*
* @return none
*/
void SystemCoreClockUpdate (void)
{
uint32_t tmp = 0, pllmull = 0, pllsource = 0, Pll_6_5 = 0;
tmp = RCC->CFGR0 & RCC_SWS;
switch (tmp)
{
case 0x00:
SystemCoreClock = HSI_VALUE;
break;
case 0x04:
SystemCoreClock = HSE_VALUE;
break;
case 0x08:
pllmull = RCC->CFGR0 & RCC_PLLMULL;
pllsource = RCC->CFGR0 & RCC_PLLSRC;
pllmull = ( pllmull >> 18) + 2;
if(pllmull == 17) pllmull = 18;
if (pllsource == 0x00)
{
if(EXTEN->EXTEN_CTR & EXTEN_PLL_HSI_PRE){
SystemCoreClock = HSI_VALUE * pllmull;
}
else{
SystemCoreClock = (HSI_VALUE >> 1) * pllmull;
}
}
else
{
#if defined (CH32V20x_D8W) || defined (CH32V20x_D8)
if(((RCC->CFGR0 & (3<<22)) == (3<<22)) && (RCC_USB5PRE_JUDGE()== SET))
{
SystemCoreClock = ((HSE_VALUE>>1)) * pllmull;
}
else
#endif
if ((RCC->CFGR0 & RCC_PLLXTPRE) != (uint32_t)RESET)
{
#if defined (CH32V20x_D8) || defined (CH32V20x_D8W)
SystemCoreClock = ((HSE_VALUE>>2) >> 1) * pllmull;
#else
SystemCoreClock = (HSE_VALUE >> 1) * pllmull;
#endif
}
else
{
#if defined (CH32V20x_D8) || defined (CH32V20x_D8W)
SystemCoreClock = (HSE_VALUE>>2) * pllmull;
#else
SystemCoreClock = HSE_VALUE * pllmull;
#endif
}
}
if(Pll_6_5 == 1) SystemCoreClock = (SystemCoreClock / 2);
break;
default:
SystemCoreClock = HSI_VALUE;
break;
}
tmp = AHBPrescTable[((RCC->CFGR0 & RCC_HPRE) >> 4)];
SystemCoreClock >>= tmp;
}
/*********************************************************************
* @fn SetSysClock
*
* @brief Configures the System clock frequency, HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClock(void)
{
//GPIO_IPD_Unused();
#ifdef SYSCLK_FREQ_HSE
SetSysClockToHSE();
#elif defined SYSCLK_FREQ_48MHz_HSE
SetSysClockTo48_HSE();
#elif defined SYSCLK_FREQ_56MHz_HSE
SetSysClockTo56_HSE();
#elif defined SYSCLK_FREQ_72MHz_HSE
SetSysClockTo72_HSE();
#elif defined SYSCLK_FREQ_96MHz_HSE
SetSysClockTo96_HSE();
#elif defined SYSCLK_FREQ_120MHz_HSE
SetSysClockTo120_HSE();
#elif defined SYSCLK_FREQ_144MHz_HSE
SetSysClockTo144_HSE();
#elif defined SYSCLK_FREQ_48MHz_HSI
SetSysClockTo48_HSI();
#elif defined SYSCLK_FREQ_56MHz_HSI
SetSysClockTo56_HSI();
#elif defined SYSCLK_FREQ_72MHz_HSI
SetSysClockTo72_HSI();
#elif defined SYSCLK_FREQ_96MHz_HSI
SetSysClockTo96_HSI();
#elif defined SYSCLK_FREQ_120MHz_HSI
SetSysClockTo120_HSI();
#elif defined SYSCLK_FREQ_144MHz_HSI
SetSysClockTo144_HSI();
#endif
/* If none of the define above is enabled, the HSI is used as System clock
* source (default after reset)
*/
}
#ifdef SYSCLK_FREQ_HSE
/*********************************************************************
* @fn SetSysClockToHSE
*
* @brief Sets HSE as System clock source and configure HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClockToHSE(void)
{
__IO uint32_t StartUpCounter = 0, HSEStatus = 0;
RCC->CTLR |= ((uint32_t)RCC_HSEON);
/* Wait till HSE is ready and if Time out is reached exit */
do
{
HSEStatus = RCC->CTLR & RCC_HSERDY;
StartUpCounter++;
} while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
if ((RCC->CTLR & RCC_HSERDY) != RESET)
{
HSEStatus = (uint32_t)0x01;
}
else
{
HSEStatus = (uint32_t)0x00;
}
if (HSEStatus == (uint32_t)0x01)
{
/* HCLK = SYSCLK */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV1;
/* PCLK2 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE2_DIV1;
/* PCLK1 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE1_DIV1;
/* Select HSE as system clock source
* CH32V20x_D6 (HSE=8MHZ)
* CH32V20x_D8 (HSE=32MHZ)
* CH32V20x_D8W (HSE=32MHZ)
*/
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_SW));
RCC->CFGR0 |= (uint32_t)RCC_SW_HSE;
/* Wait till HSE is used as system clock source */
while ((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x04)
{
}
}
else
{
/* If HSE fails to start-up, the application will have wrong clock
* configuration. User can add here some code to deal with this error
*/
}
}
#elif defined SYSCLK_FREQ_48MHz_HSE
/*********************************************************************
* @fn SetSysClockTo48_HSE
*
* @brief Sets System clock frequency to 48MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClockTo48_HSE(void)
{
__IO uint32_t StartUpCounter = 0, HSEStatus = 0;
RCC->CTLR |= ((uint32_t)RCC_HSEON);
/* Wait till HSE is ready and if Time out is reached exit */
do
{
HSEStatus = RCC->CTLR & RCC_HSERDY;
StartUpCounter++;
} while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
if ((RCC->CTLR & RCC_HSERDY) != RESET)
{
HSEStatus = (uint32_t)0x01;
}
else
{
HSEStatus = (uint32_t)0x00;
}
if (HSEStatus == (uint32_t)0x01)
{
/* HCLK = SYSCLK */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV1;
/* PCLK2 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE2_DIV1;
/* PCLK1 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE1_DIV2;
/* CH32V20x_D6-PLL configuration: PLLCLK = HSE * 6 = 48 MHz (HSE=8MHZ)
* CH32V20x_D8-PLL configuration: PLLCLK = HSE/4 * 6 = 48 MHz (HSE=32MHZ)
* CH32V20x_D8W-PLL configuration: PLLCLK = HSE/4 * 6 = 48 MHz (HSE=32MHZ)
*/
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_PLLSRC | RCC_PLLXTPRE | RCC_PLLMULL));
RCC->CFGR0 |= (uint32_t)(RCC_PLLSRC_HSE | RCC_PLLXTPRE_HSE | RCC_PLLMULL6);
/* Enable PLL */
RCC->CTLR |= RCC_PLLON;
/* Wait till PLL is ready */
while((RCC->CTLR & RCC_PLLRDY) == 0)
{
}
/* Select PLL as system clock source */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_SW));
RCC->CFGR0 |= (uint32_t)RCC_SW_PLL;
/* Wait till PLL is used as system clock source */
while ((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x08)
{
}
}
else
{
/*
* If HSE fails to start-up, the application will have wrong clock
* configuration. User can add here some code to deal with this error
*/
}
}
#elif defined SYSCLK_FREQ_56MHz_HSE
/*********************************************************************
* @fn SetSysClockTo56_HSE
*
* @brief Sets System clock frequency to 56MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClockTo56_HSE(void)
{
__IO uint32_t StartUpCounter = 0, HSEStatus = 0;
RCC->CTLR |= ((uint32_t)RCC_HSEON);
/* Wait till HSE is ready and if Time out is reached exit */
do
{
HSEStatus = RCC->CTLR & RCC_HSERDY;
StartUpCounter++;
} while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
if ((RCC->CTLR & RCC_HSERDY) != RESET)
{
HSEStatus = (uint32_t)0x01;
}
else
{
HSEStatus = (uint32_t)0x00;
}
if (HSEStatus == (uint32_t)0x01)
{
/* HCLK = SYSCLK */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV1;
/* PCLK2 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE2_DIV1;
/* PCLK1 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE1_DIV2;
/* CH32V20x_D6-PLL configuration: PLLCLK = HSE * 7 = 56 MHz (HSE=8MHZ)
* CH32V20x_D8-PLL configuration: PLLCLK = HSE/4 * 7 = 56 MHz (HSE=32MHZ)
* CH32V20x_D8W-PLL configuration: PLLCLK = HSE/4 * 7 = 56 MHz (HSE=32MHZ)
*/
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_PLLSRC | RCC_PLLXTPRE | RCC_PLLMULL));
RCC->CFGR0 |= (uint32_t)(RCC_PLLSRC_HSE | RCC_PLLXTPRE_HSE | RCC_PLLMULL7);
/* Enable PLL */
RCC->CTLR |= RCC_PLLON;
/* Wait till PLL is ready */
while((RCC->CTLR & RCC_PLLRDY) == 0)
{
}
/* Select PLL as system clock source */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_SW));
RCC->CFGR0 |= (uint32_t)RCC_SW_PLL;
/* Wait till PLL is used as system clock source */
while ((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x08)
{
}
}
else
{
/*
* If HSE fails to start-up, the application will have wrong clock
* configuration. User can add here some code to deal with this error
*/
}
}
#elif defined SYSCLK_FREQ_72MHz_HSE
/*********************************************************************
* @fn SetSysClockTo72_HSE
*
* @brief Sets System clock frequency to 72MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClockTo72_HSE(void)
{
__IO uint32_t StartUpCounter = 0, HSEStatus = 0;
RCC->CTLR |= ((uint32_t)RCC_HSEON);
/* Wait till HSE is ready and if Time out is reached exit */
do
{
HSEStatus = RCC->CTLR & RCC_HSERDY;
StartUpCounter++;
} while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
if ((RCC->CTLR & RCC_HSERDY) != RESET)
{
HSEStatus = (uint32_t)0x01;
}
else
{
HSEStatus = (uint32_t)0x00;
}
if (HSEStatus == (uint32_t)0x01)
{
/* HCLK = SYSCLK */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV1;
/* PCLK2 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE2_DIV1;
/* PCLK1 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE1_DIV2;
/* CH32V20x_D6-PLL configuration: PLLCLK = HSE * 9 = 72 MHz (HSE=8MHZ)
* CH32V20x_D8-PLL configuration: PLLCLK = HSE/4 * 9 = 72 MHz (HSE=32MHZ)
* CH32V20x_D8W-PLL configuration: PLLCLK = HSE/4 * 9 = 72 MHz (HSE=32MHZ)
*/
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_PLLSRC | RCC_PLLXTPRE |
RCC_PLLMULL));
RCC->CFGR0 |= (uint32_t)(RCC_PLLSRC_HSE | RCC_PLLXTPRE_HSE | RCC_PLLMULL9);
/* Enable PLL */
RCC->CTLR |= RCC_PLLON;
/* Wait till PLL is ready */
while((RCC->CTLR & RCC_PLLRDY) == 0)
{
}
/* Select PLL as system clock source */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_SW));
RCC->CFGR0 |= (uint32_t)RCC_SW_PLL;
/* Wait till PLL is used as system clock source */
while ((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x08)
{
}
}
else
{
/*
* If HSE fails to start-up, the application will have wrong clock
* configuration. User can add here some code to deal with this error
*/
}
}
#elif defined SYSCLK_FREQ_96MHz_HSE
/*********************************************************************
* @fn SetSysClockTo96_HSE
*
* @brief Sets System clock frequency to 96MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClockTo96_HSE(void)
{
__IO uint32_t StartUpCounter = 0, HSEStatus = 0;
RCC->CTLR |= ((uint32_t)RCC_HSEON);
/* Wait till HSE is ready and if Time out is reached exit */
do
{
HSEStatus = RCC->CTLR & RCC_HSERDY;
StartUpCounter++;
} while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
if ((RCC->CTLR & RCC_HSERDY) != RESET)
{
HSEStatus = (uint32_t)0x01;
}
else
{
HSEStatus = (uint32_t)0x00;
}
if (HSEStatus == (uint32_t)0x01)
{
/* HCLK = SYSCLK */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV1;
/* PCLK2 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE2_DIV1;
/* PCLK1 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE1_DIV2;
/* CH32V20x_D6-PLL configuration: PLLCLK = HSE * 12 = 96 MHz (HSE=8MHZ)
* CH32V20x_D8-PLL configuration: PLLCLK = HSE/4 * 12 = 96 MHz (HSE=32MHZ)
* CH32V20x_D8W-PLL configuration: PLLCLK = HSE/4 * 12 = 96 MHz (HSE=32MHZ)
*/
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_PLLSRC | RCC_PLLXTPRE |
RCC_PLLMULL));
RCC->CFGR0 |= (uint32_t)(RCC_PLLSRC_HSE | RCC_PLLXTPRE_HSE | RCC_PLLMULL12);
/* Enable PLL */
RCC->CTLR |= RCC_PLLON;
/* Wait till PLL is ready */
while((RCC->CTLR & RCC_PLLRDY) == 0)
{
}
/* Select PLL as system clock source */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_SW));
RCC->CFGR0 |= (uint32_t)RCC_SW_PLL;
/* Wait till PLL is used as system clock source */
while ((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x08)
{
}
}
else
{
/*
* If HSE fails to start-up, the application will have wrong clock
* configuration. User can add here some code to deal with this error
*/
}
}
#elif defined SYSCLK_FREQ_120MHz_HSE
/*********************************************************************
* @fn SetSysClockTo120_HSE
*
* @brief Sets System clock frequency to 120MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClockTo120_HSE(void)
{
__IO uint32_t StartUpCounter = 0, HSEStatus = 0;
RCC->CTLR |= ((uint32_t)RCC_HSEON);
/* Wait till HSE is ready and if Time out is reached exit */
do
{
HSEStatus = RCC->CTLR & RCC_HSERDY;
StartUpCounter++;
} while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
if((RCC->CTLR & RCC_HSERDY) != RESET)
{
HSEStatus = (uint32_t)0x01;
}
else
{
HSEStatus = (uint32_t)0x00;
}
if(HSEStatus == (uint32_t)0x01)
{
#if defined (CH32V20x_D8W)
RCC->CFGR0 |= (uint32_t)(3<<22);
/* HCLK = SYSCLK/2 */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV2;
#else
/* HCLK = SYSCLK */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV1;
#endif
/* PCLK2 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE2_DIV1;
/* PCLK1 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE1_DIV2;
/* CH32V20x_D6-PLL configuration: PLLCLK = HSE * 15 = 120 MHz (HSE=8MHZ)
* CH32V20x_D8-PLL configuration: PLLCLK = HSE/4 * 15 = 120 MHz (HSE=32MHZ)
* CH32V20x_D8W-PLL configuration: PLLCLK = HSE/2 * 15 = 240 MHz (HSE=32MHZ)
*/
RCC->CFGR0 &= (uint32_t)((uint32_t) ~(RCC_PLLSRC | RCC_PLLXTPRE |
RCC_PLLMULL));
RCC->CFGR0 |= (uint32_t)(RCC_PLLSRC_HSE | RCC_PLLXTPRE_HSE | RCC_PLLMULL15);
/* Enable PLL */
RCC->CTLR |= RCC_PLLON;
/* Wait till PLL is ready */
while((RCC->CTLR & RCC_PLLRDY) == 0)
{
}
/* Select PLL as system clock source */
RCC->CFGR0 &= (uint32_t)((uint32_t) ~(RCC_SW));
RCC->CFGR0 |= (uint32_t)RCC_SW_PLL;
/* Wait till PLL is used as system clock source */
while((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x08)
{
}
}
else
{
/*
* If HSE fails to start-up, the application will have wrong clock
* configuration. User can add here some code to deal with this error
*/
}
}
#elif defined SYSCLK_FREQ_144MHz_HSE
/*********************************************************************
* @fn SetSysClockTo144_HSE
*
* @brief Sets System clock frequency to 144MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClockTo144_HSE(void)
{
__IO uint32_t StartUpCounter = 0, HSEStatus = 0;
RCC->CTLR |= ((uint32_t)RCC_HSEON);
/* Wait till HSE is ready and if Time out is reached exit */
do
{
HSEStatus = RCC->CTLR & RCC_HSERDY;
StartUpCounter++;
} while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
if ((RCC->CTLR & RCC_HSERDY) != RESET)
{
HSEStatus = (uint32_t)0x01;
}
else
{
HSEStatus = (uint32_t)0x00;
}
if (HSEStatus == (uint32_t)0x01)
{
/* HCLK = SYSCLK */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV1;
/* PCLK2 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE2_DIV1;
/* PCLK1 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE1_DIV2;
/* CH32V20x_D6-PLL configuration: PLLCLK = HSE * 18 = 144 MHz (HSE=8MHZ)
* CH32V20x_D8-PLL configuration: PLLCLK = HSE/4 * 18 = 144 MHz (HSE=32MHZ)
* CH32V20x_D8W-PLL configuration: PLLCLK = HSE/4 * 18 = 144 MHz (HSE=32MHZ)
*/
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_PLLSRC | RCC_PLLXTPRE |
RCC_PLLMULL));
RCC->CFGR0 |= (uint32_t)(RCC_PLLSRC_HSE | RCC_PLLXTPRE_HSE | RCC_PLLMULL18);
/* Enable PLL */
RCC->CTLR |= RCC_PLLON;
/* Wait till PLL is ready */
while((RCC->CTLR & RCC_PLLRDY) == 0)
{
}
/* Select PLL as system clock source */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_SW));
RCC->CFGR0 |= (uint32_t)RCC_SW_PLL;
/* Wait till PLL is used as system clock source */
while ((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x08)
{
}
}
else
{
/*
* If HSE fails to start-up, the application will have wrong clock
* configuration. User can add here some code to deal with this error
*/
}
}
#elif defined SYSCLK_FREQ_48MHz_HSI
/*********************************************************************
* @fn SetSysClockTo48_HSI
*
* @brief Sets System clock frequency to 48MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClockTo48_HSI(void)
{
EXTEN->EXTEN_CTR |= EXTEN_PLL_HSI_PRE;
/* HCLK = SYSCLK */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV1;
/* PCLK2 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE2_DIV1;
/* PCLK1 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE1_DIV2;
/* PLL configuration: PLLCLK = HSI * 6 = 48 MHz */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_PLLSRC | RCC_PLLXTPRE | RCC_PLLMULL));
RCC->CFGR0 |= (uint32_t)(RCC_PLLSRC_HSI_Div2 | RCC_PLLMULL6);
/* Enable PLL */
RCC->CTLR |= RCC_PLLON;
/* Wait till PLL is ready */
while((RCC->CTLR & RCC_PLLRDY) == 0)
{
}
/* Select PLL as system clock source */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_SW));
RCC->CFGR0 |= (uint32_t)RCC_SW_PLL;
/* Wait till PLL is used as system clock source */
while ((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x08)
{
}
}
#elif defined SYSCLK_FREQ_56MHz_HSI
/*********************************************************************
* @fn SetSysClockTo56_HSI
*
* @brief Sets System clock frequency to 56MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClockTo56_HSI(void)
{
EXTEN->EXTEN_CTR |= EXTEN_PLL_HSI_PRE;
/* HCLK = SYSCLK */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV1;
/* PCLK2 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE2_DIV1;
/* PCLK1 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE1_DIV2;
/* PLL configuration: PLLCLK = HSI * 7 = 48 MHz */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_PLLSRC | RCC_PLLXTPRE | RCC_PLLMULL));
RCC->CFGR0 |= (uint32_t)(RCC_PLLSRC_HSI_Div2 | RCC_PLLMULL7);
/* Enable PLL */
RCC->CTLR |= RCC_PLLON;
/* Wait till PLL is ready */
while((RCC->CTLR & RCC_PLLRDY) == 0)
{
}
/* Select PLL as system clock source */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_SW));
RCC->CFGR0 |= (uint32_t)RCC_SW_PLL;
/* Wait till PLL is used as system clock source */
while ((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x08)
{
}
}
#elif defined SYSCLK_FREQ_72MHz_HSI
/*********************************************************************
* @fn SetSysClockTo72_HSI
*
* @brief Sets System clock frequency to 72MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClockTo72_HSI(void)
{
EXTEN->EXTEN_CTR |= EXTEN_PLL_HSI_PRE;
/* HCLK = SYSCLK */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV1;
/* PCLK2 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE2_DIV1;
/* PCLK1 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE1_DIV2;
/* PLL configuration: PLLCLK = HSI * 9 = 72 MHz */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_PLLSRC | RCC_PLLXTPRE | RCC_PLLMULL));
RCC->CFGR0 |= (uint32_t)(RCC_PLLSRC_HSI_Div2 | RCC_PLLMULL9);
/* Enable PLL */
RCC->CTLR |= RCC_PLLON;
/* Wait till PLL is ready */
while((RCC->CTLR & RCC_PLLRDY) == 0)
{
}
/* Select PLL as system clock source */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_SW));
RCC->CFGR0 |= (uint32_t)RCC_SW_PLL;
/* Wait till PLL is used as system clock source */
while ((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x08)
{
}
}
#elif defined SYSCLK_FREQ_96MHz_HSI
/*********************************************************************
* @fn SetSysClockTo96_HSI
*
* @brief Sets System clock frequency to 96MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClockTo96_HSI(void)
{
EXTEN->EXTEN_CTR |= EXTEN_PLL_HSI_PRE;
/* HCLK = SYSCLK */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV1;
/* PCLK2 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE2_DIV1;
/* PCLK1 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE1_DIV2;
/* PLL configuration: PLLCLK = HSI * 12 = 96 MHz */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_PLLSRC | RCC_PLLXTPRE | RCC_PLLMULL));
RCC->CFGR0 |= (uint32_t)(RCC_PLLSRC_HSI_Div2 | RCC_PLLMULL12);
/* Enable PLL */
RCC->CTLR |= RCC_PLLON;
/* Wait till PLL is ready */
while((RCC->CTLR & RCC_PLLRDY) == 0)
{
}
/* Select PLL as system clock source */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_SW));
RCC->CFGR0 |= (uint32_t)RCC_SW_PLL;
/* Wait till PLL is used as system clock source */
while ((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x08)
{
}
}
#elif defined SYSCLK_FREQ_120MHz_HSI
/*********************************************************************
* @fn SetSysClockTo120_HSI
*
* @brief Sets System clock frequency to 120MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClockTo120_HSI(void)
{
EXTEN->EXTEN_CTR |= EXTEN_PLL_HSI_PRE;
/* HCLK = SYSCLK */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV1;
/* PCLK2 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE2_DIV1;
/* PCLK1 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE1_DIV2;
/* PLL configuration: PLLCLK = HSI * 15 = 120 MHz */
RCC->CFGR0 &= (uint32_t)((uint32_t) ~(RCC_PLLSRC | RCC_PLLXTPRE |
RCC_PLLMULL));
RCC->CFGR0 |= (uint32_t)(RCC_PLLSRC_HSI_Div2 | RCC_PLLMULL15);
/* Enable PLL */
RCC->CTLR |= RCC_PLLON;
/* Wait till PLL is ready */
while((RCC->CTLR & RCC_PLLRDY) == 0)
{
}
/* Select PLL as system clock source */
RCC->CFGR0 &= (uint32_t)((uint32_t) ~(RCC_SW));
RCC->CFGR0 |= (uint32_t)RCC_SW_PLL;
/* Wait till PLL is used as system clock source */
while((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x08)
{
}
}
#elif defined SYSCLK_FREQ_144MHz_HSI
/*********************************************************************
* @fn SetSysClockTo144_HSI
*
* @brief Sets System clock frequency to 144MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
*
* @return none
*/
static void SetSysClockTo144_HSI(void)
{
EXTEN->EXTEN_CTR |= EXTEN_PLL_HSI_PRE;
/* HCLK = SYSCLK */
RCC->CFGR0 |= (uint32_t)RCC_HPRE_DIV1;
/* PCLK2 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE2_DIV1;
/* PCLK1 = HCLK */
RCC->CFGR0 |= (uint32_t)RCC_PPRE1_DIV2;
/* PLL configuration: PLLCLK = HSI * 18 = 144 MHz */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_PLLSRC | RCC_PLLXTPRE | RCC_PLLMULL));
RCC->CFGR0 |= (uint32_t)(RCC_PLLSRC_HSI_Div2 | RCC_PLLMULL18);
/* Enable PLL */
RCC->CTLR |= RCC_PLLON;
/* Wait till PLL is ready */
while((RCC->CTLR & RCC_PLLRDY) == 0)
{
}
/* Select PLL as system clock source */
RCC->CFGR0 &= (uint32_t)((uint32_t)~(RCC_SW));
RCC->CFGR0 |= (uint32_t)RCC_SW_PLL;
/* Wait till PLL is used as system clock source */
while ((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x08)
{
}
}
#endif
@@ -0,0 +1,32 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : system_ch32v20x.h
* Author : WCH
* Version : V1.0.0
* Date : 2021/06/06
* Description : CH32V20x Device Peripheral Access Layer System Header File.
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#ifndef __SYSTEM_ch32v20x_H
#define __SYSTEM_ch32v20x_H
#ifdef __cplusplus
extern "C" {
#endif
extern uint32_t SystemCoreClock; /* System Clock Frequency (Core Clock) */
/* System_Exported_Functions */
extern void SystemInit(void);
extern void SystemCoreClockUpdate(void);
#ifdef __cplusplus
}
#endif
#endif /*__CH32V20x_SYSTEM_H */
Binary file not shown.
+205
View File
@@ -0,0 +1,205 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : wui.h
* Author : WCH
* Version : V1.2.0
* Date : 2026/07/30
* Description : This file contains core type definitions, HAL interface,
* event system, and main API functions.
*********************************************************************************/
#ifndef WUI_H
#define WUI_H
#include <stdint.h>
#include <stddef.h>
#include "LCD.h"
/*******************************************************************************
* TYPE DEFINITIONS
******************************************************************************/
typedef struct {
uint32_t addr;
uint16_t width;
uint16_t height;
uint32_t data_size;
} image_info_t;
//
#define IMAGE_TYPE_RAW 0x0000
#define IMAGE_TYPE_RLE 0x2000
#define IMAGE_TYPE_CLUT 0x4000
#define IMAGE_TYPE_CLUT4 0x6000
#define IMAGE_TYPE_MASK 0xE000
#define IMAGE_INDEX_MASK 0x1FFF
#define MAKE_IMAGE_ID(type, idx) ((type) | ((idx) & IMAGE_INDEX_MASK))
#define IMAGE_GET_TYPE(id) ((id) & IMAGE_TYPE_MASK)
#define IMAGE_GET_INDEX(id) ((id) & IMAGE_INDEX_MASK)
/*******************************************************************************
* HAL CALLBACK TYPES
******************************************************************************/
typedef void (*wui_touch_read_cb_t)(uint16_t* x, uint16_t* y, uint8_t* pressed);
typedef void (*wui_flash_read_cb_t)(uint8_t* buf, uint32_t addr, uint32_t size);
typedef void (*wui_lcd_set_windows_cb_t)(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
typedef void (*wui_lcd_dma_start_cb_t)(void);
typedef void (*wui_lcd_dma_send_cb_t)(const uint8_t* buf, uint32_t len);
typedef void (*wui_lcd_dma_wait_cb_t)(void);
typedef void (*wui_lcd_dma_end_cb_t)(void);
/*******************************************************************************
* HAL INTERFACE
******************************************************************************/
/* Contains all hardware abstraction layer function pointers */
typedef struct
{
wui_touch_read_cb_t touch_read; /* Touch screen read function */
wui_flash_read_cb_t flash_read; /* Flash read function */
wui_lcd_set_windows_cb_t lcd_set_windows; /* LCD window set function */
wui_lcd_dma_start_cb_t lcd_dma_start; /* LCD DMA start function */
wui_lcd_dma_send_cb_t lcd_dma_send; /* LCD DMA send function */
wui_lcd_dma_wait_cb_t lcd_dma_wait; /* LCD DMA wait function */
wui_lcd_dma_end_cb_t lcd_dma_end; /* LCD DMA end function */
} wui_hal_t;
/*******************************************************************************
* PAGE DEFINITIONS
******************************************************************************/
/* Page descriptor structure */
typedef struct
{
uint16_t bg_color; /* Background color */
const char* page_name; /* Page name string */
void (*page_init)(void); /* Page initialization function */
void (*page_loop)(void); /* Page loop function */
void* user_data; /* User data pointer */
} wui_page_desc_t;
/*******************************************************************************
* INITIALIZATION
******************************************************************************/
/* WUI initialization data structure */
typedef struct
{
uint16_t width; /* Display width */
uint16_t height; /* Display height */
uint16_t page_count; /* Number of pages */
uint8_t* heap_addr; /* Heap memory address */
size_t heap_size; /* Heap memory size */
} wui_init_data_t;
/*******************************************************************************
* FONT SYSTEM
******************************************************************************/
/* Font structure */
typedef struct
{
uint16_t height; /* Font height */
uint16_t width; /* Font width */
uint8_t cnt; /* Character count */
uint8_t start_char; /* Start character */
uint16_t first_img_id; /* First image ID */
} wui_font_t;
/* Bitmap font structure */
typedef struct
{
uint8_t width; /* Font width */
uint8_t height; /* Font height */
uint8_t start_char; /* Start character */
uint8_t cnt; /* Character count */
const uint8_t* data; /* Font data pointer */
} wui_bitfont_t;
/*******************************************************************************
* EVENT SYSTEM
******************************************************************************/
/* Event type enumeration */
typedef enum
{
WUI_EVENT_NONE = 0, /* No event */
WUI_EVENT_TOUCH_DOWN = 1, /* Touch down event */
WUI_EVENT_TOUCH_MOVE = 2, /* Touch move event */
WUI_EVENT_TOUCH_LONGPRESS = 3, /* Long press event */
WUI_EVENT_TOUCH_UP = 4, /* Touch up event */
WUI_EVENT_WIDGET_CLICK = 0x10, /* Click event */
WUI_EVENT_WIDGET_LONG_PRESS = 0x11, /* Long press event */
WUI_EVENT_WIDGET_CHANGE = 0x20, /* Value change event */
} _wui_event_t;
typedef uint16_t wui_event_t;
/*******************************************************************************
* TOUCH AREA
******************************************************************************/
typedef struct
{
uint16_t widget_id; /* Widget ID */
uint16_t x, y, w, h; /* Touch area position and size */
} wui_touch_area_t;
/*******************************************************************************
* VERSION API
******************************************************************************/
const char* wui_get_version(void);
/*******************************************************************************
* CORE INITIALIZATION API
******************************************************************************/
void wui_init(wui_init_data_t* data);
void wui_register_hal(const wui_hal_t* hal);
/*******************************************************************************
* PAGE MANAGEMENT API
******************************************************************************/
void wui_page_switch(uint16_t page);
void wui_page_ui_init(void);
void wui_page_ui_loop(void);
const wui_page_desc_t* wui_page_get_desc(uint16_t page);
const char* wui_page_get_name(uint16_t page);
/*******************************************************************************
* UI UPDATE API
******************************************************************************/
uint32_t wui_page_ui_update(void);
void wui_page_ui_tick(uint32_t delta_ms);
/*******************************************************************************
* KEY EVENT API
******************************************************************************/
void wui_register_key_handler(void (*handler)(uint32_t key));
void wui_dispatch_key(void);
void wui_set_key_event(uint32_t key);
/*******************************************************************************
* TOUCH LAYER API
******************************************************************************/
void wui_register_touch_layer(const wui_touch_area_t* areas, uint8_t count, void (*on_event)(uint16_t widget_id, wui_event_t event));
void wui_touch_area_set_enabled(uint16_t widget_id, uint8_t enabled);
#endif /* WUI_H */
@@ -0,0 +1,304 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : wui_widget.h
* Author : WCH
* Version : V1.2.0
* Date : 2026/07/30
* Description : This file contains widget type definitions, properties structures,
* and API functions for widget manipulation.
*********************************************************************************/
#ifndef WUI_WIDGET_H
#define WUI_WIDGET_H
#include <stdint.h>
#include "wui.h"
/*******************************************************************************
* TYPE DEFINITIONS
******************************************************************************/
/* Widget ID types */
typedef uint16_t wui_str_id_t; /* String resource ID */
typedef uint16_t wui_font_id_t; /* Font resource ID */
typedef uint16_t wui_bitmap_font_id_t; /* Bitmap font resource ID */
typedef uint16_t wui_imgtable_id_t; /* Image table resource ID */
typedef uint16_t wui_swgroup_id_t; /* Switch group resource ID */
/*******************************************************************************
* WIDGET TYPES
******************************************************************************/
/**
* @brief Widget type enumeration
*/
typedef enum
{
Wui_w_None, /* Invalid widget type */
Wui_w_Anime, /* Animation widget */
Wui_w_Switch, /* Switch widget */
Wui_w_Res0, /* Reserved 0 */
Wui_w_MultiState, /* Multi-state widget */
Wui_w_StaticImage, /* Static image widget */
Wui_w_QRCode, /* QR code widget */
Wui_w_Rect, /* Rectangle widget */
Wui_w_Res1, /* Reserved 1 */
Wui_w_Res2, /* Reserved 2 */
Wui_w_Res3, /* Reserved 3 */
Wui_w_ProgressBar, /* Progress bar widget */
Wui_w_Button, /* Button widget */
Wui_w_ImgSlider, /* Image slider widget */
Wui_w_SimpleString, /* Simple string widget */
Wui_w_ExString, /* Extended string widget */
Wui_w_COUNT /* Widget type count */
} _wui_widget_type_t;
typedef uint16_t wui_widget_type_t;
/*******************************************************************************
* CONSTANTS & MACROS
******************************************************************************/
/* Progress bar direction */
#define WUI_PB_HORIZONTAL 0 /* Horizontal progress bar */
#define WUI_PB_VERTICAL 1 /* Vertical progress bar */
/* Image slider direction */
#define WUI_IMGSLIDER_HORIZONTAL 0 /* Horizontal image slider */
#define WUI_IMGSLIDER_VERTICAL 1 /* Vertical image slider */
/* Simple string alignment */
#define WUI_SIMPLESTRING_ALIGN_LEFT 0 /* Left alignment */
#define WUI_SIMPLESTRING_ALIGN_RIGHT 1 /* Right alignment */
#define WUI_SIMPLESTRING_ALIGN_CENTER 2 /* Center alignment */
/* Extended string type */
#define WUI_EXSTRING_TYPE_NORMAL 0 /* Normal type */
/* Extended string alignment */
#define WUI_EXSTRING_ALIGN_LEFT 0 /* Left alignment */
#define WUI_EXSTRING_ALIGN_RIGHT 1 /* Right alignment */
#define WUI_EXSTRING_ALIGN_CENTER 2 /* Center alignment */
/*******************************************************************************
* WIDGET PROPERTIES
******************************************************************************/
/* Animation widget properties */
typedef struct
{
uint16_t start_img_id; /* Start image ID */
uint16_t frame_count; /* Total frame count */
uint8_t fps; /* Frames per second */
uint8_t loop; /* Loop mode (0: no loop, 1: loop) */
} wui_widget_anime_props_t;
/* Switch widget properties*/
typedef struct
{
uint16_t on_img_id; /* ON state image ID */
uint16_t off_img_id; /* OFF state image ID */
uint8_t is_on; /* Current state (0: OFF, 1: ON) */
} wui_widget_switch_props_t;
/* Multi-state widget properties */
typedef struct
{
wui_imgtable_id_t imgtable_id; /* Image table ID */
uint8_t state_count; /* Number of states */
uint8_t default_state; /* Default state index */
} wui_widget_multistate_props_t;
/* Static image widget properties */
typedef struct
{
uint16_t img_id; /* Image ID */
} wui_widget_staticimg_props_t;
/* QR code widget properties */
typedef struct
{
uint16_t img_id; /* Image ID */
} wui_widget_qrcode_props_t;
/* Rectangle widget properties */
typedef struct
{
uint16_t color; /* Rectangle color */
} wui_widget_rect_props_t;
/* Button widget properties */
typedef struct
{
uint16_t normal_img_id; /* Normal state image ID */
uint16_t pressed_img_id; /* Pressed state image ID */
uint8_t is_pressed; /* Current state (0: released, 1: pressed) */
} wui_widget_button_props_t;
/* Progress bar widget properties */
typedef struct
{
uint8_t direction; /* Direction (HORIZONTAL/VERTICAL) */
uint8_t min_value; /* Minimum value */
uint8_t max_value; /* Maximum value */
uint8_t current_value; /* Current value */
uint16_t bg_color; /* Background color */
uint16_t fill_color; /* Fill color */
uint16_t thumb_color; /* Thumb color */
uint16_t thumb_w; /* Thumb width */
} wui_widget_pb_props_t;
/* Image slider widget properties */
typedef struct
{
uint16_t full_img_id; /* Full image ID , Must be in raw format */
uint16_t empty_img_id; /* Empty image ID , Must be in raw format*/
uint8_t current_value; /* Initialization percentage (0-100) */
uint8_t direction; /* Direction (HORIZONTAL/VERTICAL) */
} wui_widget_imgslider_props_t;
/* Simple string widget properties */
typedef struct
{
wui_str_id_t str_id; /* String resource ID */
uint16_t fg_color; /* Foreground color */
uint16_t bg_color; /* Background color */
uint8_t align; /* Alignment (LEFT/RIGHT/CENTER) */
wui_bitmap_font_id_t font_id; /* Bitmap font ID */
} wui_widget_simplestring_props_t;
/* Extended string widget properties */
typedef struct
{
uint8_t type; /* String type */
uint8_t align; /* Alignment (LEFT/RIGHT/CENTER) */
union
{
struct
{
uint16_t fg_color; /* Foreground color */
uint16_t bg_color; /* Background color */
};
void* res; /* Reserved pointer */
};
wui_str_id_t str_id; /* String resource ID */
wui_font_id_t font_id; /* Font ID */
} wui_widget_exstring_props_t;
/*******************************************************************************
* WIDGET DESCRIPTOR
******************************************************************************/
/* This is the main structure for defining a widget */
typedef struct
{
uint16_t widget_id; /* Unique widget ID */
uint16_t type; /* Widget type */
uint16_t x, y, w, h; /* Widget position and size */
uint8_t flags; /* Widget flags */
union
{
wui_widget_anime_props_t anime; /* Animation properties */
wui_widget_switch_props_t switch_; /* Switch properties */
// wui_widget_swgroup_props_t swgroup; /* Switch group properties */
wui_widget_multistate_props_t multistate; /* Multi-state properties */
wui_widget_staticimg_props_t staticimg; /* Static image properties */
wui_widget_qrcode_props_t qrcode; /* QR code properties */
wui_widget_rect_props_t rect; /* Rectangle properties */
wui_widget_pb_props_t progress; /* Progress bar properties */
wui_widget_button_props_t button; /* Button properties */
wui_widget_imgslider_props_t imgslider; /* Image slider properties */
wui_widget_simplestring_props_t simplestring; /* Simple string properties */
wui_widget_exstring_props_t exstring; /* Extended string properties */
} props;
} wui_widget_desc_t;
/*******************************************************************************
* API FUNCTIONS
******************************************************************************/
void wui_page_init(const wui_widget_desc_t* widgets, uint8_t widget_count);
/*******************************************************************************
* ANIMATION API
******************************************************************************/
void wui_widget_anime_play(uint16_t widget_id);
void wui_widget_anime_pause(uint16_t widget_id);
void wui_widget_anime_reset(uint16_t widget_id);
uint8_t wui_widget_anime_is_completed(uint16_t widget_id);
/*******************************************************************************
* SWITCH API
******************************************************************************/
void wui_widget_switch_toggle(uint16_t widget_id);
void wui_widget_switch_set_on(uint16_t widget_id, uint8_t on);
uint8_t wui_widget_switch_is_on(uint16_t widget_id);
/*******************************************************************************
* MULTI-STATE API
******************************************************************************/
void wui_widget_multistate_next(uint16_t widget_id);
void wui_widget_multistate_prev(uint16_t widget_id);
void wui_widget_multistate_set_index(uint16_t widget_id, uint8_t index);
uint8_t wui_widget_multistate_get_index(uint16_t widget_id);
/*******************************************************************************
* STATIC IMAGE API
******************************************************************************/
uint16_t wui_widget_staticimg_get_img_id(uint16_t widget_id);
void wui_widget_staticimg_set_img_id(uint16_t widget_id, uint16_t img_id);
/*******************************************************************************
* RECTANGLE API
******************************************************************************/
void wui_widget_rect_set_color(uint16_t widget_id, uint16_t color);
uint16_t wui_widget_rect_get_color(uint16_t widget_id);
/*******************************************************************************
* PROGRESS BAR API
******************************************************************************/
void wui_widget_pb_set_value(uint16_t widget_id, uint8_t value);
uint8_t wui_widget_pb_get_value(uint16_t widget_id);
/*******************************************************************************
* IMAGE SLIDER API
******************************************************************************/
void wui_widget_imgslider_set_value(uint16_t widget_id, uint8_t current_value);
uint8_t wui_widget_imgslider_get_value(uint16_t widget_id);
/*******************************************************************************
* BUTTON API
******************************************************************************/
void wui_widget_button_press(uint16_t widget_id);
void wui_widget_button_release(uint16_t widget_id);
uint8_t wui_widget_button_is_pressed(uint16_t widget_id);
/*******************************************************************************
* SIMPLE STRING API
******************************************************************************/
void wui_widget_simplestring_set_str(uint16_t widget_id, const char* str);
const char* wui_widget_simplestring_get_str(uint16_t widget_id);
void wui_widget_simplestring_set_align(uint16_t widget_id, uint8_t align);
uint8_t wui_widget_simplestring_get_align(uint16_t widget_id);
void wui_widget_simplestring_set_color(uint16_t widget_id, uint16_t fg_color, uint16_t bg_color);
/*******************************************************************************
* EXTENDED STRING API
******************************************************************************/
void wui_widget_exstring_set_str(uint16_t widget_id, const char* str);
const char* wui_widget_exstring_get_str(uint16_t widget_id);
void wui_widget_exstring_set_align(uint16_t widget_id, uint8_t align);
uint8_t wui_widget_exstring_get_align(uint16_t widget_id);
#endif /* WUI_WIDGET_H */
@@ -0,0 +1,150 @@
#include "wui.h"
#include "wui_port.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include "flash.h"
#include "images.h"
#include "LCD.h"
#include "spi.h"
void HW_Key_event(uint32_t _key_code)
{
printf("[KEY] press %c\n", _key_code);
wui_set_key_event(_key_code);
}
/*********************************************************************
* @fn touch_read
*
* @brief Read touch screen coordinates and pressed state.
* v203 has no touch screen, so touch is disabled.
*
* @param x - Pointer to store X coordinate.
* @param y - Pointer to store Y coordinate.
* @param pressed - Pointer to store pressed state.
*
* @return none
*/
static void touch_read(uint16_t* x, uint16_t* y, uint8_t* pressed)
{
*x = 0;
*y = 0;
*pressed = 0;
}
/*********************************************************************
* @fn spi_flash_read
*
* @brief Read data from SPI Flash.
*
* @param outBuffer - Pointer to data buffer to store read data.
* @param ReadAddr - Start address to read from.
* @param size - Number of bytes to read.
*
* @return none
*/
static void spi_flash_read(uint8_t* outBuffer, uint32_t ReadAddr, uint32_t size)
{
SPI_Flash_Read_dma_start(ReadAddr);
SPI1_Read_DMA(outBuffer, (uint16_t)size);
SPI1_wait_for_bsy();
SPI_Flash_Read_dma_end();
}
/*********************************************************************
* @fn lcd_set_windows
*
* @brief Set LCD display window.
*
* @param x_start - Start X coordinate.
* @param y_start - Start Y coordinate.
* @param x_end - End X coordinate.
* @param y_end - End Y coordinate.
*
* @return none
*/
static void lcd_set_windows(uint16_t x_start, uint16_t y_start, uint16_t x_end, uint16_t y_end)
{
LCD_SetWindows(x_start, y_start, x_end, y_end);
}
/*********************************************************************
* @fn lcd_dma_start
*
* @brief Start LCD data transfer.
*
* @return none
*/
static void lcd_dma_start(void)
{
LCD_DC_SET();
LCD_CS_CLR();
}
/*********************************************************************
* @fn lcd_dma_send
*
* @brief Send data via LCD DMA.
*
* @param buf - Pointer to data buffer to send.
* @param len - Length of data in bytes.
*
* @return none
*/
static void lcd_dma_send(const uint8_t* buf, uint32_t len)
{
SPI2_Write_DMA((uint8_t*)buf, (uint16_t)len);
}
/*********************************************************************
* @fn lcd_dma_wait
*
* @brief Wait for LCD DMA transfer to complete.
*
* @return none
*/
static void lcd_dma_wait(void)
{
while (SPI2_DMA_TX_CH->CNTR > 0)
{
}
while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_BSY) == SET)
;
}
/*********************************************************************
* @fn lcd_dma_end
*
* @brief End LCD DMA transfer.
*
* @return none
*/
static void lcd_dma_end(void)
{
LCD_CS_SET();
}
/*********************************************************************
* @fn wui_get_hal
*
* @brief Get WUI HAL interface structure.
*
* @return Pointer to HAL interface structure.
*/
const wui_hal_t* wui_get_hal(void)
{
static const wui_hal_t hal = {
.touch_read = touch_read,
.flash_read = spi_flash_read,
.lcd_set_windows = lcd_set_windows,
.lcd_dma_start = lcd_dma_start,
.lcd_dma_send = lcd_dma_send,
.lcd_dma_wait = lcd_dma_wait,
.lcd_dma_end = lcd_dma_end,
};
return &hal;
}
@@ -0,0 +1,11 @@
#ifndef __WUI_PORT_H
#define __WUI_PORT_H
#include <stdint.h>
#include "wui.h"
void HW_Key_event(uint32_t _key_code);
const wui_hal_t* wui_get_hal(void);
#endif // __WUI_PORT_H
Binary file not shown.
@@ -0,0 +1,377 @@
/**
* @file images.h
* @brief Image resource table generated by WCHGUIDesigner.
* @note Byte order: Big Endian
*/
#ifndef _IMAGES_H_
#define _IMAGES_H_
#include <stdint.h>
#include <stddef.h>
typedef enum {
IMAGE_NONE = 0xFFFF,
// === Raw images (0b000) ===
IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0030 = MAKE_IMAGE_ID(IMAGE_TYPE_RAW, 0),
IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0031 = MAKE_IMAGE_ID(IMAGE_TYPE_RAW, 1),
IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0032 = MAKE_IMAGE_ID(IMAGE_TYPE_RAW, 2),
IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0033 = MAKE_IMAGE_ID(IMAGE_TYPE_RAW, 3),
IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0034 = MAKE_IMAGE_ID(IMAGE_TYPE_RAW, 4),
IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0035 = MAKE_IMAGE_ID(IMAGE_TYPE_RAW, 5),
IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0036 = MAKE_IMAGE_ID(IMAGE_TYPE_RAW, 6),
IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0037 = MAKE_IMAGE_ID(IMAGE_TYPE_RAW, 7),
IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0038 = MAKE_IMAGE_ID(IMAGE_TYPE_RAW, 8),
IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0039 = MAKE_IMAGE_ID(IMAGE_TYPE_RAW, 9),
IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_003A = MAKE_IMAGE_ID(IMAGE_TYPE_RAW, 10),
// === CLUT images (0b010) ===
IMAGE_RES_IMG_TPL_MAIN_PAGELIGHTCFG1 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 11),
IMAGE_RES_IMG_TPL_MAIN_PAGELIGHTCFG2 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 12),
IMAGE_RES_IMG_TPL_MAIN_PAGELIGHTCOLOR1 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 13),
IMAGE_RES_IMG_TPL_MAIN_PAGELIGHTCOLOR2 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 14),
IMAGE_RES_IMG_TPL_MAIN_PAGERELDATA1 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 15),
IMAGE_RES_IMG_TPL_MAIN_PAGERELDATA2 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 16),
IMAGE_RES_IMG_TPL_MAIN_PAGEANIMAL1 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 17),
IMAGE_RES_IMG_TPL_MAIN_PAGEANIMAL2 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 18),
IMAGE_RES_IMG_TPL_MAIN_PAGEMODEL1 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 19),
IMAGE_RES_IMG_TPL_MAIN_PAGEMODEL2 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 20),
IMAGE_RES_IMG_TPL_MAIN_PAGESETTING1 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 21),
IMAGE_RES_IMG_TPL_MAIN_PAGESETTING2 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 22),
IMAGE_RES_IMG_TPL_MAIN_BAT00 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 23),
IMAGE_RES_IMG_TPL_MAIN_BAT01 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 24),
IMAGE_RES_IMG_TPL_MAIN_BAT02 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 25),
IMAGE_RES_IMG_TPL_MAIN_BAT03 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 26),
IMAGE_RES_IMG_TPL_MAIN_BAT04 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 27),
IMAGE_RES_IMG_TPL_MAIN_BAT05 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 28),
IMAGE_RES_IMG_TPL_MAIN_BAT06 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 29),
IMAGE_RES_IMG_TPL_MAIN_BAT07 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 30),
IMAGE_RES_IMG_TPL_MAIN_BAT08 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 31),
IMAGE_RES_IMG_TPL_MAIN_BAT09 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 32),
IMAGE_RES_IMG_TPL_MAIN_BAT10 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 33),
IMAGE_RES_IMG_TPL_MAIN_BAT11 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 34),
IMAGE_RES_IMG_TPL_MAIN_BAT12 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 35),
IMAGE_RES_IMG_TPL_MAIN_BAT13 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 36),
IMAGE_RES_IMG_TPL_MAIN_BAT14 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 37),
IMAGE_RES_IMG_TPL_MAIN_BAT15 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 38),
IMAGE_RES_IMG_TPL_MAIN_BAT16 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 39),
IMAGE_RES_IMG_TPL_MAIN_BAT17 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 40),
IMAGE_RES_IMG_TPL_MAIN_BAT18 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 41),
IMAGE_RES_IMG_TPL_MAIN_BAT19 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 42),
IMAGE_RES_IMG_TPL_MAIN_BAT20 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 43),
IMAGE_RES_IMG_TPL_MAIN_BAT21 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 44),
IMAGE_RES_IMG_TPL_MAIN_CON1 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 45),
IMAGE_RES_IMG_TPL_MAIN_CON2 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 46),
IMAGE_RES_IMG_TPL_MAIN_CON3 = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 47),
IMAGE_RES_IMG_TPL_MAIN_BG = MAKE_IMAGE_ID(IMAGE_TYPE_CLUT, 48),
} image_index_t;
static const image_info_t image_table[] = {
{ // IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0030
.addr = 0x0001DED4,
.width = 10,
.height = 26,
.data_size = 520,
},
{ // IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0031
.addr = 0x0001E0DC,
.width = 10,
.height = 26,
.data_size = 520,
},
{ // IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0032
.addr = 0x0001E2E4,
.width = 10,
.height = 26,
.data_size = 520,
},
{ // IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0033
.addr = 0x0001E4EC,
.width = 10,
.height = 26,
.data_size = 520,
},
{ // IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0034
.addr = 0x0001E6F4,
.width = 10,
.height = 26,
.data_size = 520,
},
{ // IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0035
.addr = 0x0001E8FC,
.width = 10,
.height = 26,
.data_size = 520,
},
{ // IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0036
.addr = 0x0001EB04,
.width = 10,
.height = 26,
.data_size = 520,
},
{ // IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0037
.addr = 0x0001ED0C,
.width = 10,
.height = 26,
.data_size = 520,
},
{ // IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0038
.addr = 0x0001EF14,
.width = 10,
.height = 26,
.data_size = 520,
},
{ // IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0039
.addr = 0x0001F11C,
.width = 10,
.height = 26,
.data_size = 520,
},
{ // IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_003A
.addr = 0x0001F324,
.width = 10,
.height = 26,
.data_size = 520,
},
{ // IMAGE_RES_IMG_TPL_MAIN_PAGELIGHTCFG1
.addr = 0x00000000,
.width = 73,
.height = 99,
.data_size = 7739,
},
{ // IMAGE_RES_IMG_TPL_MAIN_PAGELIGHTCFG2
.addr = 0x00001E3C,
.width = 73,
.height = 99,
.data_size = 7739,
},
{ // IMAGE_RES_IMG_TPL_MAIN_PAGELIGHTCOLOR1
.addr = 0x00003C78,
.width = 73,
.height = 99,
.data_size = 7739,
},
{ // IMAGE_RES_IMG_TPL_MAIN_PAGELIGHTCOLOR2
.addr = 0x00005AB4,
.width = 73,
.height = 99,
.data_size = 7739,
},
{ // IMAGE_RES_IMG_TPL_MAIN_PAGERELDATA1
.addr = 0x000078F0,
.width = 73,
.height = 99,
.data_size = 7739,
},
{ // IMAGE_RES_IMG_TPL_MAIN_PAGERELDATA2
.addr = 0x0000972C,
.width = 73,
.height = 99,
.data_size = 7739,
},
{ // IMAGE_RES_IMG_TPL_MAIN_PAGEANIMAL1
.addr = 0x0000B568,
.width = 73,
.height = 99,
.data_size = 7739,
},
{ // IMAGE_RES_IMG_TPL_MAIN_PAGEANIMAL2
.addr = 0x0000D3A4,
.width = 73,
.height = 99,
.data_size = 7739,
},
{ // IMAGE_RES_IMG_TPL_MAIN_PAGEMODEL1
.addr = 0x0000F1E0,
.width = 73,
.height = 99,
.data_size = 7739,
},
{ // IMAGE_RES_IMG_TPL_MAIN_PAGEMODEL2
.addr = 0x0001101C,
.width = 73,
.height = 99,
.data_size = 7739,
},
{ // IMAGE_RES_IMG_TPL_MAIN_PAGESETTING1
.addr = 0x00012E58,
.width = 73,
.height = 99,
.data_size = 7739,
},
{ // IMAGE_RES_IMG_TPL_MAIN_PAGESETTING2
.addr = 0x00014C94,
.width = 73,
.height = 99,
.data_size = 7739,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT00
.addr = 0x00016AD0,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT01
.addr = 0x00016F74,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT02
.addr = 0x00017418,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT03
.addr = 0x000178BC,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT04
.addr = 0x00017D60,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT05
.addr = 0x00018204,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT06
.addr = 0x000186A8,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT07
.addr = 0x00018B4C,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT08
.addr = 0x00018FF0,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT09
.addr = 0x00019494,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT10
.addr = 0x00019938,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT11
.addr = 0x00019DDC,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT12
.addr = 0x0001A280,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT13
.addr = 0x0001A724,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT14
.addr = 0x0001ABC8,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT15
.addr = 0x0001B06C,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT16
.addr = 0x0001B510,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT17
.addr = 0x0001B9B4,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT18
.addr = 0x0001BE58,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT19
.addr = 0x0001C2FC,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT20
.addr = 0x0001C7A0,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BAT21
.addr = 0x0001CC44,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_CON1
.addr = 0x0001D0E8,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_CON2
.addr = 0x0001D58C,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_CON3
.addr = 0x0001DA30,
.width = 26,
.height = 26,
.data_size = 1188,
},
{ // IMAGE_RES_IMG_TPL_MAIN_BG
.addr = 0x0001F52C,
.width = 320,
.height = 240,
.data_size = 77312,
},
};
#define RAW_IMAGE_COUNT 11
#define RLE_IMAGE_COUNT 0
#define CLUT_IMAGE_COUNT 38
#define CLUT4_IMAGE_COUNT 0
#define IMAGE_COUNT 49
static inline const image_info_t* get_image(image_index_t index) {
uint16_t idx = IMAGE_GET_INDEX(index);
if (idx >= IMAGE_COUNT) return NULL;
return &image_table[idx];
}
#endif /* _IMAGES_H_ */
@@ -0,0 +1,170 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : wui_asset.c
* Author : WCH
* Version : V1.2.0
* Date : 2026/07/30
* Description : This file is auto-generated by WUI Designer Tool.
* : Contains WUI asset resources (strings, images, fonts).
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#include "wui_asset.h"
#include <stddef.h>
#include "LCD_Font.h"
const wui_bitfont_t wui_font_6x12 = { 6, 12, 0x20, 95, (const uint8_t*)asc2_1206 };
const wui_bitfont_t wui_font_8x16 = { 8, 16, 0x20, 95, (const uint8_t*)asc2_1608 };
/*******************************************************************************
* STRING RESOURCES
******************************************************************************/
/* Maps string IDs to string pointers */
static const char* wui_string_table[WUI_STR_COUNT] = {
[WUI_STR_NONE] = NULL,
[WUI_STR_MAIN_MAIN_TIME] = "12:34",
};
/**
* @brief Get string by ID
* @param id - String ID
* @return String pointer, or NULL if not found
*/
const char* wui_get_string(wui_str_id_t id)
{
if (id > 0 && id < WUI_STR_COUNT)
{
return wui_string_table[id];
}
return NULL;
}
/*******************************************************************************
* IMAGE TABLE RESOURCES
******************************************************************************/
static const uint16_t wui_imgtable_main_main_battery[] = {
IMAGE_RES_IMG_TPL_MAIN_BAT00,
IMAGE_RES_IMG_TPL_MAIN_BAT01,
IMAGE_RES_IMG_TPL_MAIN_BAT02,
IMAGE_RES_IMG_TPL_MAIN_BAT03,
IMAGE_RES_IMG_TPL_MAIN_BAT04,
IMAGE_RES_IMG_TPL_MAIN_BAT05,
IMAGE_RES_IMG_TPL_MAIN_BAT06,
IMAGE_RES_IMG_TPL_MAIN_BAT07,
IMAGE_RES_IMG_TPL_MAIN_BAT08,
IMAGE_RES_IMG_TPL_MAIN_BAT09,
IMAGE_RES_IMG_TPL_MAIN_BAT10,
IMAGE_RES_IMG_TPL_MAIN_BAT11,
IMAGE_RES_IMG_TPL_MAIN_BAT12,
IMAGE_RES_IMG_TPL_MAIN_BAT13,
IMAGE_RES_IMG_TPL_MAIN_BAT14,
IMAGE_RES_IMG_TPL_MAIN_BAT15,
IMAGE_RES_IMG_TPL_MAIN_BAT16,
IMAGE_RES_IMG_TPL_MAIN_BAT17,
IMAGE_RES_IMG_TPL_MAIN_BAT18,
IMAGE_RES_IMG_TPL_MAIN_BAT19,
IMAGE_RES_IMG_TPL_MAIN_BAT20,
IMAGE_RES_IMG_TPL_MAIN_BAT21,
};
static const uint16_t wui_imgtable_main_main_connection[] = {
IMAGE_RES_IMG_TPL_MAIN_CON1,
IMAGE_RES_IMG_TPL_MAIN_CON2,
IMAGE_RES_IMG_TPL_MAIN_CON3,
};
/* Maps image table IDs to image ID arrays */
static const uint16_t* wui_imgtable_list[WUI_IMGTABLE_COUNT] = {
[WUI_IMGTABLE_NONE] = NULL,
[WUI_IMGTABLE_MAIN_MAIN_BATTERY] = wui_imgtable_main_main_battery,
[WUI_IMGTABLE_MAIN_MAIN_CONNECTION] = wui_imgtable_main_main_connection,
};
/**
* @brief Get image table by ID
* @param id - Image table ID
* @return Image table pointer, or NULL if not found
*/
const uint16_t* wui_get_imgtable(wui_imgtable_id_t id)
{
if (id > 0 && id < WUI_IMGTABLE_COUNT)
{
return wui_imgtable_list[id];
}
return NULL;
}
/*******************************************************************************
* FONT RESOURCES
******************************************************************************/
/**
* @brief Font table for WUI
* @details Maps font IDs to font structures
*/
static const wui_font_t wui_font_table[WUI_FONT_COUNT] = {
[WUI_FONT_NONE] = {0},
[WUI_FONT_WUI_PAGE_MAIN_MAIN_TIME] = {
.cnt = 10,
.start_char = '0',
.width = 10,
.height = 26,
.first_img_id = IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0030,
},
};
const wui_font_t* wui_get_font(wui_font_id_t id)
{
if (id > 0 && id < WUI_FONT_COUNT)
{
return &wui_font_table[id];
}
return NULL;
}
/*******************************************************************************
* BITMAP FONT RESOURCES
******************************************************************************/
/* Maps bitmap font IDs to font structures */
static const wui_bitfont_t* wui_bitmap_font_table[WUI_BITMAP_FONT_COUNT] = {
[WUI_BITMAP_FONT_DEFAULT] = &wui_font_8x16,
[WUI_BITMAP_FONT_6X12] = &wui_font_6x12,
[WUI_BITMAP_FONT_8X16] = &wui_font_8x16,
};
/**
* @brief Get bitmap font by ID
* @param id - Bitmap font ID
* @return Bitmap font structure pointer, or default font if not found
*/
const wui_bitfont_t* wui_get_bitmap_font(wui_bitmap_font_id_t id)
{
if (id > 0 && id < WUI_BITMAP_FONT_COUNT) {
return wui_bitmap_font_table[id];
}
return wui_bitmap_font_table[WUI_BITMAP_FONT_DEFAULT];
}
/*********************************************************************
* @fn wui_get_image
*
* @brief Get image information by index.
*
* @param index - Image index.
*
* @return Pointer to image information structure.
*/
const image_info_t* wui_get_image(uint32_t index)
{
// return get_image(index);
uint16_t idx = IMAGE_GET_INDEX(index);
if (idx >= IMAGE_COUNT) return NULL;
return &image_table[idx];
}
@@ -0,0 +1,58 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : wui_asset.h
* Author : WCH
* Version : V1.2.0
* Date : 2026/07/30
* Description : Asset management functions
*********************************************************************************/
#ifndef WUI_ASSET_H
#define WUI_ASSET_H
#include <stdint.h>
#include "wui.h"
#include "images.h"
#include "wui_widget.h"
enum
{
WUI_STR_NONE = 0,
WUI_STR_MAIN_MAIN_TIME,
WUI_STR_COUNT
};
const char* wui_get_string(wui_str_id_t id);
enum
{
WUI_FONT_NONE = 0,
WUI_FONT_WUI_PAGE_MAIN_MAIN_TIME,
WUI_FONT_COUNT
};
const wui_font_t* wui_get_font(wui_font_id_t id);
enum
{
WUI_IMGTABLE_NONE = 0,
WUI_IMGTABLE_MAIN_MAIN_BATTERY,
WUI_IMGTABLE_MAIN_MAIN_CONNECTION,
WUI_IMGTABLE_COUNT
};
const uint16_t* wui_get_imgtable(wui_imgtable_id_t id);
enum {
WUI_BITMAP_FONT_DEFAULT = 0,
WUI_BITMAP_FONT_6X12,
WUI_BITMAP_FONT_8X16,
WUI_BITMAP_FONT_COUNT
};
const wui_bitfont_t* wui_get_bitmap_font(wui_bitmap_font_id_t id);
const image_info_t* wui_get_image(uint32_t index);
#endif
@@ -0,0 +1,22 @@
#include "wui_page.h"
#include "wui.h"
#include "images.h"
#include <stdio.h>
const wui_page_desc_t wui_pages[WUI_PAGE_COUNT] = {
[WUI_PAGE_NONE] = {
.bg_color = RGB888_TO_RGB565(0, 0, 0),
.page_name = "None",
.page_init = wui_page_none_init,
.page_loop = wui_page_none_loop,
.user_data = NULL,
},
[WUI_PAGE_MAIN] = {
.bg_color = RGB888_TO_RGB565(0, 0, 0),
.page_name = "Menu Page",
.page_init = wui_page_main_init,
.page_loop = wui_page_main_loop,
.user_data = NULL,
},
};
@@ -0,0 +1,25 @@
#ifndef WUI_PAGE_H
#define WUI_PAGE_H
#include <stdint.h>
#include "stddef.h"
#include "wui.h"
typedef enum
{
WUI_PAGE_NONE = 0,
WUI_PAGE_MAIN,
WUI_PAGE_COUNT,
} wui_page_t;
#define WUI_START_PAGE WUI_PAGE_MAIN
void wui_page_none_init(void);
void wui_page_none_loop(void);
void wui_page_main_init(void);
void wui_page_main_loop(void);
extern const wui_page_desc_t wui_pages[WUI_PAGE_COUNT];
#endif
@@ -0,0 +1,80 @@
#include "wui_user/wui_page_main.h"
// ================= Template Page =================
// Template: main menu
// Template interaction logic is generated from known template IDs.
// ================= Template Logic Hooks =================
#define MENU_COUNT 6
static const uint8_t menu_widget_ids[MENU_COUNT] = {
MAIN_MAIN_SETTING,
MAIN_MAIN_MODE,
MAIN_MAIN_ANIM,
MAIN_MAIN_REAL_DATA,
MAIN_MAIN_LIGHT_COLOR,
MAIN_MAIN_COLOR_CFG,
};
static const wui_page_t menu_pages[MENU_COUNT] = {
WUI_PAGE_MAIN,
WUI_PAGE_MAIN,
WUI_PAGE_MAIN,
WUI_PAGE_MAIN,
WUI_PAGE_MAIN,
WUI_PAGE_MAIN,
};
static uint8_t main_saved_selection = 0;
static uint8_t current_menu = 0;
static void menu_set(uint8_t index, uint8_t on)
{
if (index < MENU_COUNT)
{
if (on)
{
wui_widget_button_press(menu_widget_ids[index]);
}
else
{
wui_widget_button_release(menu_widget_ids[index]);
}
}
}
static void main_on_key(uint32_t key)
{
if (key == 'a')
{
menu_set(current_menu, 0);
current_menu = (current_menu == 0) ? MENU_COUNT - 1 : current_menu - 1;
menu_set(current_menu, 1);
}
else if (key == 'd')
{
menu_set(current_menu, 0);
current_menu = (current_menu + 1 >= MENU_COUNT) ? 0 : current_menu + 1;
menu_set(current_menu, 1);
}
else if (key == 'b')
{
main_saved_selection = current_menu;
wui_page_switch(menu_pages[current_menu]);
}
}
// ================= Page Functions =================
void wui_page_main_init(void)
{
wui_page_init(widgets_main, sizeof(widgets_main) / sizeof(widgets_main[0]));
current_menu = main_saved_selection;
menu_set(current_menu, 1);
wui_register_key_handler(main_on_key);
}
void wui_page_main_loop(void)
{
}
@@ -0,0 +1,183 @@
#ifndef WUI_PAGE_MAIN_H
#define WUI_PAGE_MAIN_H
#include "wui.h"
#include "wui_user/wui_page.h"
#include "wui_widget.h"
#include "images.h"
#include "wui_asset.h"
#include <stdio.h>
// ================= Widget ID Enum =================
typedef enum
{
MAIN_MAIN_BG_BLACK,
MAIN_MAIN_BG,
MAIN_MAIN_TIME,
MAIN_MAIN_CONNECTION,
MAIN_MAIN_BATTERY,
MAIN_MAIN_SETTING,
MAIN_MAIN_MODE,
MAIN_MAIN_ANIM,
MAIN_MAIN_REAL_DATA,
MAIN_MAIN_LIGHT_COLOR,
MAIN_MAIN_COLOR_CFG,
} main_widget_id_t;
// ================= Declarative Widgets =================
static const wui_widget_desc_t widgets_main[] = {
[MAIN_MAIN_BG_BLACK] = {
.widget_id = MAIN_MAIN_BG_BLACK,
.type = Wui_w_Rect,
.x = 0,
.y = 0,
.w = 320,
.h = 240,
.props.rect = {
.color = RGB888_TO_RGB565(0, 0, 0),
},
},
[MAIN_MAIN_BG] = {
.widget_id = MAIN_MAIN_BG,
.type = Wui_w_StaticImage,
.x = 0,
.y = 0,
.w = 320,
.h = 240,
.props.staticimg = {
.img_id = IMAGE_RES_IMG_TPL_MAIN_BG,
},
},
[MAIN_MAIN_TIME] = {
.widget_id = MAIN_MAIN_TIME,
.type = Wui_w_ExString,
.x = 12,
.y = 4,
.w = 50,
.h = 26,
.props.exstring = {
.str_id = WUI_STR_MAIN_MAIN_TIME,
.font_id = WUI_FONT_WUI_PAGE_MAIN_MAIN_TIME,
.bg_color = RGB888_TO_RGB565(0, 0, 0),
.align = WUI_EXSTRING_ALIGN_LEFT,
},
},
[MAIN_MAIN_CONNECTION] = {
.widget_id = MAIN_MAIN_CONNECTION,
.type = Wui_w_MultiState,
.x = 119,
.y = 4,
.w = 26,
.h = 26,
.props.multistate = {
.imgtable_id = WUI_IMGTABLE_MAIN_MAIN_CONNECTION,
.state_count = 3,
.default_state = 2,
},
},
[MAIN_MAIN_BATTERY] = {
.widget_id = MAIN_MAIN_BATTERY,
.type = Wui_w_MultiState,
.x = 280,
.y = 4,
.w = 26,
.h = 26,
.props.multistate = {
.imgtable_id = WUI_IMGTABLE_MAIN_MAIN_BATTERY,
.state_count = 22,
.default_state = 0,
},
},
[MAIN_MAIN_SETTING] = {
.widget_id = MAIN_MAIN_SETTING,
.type = Wui_w_Button,
.x = 24,
.y = 42,
.w = 73,
.h = 99,
.props.button = {
.pressed_img_id = IMAGE_RES_IMG_TPL_MAIN_PAGESETTING2,
.normal_img_id = IMAGE_RES_IMG_TPL_MAIN_PAGESETTING1,
.is_pressed = 0,
},
},
[MAIN_MAIN_MODE] = {
.widget_id = MAIN_MAIN_MODE,
.type = Wui_w_Button,
.x = 127,
.y = 42,
.w = 73,
.h = 99,
.props.button = {
.pressed_img_id = IMAGE_RES_IMG_TPL_MAIN_PAGEMODEL2,
.normal_img_id = IMAGE_RES_IMG_TPL_MAIN_PAGEMODEL1,
.is_pressed = 0,
},
},
[MAIN_MAIN_ANIM] = {
.widget_id = MAIN_MAIN_ANIM,
.type = Wui_w_Button,
.x = 226,
.y = 42,
.w = 73,
.h = 99,
.props.button = {
.pressed_img_id = IMAGE_RES_IMG_TPL_MAIN_PAGEANIMAL2,
.normal_img_id = IMAGE_RES_IMG_TPL_MAIN_PAGEANIMAL1,
.is_pressed = 0,
},
},
[MAIN_MAIN_REAL_DATA] = {
.widget_id = MAIN_MAIN_REAL_DATA,
.type = Wui_w_Button,
.x = 24,
.y = 141,
.w = 73,
.h = 99,
.props.button = {
.pressed_img_id = IMAGE_RES_IMG_TPL_MAIN_PAGERELDATA2,
.normal_img_id = IMAGE_RES_IMG_TPL_MAIN_PAGERELDATA1,
.is_pressed = 0,
},
},
[MAIN_MAIN_LIGHT_COLOR] = {
.widget_id = MAIN_MAIN_LIGHT_COLOR,
.type = Wui_w_Button,
.x = 127,
.y = 141,
.w = 73,
.h = 99,
.props.button = {
.pressed_img_id = IMAGE_RES_IMG_TPL_MAIN_PAGELIGHTCOLOR2,
.normal_img_id = IMAGE_RES_IMG_TPL_MAIN_PAGELIGHTCOLOR1,
.is_pressed = 0,
},
},
[MAIN_MAIN_COLOR_CFG] = {
.widget_id = MAIN_MAIN_COLOR_CFG,
.type = Wui_w_Button,
.x = 226,
.y = 141,
.w = 73,
.h = 99,
.props.button = {
.pressed_img_id = IMAGE_RES_IMG_TPL_MAIN_PAGELIGHTCFG2,
.normal_img_id = IMAGE_RES_IMG_TPL_MAIN_PAGELIGHTCFG1,
.is_pressed = 0,
},
},
};
#endif // WUI_PAGE_MAIN_H
@@ -0,0 +1,16 @@
#include "wui_user/wui_page_none.h"
static void none_on_key(uint32_t key)
{
wui_page_switch(WUI_START_PAGE);
}
void wui_page_none_init()
{
wui_page_init(widgets_none, sizeof(widgets_none) / sizeof(widgets_none[0]));
wui_register_key_handler(none_on_key);
}
void wui_page_none_loop()
{
}
@@ -0,0 +1,27 @@
#ifndef WUI_PAGE_NONE_H
#define WUI_PAGE_NONE_H
#include "wui.h"
#include "wui_user/wui_page.h"
#include "wui_widget.h"
typedef enum
{
WIDGET_NONE_BG = 0,
} none_widget_id_t;
static const wui_widget_desc_t widgets_none[] = {
[WIDGET_NONE_BG] = {
.widget_id = WIDGET_NONE_BG,
.type = Wui_w_Rect,
.x = 0,
.y = 0,
.w = LCD_WIDTH,
.h = LCD_HEIGHT,
.props.rect = {
.color = LCD_black,
},
},
};
#endif // WUI_PAGE_NONE_H
+450
View File
@@ -0,0 +1,450 @@
{
"version": "1.0",
"hasAllParsed": true,
"isNormalMRSProject": true,
"basic": {
"chipInfo": {
"vendor": "WCH",
"toolchain": "RISC-V",
"series": "CH32V203",
"rtos": "NoneOS",
"mcu": "CH32V203RBT",
"description": "ROM(byte): 64K, SRAM(byte): 20K, CHIP PINS: 32, GPIO PORTS: 27.\\nWCH CH32V2 series of mainstream MCUs covers the needs of a large variety of applications in the industrial,medical and consumer markets. High performance with first-class peripherals and low-power,low-voltage operation is paired with a high level of integration at accessible prices with a simple architecture and easy-to-use tools.",
"tempratureScope": "",
"artifactType": "executable",
"link": "WCH-Link",
"peripheral_version": "1.0",
"calibrateSupport": false,
"calibrateCommand": "",
"UIConfigSupport": false,
"UIConfigCommand": "",
"externalFlashSupport": false
},
"linkedFolders": [
{
"name": "Core",
"location": "../../SRC/Core"
},
{
"name": "Debug",
"location": "../../SRC/Debug"
},
{
"name": "Ld",
"location": "../../SRC/Ld"
},
{
"name": "Peripheral",
"location": "../../SRC/Peripheral"
},
{
"name": "Startup",
"location": "../../SRC/Startup"
}
],
"removedResources": [
{
"parentLogicPath": "",
"type": "file",
"name": "*.wvproj"
}
],
"projectName": "WS2812_LED",
"architecture": "RISC-V",
"projectType": "c"
},
"buildConfig": {
"configurations": [
{
"buildArtifact": {
"artifact_name": "${ProjName}",
"artifact_extension": "elf",
"output_prefix": "",
"artifact_type": "Executable"
},
"parallelizationNumber": "optimal",
"stop_on_first_build_error": true,
"pre_script": "",
"pre_script_description": "",
"post_script": "",
"post_script_description": "",
"excludeResources": [
"${project}/Startup/startup_ch32v20x_D8W.S",
"${project}/Startup/startup_ch32v20x_D8.S"
],
"optimization": {
"level": "size",
"message_length": true,
"char_is_signed": true,
"function_sections": true,
"data_sections": true,
"no_common_unitialized": true,
"do_not_inline_functions": false,
"assume_freestanding_environment": false,
"disable_builtin": false,
"single_precision_constants": false,
"position_independent_code": false,
"link_time_optimizer": false,
"disable_loop_invariant_move": false,
"optimize_unused_sections_declared_as_high_code": false,
"code_generation_without_hardware_floating": false,
"use_pipelines": false,
"show_caret_indicating_the_column": false,
"calling_convention_variant": false,
"other_optimization_flags": ""
},
"warnings": {
"check_syntax_only": false,
"pedantic": false,
"pedantic_warnings_as_errors": false,
"inhibit_all_warnings": false,
"warn_on_various_unused_elements": true,
"warn_on_uninitialized_variables": true,
"enable_all_common_warnings": false,
"enable_extra_warnings": false,
"warn_on_undeclared_global_function": false,
"warn_on_implicit_conversions": false,
"warn_if_pointer_arthmetic": false,
"warn_if_padding_is_included": false,
"warn_if_shadowed_variable": false,
"warn_if_suspicious_logical_ops": false,
"warn_if_struct_is_returned": false,
"warn_if_floats_are_compared_as_equal": false,
"generate_errors_instead_of_warnings": false,
"other_warning_flags": ""
},
"debugging": {
"debug_level": "default",
"debug_format": "default",
"generate_prof_information": false,
"generate_gprof_information": false,
"other_debugging_flags": ""
},
"assembler": {
"preprocessor": {
"use_preprocessor": true,
"do_not_search_system_directories": false,
"preprocess_only": false,
"defined_symbols": [],
"undefined_symbols": []
},
"includes": {
"include_paths": [
"${project}/Startup"
],
"include_system_paths": [],
"include_files": []
},
"other_warning_flags": "",
"miscellaneous": {
"assembler_flags": [],
"generate_assembler_listing": false,
"save_temporary_files": false,
"verbose": false,
"other_assembler_flags": ""
}
},
"ccompiler": {
"preprocessor": {
"do_not_search_system_directories": false,
"preprocess_only": false,
"defined_symbols": [],
"undefined_symbols": []
},
"includes": {
"include_paths": [
"${project}/Debug",
"${project}/Core",
"${project}/User",
"${project}/Peripheral/inc",
"${project}/User/Drivers",
"${project}/User/wui",
"${project}/User/wui_port",
"${project}/User/wui_user"
],
"include_system_paths": [],
"include_files": []
},
"optimization": {
"language_standard": "gnu99",
"other_optimization_flags": ""
},
"warnings": {
"warn_if_a_global_function_has_no_prototype": false,
"warn_if_a_function_has_no_arg_type": false,
"warn_if_wrong_cast": false,
"other_warning_flags": ""
},
"miscellaneous": {
"generate_assembler_listing": false,
"save_temporary_files": false,
"verbose": false,
"other_compiler_flags": ""
}
},
"cppcompiler": {
"preprocessor": {
"do_not_search_system_directories": false,
"do_not_search_system_cpp_directories": false,
"preprocess_only": false,
"defined_symbols": [],
"undefined_symbols": []
},
"includes": {
"include_paths": [],
"include_system_paths": [],
"include_files": []
},
"optimization": {
"cpp_language_standard": "gnucpp11",
"abi_version": "0",
"do_not_use_exceptions": false,
"do_not_use_rtti": false,
"do_not_use__cxa_atexit": false,
"do_not_use_thread_safe_statics": false,
"other_optimization_flags": ""
},
"warnings": {
"warn_on_abi_violations": false,
"warn_on_class_privacy": false,
"warn_on_no_except_expressions": false,
"warn_on_virtual_destructors": false,
"warn_on_uncast_null": false,
"warn_on_sign_promotion": false,
"warn_about_effictive_cpp_violcations": false,
"other_warning_flags": ""
},
"miscellaneous": {
"generate_assembler_listing": false,
"save_temporary_files": false,
"verbose": false,
"other_compiler_flags": ""
}
},
"clinker": {
"general": {
"scriptFiles": [
"${project}/Ld/Link.ld"
],
"do_not_use_standard_start_files": true,
"do_not_use_default_libraries": false,
"no_startup_or_default_libs": false,
"remove_unused_sections": true,
"print_removed_sections": false,
"omit_all_symbol_information": false
},
"libraries": {
"libraries": [],
"library_search_path": []
},
"miscellaneous": {
"picolibc": "disabled",
"linker_flags": [],
"other_objects": [
"${project}/User/wui/libwui_0.2.a"
],
"generate_map": "\"${BuildArtifactFileBaseName}.map\"",
"cross_reference": false,
"print_link_map": false,
"use_newlib_nano": true,
"use_float_with_nano_printf": false,
"use_float_with_nano_scanf": false,
"do_not_use_syscalls": true,
"verbose": false,
"use_wch_printffloat": false,
"use_wch_printf": false,
"use_iqmath": false,
"other_linker_flags": ""
}
},
"cpplinker": {
"general": {
"scriptFiles": [
"${project}/Ld/Link.ld"
],
"do_not_use_standard_start_files": true,
"do_not_use_default_libraries": false,
"no_startup_or_default_libs": false,
"remove_unused_sections": true,
"print_removed_sections": false,
"omit_all_symbol_information": false
},
"libraries": {
"libraries": [],
"library_search_path": []
},
"miscellaneous": {
"picolibc": "disabled",
"linker_flags": [],
"other_objects": [
"${project}/User/wui/libwui_0.2.a"
],
"generate_map": "\"${BuildArtifactFileBaseName}.map\"",
"cross_reference": false,
"print_link_map": false,
"use_newlib_nano": true,
"use_float_with_nano_printf": false,
"use_float_with_nano_scanf": false,
"do_not_use_syscalls": true,
"verbose": false,
"use_wch_printffloat": false,
"use_wch_printf": false,
"use_iqmath": false,
"other_linker_flags": ""
}
},
"archiver": {
"archiver_flags": "-r",
"libOutputPrefix": "lib"
},
"createFlash": {
"enabled": true,
"outputFileFormat": "ihex",
"copy_only_section_text": false,
"copy_only_section_data": false,
"copy_only_sections": [],
"create_algorithm_file": false,
"other_flags": ""
},
"createList": {
"enabled": true,
"display_source": false,
"display_all_headers": true,
"demangle_names": true,
"display_debug_info": false,
"disassemble": true,
"display_file_headers": false,
"display_line_numbers": false,
"display_relocation_info": false,
"display_symbols": false,
"wide_lines": false,
"other_flags": ""
},
"printSize": {
"enabled": true,
"size_format": "berkeley",
"hex": false,
"show_totals": false,
"other_flags": ""
},
"configVariables": [],
"riscvTargetProcessor": {
"architecture": "rv32i",
"multiply_extension": true,
"atomic_extension": true,
"floating_point": "none",
"compressed_extension": true,
"extra_compressed_extension": true,
"bit_extension": false,
"multiplication_subset_of_the_M_extension": false,
"vector_cryptography_extensions": "",
"integer_ABI": "ilp32",
"floating_point_ABI": "none",
"tuning": "default",
"code_model": "default",
"small_data_limit": 8,
"align": "default",
"save_restore": true,
"other_target_flags": ""
},
"component_toolchain": "${WCH:Toolchain:GCC8}",
"name": "obj"
}
]
},
"flashConfig": {
"mcutype": "CH32V20x",
"address": "0x08000000",
"target_path": "obj\\WS2812_LED.hex",
"clkSpeed": "High",
"debug_interface_mode": "1-wire serial",
"erase": true,
"program": true,
"verify": true,
"reset": true,
"sdiPrintf": false,
"disablepowerout": false,
"clearcodeflash": false,
"disablecodeprotect": false,
"flashType": "",
"asmFile_path": "",
"exepath": "",
"exearguments": ""
},
"debugConfigurations": {
"openOCDCfg": {
"useLocalOpenOCD": true,
"executable": "${WCH:OpenOCD:default}",
"gdbport": 3333,
"telnetport": 4444,
"tclport": 6666,
"configOptions": [
"-f \"${WCH:OpenOCD:default}/bin/wch-riscv.cfg\""
],
"host": "127.0.0.1",
"port": 3333,
"skipDownloadBeforeDebug": false,
"enablePageEraser": false,
"enableNoZeroWaitingAreaFlash": false
},
"gdbCfg": {
"executable": "${WCH:Toolchain:GCC8}",
"options": [],
"commands": [
"set mem inaccessible-by-default off",
"set architecture riscv:rv32",
"set remotetimeout unlimited",
"set disassembler-options xw"
]
},
"startup": {
"initCommands": {
"initReset": true,
"initResetType": "init",
"additionalCommands": [],
"armSemihosting": false,
"armSemihosting_old": false
},
"loadedFiles": {
"loadSymbols": true,
"useProjBinaryForSymbols": true,
"useFileForSymbols": false,
"symbolFile": "",
"symbolFileOffset": "",
"loadImage": true,
"useProjBinaryForImage": true,
"useFileForImage": false,
"executableFile": "",
"executableFileOffset": ""
},
"runCommands": {
"runReset": true,
"runResetType": "halt",
"additionalCommands": [],
"setBreakAt": "handle_reset",
"continue": true,
"setBreak": true,
"setProgramCounter": false,
"setProgramCounterAddress": ""
},
"debugInRAM": false
},
"svdpath": "${WCH:SDK:default}/RISC-V/CH32V203/NoneOS/CH32V203xx.svd",
"output": {
"showDebugGDBTrace": true,
"saveDebugOutputToFile": false,
"showDebugOutputTimestamps": true
},
"reserve": {
"PROGRAM_NAME": "obj/WS2812_LED.elf",
"PROJECT_ATTR": "WS2812_LED",
"PROJECT_BUILD_CONFIG_AUTO_ATTR": true,
"PROJECT_BUILD_CONFIG_ID_ATTR": "",
"ATTR_BUILD_BEFORE_LAUNCH_ATTR": 2,
"GdbServerAllocateConsole": true,
"GdbServerAllocateTelnetConsole": false,
"StartGdbCLient": true,
"UPDATE_THREADLIST_ON_SUSPEND": false
}
}
}